/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@imtbl/sdk@1.78.11/dist/index.browser.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(G,K){"object"==typeof exports&&"undefined"!=typeof module?K(exports):"function"==typeof define&&define.amd?define(["exports"],K):K((G="undefined"!=typeof globalThis?globalThis:G||self).immutable={})}(this,(function(G){"use strict";function bind$1(G,K){return function wrap(){return G.apply(K,arguments)}}const{toString:K}=Object.prototype,{getPrototypeOf:ne}=Object,ue=(pe=Object.create(null),G=>{const ne=K.call(G);return pe[ne]||(pe[ne]=ne.slice(8,-1).toLowerCase())});var pe;const kindOfTest$1=G=>(G=G.toLowerCase(),K=>ue(K)===G),typeOfTest$1=G=>K=>typeof K===G,{isArray:he}=Array,ye=typeOfTest$1("undefined");const me=kindOfTest$1("ArrayBuffer");const be=typeOfTest$1("string"),ve=typeOfTest$1("function"),_e=typeOfTest$1("number"),isObject$2=G=>null!==G&&"object"==typeof G,isPlainObject$1=G=>{if("object"!==ue(G))return!1;const K=ne(G);return!(null!==K&&K!==Object.prototype&&null!==Object.getPrototypeOf(K)||Symbol.toStringTag in G||Symbol.iterator in G)},Te=kindOfTest$1("Date"),Ee=kindOfTest$1("File"),Pe=kindOfTest$1("Blob"),Se=kindOfTest$1("FileList"),Ce=kindOfTest$1("URLSearchParams");function forEach$2(G,K,{allOwnKeys:ne=!1}={}){if(null==G)return;let ue,pe;if("object"!=typeof G&&(G=[G]),he(G))for(ue=0,pe=G.length;ue<pe;ue++)K.call(null,G[ue],ue,G);else{const pe=ne?Object.getOwnPropertyNames(G):Object.keys(G),he=pe.length;let ye;for(ue=0;ue<he;ue++)ye=pe[ue],K.call(null,G[ye],ye,G)}}function findKey$1(G,K){K=K.toLowerCase();const ne=Object.keys(G);let ue,pe=ne.length;for(;pe-- >0;)if(ue=ne[pe],K===ue.toLowerCase())return ue;return null}const ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,isContextDefined$1=G=>!ye(G)&&G!==ke;const Oe=(xe="undefined"!=typeof Uint8Array&&ne(Uint8Array),G=>xe&&G instanceof xe);var xe;const Ne=kindOfTest$1("HTMLFormElement"),Me=(({hasOwnProperty:G})=>(K,ne)=>G.call(K,ne))(Object.prototype),Be=kindOfTest$1("RegExp"),reduceDescriptors$1=(G,K)=>{const ne=Object.getOwnPropertyDescriptors(G),ue={};forEach$2(ne,((ne,pe)=>{let he;!1!==(he=K(ne,pe,G))&&(ue[pe]=he||ne)})),Object.defineProperties(G,ue)},Fe="abcdefghijklmnopqrstuvwxyz",De="0123456789",Le={DIGIT:De,ALPHA:Fe,ALPHA_DIGIT:Fe+Fe.toUpperCase()+De};const Ue=kindOfTest$1("AsyncFunction");var je={isArray:he,isArrayBuffer:me,isBuffer:function isBuffer$4(G){return null!==G&&!ye(G)&&null!==G.constructor&&!ye(G.constructor)&&ve(G.constructor.isBuffer)&&G.constructor.isBuffer(G)},isFormData:G=>{let K;return G&&("function"==typeof FormData&&G instanceof FormData||ve(G.append)&&("formdata"===(K=ue(G))||"object"===K&&ve(G.toString)&&"[object FormData]"===G.toString()))},isArrayBufferView:function isArrayBufferView$1(G){let K;return K="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(G):G&&G.buffer&&me(G.buffer),K},isString:be,isNumber:_e,isBoolean:G=>!0===G||!1===G,isObject:isObject$2,isPlainObject:isPlainObject$1,isUndefined:ye,isDate:Te,isFile:Ee,isBlob:Pe,isRegExp:Be,isFunction:ve,isStream:G=>isObject$2(G)&&ve(G.pipe),isURLSearchParams:Ce,isTypedArray:Oe,isFileList:Se,forEach:forEach$2,merge:function merge$1(){const{caseless:G}=isContextDefined$1(this)&&this||{},K={},assignValue=(ne,ue)=>{const pe=G&&findKey$1(K,ue)||ue;isPlainObject$1(K[pe])&&isPlainObject$1(ne)?K[pe]=merge$1(K[pe],ne):isPlainObject$1(ne)?K[pe]=merge$1({},ne):he(ne)?K[pe]=ne.slice():K[pe]=ne};for(let G=0,K=arguments.length;G<K;G++)arguments[G]&&forEach$2(arguments[G],assignValue);return K},extend:(G,K,ne,{allOwnKeys:ue}={})=>(forEach$2(K,((K,ue)=>{ne&&ve(K)?G[ue]=bind$1(K,ne):G[ue]=K}),{allOwnKeys:ue}),G),trim:G=>G.trim?G.trim():G.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:G=>(65279===G.charCodeAt(0)&&(G=G.slice(1)),G),inherits:(G,K,ne,ue)=>{G.prototype=Object.create(K.prototype,ue),G.prototype.constructor=G,Object.defineProperty(G,"super",{value:K.prototype}),ne&&Object.assign(G.prototype,ne)},toFlatObject:(G,K,ue,pe)=>{let he,ye,me;const be={};if(K=K||{},null==G)return K;do{for(he=Object.getOwnPropertyNames(G),ye=he.length;ye-- >0;)me=he[ye],pe&&!pe(me,G,K)||be[me]||(K[me]=G[me],be[me]=!0);G=!1!==ue&&ne(G)}while(G&&(!ue||ue(G,K))&&G!==Object.prototype);return K},kindOf:ue,kindOfTest:kindOfTest$1,endsWith:(G,K,ne)=>{G=String(G),(void 0===ne||ne>G.length)&&(ne=G.length),ne-=K.length;const ue=G.indexOf(K,ne);return-1!==ue&&ue===ne},toArray:G=>{if(!G)return null;if(he(G))return G;let K=G.length;if(!_e(K))return null;const ne=new Array(K);for(;K-- >0;)ne[K]=G[K];return ne},forEachEntry:(G,K)=>{const ne=(G&&G[Symbol.iterator]).call(G);let ue;for(;(ue=ne.next())&&!ue.done;){const ne=ue.value;K.call(G,ne[0],ne[1])}},matchAll:(G,K)=>{let ne;const ue=[];for(;null!==(ne=G.exec(K));)ue.push(ne);return ue},isHTMLForm:Ne,hasOwnProperty:Me,hasOwnProp:Me,reduceDescriptors:reduceDescriptors$1,freezeMethods:G=>{reduceDescriptors$1(G,((K,ne)=>{if(ve(G)&&-1!==["arguments","caller","callee"].indexOf(ne))return!1;const ue=G[ne];ve(ue)&&(K.enumerable=!1,"writable"in K?K.writable=!1:K.set||(K.set=()=>{throw Error("Can not rewrite read-only method '"+ne+"'")}))}))},toObjectSet:(G,K)=>{const ne={},define=G=>{G.forEach((G=>{ne[G]=!0}))};return he(G)?define(G):define(String(G).split(K)),ne},toCamelCase:G=>G.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function replacer(G,K,ne){return K.toUpperCase()+ne})),noop:()=>{},toFiniteNumber:(G,K)=>(G=+G,Number.isFinite(G)?G:K),findKey:findKey$1,global:ke,isContextDefined:isContextDefined$1,ALPHABET:Le,generateString:(G=16,K=Le.ALPHA_DIGIT)=>{let ne="";const{length:ue}=K;for(;G--;)ne+=K[Math.random()*ue|0];return ne},isSpecCompliantForm:function isSpecCompliantForm$1(G){return!!(G&&ve(G.append)&&"FormData"===G[Symbol.toStringTag]&&G[Symbol.iterator])},toJSONObject:G=>{const K=new Array(10),visit=(G,ne)=>{if(isObject$2(G)){if(K.indexOf(G)>=0)return;if(!("toJSON"in G)){K[ne]=G;const ue=he(G)?[]:{};return forEach$2(G,((G,K)=>{const pe=visit(G,ne+1);!ye(pe)&&(ue[K]=pe)})),K[ne]=void 0,ue}}return G};return visit(G,0)},isAsyncFn:Ue,isThenable:G=>G&&(isObject$2(G)||ve(G))&&ve(G.then)&&ve(G.catch)};function AxiosError$2(G,K,ne,ue,pe){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=G,this.name="AxiosError",K&&(this.code=K),ne&&(this.config=ne),ue&&(this.request=ue),pe&&(this.response=pe)}je.inherits(AxiosError$2,Error,{toJSON:function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:je.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ze=AxiosError$2.prototype,Je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((G=>{Je[G]={value:G}})),Object.defineProperties(AxiosError$2,Je),Object.defineProperty(ze,"isAxiosError",{value:!0}),AxiosError$2.from=(G,K,ne,ue,pe,he)=>{const ye=Object.create(ze);return je.toFlatObject(G,ye,(function filter(G){return G!==Error.prototype}),(G=>"isAxiosError"!==G)),AxiosError$2.call(ye,G.message,K,ne,ue,pe),ye.cause=G,ye.name=G.name,he&&Object.assign(ye,he),ye};function isVisitable$1(G){return je.isPlainObject(G)||je.isArray(G)}function removeBrackets$1(G){return je.endsWith(G,"[]")?G.slice(0,-2):G}function renderKey$1(G,K,ne){return G?G.concat(K).map((function each(G,K){return G=removeBrackets$1(G),!ne&&K?"["+G+"]":G})).join(ne?".":""):K}const Xe=je.toFlatObject(je,{},null,(function filter(G){return/^is[A-Z]/.test(G)}));function toFormData$2(G,K,ne){if(!je.isObject(G))throw new TypeError("target must be an object");K=K||new FormData;const ue=(ne=je.toFlatObject(ne,{metaTokens:!0,dots:!1,indexes:!1},!1,(function defined(G,K){return!je.isUndefined(K[G])}))).metaTokens,pe=ne.visitor||defaultVisitor,he=ne.dots,ye=ne.indexes,me=(ne.Blob||"undefined"!=typeof Blob&&Blob)&&je.isSpecCompliantForm(K);if(!je.isFunction(pe))throw new TypeError("visitor must be a function");function convertValue(G){if(null===G)return"";if(je.isDate(G))return G.toISOString();if(!me&&je.isBlob(G))throw new AxiosError$2("Blob is not supported. Use a Buffer instead.");return je.isArrayBuffer(G)||je.isTypedArray(G)?me&&"function"==typeof Blob?new Blob([G]):Buffer.from(G):G}function defaultVisitor(G,ne,pe){let me=G;if(G&&!pe&&"object"==typeof G)if(je.endsWith(ne,"{}"))ne=ue?ne:ne.slice(0,-2),G=JSON.stringify(G);else if(je.isArray(G)&&function isFlatArray$1(G){return je.isArray(G)&&!G.some(isVisitable$1)}(G)||(je.isFileList(G)||je.endsWith(ne,"[]"))&&(me=je.toArray(G)))return ne=removeBrackets$1(ne),me.forEach((function each(G,ue){!je.isUndefined(G)&&null!==G&&K.append(!0===ye?renderKey$1([ne],ue,he):null===ye?ne:ne+"[]",convertValue(G))})),!1;return!!isVisitable$1(G)||(K.append(renderKey$1(pe,ne,he),convertValue(G)),!1)}const be=[],ve=Object.assign(Xe,{defaultVisitor:defaultVisitor,convertValue:convertValue,isVisitable:isVisitable$1});if(!je.isObject(G))throw new TypeError("data must be an object");return function build(G,ne){if(!je.isUndefined(G)){if(-1!==be.indexOf(G))throw Error("Circular reference detected in "+ne.join("."));be.push(G),je.forEach(G,(function each(G,ue){!0===(!(je.isUndefined(G)||null===G)&&pe.call(K,G,je.isString(ue)?ue.trim():ue,ne,ve))&&build(G,ne?ne.concat(ue):[ue])})),be.pop()}}(G),K}function encode$8(G){const K={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(G).replace(/[!'()~]|%20|%00/g,(function replacer(G){return K[G]}))}function AxiosURLSearchParams$1(G,K){this._pairs=[],G&&toFormData$2(G,this,K)}const Qe=AxiosURLSearchParams$1.prototype;function encode$7(G){return encodeURIComponent(G).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL$1(G,K,ne){if(!K)return G;const ue=ne&&ne.encode||encode$7,pe=ne&&ne.serialize;let he;if(he=pe?pe(K,ne):je.isURLSearchParams(K)?K.toString():new AxiosURLSearchParams$1(K,ne).toString(ue),he){const K=G.indexOf("#");-1!==K&&(G=G.slice(0,K)),G+=(-1===G.indexOf("?")?"?":"&")+he}return G}Qe.append=function append(G,K){this._pairs.push([G,K])},Qe.toString=function toString(G){const K=G?function(K){return G.call(this,K,encode$8)}:encode$8;return this._pairs.map((function each(G){return K(G[0])+"="+K(G[1])}),"").join("&")};let Ye=class InterceptorManager{constructor(){this.handlers=[]}use(G,K,ne){return this.handlers.push({fulfilled:G,rejected:K,synchronous:!!ne&&ne.synchronous,runWhen:ne?ne.runWhen:null}),this.handlers.length-1}eject(G){this.handlers[G]&&(this.handlers[G]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(G){je.forEach(this.handlers,(function forEachHandler(K){null!==K&&G(K)}))}};var et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:AxiosURLSearchParams$1,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const rt="undefined"!=typeof window&&"undefined"!=typeof document,nt=(at="undefined"!=typeof navigator&&navigator.product,rt&&["ReactNative","NativeScript","NS"].indexOf(at)<0);var at;const it="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var ot={...Object.freeze({__proto__:null,hasBrowserEnv:rt,hasStandardBrowserEnv:nt,hasStandardBrowserWebWorkerEnv:it}),...tt};function formDataToJSON$1(G){function buildPath(G,K,ne,ue){let pe=G[ue++];if("__proto__"===pe)return!0;const he=Number.isFinite(+pe),ye=ue>=G.length;if(pe=!pe&&je.isArray(ne)?ne.length:pe,ye)return je.hasOwnProp(ne,pe)?ne[pe]=[ne[pe],K]:ne[pe]=K,!he;ne[pe]&&je.isObject(ne[pe])||(ne[pe]=[]);return buildPath(G,K,ne[pe],ue)&&je.isArray(ne[pe])&&(ne[pe]=function arrayToObject$1(G){const K={},ne=Object.keys(G);let ue;const pe=ne.length;let he;for(ue=0;ue<pe;ue++)he=ne[ue],K[he]=G[he];return K}(ne[pe])),!he}if(je.isFormData(G)&&je.isFunction(G.entries)){const K={};return je.forEachEntry(G,((G,ne)=>{buildPath(function parsePropPath$1(G){return je.matchAll(/\w+|\[(\w*)]/g,G).map((G=>"[]"===G[0]?"":G[1]||G[0]))}(G),ne,K,0)})),K}return null}const ct={transitional:et,adapter:["xhr","http"],transformRequest:[function transformRequest(G,K){const ne=K.getContentType()||"",ue=ne.indexOf("application/json")>-1,pe=je.isObject(G);pe&&je.isHTMLForm(G)&&(G=new FormData(G));if(je.isFormData(G))return ue&&ue?JSON.stringify(formDataToJSON$1(G)):G;if(je.isArrayBuffer(G)||je.isBuffer(G)||je.isStream(G)||je.isFile(G)||je.isBlob(G))return G;if(je.isArrayBufferView(G))return G.buffer;if(je.isURLSearchParams(G))return K.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),G.toString();let he;if(pe){if(ne.indexOf("application/x-www-form-urlencoded")>-1)return function toURLEncodedForm$1(G,K){return toFormData$2(G,new ot.classes.URLSearchParams,Object.assign({visitor:function(G,K,ne,ue){return ot.isNode&&je.isBuffer(G)?(this.append(K,G.toString("base64")),!1):ue.defaultVisitor.apply(this,arguments)}},K))}(G,this.formSerializer).toString();if((he=je.isFileList(G))||ne.indexOf("multipart/form-data")>-1){const K=this.env&&this.env.FormData;return toFormData$2(he?{"files[]":G}:G,K&&new K,this.formSerializer)}}return pe||ue?(K.setContentType("application/json",!1),function stringifySafely$1(G,K,ne){if(je.isString(G))try{return(K||JSON.parse)(G),je.trim(G)}catch(G){if("SyntaxError"!==G.name)throw G}return(0,JSON.stringify)(G)}(G)):G}],transformResponse:[function transformResponse(G){const K=this.transitional||ct.transitional,ne=K&&K.forcedJSONParsing,ue="json"===this.responseType;if(G&&je.isString(G)&&(ne&&!this.responseType||ue)){const ne=!(K&&K.silentJSONParsing)&&ue;try{return JSON.parse(G)}catch(G){if(ne){if("SyntaxError"===G.name)throw AxiosError$2.from(G,AxiosError$2.ERR_BAD_RESPONSE,this,null,this.response);throw G}}}return G}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ot.classes.FormData,Blob:ot.classes.Blob},validateStatus:function validateStatus(G){return G>=200&&G<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch"],(G=>{ct.headers[G]={}}));const dt=je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ut=Symbol("internals");function normalizeHeader$1(G){return G&&String(G).trim().toLowerCase()}function normalizeValue$1(G){return!1===G||null==G?G:je.isArray(G)?G.map(normalizeValue$1):String(G)}function matchHeaderValue$1(G,K,ne,ue,pe){return je.isFunction(ue)?ue.call(this,K,ne):(pe&&(K=ne),je.isString(K)?je.isString(ue)?-1!==K.indexOf(ue):je.isRegExp(ue)?ue.test(K):void 0:void 0)}let ft=class AxiosHeaders{constructor(G){G&&this.set(G)}set(G,K,ne){const ue=this;function setHeader(G,K,ne){const pe=normalizeHeader$1(K);if(!pe)throw new Error("header name must be a non-empty string");const he=je.findKey(ue,pe);(!he||void 0===ue[he]||!0===ne||void 0===ne&&!1!==ue[he])&&(ue[he||K]=normalizeValue$1(G))}const setHeaders=(G,K)=>je.forEach(G,((G,ne)=>setHeader(G,ne,K)));return je.isPlainObject(G)||G instanceof this.constructor?setHeaders(G,K):je.isString(G)&&(G=G.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(G.trim())?setHeaders((G=>{const K={};let ne,ue,pe;return G&&G.split("\n").forEach((function parser(G){pe=G.indexOf(":"),ne=G.substring(0,pe).trim().toLowerCase(),ue=G.substring(pe+1).trim(),!ne||K[ne]&&dt[ne]||("set-cookie"===ne?K[ne]?K[ne].push(ue):K[ne]=[ue]:K[ne]=K[ne]?K[ne]+", "+ue:ue)})),K})(G),K):null!=G&&setHeader(K,G,ne),this}get(G,K){if(G=normalizeHeader$1(G)){const ne=je.findKey(this,G);if(ne){const G=this[ne];if(!K)return G;if(!0===K)return function parseTokens$1(G){const K=Object.create(null),ne=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let ue;for(;ue=ne.exec(G);)K[ue[1]]=ue[2];return K}(G);if(je.isFunction(K))return K.call(this,G,ne);if(je.isRegExp(K))return K.exec(G);throw new TypeError("parser must be boolean|regexp|function")}}}has(G,K){if(G=normalizeHeader$1(G)){const ne=je.findKey(this,G);return!(!ne||void 0===this[ne]||K&&!matchHeaderValue$1(0,this[ne],ne,K))}return!1}delete(G,K){const ne=this;let ue=!1;function deleteHeader(G){if(G=normalizeHeader$1(G)){const pe=je.findKey(ne,G);!pe||K&&!matchHeaderValue$1(0,ne[pe],pe,K)||(delete ne[pe],ue=!0)}}return je.isArray(G)?G.forEach(deleteHeader):deleteHeader(G),ue}clear(G){const K=Object.keys(this);let ne=K.length,ue=!1;for(;ne--;){const pe=K[ne];G&&!matchHeaderValue$1(0,this[pe],pe,G,!0)||(delete this[pe],ue=!0)}return ue}normalize(G){const K=this,ne={};return je.forEach(this,((ue,pe)=>{const he=je.findKey(ne,pe);if(he)return K[he]=normalizeValue$1(ue),void delete K[pe];const ye=G?function formatHeader$1(G){return G.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((G,K,ne)=>K.toUpperCase()+ne))}(pe):String(pe).trim();ye!==pe&&delete K[pe],K[ye]=normalizeValue$1(ue),ne[ye]=!0})),this}concat(...G){return this.constructor.concat(this,...G)}toJSON(G){const K=Object.create(null);return je.forEach(this,((ne,ue)=>{null!=ne&&!1!==ne&&(K[ue]=G&&je.isArray(ne)?ne.join(", "):ne)})),K}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([G,K])=>G+": "+K)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(G){return G instanceof this?G:new this(G)}static concat(G,...K){const ne=new this(G);return K.forEach((G=>ne.set(G))),ne}static accessor(G){const K=(this[ut]=this[ut]={accessors:{}}).accessors,ne=this.prototype;function defineAccessor(G){const ue=normalizeHeader$1(G);K[ue]||(!function buildAccessors$1(G,K){const ne=je.toCamelCase(" "+K);["get","set","has"].forEach((ue=>{Object.defineProperty(G,ue+ne,{value:function(G,ne,pe){return this[ue].call(this,K,G,ne,pe)},configurable:!0})}))}(ne,G),K[ue]=!0)}return je.isArray(G)?G.forEach(defineAccessor):defineAccessor(G),this}};function transformData$1(G,K){const ne=this||ct,ue=K||ne,pe=ft.from(ue.headers);let he=ue.data;return je.forEach(G,(function transform(G){he=G.call(ne,he,pe.normalize(),K?K.status:void 0)})),pe.normalize(),he}function isCancel$2(G){return!(!G||!G.__CANCEL__)}function CanceledError$2(G,K,ne){AxiosError$2.call(this,null==G?"canceled":G,AxiosError$2.ERR_CANCELED,K,ne),this.name="CanceledError"}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),je.reduceDescriptors(ft.prototype,(({value:G},K)=>{let ne=K[0].toUpperCase()+K.slice(1);return{get:()=>G,set(G){this[ne]=G}}})),je.freezeMethods(ft),je.inherits(CanceledError$2,AxiosError$2,{__CANCEL__:!0});var yt=ot.hasStandardBrowserEnv?{write(G,K,ne,ue,pe,he){const ye=[G+"="+encodeURIComponent(K)];je.isNumber(ne)&&ye.push("expires="+new Date(ne).toGMTString()),je.isString(ue)&&ye.push("path="+ue),je.isString(pe)&&ye.push("domain="+pe),!0===he&&ye.push("secure"),document.cookie=ye.join("; ")},read(G){const K=document.cookie.match(new RegExp("(^|;\\s*)("+G+")=([^;]*)"));return K?decodeURIComponent(K[3]):null},remove(G){this.write(G,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function buildFullPath$1(G,K){return G&&!function isAbsoluteURL$1(G){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(G)}(K)?function combineURLs$1(G,K){return K?G.replace(/\/?\/$/,"")+"/"+K.replace(/^\/+/,""):G}(G,K):K}var wt=ot.hasStandardBrowserEnv?function standardBrowserEnv(){const G=/(msie|trident)/i.test(navigator.userAgent),K=document.createElement("a");let ne;function resolveURL(ne){let ue=ne;return G&&(K.setAttribute("href",ue),ue=K.href),K.setAttribute("href",ue),{href:K.href,protocol:K.protocol?K.protocol.replace(/:$/,""):"",host:K.host,search:K.search?K.search.replace(/^\?/,""):"",hash:K.hash?K.hash.replace(/^#/,""):"",hostname:K.hostname,port:K.port,pathname:"/"===K.pathname.charAt(0)?K.pathname:"/"+K.pathname}}return ne=resolveURL(window.location.href),function isURLSameOrigin(G){const K=je.isString(G)?resolveURL(G):G;return K.protocol===ne.protocol&&K.host===ne.host}}():function isURLSameOrigin(){return!0};function progressEventReducer$1(G,K){let ne=0;const ue=function speedometer$1(G,K){G=G||10;const ne=new Array(G),ue=new Array(G);let pe,he=0,ye=0;return K=void 0!==K?K:1e3,function push(me){const be=Date.now(),ve=ue[ye];pe||(pe=be),ne[he]=me,ue[he]=be;let _e=ye,Te=0;for(;_e!==he;)Te+=ne[_e++],_e%=G;if(he=(he+1)%G,he===ye&&(ye=(ye+1)%G),be-pe<K)return;const Ee=ve&&be-ve;return Ee?Math.round(1e3*Te/Ee):void 0}}(50,250);return pe=>{const he=pe.loaded,ye=pe.lengthComputable?pe.total:void 0,me=he-ne,be=ue(me);ne=he;const ve={loaded:he,total:ye,progress:ye?he/ye:void 0,bytes:me,rate:be||void 0,estimated:be&&ye&&he<=ye?(ye-he)/be:void 0,event:pe};ve[K?"download":"upload"]=!0,G(ve)}}var At="undefined"!=typeof XMLHttpRequest&&function(G){return new Promise((function dispatchXhrRequest(K,ne){let ue=G.data;const pe=ft.from(G.headers).normalize();let he,ye,{responseType:me,withXSRFToken:be}=G;function done(){G.cancelToken&&G.cancelToken.unsubscribe(he),G.signal&&G.signal.removeEventListener("abort",he)}if(je.isFormData(ue))if(ot.hasStandardBrowserEnv||ot.hasStandardBrowserWebWorkerEnv)pe.setContentType(!1);else if(!1!==(ye=pe.getContentType())){const[G,...K]=ye?ye.split(";").map((G=>G.trim())).filter(Boolean):[];pe.setContentType([G||"multipart/form-data",...K].join("; "))}let ve=new XMLHttpRequest;if(G.auth){const K=G.auth.username||"",ne=G.auth.password?unescape(encodeURIComponent(G.auth.password)):"";pe.set("Authorization","Basic "+btoa(K+":"+ne))}const _e=buildFullPath$1(G.baseURL,G.url);function onloadend(){if(!ve)return;const ue=ft.from("getAllResponseHeaders"in ve&&ve.getAllResponseHeaders());!function settle$1(G,K,ne){const ue=ne.config.validateStatus;ne.status&&ue&&!ue(ne.status)?K(new AxiosError$2("Request failed with status code "+ne.status,[AxiosError$2.ERR_BAD_REQUEST,AxiosError$2.ERR_BAD_RESPONSE][Math.floor(ne.status/100)-4],ne.config,ne.request,ne)):G(ne)}((function _resolve(G){K(G),done()}),(function _reject(G){ne(G),done()}),{data:me&&"text"!==me&&"json"!==me?ve.response:ve.responseText,status:ve.status,statusText:ve.statusText,headers:ue,config:G,request:ve}),ve=null}if(ve.open(G.method.toUpperCase(),buildURL$1(_e,G.params,G.paramsSerializer),!0),ve.timeout=G.timeout,"onloadend"in ve?ve.onloadend=onloadend:ve.onreadystatechange=function handleLoad(){ve&&4===ve.readyState&&(0!==ve.status||ve.responseURL&&0===ve.responseURL.indexOf("file:"))&&setTimeout(onloadend)},ve.onabort=function handleAbort(){ve&&(ne(new AxiosError$2("Request aborted",AxiosError$2.ECONNABORTED,G,ve)),ve=null)},ve.onerror=function handleError(){ne(new AxiosError$2("Network Error",AxiosError$2.ERR_NETWORK,G,ve)),ve=null},ve.ontimeout=function handleTimeout(){let K=G.timeout?"timeout of "+G.timeout+"ms exceeded":"timeout exceeded";const ue=G.transitional||et;G.timeoutErrorMessage&&(K=G.timeoutErrorMessage),ne(new AxiosError$2(K,ue.clarifyTimeoutError?AxiosError$2.ETIMEDOUT:AxiosError$2.ECONNABORTED,G,ve)),ve=null},ot.hasStandardBrowserEnv&&(be&&je.isFunction(be)&&(be=be(G)),be||!1!==be&&wt(_e))){const K=G.xsrfHeaderName&&G.xsrfCookieName&&yt.read(G.xsrfCookieName);K&&pe.set(G.xsrfHeaderName,K)}void 0===ue&&pe.setContentType(null),"setRequestHeader"in ve&&je.forEach(pe.toJSON(),(function setRequestHeader(G,K){ve.setRequestHeader(K,G)})),je.isUndefined(G.withCredentials)||(ve.withCredentials=!!G.withCredentials),me&&"json"!==me&&(ve.responseType=G.responseType),"function"==typeof G.onDownloadProgress&&ve.addEventListener("progress",progressEventReducer$1(G.onDownloadProgress,!0)),"function"==typeof G.onUploadProgress&&ve.upload&&ve.upload.addEventListener("progress",progressEventReducer$1(G.onUploadProgress)),(G.cancelToken||G.signal)&&(he=K=>{ve&&(ne(!K||K.type?new CanceledError$2(null,G,ve):K),ve.abort(),ve=null)},G.cancelToken&&G.cancelToken.subscribe(he),G.signal&&(G.signal.aborted?he():G.signal.addEventListener("abort",he)));const Te=function parseProtocol$1(G){const K=/^([-+\w]{1,25})(:?\/\/|:)/.exec(G);return K&&K[1]||""}(_e);Te&&-1===ot.protocols.indexOf(Te)?ne(new AxiosError$2("Unsupported protocol "+Te+":",AxiosError$2.ERR_BAD_REQUEST,G)):ve.send(ue||null)}))};const St={http:null,xhr:At};je.forEach(St,((G,K)=>{if(G){try{Object.defineProperty(G,"name",{value:K})}catch(G){}Object.defineProperty(G,"adapterName",{value:K})}}));const renderReason$1=G=>`- ${G}`,isResolvedHandle$1=G=>je.isFunction(G)||null===G||!1===G;var adapters$1_getAdapter=G=>{G=je.isArray(G)?G:[G];const{length:K}=G;let ne,ue;const pe={};for(let he=0;he<K;he++){let K;if(ne=G[he],ue=ne,!isResolvedHandle$1(ne)&&(ue=St[(K=String(ne)).toLowerCase()],void 0===ue))throw new AxiosError$2(`Unknown adapter '${K}'`);if(ue)break;pe[K||"#"+he]=ue}if(!ue){const G=Object.entries(pe).map((([G,K])=>`adapter ${G} `+(!1===K?"is not supported by the environment":"is not available in the build")));throw new AxiosError$2("There is no suitable adapter to dispatch the request "+(K?G.length>1?"since :\n"+G.map(renderReason$1).join("\n"):" "+renderReason$1(G[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return ue};function throwIfCancellationRequested$1(G){if(G.cancelToken&&G.cancelToken.throwIfRequested(),G.signal&&G.signal.aborted)throw new CanceledError$2(null,G)}function dispatchRequest$1(G){throwIfCancellationRequested$1(G),G.headers=ft.from(G.headers),G.data=transformData$1.call(G,G.transformRequest),-1!==["post","put","patch"].indexOf(G.method)&&G.headers.setContentType("application/x-www-form-urlencoded",!1);return adapters$1_getAdapter(G.adapter||ct.adapter)(G).then((function onAdapterResolution(K){return throwIfCancellationRequested$1(G),K.data=transformData$1.call(G,G.transformResponse,K),K.headers=ft.from(K.headers),K}),(function onAdapterRejection(K){return isCancel$2(K)||(throwIfCancellationRequested$1(G),K&&K.response&&(K.response.data=transformData$1.call(G,G.transformResponse,K.response),K.response.headers=ft.from(K.response.headers))),Promise.reject(K)}))}const headersToObject$1=G=>G instanceof ft?G.toJSON():G;function mergeConfig$2(G,K){K=K||{};const ne={};function getMergedValue(G,K,ne){return je.isPlainObject(G)&&je.isPlainObject(K)?je.merge.call({caseless:ne},G,K):je.isPlainObject(K)?je.merge({},K):je.isArray(K)?K.slice():K}function mergeDeepProperties(G,K,ne){return je.isUndefined(K)?je.isUndefined(G)?void 0:getMergedValue(void 0,G,ne):getMergedValue(G,K,ne)}function valueFromConfig2(G,K){if(!je.isUndefined(K))return getMergedValue(void 0,K)}function defaultToConfig2(G,K){return je.isUndefined(K)?je.isUndefined(G)?void 0:getMergedValue(void 0,G):getMergedValue(void 0,K)}function mergeDirectKeys(ne,ue,pe){return pe in K?getMergedValue(ne,ue):pe in G?getMergedValue(void 0,ne):void 0}const ue={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,withXSRFToken:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:(G,K)=>mergeDeepProperties(headersToObject$1(G),headersToObject$1(K),!0)};return je.forEach(Object.keys(Object.assign({},G,K)),(function computeConfigValue(pe){const he=ue[pe]||mergeDeepProperties,ye=he(G[pe],K[pe],pe);je.isUndefined(ye)&&he!==mergeDirectKeys||(ne[pe]=ye)})),ne}const kt="1.6.5",Bt={};["object","boolean","number","function","string","symbol"].forEach(((G,K)=>{Bt[G]=function validator(ne){return typeof ne===G||"a"+(K<1?"n ":" ")+G}}));const Lt={};Bt.transitional=function transitional(G,K,ne){function formatMessage(G,K){return"[Axios v1.6.5] Transitional option '"+G+"'"+K+(ne?". "+ne:"")}return(ne,ue,pe)=>{if(!1===G)throw new AxiosError$2(formatMessage(ue," has been removed"+(K?" in "+K:"")),AxiosError$2.ERR_DEPRECATED);return K&&!Lt[ue]&&(Lt[ue]=!0,console.warn(formatMessage(ue," has been deprecated since v"+K+" and will be removed in the near future"))),!G||G(ne,ue,pe)}};var Ut={assertOptions:function assertOptions$1(G,K,ne){if("object"!=typeof G)throw new AxiosError$2("options must be an object",AxiosError$2.ERR_BAD_OPTION_VALUE);const ue=Object.keys(G);let pe=ue.length;for(;pe-- >0;){const he=ue[pe],ye=K[he];if(ye){const K=G[he],ne=void 0===K||ye(K,he,G);if(!0!==ne)throw new AxiosError$2("option "+he+" must be "+ne,AxiosError$2.ERR_BAD_OPTION_VALUE)}else if(!0!==ne)throw new AxiosError$2("Unknown option "+he,AxiosError$2.ERR_BAD_OPTION)}},validators:Bt};const $t=Ut.validators;let Ht=class Axios{constructor(G){this.defaults=G,this.interceptors={request:new Ye,response:new Ye}}request(G,K){"string"==typeof G?(K=K||{}).url=G:K=G||{},K=mergeConfig$2(this.defaults,K);const{transitional:ne,paramsSerializer:ue,headers:pe}=K;void 0!==ne&&Ut.assertOptions(ne,{silentJSONParsing:$t.transitional($t.boolean),forcedJSONParsing:$t.transitional($t.boolean),clarifyTimeoutError:$t.transitional($t.boolean)},!1),null!=ue&&(je.isFunction(ue)?K.paramsSerializer={serialize:ue}:Ut.assertOptions(ue,{encode:$t.function,serialize:$t.function},!0)),K.method=(K.method||this.defaults.method||"get").toLowerCase();let he=pe&&je.merge(pe.common,pe[K.method]);pe&&je.forEach(["delete","get","head","post","put","patch","common"],(G=>{delete pe[G]})),K.headers=ft.concat(he,pe);const ye=[];let me=!0;this.interceptors.request.forEach((function unshiftRequestInterceptors(G){"function"==typeof G.runWhen&&!1===G.runWhen(K)||(me=me&&G.synchronous,ye.unshift(G.fulfilled,G.rejected))}));const be=[];let ve;this.interceptors.response.forEach((function pushResponseInterceptors(G){be.push(G.fulfilled,G.rejected)}));let _e,Te=0;if(!me){const G=[dispatchRequest$1.bind(this),void 0];for(G.unshift.apply(G,ye),G.push.apply(G,be),_e=G.length,ve=Promise.resolve(K);Te<_e;)ve=ve.then(G[Te++],G[Te++]);return ve}_e=ye.length;let Ee=K;for(Te=0;Te<_e;){const G=ye[Te++],K=ye[Te++];try{Ee=G(Ee)}catch(G){K.call(this,G);break}}try{ve=dispatchRequest$1.call(this,Ee)}catch(G){return Promise.reject(G)}for(Te=0,_e=be.length;Te<_e;)ve=ve.then(be[Te++],be[Te++]);return ve}getUri(G){return buildURL$1(buildFullPath$1((G=mergeConfig$2(this.defaults,G)).baseURL,G.url),G.params,G.paramsSerializer)}};je.forEach(["delete","get","head","options"],(function forEachMethodNoData(G){Ht.prototype[G]=function(K,ne){return this.request(mergeConfig$2(ne||{},{method:G,url:K,data:(ne||{}).data}))}})),je.forEach(["post","put","patch"],(function forEachMethodWithData(G){function generateHTTPMethod(K){return function httpMethod(ne,ue,pe){return this.request(mergeConfig$2(pe||{},{method:G,headers:K?{"Content-Type":"multipart/form-data"}:{},url:ne,data:ue}))}}Ht.prototype[G]=generateHTTPMethod(),Ht.prototype[G+"Form"]=generateHTTPMethod(!0)}));const Vt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Vt).forEach((([G,K])=>{Vt[K]=G}));const er=function createInstance$1(G){const K=new Ht(G),ne=bind$1(Ht.prototype.request,K);return je.extend(ne,Ht.prototype,K,{allOwnKeys:!0}),je.extend(ne,K,null,{allOwnKeys:!0}),ne.create=function create(K){return createInstance$1(mergeConfig$2(G,K))},ne}(ct);er.Axios=Ht,er.CanceledError=CanceledError$2,er.CancelToken=class CancelToken{constructor(G){if("function"!=typeof G)throw new TypeError("executor must be a function.");let K;this.promise=new Promise((function promiseExecutor(G){K=G}));const ne=this;this.promise.then((G=>{if(!ne._listeners)return;let K=ne._listeners.length;for(;K-- >0;)ne._listeners[K](G);ne._listeners=null})),this.promise.then=G=>{let K;const ue=new Promise((G=>{ne.subscribe(G),K=G})).then(G);return ue.cancel=function reject(){ne.unsubscribe(K)},ue},G((function cancel(G,ue,pe){ne.reason||(ne.reason=new CanceledError$2(G,ue,pe),K(ne.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(G){this.reason?G(this.reason):this._listeners?this._listeners.push(G):this._listeners=[G]}unsubscribe(G){if(!this._listeners)return;const K=this._listeners.indexOf(G);-1!==K&&this._listeners.splice(K,1)}static source(){let G;const K=new CancelToken((function executor(K){G=K}));return{token:K,cancel:G}}},er.isCancel=isCancel$2,er.VERSION=kt,er.toFormData=toFormData$2,er.AxiosError=AxiosError$2,er.Cancel=er.CanceledError,er.all=function all(G){return Promise.all(G)},er.spread=function spread$2(G){return function wrap(K){return G.apply(null,K)}},er.isAxiosError=function isAxiosError$2(G){return je.isObject(G)&&!0===G.isAxiosError},er.mergeConfig=mergeConfig$2,er.AxiosHeaders=ft,er.formToJSON=G=>formDataToJSON$1(je.isHTMLForm(G)?new FormData(G):G),er.getAdapter=adapters$1_getAdapter,er.HttpStatusCode=Vt,er.default=er;const{Axios:tr,AxiosError:rr,CanceledError:cr,isCancel:dr,CancelToken:Rr,VERSION:kr,all:$r,Cancel:qr,isAxiosError:Hr,spread:Vr,toFormData:Zr,AxiosHeaders:en,HttpStatusCode:tn,formToJSON:an,getAdapter:sn,mergeConfig:un}=er;
/**
   * tiny-lru
   *
   * @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
   * @license BSD-3-Clause
   * @version 11.2.5
   */function lru$1(G=1e3,K=0,ne=!1){if(isNaN(G)||G<0)throw new TypeError("Invalid max value");if(isNaN(K)||K<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof ne)throw new TypeError("Invalid resetTtl value");return new class LRU{constructor(G=0,K=0,ne=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=G,this.resetTtl=ne,this.size=0,this.ttl=K}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(G){if(this.has(G)){const K=this.items[G];delete this.items[G],this.size--,null!==K.prev&&(K.prev.next=K.next),null!==K.next&&(K.next.prev=K.prev),this.first===K&&(this.first=K.next),this.last===K&&(this.last=K.prev)}return this}entries(G=this.keys()){return G.map((G=>[G,this.get(G)]))}evict(G=!1){if(G||this.size>0){const G=this.first;delete this.items[G.key],0==--this.size?(this.first=null,this.last=null):(this.first=G.next,this.first.prev=null)}return this}expiresAt(G){let K;return this.has(G)&&(K=this.items[G].expiry),K}get(G){let K;if(this.has(G)){const ne=this.items[G];this.ttl>0&&ne.expiry<=Date.now()?this.delete(G):(K=ne.value,this.set(G,K,!0))}return K}has(G){return G in this.items}keys(){const G=[];let K=this.first;for(;null!==K;)G.push(K.key),K=K.next;return G}set(G,K,ne=!1,ue=this.resetTtl){let pe;if(ne||this.has(G)){if(pe=this.items[G],pe.value=K,!1===ne&&ue&&(pe.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.last!==pe){const G=this.last,K=pe.next,ne=pe.prev;this.first===pe&&(this.first=pe.next),pe.next=null,pe.prev=this.last,G.next=pe,null!==ne&&(ne.next=K),null!==K&&(K.prev=ne)}}else this.max>0&&this.size===this.max&&this.evict(!0),pe=this.items[G]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:G,prev:this.last,next:null,value:K},1==++this.size?this.first=pe:this.last.next=pe;return this.last=pe,this}values(G=this.keys()){return G.map((G=>this.get(G)))}}(G,K,ne)}const fn={max:1e3},memorise$1=(G,K={})=>{const{cache:ne,cacheKeyResolver:ue=defaultGenCacheKey$1,onHit:pe,lruOptions:he={}}=K,ye={...fn,...he},me=ne||lru$1(ye.max,ye.ttl);function returnFn(...K){const ne=ue(...K),he=me.get(ne);if(me.has(ne))return pe&&pe(ne,he,me),he;const ye=G.apply(this,K);return me.set(ne,ye),ye}return returnFn._cache=me,returnFn},defaultGenCacheKey$1=(...G)=>0===G.length?"no-args":G.map((G=>void 0===G?"undefined":null===G?"null":Array.isArray(G)?`[${defaultGenCacheKey$1(...G)}]`:"object"==typeof G?`{${defaultGenCacheKey$1(...sortedObjectEntries$1(G))}}`:JSON.stringify(G))).join(","),sortedObjectEntries$1=G=>Object.entries(G).sort(((G,K)=>G[0]<K[0]?-1:1));var pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$1(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}function getAugmentedNamespace$1(G){if(G.__esModule)return G;var K=G.default;if("function"==typeof K){var ne=function a(){return this instanceof a?Reflect.construct(K,arguments,this.constructor):K.apply(this,arguments)};ne.prototype=K.prototype}else ne={};return Object.defineProperty(ne,"__esModule",{value:!0}),Object.keys(G).forEach((function(K){var ue=Object.getOwnPropertyDescriptor(G,K);Object.defineProperty(ne,K,ue.get?ue:{enumerable:!0,get:function(){return G[K]}})})),ne}var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.clearGlobalNamespace=mn=hn.getGlobalisedValue=void 0;const yn={},getGlobalObject$1=()=>"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:yn,createGlobalisedKey$1=G=>`globalise__singleton__${G}`,getGlobalScopedObject$1=G=>{const K=getGlobalObject$1(),ne=createGlobalisedKey$1(G);return K[ne]||(K[ne]={}),K[ne]};var mn=hn.getGlobalisedValue=(G,K,ne)=>{((G,K)=>{if("string"!=typeof G)throw"Invalid namespace key";if("string"!=typeof K)throw"Invalid item key"})(G,K);const ue=((G,K)=>getGlobalScopedObject$1(G)[K]||void 0)(G,K);return void 0!==ue?ue:(((G,K,ne)=>{getGlobalScopedObject$1(G)[K]=ne})(G,K,ne),ne)};hn.clearGlobalNamespace=G=>{const K=getGlobalObject$1(),ne=createGlobalisedKey$1(G);void 0!==K[ne]&&delete K[ne]};const isNode$1=()=>"undefined"==typeof window,isBrowser$1=()=>!isNode$1(),hasLocalstorage$1=()=>isBrowser$1()&&window.localStorage,genKey$1=G=>`__IMX-${G}`;function getItem$2(G){if(hasLocalstorage$1())return(G=>{if(null!==G)try{return JSON.parse(G)}catch(K){return G}})(window.localStorage.getItem(genKey$1(G)))}const setItem$2=(G,K)=>!!hasLocalstorage$1()&&(window.localStorage.setItem(genKey$1(G),(G=>"string"==typeof G?G:JSON.stringify(G))(K)),!0);var bn=Object.freeze({__proto__:null,deleteItem:G=>!!hasLocalstorage$1()&&(window.localStorage.removeItem(genKey$1(G)),!0),getItem:getItem$2,setItem:setItem$2});let gn=0;const getCorrectedTime$1=()=>{const G=(new Date).getTime()+gn;return new Date(G).toISOString()};var vn;!function(G){G.RUNTIME_ID="rid",G.PASSPORT_CLIENT_ID="passportClientId",G.ENVIRONMENT="env",G.PUBLISHABLE_API_KEY="pak",G.IDENTITY="uid",G.DOMAIN="domain",G.SDK_VERSION="sdkVersion"}(vn||(vn={}));async function post$1(G,K){const ne=er.create({baseURL:"https://api.immutable.com"}),ue=JSON.stringify(K),pe={payload:Buffer.from(ue).toString("base64")};return(await ne.post(G,pe)).data}var Tn;let En,In;!function(G){G.EVENTS="metrics-events",G.RUNTIME="metrics-runtime"}(Tn||(Tn={}));En=getItem$2(Tn.EVENTS)||[],In=getItem$2(Tn.RUNTIME)||{};const storeDetail$1=(G,K)=>{In={...In,[G]:K},setItem$2(Tn.RUNTIME,In)},getDetail$1$1=G=>{if(void 0!==In[G])return In[G]},flattenProperties$1=G=>{const K=[];return Object.entries(G).forEach((([G,ne])=>{"string"!=typeof G&&"string"!=typeof ne&&"number"!=typeof ne&&"boolean"!=typeof ne||K.push([G,ne.toString()])})),K},Rn="1.78.11",runtimeHost$1=()=>{if(isNode$1())return"";let G;try{window.self!==window.top&&(G=isNode$1()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"")}catch(G){}return G||(G=window.location.hostname),G};let Nn=!1;const initialise$2=async()=>{Nn=!0;try{const G=flattenProperties$1((()=>{if(storeDetail$1(vn.SDK_VERSION,Rn),isNode$1())return{browser:"nodejs",sdkVersion:Rn};const G=runtimeHost$1();return G&&storeDetail$1(vn.DOMAIN,G),{sdkVersion:Rn,browser:window.navigator.userAgent,domain:G,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}})()),K=getDetail$1$1(vn.RUNTIME_ID),ne={version:1,data:{runtimeDetails:G,runtimeId:K,uId:getDetail$1$1(vn.IDENTITY)}},ue=await post$1("/v1/sdk/initialise",ne),{runtimeId:pe,sTime:he}=ue;storeDetail$1(vn.RUNTIME_ID,pe),(G=>{const K=1e3*parseInt(G,10),ne=new Date(K),ue=new Date;gn=ne.getTime()-ue.getTime()})(he)}catch(G){Nn=!1}};function errorBoundary$2(G,K){return(...ne)=>{try{const ue=G(...ne);return ue instanceof Promise?ue.catch((()=>K)):ue}catch(G){return K}}}const Bn=errorBoundary$2((function isTestEnvironmentFn$1(){return isBrowser$1(),!1}),!1),Fn="imtbl__metrics",getGlobalisedValue$2=(G,K)=>mn(Fn,G,K),Dn=errorBoundary$2(((G,K)=>{const ne=memorise$1(K,{lruOptions:{ttl:5e3,max:1e3}});return mn(Fn,G,ne)})("track",((G,K,ne)=>{(G=>{En.push(G),setItem$2(Tn.EVENTS,En)})({event:`${G}.${K}`,time:getCorrectedTime$1(),...ne&&{properties:flattenProperties$1(ne)}})}))),Un=errorBoundary$2((async()=>{if(!1===Nn)return void await initialise$2();const G=En;if(0===G.length)return;const K=G.length,ne={version:1,data:{events:G,details:In}};var ue;await post$1("/v1/sdk/metrics",ne)instanceof Error||(ue=K,En=En.slice(ue),setItem$2(Tn.EVENTS,En))})),flushPoll$1=async()=>{await Un(),setTimeout(flushPoll$1,5e3)};let $n=!1;const startFlushing$1=()=>{$n||($n=!0,flushPoll$1())};Bn()||errorBoundary$2(getGlobalisedValue$2("startFlushing",startFlushing$1))();const trackDuration=(G,K,ne,ue)=>Dn(G,K,{...ue||{},duration:Math.round(ne)}),qn=errorBoundary$2(((G,K,ne=!0,ue)=>{const pe=(()=>{const s4=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);return`${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`})(),he=Date.now();let ye=0,me=0,be={};const mergeFlowProps=(...G)=>((...G)=>{if(!G.some((G=>!!G)))return{};let K={};return G.forEach((G=>{G&&(K={...K,...G})})),K})(be,...G,{flowId:pe,flowName:K});be=mergeFlowProps(ue);const addEvent=(ne,ue)=>{const pe=((G,K)=>`${G}_${(G=>G.replace(/[^a-zA-Z0-9\s\-_]/g,""))(K)}`)(K,ne);let he=0;const be=performance.now();ye>0&&(he=be-me);const ve=mergeFlowProps(ue,{flowEventName:ne,flowStep:ye});trackDuration(G,pe,he,ve),ye++,me=be};return ne&&addEvent("Start"),{details:{moduleName:G,flowName:K,flowId:pe,flowStartTime:he},addEvent:errorBoundary$2(addEvent),addFlowProperties:errorBoundary$2((G=>{G&&(be=mergeFlowProps(G))}))}})),Gn=errorBoundary$2(((G,K,ne,ue)=>{const{message:pe}=ne;let he=ne.stack||"";const{cause:ye}=ne;ye instanceof Error&&(he=`${he} \nCause: ${ye.message}\n ${ye.stack}`),Dn(G,`trackError_${K}`,{...ue||{},errorMessage:pe,errorStack:he,isTrackError:!0})})),jn=errorBoundary$2((G=>{const K=(G=>{if(G.passportId)return`passport:${G.passportId.toLowerCase()}`;if(G.ethAddress)return`ethAddress:${G.ethAddress.toLowerCase()}`;throw new Error("invalid_identity")})(G);K&&(storeDetail$1(vn.IDENTITY,K),Dn("metrics","identify",G.traits))})),Hn=errorBoundary$2(getGlobalisedValue$2("setEnvironment",(G=>{storeDetail$1(vn.ENVIRONMENT,G)}))),Wn=errorBoundary$2(getGlobalisedValue$2("setPassportClientId",(G=>{storeDetail$1(vn.PASSPORT_CLIENT_ID,G)}))),zn=errorBoundary$2(getGlobalisedValue$2("setPublishableApiKey",(G=>{storeDetail$1(vn.PUBLISHABLE_API_KEY,G)}))),Vn=errorBoundary$2(getGlobalisedValue$2("getDetail",getDetail$1$1)),Kn={localStorage:bn};var Jn,Xn;!function(G){G.PRODUCTION="production",G.SANDBOX="sandbox"}(Jn||(Jn={})),function(G){G.API_KEY="x-immutable-api-key",G.PUBLISHABLE_KEY="x-immutable-publishable-key",G.RATE_LIMITING_KEY="x-api-key"}(Xn||(Xn={}));class ImmutableConfiguration{environment;rateLimitingKey;apiKey;publishableKey;constructor(G){this.environment=G.environment,this.publishableKey=G.publishableKey,this.apiKey=G.apiKey,this.rateLimitingKey=G.rateLimitingKey,Hn(G.environment),Dn("config","created_imtbl_config")}}const addKeysToHeadersOverride=(G,K)=>{if(!G||!G.apiKey&&!G.publishableKey&&!G.rateLimitingKey)return K;const ne={};return G.apiKey&&(ne[Xn.API_KEY]=G.apiKey),G.publishableKey&&(ne[Xn.PUBLISHABLE_KEY]=G.publishableKey,zn(G.publishableKey)),G.rateLimitingKey&&(ne[Xn.RATE_LIMITING_KEY]=G.rateLimitingKey),K&&K.headers?{...K,headers:{...ne,...K.headers}}:{...K,headers:ne}};var Qn=Object.freeze({__proto__:null,get Environment(){return Jn},ImmutableConfiguration:ImmutableConfiguration,get KeyHeaders(){return Xn},addKeysToHeadersOverride:addKeysToHeadersOverride});const Zn="https://api.sandbox.x.immutable.com".replace(/\/+$/,"");let Yn=class BaseAPI{basePath;axios;configuration;constructor(G,K=Zn,ne=er){this.basePath=K,this.axios=ne,G&&(this.configuration=G,this.basePath=G.basePath||this.basePath)}},ea=class RequiredError extends Error{field;name="RequiredError";constructor(G,K){super(K),this.field=G}};const ta="https://example.com",assertParamExists$1=function(G,K,ne){if(null==ne)throw new ea(K,`Required parameter ${K} was null or undefined when calling ${G}.`)};function setFlattenedQueryParams$1(G,K,ne=""){"object"==typeof K?Array.isArray(K)?K.forEach((K=>setFlattenedQueryParams$1(G,K,ne))):Object.keys(K).forEach((ue=>setFlattenedQueryParams$1(G,K[ue],`${ne}${""!==ne?".":""}${ue}`))):G.has(ne)?G.append(ne,K):G.set(ne,K)}const setSearchParams$1=function(G,...K){const ne=new URLSearchParams(G.search);setFlattenedQueryParams$1(ne,K),G.search=ne.toString()},serializeDataIfNeeded$1=function(G,K,ne){const ue="string"!=typeof G;return(ue&&ne&&ne.isJsonMime?ne.isJsonMime(K.headers["Content-Type"]):ue)?JSON.stringify(void 0!==G?G:{}):G||""},toPathString$1=function(G){return G.pathname+G.search+G.hash},createRequestFunction$1=function(G,K,ne,ue){return(pe=K,he=ne)=>{const ye={...G.options,url:(ue?.basePath||he)+G.url};return pe.request(ye)}},AssetsApiAxiosParamCreator=function(G){return{getAsset:async(K,ne,ue,pe={})=>{assertParamExists$1("getAsset","tokenAddress",K),assertParamExists$1("getAsset","tokenId",ne);const he="/v1/assets/{token_address}/{token_id}".replace("{token_address}",encodeURIComponent(String(K))).replace("{token_id}",encodeURIComponent(String(ne))),ye=new URL(he,ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe},ve={};void 0!==ue&&(ve.include_fees=ue),setSearchParams$1(ye,ve);let _e=me&&me.headers?me.headers:{};return be.headers={..._e,...pe.headers},{url:toPathString$1(ye),options:be}},listAssets:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe={})=>{const xe=new URL("/v1/assets",ta);let Ne;G&&(Ne=G.baseOptions);const Me={method:"GET",...Ne,...Oe},Be={};void 0!==K&&(Be.page_size=K),void 0!==ne&&(Be.cursor=ne),void 0!==ue&&(Be.order_by=ue),void 0!==pe&&(Be.direction=pe),void 0!==he&&(Be.user=he),void 0!==ye&&(Be.status=ye),void 0!==me&&(Be.name=me),void 0!==be&&(Be.metadata=be),void 0!==ve&&(Be.sell_orders=ve),void 0!==_e&&(Be.buy_orders=_e),void 0!==Te&&(Be.include_fees=Te),void 0!==Ee&&(Be.collection=Ee),void 0!==Pe&&(Be.updated_min_timestamp=Pe),void 0!==Se&&(Be.updated_max_timestamp=Se),void 0!==Ce&&(Be.auxiliary_fee_percentages=Ce),void 0!==ke&&(Be.auxiliary_fee_recipients=ke),setSearchParams$1(xe,Be);let Fe=Ne&&Ne.headers?Ne.headers:{};return Me.headers={...Fe,...Oe.headers},{url:toPathString$1(xe),options:Me}}}},AssetsApiFp=function(G){const K=AssetsApiAxiosParamCreator(G);return{async getAsset(ne,ue,pe,he){const ye=await K.getAsset(ne,ue,pe,he);return createRequestFunction$1(ye,er,Zn,G)},async listAssets(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe){const Ne=await K.listAssets(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe);return createRequestFunction$1(Ne,er,Zn,G)}}};let ra=class AssetsApi extends Yn{getAsset(G,K){return AssetsApiFp(this.configuration).getAsset(G.tokenAddress,G.tokenId,G.includeFees,K).then((G=>G(this.axios,this.basePath)))}listAssets(G={},K){return AssetsApiFp(this.configuration).listAssets(G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.status,G.name,G.metadata,G.sellOrders,G.buyOrders,G.includeFees,G.collection,G.updatedMinTimestamp,G.updatedMaxTimestamp,G.auxiliaryFeePercentages,G.auxiliaryFeeRecipients,K).then((G=>G(this.axios,this.basePath)))}};const BalancesApiAxiosParamCreator=function(G){return{getBalance:async(K,ne,ue={})=>{assertParamExists$1("getBalance","owner",K),assertParamExists$1("getBalance","address",ne);const pe="/v2/balances/{owner}/{address}".replace("{owner}",encodeURIComponent(String(K))).replace("{address}",encodeURIComponent(String(ne))),he=new URL(pe,ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams$1(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString$1(he),options:me}},listBalances:async(K,ne,ue,pe,he,ye={})=>{assertParamExists$1("listBalances","owner",K);const me="/v2/balances/{owner}".replace("{owner}",encodeURIComponent(String(K))),be=new URL(me,ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={};void 0!==ne&&(Te.page_size=ne),void 0!==ue&&(Te.cursor=ue),void 0!==pe&&(Te.order_by=pe),void 0!==he&&(Te.direction=he),setSearchParams$1(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...ye.headers},{url:toPathString$1(be),options:_e}}}},BalancesApiFp=function(G){const K=BalancesApiAxiosParamCreator(G);return{async getBalance(ne,ue,pe){const he=await K.getBalance(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async listBalances(ne,ue,pe,he,ye,me){const be=await K.listBalances(ne,ue,pe,he,ye,me);return createRequestFunction$1(be,er,Zn,G)}}};let na=class BalancesApi extends Yn{getBalance(G,K){return BalancesApiFp(this.configuration).getBalance(G.owner,G.address,K).then((G=>G(this.axios,this.basePath)))}listBalances(G,K){return BalancesApiFp(this.configuration).listBalances(G.owner,G.pageSize,G.cursor,G.orderBy,G.direction,K).then((G=>G(this.axios,this.basePath)))}};const CollectionsApiAxiosParamCreator$1=function(G){return{createCollection:async(K,ne,ue,pe,he={})=>{assertParamExists$1("createCollection","iMXSignature",K),assertParamExists$1("createCollection","iMXTimestamp",ne),assertParamExists$1("createCollection","createCollectionRequest",ue);const ye=new URL("/v1/collections",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=K&&(ve["IMX-Signature"]=String(K)),null!=ne&&(ve["IMX-Timestamp"]=String(ne)),null!=pe&&(ve["x-immutable-api-key"]=String(pe)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(ue,be,G),{url:toPathString$1(ye),options:be}},getCollection:async(K,ne={})=>{assertParamExists$1("getCollection","address",K);const ue="/v1/collections/{address}".replace("{address}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},listCollectionFilters:async(K,ne,ue,pe={})=>{assertParamExists$1("listCollectionFilters","address",K);const he="/v1/collections/{address}/filters".replace("{address}",encodeURIComponent(String(K))),ye=new URL(he,ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe},ve={};void 0!==ne&&(ve.page_size=ne),void 0!==ue&&(ve.next_page_token=ue),setSearchParams$1(ye,ve);let _e=me&&me.headers?me.headers:{};return be.headers={..._e,...pe.headers},{url:toPathString$1(ye),options:be}},listCollections:async(K,ne,ue,pe,he,ye,me,be={})=>{const ve=new URL("/v1/collections",ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...be},Ee={};void 0!==K&&(Ee.page_size=K),void 0!==ne&&(Ee.cursor=ne),void 0!==ue&&(Ee.order_by=ue),void 0!==pe&&(Ee.direction=pe),void 0!==he&&(Ee.blacklist=he),void 0!==ye&&(Ee.whitelist=ye),void 0!==me&&(Ee.keyword=me),setSearchParams$1(ve,Ee);let Pe=_e&&_e.headers?_e.headers:{};return Te.headers={...Pe,...be.headers},{url:toPathString$1(ve),options:Te}},summarizeCollections:async(K,ne={})=>{assertParamExists$1("summarizeCollections","user",K);const ue=new URL("/v1/collections-summary",ta);let pe;G&&(pe=G.baseOptions);const he={method:"GET",...pe,...ne},ye={};void 0!==K&&(ye.user=K),setSearchParams$1(ue,ye);let me=pe&&pe.headers?pe.headers:{};return he.headers={...me,...ne.headers},{url:toPathString$1(ue),options:he}},updateCollection:async(K,ne,ue,pe,he={})=>{assertParamExists$1("updateCollection","address",K),assertParamExists$1("updateCollection","iMXSignature",ne),assertParamExists$1("updateCollection","iMXTimestamp",ue),assertParamExists$1("updateCollection","updateCollectionRequest",pe);const ye="/v1/collections/{address}".replace("{address}",encodeURIComponent(String(K))),me=new URL(ye,ta);let be;G&&(be=G.baseOptions);const ve={method:"PATCH",...be,...he},_e={};null!=ne&&(_e["IMX-Signature"]=String(ne)),null!=ue&&(_e["IMX-Timestamp"]=String(ue)),_e["Content-Type"]="application/json",setSearchParams$1(me,{});let Te=be&&be.headers?be.headers:{};return ve.headers={..._e,...Te,...he.headers},ve.data=serializeDataIfNeeded$1(pe,ve,G),{url:toPathString$1(me),options:ve}}}},CollectionsApiFp$1=function(G){const K=CollectionsApiAxiosParamCreator$1(G);return{async createCollection(ne,ue,pe,he,ye){const me=await K.createCollection(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getCollection(ne,ue){const pe=await K.getCollection(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listCollectionFilters(ne,ue,pe,he){const ye=await K.listCollectionFilters(ne,ue,pe,he);return createRequestFunction$1(ye,er,Zn,G)},async listCollections(ne,ue,pe,he,ye,me,be,ve){const _e=await K.listCollections(ne,ue,pe,he,ye,me,be,ve);return createRequestFunction$1(_e,er,Zn,G)},async summarizeCollections(ne,ue){const pe=await K.summarizeCollections(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async updateCollection(ne,ue,pe,he,ye){const me=await K.updateCollection(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)}}};let aa=class CollectionsApi extends Yn{createCollection(G,K){return CollectionsApiFp$1(this.configuration).createCollection(G.iMXSignature,G.iMXTimestamp,G.createCollectionRequest,G.xImmutableApiKey,K).then((G=>G(this.axios,this.basePath)))}getCollection(G,K){return CollectionsApiFp$1(this.configuration).getCollection(G.address,K).then((G=>G(this.axios,this.basePath)))}listCollectionFilters(G,K){return CollectionsApiFp$1(this.configuration).listCollectionFilters(G.address,G.pageSize,G.nextPageToken,K).then((G=>G(this.axios,this.basePath)))}listCollections(G={},K){return CollectionsApiFp$1(this.configuration).listCollections(G.pageSize,G.cursor,G.orderBy,G.direction,G.blacklist,G.whitelist,G.keyword,K).then((G=>G(this.axios,this.basePath)))}summarizeCollections(G,K){return CollectionsApiFp$1(this.configuration).summarizeCollections(G.user,K).then((G=>G(this.axios,this.basePath)))}updateCollection(G,K){return CollectionsApiFp$1(this.configuration).updateCollection(G.address,G.iMXSignature,G.iMXTimestamp,G.updateCollectionRequest,K).then((G=>G(this.axios,this.basePath)))}};const DepositsApiAxiosParamCreator=function(G){return{getDeposit:async(K,ne={})=>{assertParamExists$1("getDeposit","id",K);const ue="/v1/deposits/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},getSignableDeposit:async(K,ne={})=>{assertParamExists$1("getSignableDeposit","getSignableDepositRequest",K);const ue=new URL("/v1/signable-deposit-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},listDeposits:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe={})=>{const xe=new URL("/v1/deposits",ta);let Ne;G&&(Ne=G.baseOptions);const Me={method:"GET",...Ne,...Oe},Be={};void 0!==K&&(Be.page_size=K),void 0!==ne&&(Be.cursor=ne),void 0!==ue&&(Be.order_by=ue),void 0!==pe&&(Be.direction=pe),void 0!==he&&(Be.user=he),void 0!==ye&&(Be.status=ye),void 0!==me&&(Be.min_timestamp=me),void 0!==be&&(Be.max_timestamp=be),void 0!==ve&&(Be.token_type=ve),void 0!==_e&&(Be.token_id=_e),void 0!==Te&&(Be.asset_id=Te),void 0!==Ee&&(Be.token_address=Ee),void 0!==Pe&&(Be.token_name=Pe),void 0!==Se&&(Be.min_quantity=Se),void 0!==Ce&&(Be.max_quantity=Ce),void 0!==ke&&(Be.metadata=ke),setSearchParams$1(xe,Be);let Fe=Ne&&Ne.headers?Ne.headers:{};return Me.headers={...Fe,...Oe.headers},{url:toPathString$1(xe),options:Me}}}},DepositsApiFp=function(G){const K=DepositsApiAxiosParamCreator(G);return{async getDeposit(ne,ue){const pe=await K.getDeposit(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getSignableDeposit(ne,ue){const pe=await K.getSignableDeposit(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listDeposits(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe){const Ne=await K.listDeposits(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe);return createRequestFunction$1(Ne,er,Zn,G)}}};let ia=class DepositsApi extends Yn{getDeposit(G,K){return DepositsApiFp(this.configuration).getDeposit(G.id,K).then((G=>G(this.axios,this.basePath)))}getSignableDeposit(G,K){return DepositsApiFp(this.configuration).getSignableDeposit(G.getSignableDepositRequest,K).then((G=>G(this.axios,this.basePath)))}listDeposits(G={},K){return DepositsApiFp(this.configuration).listDeposits(G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.status,G.minTimestamp,G.maxTimestamp,G.tokenType,G.tokenId,G.assetId,G.tokenAddress,G.tokenName,G.minQuantity,G.maxQuantity,G.metadata,K).then((G=>G(this.axios,this.basePath)))}};const EncodingApiAxiosParamCreator=function(G){return{encodeAsset:async(K,ne,ue={})=>{assertParamExists$1("encodeAsset","assetType",K),assertParamExists$1("encodeAsset","encodeAssetRequest",ne);const pe="/v1/encode/{assetType}".replace("{assetType}",encodeURIComponent(String(K))),he=new URL(pe,ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams$1(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded$1(ne,me,G),{url:toPathString$1(he),options:me}}}},EncodingApiFp=function(G){const K=EncodingApiAxiosParamCreator(G);return{async encodeAsset(ne,ue,pe){const he=await K.encodeAsset(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)}}};let sa=class EncodingApi extends Yn{encodeAsset(G,K){return EncodingApiFp(this.configuration).encodeAsset(G.assetType,G.encodeAssetRequest,K).then((G=>G(this.axios,this.basePath)))}};const ExchangesApiAxiosParamCreator=function(G){return{createExchange:async(K,ne={})=>{assertParamExists$1("createExchange","createExchangeAPIRequest",K);const ue=new URL("/v3/exchanges",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},createExchangeTransfer:async(K,ne,ue,pe,he,ye={})=>{assertParamExists$1("createExchangeTransfer","id",K),assertParamExists$1("createExchangeTransfer","createTransferRequest",ne);const me="/v2/exchanges/{id}/transfers".replace("{id}",encodeURIComponent(String(K))),be=new URL(me,ta);let ve;G&&(ve=G.baseOptions);const _e={method:"POST",...ve,...ye},Te={};null!=ue&&(Te["x-imx-eth-address"]=String(ue)),null!=pe&&(Te["x-imx-eth-signature"]=String(pe)),null!=he&&(Te.Authorization=String(he)),Te["Content-Type"]="application/json",setSearchParams$1(be,{});let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Te,...Ee,...ye.headers},_e.data=serializeDataIfNeeded$1(ne,_e,G),{url:toPathString$1(be),options:_e}},getExchange:async(K,ne={})=>{assertParamExists$1("getExchange","id",K);const ue="/v3/exchanges/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},getExchangeSignableTransfer:async(K,ne,ue={})=>{assertParamExists$1("getExchangeSignableTransfer","id",K),assertParamExists$1("getExchangeSignableTransfer","getSignableTransferRequest",ne);const pe="/v2/exchanges/{id}/signable-transfer-details".replace("{id}",encodeURIComponent(String(K))),he=new URL(pe,ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams$1(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded$1(ne,me,G),{url:toPathString$1(he),options:me}},getExchanges:async(K,ne,ue,pe,he,ye,me,be,ve,_e={})=>{const Te=new URL("/v3/exchanges",ta);let Ee;G&&(Ee=G.baseOptions);const Pe={method:"GET",...Ee,..._e},Se={};void 0!==K&&(Se.page_size=K),void 0!==ne&&(Se.cursor=ne),void 0!==ue&&(Se.order_by=ue),void 0!==pe&&(Se.direction=pe),void 0!==he&&(Se.id=he),void 0!==ye&&(Se.wallet_address=ye),void 0!==me&&(Se.status=me),void 0!==be&&(Se.provider=be),void 0!==ve&&(Se.transfer_id=ve),setSearchParams$1(Te,Se);let Ce=Ee&&Ee.headers?Ee.headers:{};return Pe.headers={...Ce,..._e.headers},{url:toPathString$1(Te),options:Pe}}}},ExchangesApiFp=function(G){const K=ExchangesApiAxiosParamCreator(G);return{async createExchange(ne,ue){const pe=await K.createExchange(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async createExchangeTransfer(ne,ue,pe,he,ye,me){const be=await K.createExchangeTransfer(ne,ue,pe,he,ye,me);return createRequestFunction$1(be,er,Zn,G)},async getExchange(ne,ue){const pe=await K.getExchange(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getExchangeSignableTransfer(ne,ue,pe){const he=await K.getExchangeSignableTransfer(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async getExchanges(ne,ue,pe,he,ye,me,be,ve,_e,Te){const Ee=await K.getExchanges(ne,ue,pe,he,ye,me,be,ve,_e,Te);return createRequestFunction$1(Ee,er,Zn,G)}}};let oa=class ExchangesApi extends Yn{createExchange(G,K){return ExchangesApiFp(this.configuration).createExchange(G.createExchangeAPIRequest,K).then((G=>G(this.axios,this.basePath)))}createExchangeTransfer(G,K){return ExchangesApiFp(this.configuration).createExchangeTransfer(G.id,G.createTransferRequest,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}getExchange(G,K){return ExchangesApiFp(this.configuration).getExchange(G.id,K).then((G=>G(this.axios,this.basePath)))}getExchangeSignableTransfer(G,K){return ExchangesApiFp(this.configuration).getExchangeSignableTransfer(G.id,G.getSignableTransferRequest,K).then((G=>G(this.axios,this.basePath)))}getExchanges(G={},K){return ExchangesApiFp(this.configuration).getExchanges(G.pageSize,G.cursor,G.orderBy,G.direction,G.id,G.walletAddress,G.status,G.provider,G.transferId,K).then((G=>G(this.axios,this.basePath)))}};const MetadataApiAxiosParamCreator$1=function(G){return{addMetadataSchemaToCollection:async(K,ne,ue,pe,he={})=>{assertParamExists$1("addMetadataSchemaToCollection","address",K),assertParamExists$1("addMetadataSchemaToCollection","iMXSignature",ne),assertParamExists$1("addMetadataSchemaToCollection","iMXTimestamp",ue),assertParamExists$1("addMetadataSchemaToCollection","addMetadataSchemaToCollectionRequest",pe);const ye="/v1/collections/{address}/metadata-schema".replace("{address}",encodeURIComponent(String(K))),me=new URL(ye,ta);let be;G&&(be=G.baseOptions);const ve={method:"POST",...be,...he},_e={};null!=ne&&(_e["IMX-Signature"]=String(ne)),null!=ue&&(_e["IMX-Timestamp"]=String(ue)),_e["Content-Type"]="application/json",setSearchParams$1(me,{});let Te=be&&be.headers?be.headers:{};return ve.headers={..._e,...Te,...he.headers},ve.data=serializeDataIfNeeded$1(pe,ve,G),{url:toPathString$1(me),options:ve}},getMetadataSchema:async(K,ne={})=>{assertParamExists$1("getMetadataSchema","address",K);const ue="/v1/collections/{address}/metadata-schema".replace("{address}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},updateMetadataSchemaByName:async(K,ne,ue,pe,he,ye={})=>{assertParamExists$1("updateMetadataSchemaByName","address",K),assertParamExists$1("updateMetadataSchemaByName","name",ne),assertParamExists$1("updateMetadataSchemaByName","iMXSignature",ue),assertParamExists$1("updateMetadataSchemaByName","iMXTimestamp",pe),assertParamExists$1("updateMetadataSchemaByName","metadataSchemaRequest",he);const me="/v1/collections/{address}/metadata-schema/{name}".replace("{address}",encodeURIComponent(String(K))).replace("{name}",encodeURIComponent(String(ne))),be=new URL(me,ta);let ve;G&&(ve=G.baseOptions);const _e={method:"PATCH",...ve,...ye},Te={};null!=ue&&(Te["IMX-Signature"]=String(ue)),null!=pe&&(Te["IMX-Timestamp"]=String(pe)),Te["Content-Type"]="application/json",setSearchParams$1(be,{});let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Te,...Ee,...ye.headers},_e.data=serializeDataIfNeeded$1(he,_e,G),{url:toPathString$1(be),options:_e}}}},MetadataApiFp$1=function(G){const K=MetadataApiAxiosParamCreator$1(G);return{async addMetadataSchemaToCollection(ne,ue,pe,he,ye){const me=await K.addMetadataSchemaToCollection(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getMetadataSchema(ne,ue){const pe=await K.getMetadataSchema(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async updateMetadataSchemaByName(ne,ue,pe,he,ye,me){const be=await K.updateMetadataSchemaByName(ne,ue,pe,he,ye,me);return createRequestFunction$1(be,er,Zn,G)}}};let ca=class MetadataApi extends Yn{addMetadataSchemaToCollection(G,K){return MetadataApiFp$1(this.configuration).addMetadataSchemaToCollection(G.address,G.iMXSignature,G.iMXTimestamp,G.addMetadataSchemaToCollectionRequest,K).then((G=>G(this.axios,this.basePath)))}getMetadataSchema(G,K){return MetadataApiFp$1(this.configuration).getMetadataSchema(G.address,K).then((G=>G(this.axios,this.basePath)))}updateMetadataSchemaByName(G,K){return MetadataApiFp$1(this.configuration).updateMetadataSchemaByName(G.address,G.name,G.iMXSignature,G.iMXTimestamp,G.metadataSchemaRequest,K).then((G=>G(this.axios,this.basePath)))}};const MetadataRefreshesApiAxiosParamCreator=function(G){return{getAListOfMetadataRefreshes:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists$1("getAListOfMetadataRefreshes","xImxEthSignature",K),assertParamExists$1("getAListOfMetadataRefreshes","xImxEthTimestamp",ne),assertParamExists$1("getAListOfMetadataRefreshes","xImxEthAddress",ue);const be=new URL("/v1/metadata-refreshes",ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...me},Te={},Ee={};void 0!==pe&&(Ee.page_size=pe),void 0!==he&&(Ee.cursor=he),void 0!==ye&&(Ee.collection_address=ye),null!=K&&(Te["x-imx-eth-signature"]=String(K)),null!=ne&&(Te["x-imx-eth-timestamp"]=String(ne)),null!=ue&&(Te["x-imx-eth-address"]=String(ue)),setSearchParams$1(be,Ee);let Pe=ve&&ve.headers?ve.headers:{};return _e.headers={...Te,...Pe,...me.headers},{url:toPathString$1(be),options:_e}},getMetadataRefreshErrors:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists$1("getMetadataRefreshErrors","refreshId",K),assertParamExists$1("getMetadataRefreshErrors","xImxEthSignature",ne),assertParamExists$1("getMetadataRefreshErrors","xImxEthTimestamp",ue),assertParamExists$1("getMetadataRefreshErrors","xImxEthAddress",pe);const be="/v1/metadata-refreshes/{refresh_id}/errors".replace("{refresh_id}",encodeURIComponent(String(K))),ve=new URL(be,ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...me},Ee={},Pe={};void 0!==he&&(Pe.page_size=he),void 0!==ye&&(Pe.cursor=ye),null!=ne&&(Ee["x-imx-eth-signature"]=String(ne)),null!=ue&&(Ee["x-imx-eth-timestamp"]=String(ue)),null!=pe&&(Ee["x-imx-eth-address"]=String(pe)),setSearchParams$1(ve,Pe);let Se=_e&&_e.headers?_e.headers:{};return Te.headers={...Ee,...Se,...me.headers},{url:toPathString$1(ve),options:Te}},getMetadataRefreshResults:async(K,ne,ue,pe,he={})=>{assertParamExists$1("getMetadataRefreshResults","refreshId",K),assertParamExists$1("getMetadataRefreshResults","xImxEthSignature",ne),assertParamExists$1("getMetadataRefreshResults","xImxEthTimestamp",ue),assertParamExists$1("getMetadataRefreshResults","xImxEthAddress",pe);const ye="/v1/metadata-refreshes/{refresh_id}".replace("{refresh_id}",encodeURIComponent(String(K))),me=new URL(ye,ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};null!=ne&&(_e["x-imx-eth-signature"]=String(ne)),null!=ue&&(_e["x-imx-eth-timestamp"]=String(ue)),null!=pe&&(_e["x-imx-eth-address"]=String(pe)),setSearchParams$1(me,{});let Te=be&&be.headers?be.headers:{};return ve.headers={..._e,...Te,...he.headers},{url:toPathString$1(me),options:ve}},requestAMetadataRefresh:async(K,ne,ue,pe,he={})=>{assertParamExists$1("requestAMetadataRefresh","xImxEthSignature",K),assertParamExists$1("requestAMetadataRefresh","xImxEthTimestamp",ne),assertParamExists$1("requestAMetadataRefresh","xImxEthAddress",ue),assertParamExists$1("requestAMetadataRefresh","createMetadataRefreshRequest",pe);const ye=new URL("/v1/metadata-refreshes",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=K&&(ve["x-imx-eth-signature"]=String(K)),null!=ne&&(ve["x-imx-eth-timestamp"]=String(ne)),null!=ue&&(ve["x-imx-eth-address"]=String(ue)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(pe,be,G),{url:toPathString$1(ye),options:be}}}},MetadataRefreshesApiFp=function(G){const K=MetadataRefreshesApiAxiosParamCreator(G);return{async getAListOfMetadataRefreshes(ne,ue,pe,he,ye,me,be){const ve=await K.getAListOfMetadataRefreshes(ne,ue,pe,he,ye,me,be);return createRequestFunction$1(ve,er,Zn,G)},async getMetadataRefreshErrors(ne,ue,pe,he,ye,me,be){const ve=await K.getMetadataRefreshErrors(ne,ue,pe,he,ye,me,be);return createRequestFunction$1(ve,er,Zn,G)},async getMetadataRefreshResults(ne,ue,pe,he,ye){const me=await K.getMetadataRefreshResults(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async requestAMetadataRefresh(ne,ue,pe,he,ye){const me=await K.requestAMetadataRefresh(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)}}};let da=class MetadataRefreshesApi extends Yn{getAListOfMetadataRefreshes(G,K){return MetadataRefreshesApiFp(this.configuration).getAListOfMetadataRefreshes(G.xImxEthSignature,G.xImxEthTimestamp,G.xImxEthAddress,G.pageSize,G.cursor,G.collectionAddress,K).then((G=>G(this.axios,this.basePath)))}getMetadataRefreshErrors(G,K){return MetadataRefreshesApiFp(this.configuration).getMetadataRefreshErrors(G.refreshId,G.xImxEthSignature,G.xImxEthTimestamp,G.xImxEthAddress,G.pageSize,G.cursor,K).then((G=>G(this.axios,this.basePath)))}getMetadataRefreshResults(G,K){return MetadataRefreshesApiFp(this.configuration).getMetadataRefreshResults(G.refreshId,G.xImxEthSignature,G.xImxEthTimestamp,G.xImxEthAddress,K).then((G=>G(this.axios,this.basePath)))}requestAMetadataRefresh(G,K){return MetadataRefreshesApiFp(this.configuration).requestAMetadataRefresh(G.xImxEthSignature,G.xImxEthTimestamp,G.xImxEthAddress,G.createMetadataRefreshRequest,K).then((G=>G(this.axios,this.basePath)))}};const MintsApiAxiosParamCreator=function(G){return{getMint:async(K,ne={})=>{assertParamExists$1("getMint","id",K);const ue="/v1/mints/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},getMintableTokenDetailsByClientTokenId:async(K,ne,ue={})=>{assertParamExists$1("getMintableTokenDetailsByClientTokenId","tokenAddress",K),assertParamExists$1("getMintableTokenDetailsByClientTokenId","tokenId",ne);const pe="/v1/mintable-token/{token_address}/{token_id}".replace("{token_address}",encodeURIComponent(String(K))).replace("{token_id}",encodeURIComponent(String(ne))),he=new URL(pe,ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams$1(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString$1(he),options:me}},listMints:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke={})=>{const Oe=new URL("/v1/mints",ta);let xe;G&&(xe=G.baseOptions);const Ne={method:"GET",...xe,...ke},Me={};void 0!==K&&(Me.page_size=K),void 0!==ne&&(Me.cursor=ne),void 0!==ue&&(Me.order_by=ue),void 0!==pe&&(Me.direction=pe),void 0!==he&&(Me.user=he),void 0!==ye&&(Me.status=ye),void 0!==me&&(Me.min_timestamp=me),void 0!==be&&(Me.max_timestamp=be),void 0!==ve&&(Me.token_type=ve),void 0!==_e&&(Me.token_id=_e),void 0!==Te&&(Me.token_name=Te),void 0!==Ee&&(Me.token_address=Ee),void 0!==Pe&&(Me.min_quantity=Pe),void 0!==Se&&(Me.max_quantity=Se),void 0!==Ce&&(Me.metadata=Ce),setSearchParams$1(Oe,Me);let Be=xe&&xe.headers?xe.headers:{};return Ne.headers={...Be,...ke.headers},{url:toPathString$1(Oe),options:Ne}},mintTokens:async(K,ne={})=>{assertParamExists$1("mintTokens","mintTokensRequestV2",K);const ue=new URL("/v2/mints",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}}}},MintsApiFp=function(G){const K=MintsApiAxiosParamCreator(G);return{async getMint(ne,ue){const pe=await K.getMint(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getMintableTokenDetailsByClientTokenId(ne,ue,pe){const he=await K.getMintableTokenDetailsByClientTokenId(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async listMints(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe){const xe=await K.listMints(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe);return createRequestFunction$1(xe,er,Zn,G)},async mintTokens(ne,ue){const pe=await K.mintTokens(ne,ue);return createRequestFunction$1(pe,er,Zn,G)}}};let ua=class MintsApi extends Yn{getMint(G,K){return MintsApiFp(this.configuration).getMint(G.id,K).then((G=>G(this.axios,this.basePath)))}getMintableTokenDetailsByClientTokenId(G,K){return MintsApiFp(this.configuration).getMintableTokenDetailsByClientTokenId(G.tokenAddress,G.tokenId,K).then((G=>G(this.axios,this.basePath)))}listMints(G={},K){return MintsApiFp(this.configuration).listMints(G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.status,G.minTimestamp,G.maxTimestamp,G.tokenType,G.tokenId,G.tokenName,G.tokenAddress,G.minQuantity,G.maxQuantity,G.metadata,K).then((G=>G(this.axios,this.basePath)))}mintTokens(G,K){return MintsApiFp(this.configuration).mintTokens(G.mintTokensRequestV2,K).then((G=>G(this.axios,this.basePath)))}};const NftCheckoutPrimaryApiAxiosParamCreator=function(G){return{createNftPrimary:async(K,ne={})=>{assertParamExists$1("createNftPrimary","createAPIRequest",K);const ue=new URL("/v2/nft/primary",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getCurrenciesNFTCheckoutPrimary:async(K,ne,ue={})=>{const pe=new URL("/v2/nft/primary/currencies",ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ue},me={};void 0!==K&&(me.provider=K),void 0!==ne&&(me.include_limits=ne),setSearchParams$1(pe,me);let be=he&&he.headers?he.headers:{};return ye.headers={...be,...ue.headers},{url:toPathString$1(pe),options:ye}},getNftPrimaryTransaction:async(K,ne={})=>{assertParamExists$1("getNftPrimaryTransaction","transactionId",K);const ue="/v2/nft/primary/{transaction_id}".replace("{transaction_id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},getNftPrimaryTransactions:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee={})=>{const Pe=new URL("/v2/nft/primary",ta);let Se;G&&(Se=G.baseOptions);const Ce={method:"GET",...Se,...Ee},ke={};void 0!==K&&(ke.page_size=K),void 0!==ne&&(ke.cursor=ne),void 0!==ue&&(ke.order_by=ue),void 0!==pe&&(ke.direction=pe),void 0!==he&&(ke.transaction_id=he),void 0!==ye&&(ke.contract_address=ye),void 0!==me&&(ke.seller_wallet_address=me),void 0!==be&&(ke.user_wallet_address=be),void 0!==ve&&(ke.status=ve),void 0!==_e&&(ke.provider=_e),void 0!==Te&&(ke.mint_id=Te),setSearchParams$1(Pe,ke);let Oe=Se&&Se.headers?Se.headers:{};return Ce.headers={...Oe,...Ee.headers},{url:toPathString$1(Pe),options:Ce}},registerNftPrimarySalesContract:async(K,ne={})=>{assertParamExists$1("registerNftPrimarySalesContract","createAPIRequest",K);const ue=new URL("/v2/nft/primary/register",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}}}},NftCheckoutPrimaryApiFp=function(G){const K=NftCheckoutPrimaryApiAxiosParamCreator(G);return{async createNftPrimary(ne,ue){const pe=await K.createNftPrimary(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getCurrenciesNFTCheckoutPrimary(ne,ue,pe){const he=await K.getCurrenciesNFTCheckoutPrimary(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async getNftPrimaryTransaction(ne,ue){const pe=await K.getNftPrimaryTransaction(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getNftPrimaryTransactions(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe){const Se=await K.getNftPrimaryTransactions(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe);return createRequestFunction$1(Se,er,Zn,G)},async registerNftPrimarySalesContract(ne,ue){const pe=await K.registerNftPrimarySalesContract(ne,ue);return createRequestFunction$1(pe,er,Zn,G)}}};let fa=class NftCheckoutPrimaryApi extends Yn{createNftPrimary(G,K){return NftCheckoutPrimaryApiFp(this.configuration).createNftPrimary(G.createAPIRequest,K).then((G=>G(this.axios,this.basePath)))}getCurrenciesNFTCheckoutPrimary(G={},K){return NftCheckoutPrimaryApiFp(this.configuration).getCurrenciesNFTCheckoutPrimary(G.provider,G.includeLimits,K).then((G=>G(this.axios,this.basePath)))}getNftPrimaryTransaction(G,K){return NftCheckoutPrimaryApiFp(this.configuration).getNftPrimaryTransaction(G.transactionId,K).then((G=>G(this.axios,this.basePath)))}getNftPrimaryTransactions(G={},K){return NftCheckoutPrimaryApiFp(this.configuration).getNftPrimaryTransactions(G.pageSize,G.cursor,G.orderBy,G.direction,G.transactionId,G.contractAddress,G.sellerWalletAddress,G.userWalletAddress,G.status,G.provider,G.mintId,K).then((G=>G(this.axios,this.basePath)))}registerNftPrimarySalesContract(G,K){return NftCheckoutPrimaryApiFp(this.configuration).registerNftPrimarySalesContract(G.createAPIRequest,K).then((G=>G(this.axios,this.basePath)))}};const OrdersApiAxiosParamCreator$1=function(G){return{cancelOrderV3:async(K,ne,ue,pe,he,ye={})=>{assertParamExists$1("cancelOrderV3","id",K),assertParamExists$1("cancelOrderV3","cancelOrderRequest",ne);const me="/v3/orders/{id}".replace("{id}",encodeURIComponent(String(K))),be=new URL(me,ta);let ve;G&&(ve=G.baseOptions);const _e={method:"DELETE",...ve,...ye},Te={};null!=ue&&(Te["x-imx-eth-address"]=String(ue)),null!=pe&&(Te["x-imx-eth-signature"]=String(pe)),null!=he&&(Te.Authorization=String(he)),Te["Content-Type"]="application/json",setSearchParams$1(be,{});let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Te,...Ee,...ye.headers},_e.data=serializeDataIfNeeded$1(ne,_e,G),{url:toPathString$1(be),options:_e}},createOrderV3:async(K,ne,ue,pe,he={})=>{assertParamExists$1("createOrderV3","createOrderRequest",K);const ye=new URL("/v3/orders",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=ne&&(ve["x-imx-eth-address"]=String(ne)),null!=ue&&(ve["x-imx-eth-signature"]=String(ue)),null!=pe&&(ve.Authorization=String(pe)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(K,be,G),{url:toPathString$1(ye),options:be}},getOrderV3:async(K,ne,ue,pe,he={})=>{assertParamExists$1("getOrderV3","id",K);const ye="/v3/orders/{id}".replace("{id}",encodeURIComponent(String(K))),me=new URL(ye,ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};void 0!==ne&&(_e.include_fees=ne),void 0!==ue&&(_e.auxiliary_fee_percentages=ue),void 0!==pe&&(_e.auxiliary_fee_recipients=pe),setSearchParams$1(me,_e);let Te=be&&be.headers?be.headers:{};return ve.headers={...Te,...he.headers},{url:toPathString$1(me),options:ve}},getSignableCancelOrderV3:async(K,ne={})=>{assertParamExists$1("getSignableCancelOrderV3","getSignableCancelOrderRequest",K);const ue=new URL("/v3/signable-cancel-order-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getSignableOrder:async(K,ne={})=>{assertParamExists$1("getSignableOrder","getSignableOrderRequestV3",K);const ue=new URL("/v3/signable-order-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},listOrdersV3:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe={})=>{const Ye=new URL("/v3/orders",ta);let et;G&&(et=G.baseOptions);const tt={method:"GET",...et,...Qe},rt={};void 0!==K&&(rt.page_size=K),void 0!==ne&&(rt.cursor=ne),void 0!==ue&&(rt.order_by=ue),void 0!==pe&&(rt.direction=pe),void 0!==he&&(rt.user=he),void 0!==ye&&(rt.status=ye),void 0!==me&&(rt.min_timestamp=me),void 0!==be&&(rt.max_timestamp=be),void 0!==ve&&(rt.updated_min_timestamp=ve),void 0!==_e&&(rt.updated_max_timestamp=_e),void 0!==Te&&(rt.buy_token_type=Te),void 0!==Ee&&(rt.buy_token_id=Ee),void 0!==Pe&&(rt.buy_asset_id=Pe),void 0!==Se&&(rt.buy_token_address=Se),void 0!==Ce&&(rt.buy_token_name=Ce),void 0!==ke&&(rt.buy_min_quantity=ke),void 0!==Oe&&(rt.buy_max_quantity=Oe),void 0!==xe&&(rt.buy_metadata=xe),void 0!==Ne&&(rt.sell_token_type=Ne),void 0!==Me&&(rt.sell_token_id=Me),void 0!==Be&&(rt.sell_asset_id=Be),void 0!==Fe&&(rt.sell_token_address=Fe),void 0!==De&&(rt.sell_token_name=De),void 0!==Le&&(rt.sell_min_quantity=Le),void 0!==Ue&&(rt.sell_max_quantity=Ue),void 0!==je&&(rt.sell_metadata=je),void 0!==ze&&(rt.auxiliary_fee_percentages=ze),void 0!==Je&&(rt.auxiliary_fee_recipients=Je),void 0!==Xe&&(rt.include_fees=Xe),setSearchParams$1(Ye,rt);let nt=et&&et.headers?et.headers:{};return tt.headers={...nt,...Qe.headers},{url:toPathString$1(Ye),options:tt}}}},OrdersApiFp$1=function(G){const K=OrdersApiAxiosParamCreator$1(G);return{async cancelOrderV3(ne,ue,pe,he,ye,me){const be=await K.cancelOrderV3(ne,ue,pe,he,ye,me);return createRequestFunction$1(be,er,Zn,G)},async createOrderV3(ne,ue,pe,he,ye){const me=await K.createOrderV3(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getOrderV3(ne,ue,pe,he,ye){const me=await K.getOrderV3(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getSignableCancelOrderV3(ne,ue){const pe=await K.getSignableCancelOrderV3(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getSignableOrder(ne,ue){const pe=await K.getSignableOrder(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listOrdersV3(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye){const et=await K.listOrdersV3(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye);return createRequestFunction$1(et,er,Zn,G)}}};let la=class OrdersApi extends Yn{cancelOrderV3(G,K){return OrdersApiFp$1(this.configuration).cancelOrderV3(G.id,G.cancelOrderRequest,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}createOrderV3(G,K){return OrdersApiFp$1(this.configuration).createOrderV3(G.createOrderRequest,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}getOrderV3(G,K){return OrdersApiFp$1(this.configuration).getOrderV3(G.id,G.includeFees,G.auxiliaryFeePercentages,G.auxiliaryFeeRecipients,K).then((G=>G(this.axios,this.basePath)))}getSignableCancelOrderV3(G,K){return OrdersApiFp$1(this.configuration).getSignableCancelOrderV3(G.getSignableCancelOrderRequest,K).then((G=>G(this.axios,this.basePath)))}getSignableOrder(G,K){return OrdersApiFp$1(this.configuration).getSignableOrder(G.getSignableOrderRequestV3,K).then((G=>G(this.axios,this.basePath)))}listOrdersV3(G={},K){return OrdersApiFp$1(this.configuration).listOrdersV3(G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.status,G.minTimestamp,G.maxTimestamp,G.updatedMinTimestamp,G.updatedMaxTimestamp,G.buyTokenType,G.buyTokenId,G.buyAssetId,G.buyTokenAddress,G.buyTokenName,G.buyMinQuantity,G.buyMaxQuantity,G.buyMetadata,G.sellTokenType,G.sellTokenId,G.sellAssetId,G.sellTokenAddress,G.sellTokenName,G.sellMinQuantity,G.sellMaxQuantity,G.sellMetadata,G.auxiliaryFeePercentages,G.auxiliaryFeeRecipients,G.includeFees,K).then((G=>G(this.axios,this.basePath)))}};const ProjectsApiAxiosParamCreator=function(G){return{getProject:async(K,ne,ue,pe={})=>{assertParamExists$1("getProject","id",K),assertParamExists$1("getProject","iMXSignature",ne),assertParamExists$1("getProject","iMXTimestamp",ue);const he="/v1/projects/{id}".replace("{id}",encodeURIComponent(String(K))),ye=new URL(he,ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe},ve={};null!=ne&&(ve["IMX-Signature"]=String(ne)),null!=ue&&(ve["IMX-Timestamp"]=String(ue)),setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},{url:toPathString$1(ye),options:be}}}},ProjectsApiFp=function(G){const K=ProjectsApiAxiosParamCreator(G);return{async getProject(ne,ue,pe,he){const ye=await K.getProject(ne,ue,pe,he);return createRequestFunction$1(ye,er,Zn,G)}}};let pa=class ProjectsApi extends Yn{getProject(G,K){return ProjectsApiFp(this.configuration).getProject(G.id,G.iMXSignature,G.iMXTimestamp,K).then((G=>G(this.axios,this.basePath)))}};const TokensApiAxiosParamCreator$1=function(G){return{getToken:async(K,ne={})=>{assertParamExists$1("getToken","address",K);const ue="/v1/tokens/{address}".replace("{address}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},listTokens:async(K,ne,ue,pe,he,ye,me={})=>{const be=new URL("/v1/tokens",ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...me},Te={};void 0!==K&&(Te.page_size=K),void 0!==ne&&(Te.cursor=ne),void 0!==ue&&(Te.order_by=ue),void 0!==pe&&(Te.direction=pe),void 0!==he&&(Te.address=he),void 0!==ye&&(Te.symbols=ye),setSearchParams$1(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...me.headers},{url:toPathString$1(be),options:_e}}}},TokensApiFp$1=function(G){const K=TokensApiAxiosParamCreator$1(G);return{async getToken(ne,ue){const pe=await K.getToken(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listTokens(ne,ue,pe,he,ye,me,be){const ve=await K.listTokens(ne,ue,pe,he,ye,me,be);return createRequestFunction$1(ve,er,Zn,G)}}};let ha=class TokensApi extends Yn{getToken(G,K){return TokensApiFp$1(this.configuration).getToken(G.address,K).then((G=>G(this.axios,this.basePath)))}listTokens(G={},K){return TokensApiFp$1(this.configuration).listTokens(G.pageSize,G.cursor,G.orderBy,G.direction,G.address,G.symbols,K).then((G=>G(this.axios,this.basePath)))}};const TradesApiAxiosParamCreator=function(G){return{createTradeV3:async(K,ne,ue,pe,he={})=>{assertParamExists$1("createTradeV3","createTradeRequest",K);const ye=new URL("/v3/trades",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=ne&&(ve["x-imx-eth-address"]=String(ne)),null!=ue&&(ve["x-imx-eth-signature"]=String(ue)),null!=pe&&(ve.Authorization=String(pe)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(K,be,G),{url:toPathString$1(ye),options:be}},getSignableTrade:async(K,ne={})=>{assertParamExists$1("getSignableTrade","getSignableTradeRequest",K);const ue=new URL("/v3/signable-trade-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getTradeV3:async(K,ne={})=>{assertParamExists$1("getTradeV3","id",K);const ue="/v3/trades/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},listTradesV3:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee={})=>{const Pe=new URL("/v3/trades",ta);let Se;G&&(Se=G.baseOptions);const Ce={method:"GET",...Se,...Ee},ke={};void 0!==K&&(ke.party_a_token_type=K),void 0!==ne&&(ke.party_a_token_address=ne),void 0!==ue&&(ke.party_b_token_type=ue),void 0!==pe&&(ke.party_b_token_address=pe),void 0!==he&&(ke.party_b_token_id=he),void 0!==ye&&(ke.page_size=ye),void 0!==me&&(ke.cursor=me),void 0!==be&&(ke.order_by=be),void 0!==ve&&(ke.direction=ve),void 0!==_e&&(ke.min_timestamp=_e),void 0!==Te&&(ke.max_timestamp=Te),setSearchParams$1(Pe,ke);let Oe=Se&&Se.headers?Se.headers:{};return Ce.headers={...Oe,...Ee.headers},{url:toPathString$1(Pe),options:Ce}}}},TradesApiFp=function(G){const K=TradesApiAxiosParamCreator(G);return{async createTradeV3(ne,ue,pe,he,ye){const me=await K.createTradeV3(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getSignableTrade(ne,ue){const pe=await K.getSignableTrade(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getTradeV3(ne,ue){const pe=await K.getTradeV3(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listTradesV3(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe){const Se=await K.listTradesV3(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe);return createRequestFunction$1(Se,er,Zn,G)}}};let ya=class TradesApi extends Yn{createTradeV3(G,K){return TradesApiFp(this.configuration).createTradeV3(G.createTradeRequest,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}getSignableTrade(G,K){return TradesApiFp(this.configuration).getSignableTrade(G.getSignableTradeRequest,K).then((G=>G(this.axios,this.basePath)))}getTradeV3(G,K){return TradesApiFp(this.configuration).getTradeV3(G.id,K).then((G=>G(this.axios,this.basePath)))}listTradesV3(G={},K){return TradesApiFp(this.configuration).listTradesV3(G.partyATokenType,G.partyATokenAddress,G.partyBTokenType,G.partyBTokenAddress,G.partyBTokenId,G.pageSize,G.cursor,G.orderBy,G.direction,G.minTimestamp,G.maxTimestamp,K).then((G=>G(this.axios,this.basePath)))}};const TransfersApiAxiosParamCreator=function(G){return{createTransfer:async(K,ne,ue,pe,he={})=>{assertParamExists$1("createTransfer","createTransferRequestV2",K);const ye=new URL("/v2/transfers",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=ne&&(ve["x-imx-eth-address"]=String(ne)),null!=ue&&(ve["x-imx-eth-signature"]=String(ue)),null!=pe&&(ve.Authorization=String(pe)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(K,be,G),{url:toPathString$1(ye),options:be}},createTransferV1:async(K,ne,ue,pe,he={})=>{assertParamExists$1("createTransferV1","createTransferRequest",K);const ye=new URL("/v1/transfers",ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...he},ve={};null!=ne&&(ve["x-imx-eth-address"]=String(ne)),null!=ue&&(ve["x-imx-eth-signature"]=String(ue)),null!=pe&&(ve.Authorization=String(pe)),ve["Content-Type"]="application/json",setSearchParams$1(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...he.headers},be.data=serializeDataIfNeeded$1(K,be,G),{url:toPathString$1(ye),options:be}},getSignableTransfer:async(K,ne={})=>{assertParamExists$1("getSignableTransfer","getSignableTransferRequestV2",K);const ue=new URL("/v2/signable-transfer-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getSignableTransferV1:async(K,ne={})=>{assertParamExists$1("getSignableTransferV1","getSignableTransferRequest",K);const ue=new URL("/v1/signable-transfer-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getTransfer:async(K,ne={})=>{assertParamExists$1("getTransfer","id",K);const ue="/v1/transfers/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},listTransfers:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe={})=>{const Ne=new URL("/v1/transfers",ta);let Me;G&&(Me=G.baseOptions);const Be={method:"GET",...Me,...xe},Fe={};void 0!==K&&(Fe.page_size=K),void 0!==ne&&(Fe.cursor=ne),void 0!==ue&&(Fe.order_by=ue),void 0!==pe&&(Fe.direction=pe),void 0!==he&&(Fe.user=he),void 0!==ye&&(Fe.receiver=ye),void 0!==me&&(Fe.status=me),void 0!==be&&(Fe.min_timestamp=be),void 0!==ve&&(Fe.max_timestamp=ve),void 0!==_e&&(Fe.token_type=_e),void 0!==Te&&(Fe.token_id=Te),void 0!==Ee&&(Fe.asset_id=Ee),void 0!==Pe&&(Fe.token_address=Pe),void 0!==Se&&(Fe.token_name=Se),void 0!==Ce&&(Fe.min_quantity=Ce),void 0!==ke&&(Fe.max_quantity=ke),void 0!==Oe&&(Fe.metadata=Oe),setSearchParams$1(Ne,Fe);let De=Me&&Me.headers?Me.headers:{};return Be.headers={...De,...xe.headers},{url:toPathString$1(Ne),options:Be}}}},TransfersApiFp=function(G){const K=TransfersApiAxiosParamCreator(G);return{async createTransfer(ne,ue,pe,he,ye){const me=await K.createTransfer(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async createTransferV1(ne,ue,pe,he,ye){const me=await K.createTransferV1(ne,ue,pe,he,ye);return createRequestFunction$1(me,er,Zn,G)},async getSignableTransfer(ne,ue){const pe=await K.getSignableTransfer(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getSignableTransferV1(ne,ue){const pe=await K.getSignableTransferV1(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getTransfer(ne,ue){const pe=await K.getTransfer(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listTransfers(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne){const Me=await K.listTransfers(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne);return createRequestFunction$1(Me,er,Zn,G)}}};let ma=class TransfersApi extends Yn{createTransfer(G,K){return TransfersApiFp(this.configuration).createTransfer(G.createTransferRequestV2,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}createTransferV1(G,K){return TransfersApiFp(this.configuration).createTransferV1(G.createTransferRequest,G.xImxEthAddress,G.xImxEthSignature,G.authorization,K).then((G=>G(this.axios,this.basePath)))}getSignableTransfer(G,K){return TransfersApiFp(this.configuration).getSignableTransfer(G.getSignableTransferRequestV2,K).then((G=>G(this.axios,this.basePath)))}getSignableTransferV1(G,K){return TransfersApiFp(this.configuration).getSignableTransferV1(G.getSignableTransferRequest,K).then((G=>G(this.axios,this.basePath)))}getTransfer(G,K){return TransfersApiFp(this.configuration).getTransfer(G.id,K).then((G=>G(this.axios,this.basePath)))}listTransfers(G={},K){return TransfersApiFp(this.configuration).listTransfers(G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.receiver,G.status,G.minTimestamp,G.maxTimestamp,G.tokenType,G.tokenId,G.assetId,G.tokenAddress,G.tokenName,G.minQuantity,G.maxQuantity,G.metadata,K).then((G=>G(this.axios,this.basePath)))}};const UsersApiAxiosParamCreator=function(G){return{getSignableRegistration:async(K,ne={})=>{assertParamExists$1("getSignableRegistration","getSignableRegistrationRequest",K);const ue=new URL("/v1/signable-registration",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getSignableRegistrationOffchain:async(K,ne={})=>{assertParamExists$1("getSignableRegistrationOffchain","getSignableRegistrationRequest",K);const ue=new URL("/v1/signable-registration-offchain",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getUsers:async(K,ne={})=>{assertParamExists$1("getUsers","user",K);const ue="/v1/users/{user}".replace("{user}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},registerPassportUser:async(K,ne,ue={})=>{assertParamExists$1("registerPassportUser","authorization",K),assertParamExists$1("registerPassportUser","registerPassportUserRequest",ne);const pe=new URL("/v1/passport/users",ta);let he;G&&(he=G.baseOptions);const ye={method:"POST",...he,...ue},me={};null!=K&&(me.Authorization=String(K)),me["Content-Type"]="application/json",setSearchParams$1(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ue.headers},ye.data=serializeDataIfNeeded$1(ne,ye,G),{url:toPathString$1(pe),options:ye}},registerPassportUserV2:async(K,ne,ue={})=>{assertParamExists$1("registerPassportUserV2","authorization",K),assertParamExists$1("registerPassportUserV2","registerPassportUserRequest",ne);const pe=new URL("/v2/passport/users",ta);let he;G&&(he=G.baseOptions);const ye={method:"POST",...he,...ue},me={};null!=K&&(me.Authorization=String(K)),me["Content-Type"]="application/json",setSearchParams$1(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ue.headers},ye.data=serializeDataIfNeeded$1(ne,ye,G),{url:toPathString$1(pe),options:ye}},registerUser:async(K,ne={})=>{assertParamExists$1("registerUser","registerUserRequest",K);const ue=new URL("/v1/users",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}}}},UsersApiFp=function(G){const K=UsersApiAxiosParamCreator(G);return{async getSignableRegistration(ne,ue){const pe=await K.getSignableRegistration(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getSignableRegistrationOffchain(ne,ue){const pe=await K.getSignableRegistrationOffchain(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getUsers(ne,ue){const pe=await K.getUsers(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async registerPassportUser(ne,ue,pe){const he=await K.registerPassportUser(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async registerPassportUserV2(ne,ue,pe){const he=await K.registerPassportUserV2(ne,ue,pe);return createRequestFunction$1(he,er,Zn,G)},async registerUser(ne,ue){const pe=await K.registerUser(ne,ue);return createRequestFunction$1(pe,er,Zn,G)}}};let ba=class UsersApi extends Yn{getSignableRegistration(G,K){return UsersApiFp(this.configuration).getSignableRegistration(G.getSignableRegistrationRequest,K).then((G=>G(this.axios,this.basePath)))}getSignableRegistrationOffchain(G,K){return UsersApiFp(this.configuration).getSignableRegistrationOffchain(G.getSignableRegistrationRequest,K).then((G=>G(this.axios,this.basePath)))}getUsers(G,K){return UsersApiFp(this.configuration).getUsers(G.user,K).then((G=>G(this.axios,this.basePath)))}registerPassportUser(G,K){return UsersApiFp(this.configuration).registerPassportUser(G.authorization,G.registerPassportUserRequest,K).then((G=>G(this.axios,this.basePath)))}registerPassportUserV2(G,K){return UsersApiFp(this.configuration).registerPassportUserV2(G.authorization,G.registerPassportUserRequest,K).then((G=>G(this.axios,this.basePath)))}registerUser(G,K){return UsersApiFp(this.configuration).registerUser(G.registerUserRequest,K).then((G=>G(this.axios,this.basePath)))}};const WithdrawalsApiAxiosParamCreator=function(G){return{createWithdrawal:async(K,ne,ue,pe={})=>{assertParamExists$1("createWithdrawal","xImxEthAddress",K),assertParamExists$1("createWithdrawal","xImxEthSignature",ne),assertParamExists$1("createWithdrawal","createWithdrawalRequest",ue);const he=new URL("/v1/withdrawals",ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...pe},be={};null!=K&&(be["x-imx-eth-address"]=String(K)),null!=ne&&(be["x-imx-eth-signature"]=String(ne)),be["Content-Type"]="application/json",setSearchParams$1(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...pe.headers},me.data=serializeDataIfNeeded$1(ue,me,G),{url:toPathString$1(he),options:me}},createWithdrawalV2:async(K,ne,ue,pe={})=>{assertParamExists$1("createWithdrawalV2","xImxEthAddress",K),assertParamExists$1("createWithdrawalV2","xImxEthSignature",ne),assertParamExists$1("createWithdrawalV2","createWithdrawalRequestV2",ue);const he=new URL("/v2/withdrawals",ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...pe},be={};null!=K&&(be["x-imx-eth-address"]=String(K)),null!=ne&&(be["x-imx-eth-signature"]=String(ne)),be["Content-Type"]="application/json",setSearchParams$1(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...pe.headers},me.data=serializeDataIfNeeded$1(ue,me,G),{url:toPathString$1(he),options:me}},getSignableWithdrawal:async(K,ne={})=>{assertParamExists$1("getSignableWithdrawal","getSignableWithdrawalRequest",K);const ue=new URL("/v1/signable-withdrawal-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getSignableWithdrawalV2:async(K,ne={})=>{assertParamExists$1("getSignableWithdrawalV2","getSignableWithdrawalRequest",K);const ue=new URL("/v2/signable-withdrawal-details",ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};ye["Content-Type"]="application/json",setSearchParams$1(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded$1(K,he,G),{url:toPathString$1(ue),options:he}},getWithdrawal:async(K,ne={})=>{assertParamExists$1("getWithdrawal","id",K);const ue="/v1/withdrawals/{id}".replace("{id}",encodeURIComponent(String(K))),pe=new URL(ue,ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne};setSearchParams$1(pe,{});let me=he&&he.headers?he.headers:{};return ye.headers={...me,...ne.headers},{url:toPathString$1(pe),options:ye}},listWithdrawals:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne={})=>{const Me=new URL("/v1/withdrawals",ta);let Be;G&&(Be=G.baseOptions);const Fe={method:"GET",...Be,...Ne},De={};void 0!==K&&(De.withdrawn_to_wallet=K),void 0!==ne&&(De.rollup_status=ne),void 0!==ue&&(De.page_size=ue),void 0!==pe&&(De.cursor=pe),void 0!==he&&(De.order_by=he),void 0!==ye&&(De.direction=ye),void 0!==me&&(De.user=me),void 0!==be&&(De.status=be),void 0!==ve&&(De.min_timestamp=ve),void 0!==_e&&(De.max_timestamp=_e),void 0!==Te&&(De.token_type=Te),void 0!==Ee&&(De.token_id=Ee),void 0!==Pe&&(De.asset_id=Pe),void 0!==Se&&(De.token_address=Se),void 0!==Ce&&(De.token_name=Ce),void 0!==ke&&(De.min_quantity=ke),void 0!==Oe&&(De.max_quantity=Oe),void 0!==xe&&(De.metadata=xe),setSearchParams$1(Me,De);let Le=Be&&Be.headers?Be.headers:{};return Fe.headers={...Le,...Ne.headers},{url:toPathString$1(Me),options:Fe}}}},WithdrawalsApiFp=function(G){const K=WithdrawalsApiAxiosParamCreator(G);return{async createWithdrawal(ne,ue,pe,he){const ye=await K.createWithdrawal(ne,ue,pe,he);return createRequestFunction$1(ye,er,Zn,G)},async createWithdrawalV2(ne,ue,pe,he){const ye=await K.createWithdrawalV2(ne,ue,pe,he);return createRequestFunction$1(ye,er,Zn,G)},async getSignableWithdrawal(ne,ue){const pe=await K.getSignableWithdrawal(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getSignableWithdrawalV2(ne,ue){const pe=await K.getSignableWithdrawalV2(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async getWithdrawal(ne,ue){const pe=await K.getWithdrawal(ne,ue);return createRequestFunction$1(pe,er,Zn,G)},async listWithdrawals(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me){const Be=await K.listWithdrawals(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me);return createRequestFunction$1(Be,er,Zn,G)}}};let ga=class WithdrawalsApi extends Yn{createWithdrawal(G,K){return WithdrawalsApiFp(this.configuration).createWithdrawal(G.xImxEthAddress,G.xImxEthSignature,G.createWithdrawalRequest,K).then((G=>G(this.axios,this.basePath)))}createWithdrawalV2(G,K){return WithdrawalsApiFp(this.configuration).createWithdrawalV2(G.xImxEthAddress,G.xImxEthSignature,G.createWithdrawalRequestV2,K).then((G=>G(this.axios,this.basePath)))}getSignableWithdrawal(G,K){return WithdrawalsApiFp(this.configuration).getSignableWithdrawal(G.getSignableWithdrawalRequest,K).then((G=>G(this.axios,this.basePath)))}getSignableWithdrawalV2(G,K){return WithdrawalsApiFp(this.configuration).getSignableWithdrawalV2(G.getSignableWithdrawalRequest,K).then((G=>G(this.axios,this.basePath)))}getWithdrawal(G,K){return WithdrawalsApiFp(this.configuration).getWithdrawal(G.id,K).then((G=>G(this.axios,this.basePath)))}listWithdrawals(G={},K){return WithdrawalsApiFp(this.configuration).listWithdrawals(G.withdrawnToWallet,G.rollupStatus,G.pageSize,G.cursor,G.orderBy,G.direction,G.user,G.status,G.minTimestamp,G.maxTimestamp,G.tokenType,G.tokenId,G.assetId,G.tokenAddress,G.tokenName,G.minQuantity,G.maxQuantity,G.metadata,K).then((G=>G(this.axios,this.basePath)))}},va=class Configuration{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(G={}){this.apiKey=G.apiKey,this.username=G.username,this.password=G.password,this.accessToken=G.accessToken,this.basePath=G.basePath,this.baseOptions=G.baseOptions,this.formDataCtor=G.formDataCtor}isJsonMime(G){const K=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==G&&(K.test(G)||"application/json-patch+json"===G.toLowerCase())}};var wa=Object.freeze({__proto__:null,AssetsApi:ra,AssetsApiAxiosParamCreator:AssetsApiAxiosParamCreator,AssetsApiFactory:function(G,K,ne){const ue=AssetsApiFp(G);return{getAsset:(G,pe,he,ye)=>ue.getAsset(G,pe,he,ye).then((G=>G(ne,K))),listAssets:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne)=>ue.listAssets(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne).then((G=>G(ne,K)))}},AssetsApiFp:AssetsApiFp,BalancesApi:na,BalancesApiAxiosParamCreator:BalancesApiAxiosParamCreator,BalancesApiFactory:function(G,K,ne){const ue=BalancesApiFp(G);return{getBalance:(G,pe,he)=>ue.getBalance(G,pe,he).then((G=>G(ne,K))),listBalances:(G,pe,he,ye,me,be)=>ue.listBalances(G,pe,he,ye,me,be).then((G=>G(ne,K)))}},BalancesApiFp:BalancesApiFp,CollectionsApi:aa,CollectionsApiAxiosParamCreator:CollectionsApiAxiosParamCreator$1,CollectionsApiFactory:function(G,K,ne){const ue=CollectionsApiFp$1(G);return{createCollection:(G,pe,he,ye,me)=>ue.createCollection(G,pe,he,ye,me).then((G=>G(ne,K))),getCollection:(G,pe)=>ue.getCollection(G,pe).then((G=>G(ne,K))),listCollectionFilters:(G,pe,he,ye)=>ue.listCollectionFilters(G,pe,he,ye).then((G=>G(ne,K))),listCollections:(G,pe,he,ye,me,be,ve,_e)=>ue.listCollections(G,pe,he,ye,me,be,ve,_e).then((G=>G(ne,K))),summarizeCollections:(G,pe)=>ue.summarizeCollections(G,pe).then((G=>G(ne,K))),updateCollection:(G,pe,he,ye,me)=>ue.updateCollection(G,pe,he,ye,me).then((G=>G(ne,K)))}},CollectionsApiFp:CollectionsApiFp$1,Configuration:va,CreateExchangeAndURLAPIRequestProviderEnum:{Moonpay:"moonpay",Layerswap:"layerswap"},CreateExchangeAndURLAPIRequestTypeEnum:{Onramp:"onramp",Offramp:"offramp"},CreateProjectGroupRequestChainTypeEnum:{Starkex:"starkex",Zkevm:"zkevm"},DepositsApi:ia,DepositsApiAxiosParamCreator:DepositsApiAxiosParamCreator,DepositsApiFactory:function(G,K,ne){const ue=DepositsApiFp(G);return{getDeposit:(G,pe)=>ue.getDeposit(G,pe).then((G=>G(ne,K))),getSignableDeposit:(G,pe)=>ue.getSignableDeposit(G,pe).then((G=>G(ne,K))),listDeposits:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne)=>ue.listDeposits(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne).then((G=>G(ne,K)))}},DepositsApiFp:DepositsApiFp,EncodeAssetRequestTokenTypeEnum:{Eth:"ETH",Erc20:"ERC20",Erc721:"ERC721"},EncodingApi:sa,EncodingApiAxiosParamCreator:EncodingApiAxiosParamCreator,EncodingApiFactory:function(G,K,ne){const ue=EncodingApiFp(G);return{encodeAsset:(G,pe,he)=>ue.encodeAsset(G,pe,he).then((G=>G(ne,K)))}},EncodingApiFp:EncodingApiFp,ExchangesApi:oa,ExchangesApiAxiosParamCreator:ExchangesApiAxiosParamCreator,ExchangesApiFactory:function(G,K,ne){const ue=ExchangesApiFp(G);return{createExchange:(G,pe)=>ue.createExchange(G,pe).then((G=>G(ne,K))),createExchangeTransfer:(G,pe,he,ye,me,be)=>ue.createExchangeTransfer(G,pe,he,ye,me,be).then((G=>G(ne,K))),getExchange:(G,pe)=>ue.getExchange(G,pe).then((G=>G(ne,K))),getExchangeSignableTransfer:(G,pe,he)=>ue.getExchangeSignableTransfer(G,pe,he).then((G=>G(ne,K))),getExchanges:(G,pe,he,ye,me,be,ve,_e,Te,Ee)=>ue.getExchanges(G,pe,he,ye,me,be,ve,_e,Te,Ee).then((G=>G(ne,K)))}},ExchangesApiFp:ExchangesApiFp,FeeTokenTypeEnum:{Eth:"ETH",Erc20:"ERC20"},GetMetadataRefreshResponseStatusEnum:{Queued:"queued",InProgress:"in_progress",Completed:"completed"},MetadataApi:ca,MetadataApiAxiosParamCreator:MetadataApiAxiosParamCreator$1,MetadataApiFactory:function(G,K,ne){const ue=MetadataApiFp$1(G);return{addMetadataSchemaToCollection:(G,pe,he,ye,me)=>ue.addMetadataSchemaToCollection(G,pe,he,ye,me).then((G=>G(ne,K))),getMetadataSchema:(G,pe)=>ue.getMetadataSchema(G,pe).then((G=>G(ne,K))),updateMetadataSchemaByName:(G,pe,he,ye,me,be)=>ue.updateMetadataSchemaByName(G,pe,he,ye,me,be).then((G=>G(ne,K)))}},MetadataApiFp:MetadataApiFp$1,MetadataRefreshExcludingSummaryStatusEnum:{Queued:"queued",InProgress:"in_progress",Completed:"completed"},MetadataRefreshesApi:da,MetadataRefreshesApiAxiosParamCreator:MetadataRefreshesApiAxiosParamCreator,MetadataRefreshesApiFactory:function(G,K,ne){const ue=MetadataRefreshesApiFp(G);return{getAListOfMetadataRefreshes:(G,pe,he,ye,me,be,ve)=>ue.getAListOfMetadataRefreshes(G,pe,he,ye,me,be,ve).then((G=>G(ne,K))),getMetadataRefreshErrors:(G,pe,he,ye,me,be,ve)=>ue.getMetadataRefreshErrors(G,pe,he,ye,me,be,ve).then((G=>G(ne,K))),getMetadataRefreshResults:(G,pe,he,ye,me)=>ue.getMetadataRefreshResults(G,pe,he,ye,me).then((G=>G(ne,K))),requestAMetadataRefresh:(G,pe,he,ye,me)=>ue.requestAMetadataRefresh(G,pe,he,ye,me).then((G=>G(ne,K)))}},MetadataRefreshesApiFp:MetadataRefreshesApiFp,MetadataSchemaRequestTypeEnum:{Enum:"enum",Text:"text",Boolean:"boolean",Continuous:"continuous",Discrete:"discrete"},MintsApi:ua,MintsApiAxiosParamCreator:MintsApiAxiosParamCreator,MintsApiFactory:function(G,K,ne){const ue=MintsApiFp(G);return{getMint:(G,pe)=>ue.getMint(G,pe).then((G=>G(ne,K))),getMintableTokenDetailsByClientTokenId:(G,pe,he)=>ue.getMintableTokenDetailsByClientTokenId(G,pe,he).then((G=>G(ne,K))),listMints:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe)=>ue.listMints(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe).then((G=>G(ne,K))),mintTokens:(G,pe)=>ue.mintTokens(G,pe).then((G=>G(ne,K)))}},MintsApiFp:MintsApiFp,NftCheckoutPrimaryApi:fa,NftCheckoutPrimaryApiAxiosParamCreator:NftCheckoutPrimaryApiAxiosParamCreator,NftCheckoutPrimaryApiFactory:function(G,K,ne){const ue=NftCheckoutPrimaryApiFp(G);return{createNftPrimary:(G,pe)=>ue.createNftPrimary(G,pe).then((G=>G(ne,K))),getCurrenciesNFTCheckoutPrimary:(G,pe,he)=>ue.getCurrenciesNFTCheckoutPrimary(G,pe,he).then((G=>G(ne,K))),getNftPrimaryTransaction:(G,pe)=>ue.getNftPrimaryTransaction(G,pe).then((G=>G(ne,K))),getNftPrimaryTransactions:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se)=>ue.getNftPrimaryTransactions(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se).then((G=>G(ne,K))),registerNftPrimarySalesContract:(G,pe)=>ue.registerNftPrimarySalesContract(G,pe).then((G=>G(ne,K)))}},NftCheckoutPrimaryApiFp:NftCheckoutPrimaryApiFp,OrdersApi:la,OrdersApiAxiosParamCreator:OrdersApiAxiosParamCreator$1,OrdersApiFactory:function(G,K,ne){const ue=OrdersApiFp$1(G);return{cancelOrderV3:(G,pe,he,ye,me,be)=>ue.cancelOrderV3(G,pe,he,ye,me,be).then((G=>G(ne,K))),createOrderV3:(G,pe,he,ye,me)=>ue.createOrderV3(G,pe,he,ye,me).then((G=>G(ne,K))),getOrderV3:(G,pe,he,ye,me)=>ue.getOrderV3(G,pe,he,ye,me).then((G=>G(ne,K))),getSignableCancelOrderV3:(G,pe)=>ue.getSignableCancelOrderV3(G,pe).then((G=>G(ne,K))),getSignableOrder:(G,pe)=>ue.getSignableOrder(G,pe).then((G=>G(ne,K))),listOrdersV3:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye,et)=>ue.listOrdersV3(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye,et).then((G=>G(ne,K)))}},OrdersApiFp:OrdersApiFp$1,ProjectsApi:pa,ProjectsApiAxiosParamCreator:ProjectsApiAxiosParamCreator,ProjectsApiFactory:function(G,K,ne){const ue=ProjectsApiFp(G);return{getProject:(G,pe,he,ye)=>ue.getProject(G,pe,he,ye).then((G=>G(ne,K)))}},ProjectsApiFp:ProjectsApiFp,TokensApi:ha,TokensApiAxiosParamCreator:TokensApiAxiosParamCreator$1,TokensApiFactory:function(G,K,ne){const ue=TokensApiFp$1(G);return{getToken:(G,pe)=>ue.getToken(G,pe).then((G=>G(ne,K))),listTokens:(G,pe,he,ye,me,be,ve)=>ue.listTokens(G,pe,he,ye,me,be,ve).then((G=>G(ne,K)))}},TokensApiFp:TokensApiFp$1,TradesApi:ya,TradesApiAxiosParamCreator:TradesApiAxiosParamCreator,TradesApiFactory:function(G,K,ne){const ue=TradesApiFp(G);return{createTradeV3:(G,pe,he,ye,me)=>ue.createTradeV3(G,pe,he,ye,me).then((G=>G(ne,K))),getSignableTrade:(G,pe)=>ue.getSignableTrade(G,pe).then((G=>G(ne,K))),getTradeV3:(G,pe)=>ue.getTradeV3(G,pe).then((G=>G(ne,K))),listTradesV3:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se)=>ue.listTradesV3(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se).then((G=>G(ne,K)))}},TradesApiFp:TradesApiFp,TransfersApi:ma,TransfersApiAxiosParamCreator:TransfersApiAxiosParamCreator,TransfersApiFactory:function(G,K,ne){const ue=TransfersApiFp(G);return{createTransfer:(G,pe,he,ye,me)=>ue.createTransfer(G,pe,he,ye,me).then((G=>G(ne,K))),createTransferV1:(G,pe,he,ye,me)=>ue.createTransferV1(G,pe,he,ye,me).then((G=>G(ne,K))),getSignableTransfer:(G,pe)=>ue.getSignableTransfer(G,pe).then((G=>G(ne,K))),getSignableTransferV1:(G,pe)=>ue.getSignableTransferV1(G,pe).then((G=>G(ne,K))),getTransfer:(G,pe)=>ue.getTransfer(G,pe).then((G=>G(ne,K))),listTransfers:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me)=>ue.listTransfers(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me).then((G=>G(ne,K)))}},TransfersApiFp:TransfersApiFp,UsersApi:ba,UsersApiAxiosParamCreator:UsersApiAxiosParamCreator,UsersApiFactory:function(G,K,ne){const ue=UsersApiFp(G);return{getSignableRegistration:(G,pe)=>ue.getSignableRegistration(G,pe).then((G=>G(ne,K))),getSignableRegistrationOffchain:(G,pe)=>ue.getSignableRegistrationOffchain(G,pe).then((G=>G(ne,K))),getUsers:(G,pe)=>ue.getUsers(G,pe).then((G=>G(ne,K))),registerPassportUser:(G,pe,he)=>ue.registerPassportUser(G,pe,he).then((G=>G(ne,K))),registerPassportUserV2:(G,pe,he)=>ue.registerPassportUserV2(G,pe,he).then((G=>G(ne,K))),registerUser:(G,pe)=>ue.registerUser(G,pe).then((G=>G(ne,K)))}},UsersApiFp:UsersApiFp,WithdrawalsApi:ga,WithdrawalsApiAxiosParamCreator:WithdrawalsApiAxiosParamCreator,WithdrawalsApiFactory:function(G,K,ne){const ue=WithdrawalsApiFp(G);return{createWithdrawal:(G,pe,he,ye)=>ue.createWithdrawal(G,pe,he,ye).then((G=>G(ne,K))),createWithdrawalV2:(G,pe,he,ye)=>ue.createWithdrawalV2(G,pe,he,ye).then((G=>G(ne,K))),getSignableWithdrawal:(G,pe)=>ue.getSignableWithdrawal(G,pe).then((G=>G(ne,K))),getSignableWithdrawalV2:(G,pe)=>ue.getSignableWithdrawalV2(G,pe).then((G=>G(ne,K))),getWithdrawal:(G,pe)=>ue.getWithdrawal(G,pe).then((G=>G(ne,K))),listWithdrawals:(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be)=>ue.listWithdrawals(G,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be).then((G=>G(ne,K)))}},WithdrawalsApiFp:WithdrawalsApiFp});const _a="https://api.sandbox.immutable.com".replace(/\/+$/,"");class BaseAPI{basePath;axios;configuration;constructor(G,K=_a,ne=er){this.basePath=K,this.axios=ne,G&&(this.configuration=G,this.basePath=G.basePath||this.basePath)}}class RequiredError extends Error{field;constructor(G,K){super(K),this.field=G,this.name="RequiredError"}}const Ta="https://example.com",assertParamExists=function(G,K,ne){if(null==ne)throw new RequiredError(K,`Required parameter ${K} was null or undefined when calling ${G}.`)},setApiKeyToObject=async function(G,K,ne){if(ne&&ne.apiKey){const ue="function"==typeof ne.apiKey?await ne.apiKey(K):await ne.apiKey;G[K]=ue}},setBearerAuthToObject=async function(G,K){if(K&&K.accessToken){const ne="function"==typeof K.accessToken?await K.accessToken():await K.accessToken;G.Authorization="Bearer "+ne}};function setFlattenedQueryParams(G,K,ne=""){null!=K&&("object"==typeof K?Array.isArray(K)?K.forEach((K=>setFlattenedQueryParams(G,K,ne))):Object.keys(K).forEach((ue=>setFlattenedQueryParams(G,K[ue],`${ne}${""!==ne?".":""}${ue}`))):G.has(ne)?G.append(ne,K):G.set(ne,K))}const setSearchParams=function(G,...K){const ne=new URLSearchParams(G.search);setFlattenedQueryParams(ne,K),G.search=ne.toString()},serializeDataIfNeeded=function(G,K,ne){const ue="string"!=typeof G;return(ue&&ne&&ne.isJsonMime?ne.isJsonMime(K.headers["Content-Type"]):ue)?JSON.stringify(void 0!==G?G:{}):G||""},toPathString=function(G){return G.pathname+G.search+G.hash},createRequestFunction=function(G,K,ne,ue){return(pe=K,he=ne)=>{const ye={...G.options,url:(ue?.basePath||pe.defaults.baseURL||he)+G.url};return pe.request(ye)}},ActivitiesApiAxiosParamCreator=function(G){return{getActivity:async(K,ne,ue={})=>{assertParamExists("getActivity","chainName",K),assertParamExists("getActivity","activityId",ne);const pe="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{activity_id}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},listActivities:async(K,ne,ue,pe,he,ye,me,be,ve={})=>{assertParamExists("listActivities","chainName",K);const _e="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(K))),Te=new URL(_e,Ta);let Ee;G&&(Ee=G.baseOptions);const Pe={method:"GET",...Ee,...ve},Se={};void 0!==ne&&(Se.contract_address=ne),void 0!==ue&&(Se.token_id=ue),void 0!==pe&&(Se.account_address=pe),void 0!==he&&(Se.activity_type=he),void 0!==ye&&(Se.transaction_hash=ye),void 0!==me&&(Se.page_cursor=me),void 0!==be&&(Se.page_size=be),setSearchParams(Te,Se);let Ce=Ee&&Ee.headers?Ee.headers:{};return Pe.headers={...Ce,...ve.headers},{url:toPathString(Te),options:Pe}},listActivityHistory:async(K,ne,ue,pe,he,ye,me,be={})=>{assertParamExists("listActivityHistory","chainName",K),assertParamExists("listActivityHistory","fromUpdatedAt",ne);const ve="/v1/chains/{chain_name}/activity-history".replace("{chain_name}",encodeURIComponent(String(K))),_e=new URL(ve,Ta);let Te;G&&(Te=G.baseOptions);const Ee={method:"GET",...Te,...be},Pe={};void 0!==ne&&(Pe.from_updated_at=ne instanceof Date?ne.toISOString():ne),void 0!==ue&&(Pe.to_updated_at=ue instanceof Date?ue.toISOString():ue),void 0!==pe&&(Pe.contract_address=pe),void 0!==he&&(Pe.activity_type=he),void 0!==ye&&(Pe.page_cursor=ye),void 0!==me&&(Pe.page_size=me),setSearchParams(_e,Pe);let Se=Te&&Te.headers?Te.headers:{};return Ee.headers={...Se,...be.headers},{url:toPathString(_e),options:Ee}}}},ActivitiesApiFp=function(G){const K=ActivitiesApiAxiosParamCreator(G);return{async getActivity(ne,ue,pe){const he=await K.getActivity(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async listActivities(ne,ue,pe,he,ye,me,be,ve,_e){const Te=await K.listActivities(ne,ue,pe,he,ye,me,be,ve,_e);return createRequestFunction(Te,er,_a,G)},async listActivityHistory(ne,ue,pe,he,ye,me,be,ve){const _e=await K.listActivityHistory(ne,ue,pe,he,ye,me,be,ve);return createRequestFunction(_e,er,_a,G)}}};class ActivitiesApi extends BaseAPI{getActivity(G,K){return ActivitiesApiFp(this.configuration).getActivity(G.chainName,G.activityId,K).then((G=>G(this.axios,this.basePath)))}listActivities(G,K){return ActivitiesApiFp(this.configuration).listActivities(G.chainName,G.contractAddress,G.tokenId,G.accountAddress,G.activityType,G.transactionHash,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listActivityHistory(G,K){return ActivitiesApiFp(this.configuration).listActivityHistory(G.chainName,G.fromUpdatedAt,G.toUpdatedAt,G.contractAddress,G.activityType,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}}const ChainsApiAxiosParamCreator=function(G){return{listChains:async(K,ne,ue={})=>{const pe=new URL("/v1/chains",Ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ue},me={};void 0!==K&&(me.page_cursor=K),void 0!==ne&&(me.page_size=ne),setSearchParams(pe,me);let be=he&&he.headers?he.headers:{};return ye.headers={...be,...ue.headers},{url:toPathString(pe),options:ye}}}},ChainsApiFp=function(G){const K=ChainsApiAxiosParamCreator(G);return{async listChains(ne,ue,pe){const he=await K.listChains(ne,ue,pe);return createRequestFunction(he,er,_a,G)}}};class ChainsApi extends BaseAPI{listChains(G={},K){return ChainsApiFp(this.configuration).listChains(G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}}const CollectionsApiAxiosParamCreator=function(G){return{getCollection:async(K,ne,ue={})=>{assertParamExists("getCollection","contractAddress",K),assertParamExists("getCollection","chainName",ne);const pe="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},listCollections:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists("listCollections","chainName",K);const be="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(K))),ve=new URL(be,Ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...me},Ee={};ne&&(Ee.contract_address=ne),ue&&(Ee.verification_status=ue),void 0!==pe&&(Ee.from_updated_at=pe instanceof Date?pe.toISOString():pe),void 0!==he&&(Ee.page_cursor=he),void 0!==ye&&(Ee.page_size=ye),setSearchParams(ve,Ee);let Pe=_e&&_e.headers?_e.headers:{};return Te.headers={...Pe,...me.headers},{url:toPathString(ve),options:Te}},listCollectionsByNFTOwner:async(K,ne,ue,pe,he={})=>{assertParamExists("listCollectionsByNFTOwner","accountAddress",K),assertParamExists("listCollectionsByNFTOwner","chainName",ne);const ye="/v1/chains/{chain_name}/accounts/{account_address}/collections".replace("{account_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),me=new URL(ye,Ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};void 0!==ue&&(_e.page_cursor=ue),void 0!==pe&&(_e.page_size=pe),setSearchParams(me,_e);let Te=be&&be.headers?be.headers:{};return ve.headers={...Te,...he.headers},{url:toPathString(me),options:ve}},refreshCollectionMetadata:async(K,ne,ue,pe={})=>{assertParamExists("refreshCollectionMetadata","contractAddress",K),assertParamExists("refreshCollectionMetadata","chainName",ne),assertParamExists("refreshCollectionMetadata","refreshCollectionMetadataRequest",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...pe},ve={};await setBearerAuthToObject(ve,G),await setApiKeyToObject(ve,"x-immutable-api-key",G),await setBearerAuthToObject(ve,G),ve["Content-Type"]="application/json",setSearchParams(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},be.data=serializeDataIfNeeded(ue,be,G),{url:toPathString(ye),options:be}}}},CollectionsApiFp=function(G){const K=CollectionsApiAxiosParamCreator(G);return{async getCollection(ne,ue,pe){const he=await K.getCollection(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async listCollections(ne,ue,pe,he,ye,me,be){const ve=await K.listCollections(ne,ue,pe,he,ye,me,be);return createRequestFunction(ve,er,_a,G)},async listCollectionsByNFTOwner(ne,ue,pe,he,ye){const me=await K.listCollectionsByNFTOwner(ne,ue,pe,he,ye);return createRequestFunction(me,er,_a,G)},async refreshCollectionMetadata(ne,ue,pe,he){const ye=await K.refreshCollectionMetadata(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)}}};let Aa=class CollectionsApi extends BaseAPI{getCollection(G,K){return CollectionsApiFp(this.configuration).getCollection(G.contractAddress,G.chainName,K).then((G=>G(this.axios,this.basePath)))}listCollections(G,K){return CollectionsApiFp(this.configuration).listCollections(G.chainName,G.contractAddress,G.verificationStatus,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listCollectionsByNFTOwner(G,K){return CollectionsApiFp(this.configuration).listCollectionsByNFTOwner(G.accountAddress,G.chainName,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}refreshCollectionMetadata(G,K){return CollectionsApiFp(this.configuration).refreshCollectionMetadata(G.contractAddress,G.chainName,G.refreshCollectionMetadataRequest,K).then((G=>G(this.axios,this.basePath)))}};const CraftingApiAxiosParamCreator=function(G){return{signCraftingPayload:async(K,ne,ue={})=>{assertParamExists("signCraftingPayload","chainName",K),assertParamExists("signCraftingPayload","signCraftingRequest",ne);const pe="/v1/chains/{chain_name}/crafting/sign".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setApiKeyToObject(be,"x-immutable-api-key",G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}}}},CraftingApiFp=function(G){const K=CraftingApiAxiosParamCreator(G);return{async signCraftingPayload(ne,ue,pe){const he=await K.signCraftingPayload(ne,ue,pe);return createRequestFunction(he,er,_a,G)}}};const GuardianApiAxiosParamCreator=function(G){return{approvePendingERC191Message:async(K,ne={})=>{assertParamExists("approvePendingERC191Message","messageID",K);const ue="/guardian/v1/erc191-messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(K))),pe=new URL(ue,Ta);let he;G&&(he=G.baseOptions);const ye={method:"POST",...he,...ne},me={};await setBearerAuthToObject(me,G),setSearchParams(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ne.headers},{url:toPathString(pe),options:ye}},approvePendingMessage:async(K,ne={})=>{assertParamExists("approvePendingMessage","messageID",K);const ue="/guardian/v1/messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(K))),pe=new URL(ue,Ta);let he;G&&(he=G.baseOptions);const ye={method:"POST",...he,...ne},me={};await setBearerAuthToObject(me,G),setSearchParams(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ne.headers},{url:toPathString(pe),options:ye}},approvePendingTransaction:async(K,ne,ue={})=>{assertParamExists("approvePendingTransaction","payloadHash",K),assertParamExists("approvePendingTransaction","transactionApprovalRequest",ne);const pe="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setBearerAuthToObject(be,G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},evaluateErc191Message:async(K,ne={})=>{assertParamExists("evaluateErc191Message","eRC191MessageEvaluationRequest",K);const ue=new URL("/guardian/v1/erc191-messages/evaluate",Ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};await setBearerAuthToObject(ye,G),ye["Content-Type"]="application/json",setSearchParams(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded(K,he,G),{url:toPathString(ue),options:he}},evaluateMessage:async(K,ne={})=>{assertParamExists("evaluateMessage","messageEvaluationRequest",K);const ue=new URL("/guardian/v1/messages/evaluate",Ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};await setBearerAuthToObject(ye,G),ye["Content-Type"]="application/json",setSearchParams(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded(K,he,G),{url:toPathString(ue),options:he}},evaluateTransaction:async(K,ne,ue={})=>{assertParamExists("evaluateTransaction","id",K),assertParamExists("evaluateTransaction","transactionEvaluationRequest",ne);const pe="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setBearerAuthToObject(be,G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},getErc191MessageByID:async(K,ne={})=>{assertParamExists("getErc191MessageByID","messageID",K);const ue="/guardian/v1/erc191-messages/{messageID}".replace("{messageID}",encodeURIComponent(String(K))),pe=new URL(ue,Ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne},me={};await setBearerAuthToObject(me,G),setSearchParams(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ne.headers},{url:toPathString(pe),options:ye}},getMessageByID:async(K,ne,ue={})=>{assertParamExists("getMessageByID","messageID",K);const pe="/guardian/v1/messages/{messageID}".replace("{messageID}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue},be={},ve={};await setBearerAuthToObject(be,G),void 0!==ne&&(ve.includeSimulation=ne),setSearchParams(he,ve);let _e=ye&&ye.headers?ye.headers:{};return me.headers={...be,..._e,...ue.headers},{url:toPathString(he),options:me}},getTransactionByID:async(K,ne,ue,pe,he={})=>{assertParamExists("getTransactionByID","transactionID",K),assertParamExists("getTransactionByID","chainType",ne);const ye="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(K))),me=new URL(ye,Ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={},Te={};await setBearerAuthToObject(_e,G),void 0!==ne&&(Te.chainType=ne),void 0!==ue&&(Te.chainID=ue),void 0!==pe&&(Te.includeSimulation=pe),setSearchParams(me,Te);let Ee=be&&be.headers?be.headers:{};return ve.headers={..._e,...Ee,...he.headers},{url:toPathString(me),options:ve}}}},GuardianApiFp=function(G){const K=GuardianApiAxiosParamCreator(G);return{async approvePendingERC191Message(ne,ue){const pe=await K.approvePendingERC191Message(ne,ue);return createRequestFunction(pe,er,_a,G)},async approvePendingMessage(ne,ue){const pe=await K.approvePendingMessage(ne,ue);return createRequestFunction(pe,er,_a,G)},async approvePendingTransaction(ne,ue,pe){const he=await K.approvePendingTransaction(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async evaluateErc191Message(ne,ue){const pe=await K.evaluateErc191Message(ne,ue);return createRequestFunction(pe,er,_a,G)},async evaluateMessage(ne,ue){const pe=await K.evaluateMessage(ne,ue);return createRequestFunction(pe,er,_a,G)},async evaluateTransaction(ne,ue,pe){const he=await K.evaluateTransaction(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getErc191MessageByID(ne,ue){const pe=await K.getErc191MessageByID(ne,ue);return createRequestFunction(pe,er,_a,G)},async getMessageByID(ne,ue,pe){const he=await K.getMessageByID(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getTransactionByID(ne,ue,pe,he,ye){const me=await K.getTransactionByID(ne,ue,pe,he,ye);return createRequestFunction(me,er,_a,G)}}};class GuardianApi extends BaseAPI{approvePendingERC191Message(G,K){return GuardianApiFp(this.configuration).approvePendingERC191Message(G.messageID,K).then((G=>G(this.axios,this.basePath)))}approvePendingMessage(G,K){return GuardianApiFp(this.configuration).approvePendingMessage(G.messageID,K).then((G=>G(this.axios,this.basePath)))}approvePendingTransaction(G,K){return GuardianApiFp(this.configuration).approvePendingTransaction(G.payloadHash,G.transactionApprovalRequest,K).then((G=>G(this.axios,this.basePath)))}evaluateErc191Message(G,K){return GuardianApiFp(this.configuration).evaluateErc191Message(G.eRC191MessageEvaluationRequest,K).then((G=>G(this.axios,this.basePath)))}evaluateMessage(G,K){return GuardianApiFp(this.configuration).evaluateMessage(G.messageEvaluationRequest,K).then((G=>G(this.axios,this.basePath)))}evaluateTransaction(G,K){return GuardianApiFp(this.configuration).evaluateTransaction(G.id,G.transactionEvaluationRequest,K).then((G=>G(this.axios,this.basePath)))}getErc191MessageByID(G,K){return GuardianApiFp(this.configuration).getErc191MessageByID(G.messageID,K).then((G=>G(this.axios,this.basePath)))}getMessageByID(G,K){return GuardianApiFp(this.configuration).getMessageByID(G.messageID,G.includeSimulation,K).then((G=>G(this.axios,this.basePath)))}getTransactionByID(G,K){return GuardianApiFp(this.configuration).getTransactionByID(G.transactionID,G.chainType,G.chainID,G.includeSimulation,K).then((G=>G(this.axios,this.basePath)))}}const MetadataApiAxiosParamCreator=function(G){return{getMetadata:async(K,ne,ue,pe={})=>{assertParamExists("getMetadata","chainName",K),assertParamExists("getMetadata","contractAddress",ne),assertParamExists("getMetadata","metadataId",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))).replace("{metadata_id}",encodeURIComponent(String(ue))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe};setSearchParams(ye,{});let ve=me&&me.headers?me.headers:{};return be.headers={...ve,...pe.headers},{url:toPathString(ye),options:be}},listMetadata:async(K,ne,ue,pe,he,ye={})=>{assertParamExists("listMetadata","chainName",K),assertParamExists("listMetadata","contractAddress",ne);const me="/v1/chains/{chain_name}/collections/{contract_address}/metadata".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))),be=new URL(me,Ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={};void 0!==ue&&(Te.from_updated_at=ue instanceof Date?ue.toISOString():ue),void 0!==pe&&(Te.page_cursor=pe),void 0!==he&&(Te.page_size=he),setSearchParams(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...ye.headers},{url:toPathString(be),options:_e}},listMetadataForChain:async(K,ne,ue,pe,he={})=>{assertParamExists("listMetadataForChain","chainName",K);const ye="/v1/chains/{chain_name}/metadata".replace("{chain_name}",encodeURIComponent(String(K))),me=new URL(ye,Ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};void 0!==ne&&(_e.from_updated_at=ne instanceof Date?ne.toISOString():ne),void 0!==ue&&(_e.page_cursor=ue),void 0!==pe&&(_e.page_size=pe),setSearchParams(me,_e);let Te=be&&be.headers?be.headers:{};return ve.headers={...Te,...he.headers},{url:toPathString(me),options:ve}},listStacks:async(K,ne,ue={})=>{assertParamExists("listStacks","chainName",K),assertParamExists("listStacks","stackId",ne);const pe="/v1/chains/{chain_name}/stacks".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue},be={};ne&&(be.stack_id=ne),setSearchParams(he,be);let ve=ye&&ye.headers?ye.headers:{};return me.headers={...ve,...ue.headers},{url:toPathString(he),options:me}},refreshMetadataByID:async(K,ne,ue,pe={})=>{assertParamExists("refreshMetadataByID","chainName",K),assertParamExists("refreshMetadataByID","contractAddress",ne),assertParamExists("refreshMetadataByID","refreshMetadataByIDRequest",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...pe},ve={};await setApiKeyToObject(ve,"x-immutable-api-key",G),ve["Content-Type"]="application/json",setSearchParams(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},be.data=serializeDataIfNeeded(ue,be,G),{url:toPathString(ye),options:be}},refreshNFTMetadataByTokenID:async(K,ne,ue,pe={})=>{assertParamExists("refreshNFTMetadataByTokenID","contractAddress",K),assertParamExists("refreshNFTMetadataByTokenID","chainName",ne),assertParamExists("refreshNFTMetadataByTokenID","refreshNFTMetadataByTokenIDRequest",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...pe},ve={};await setApiKeyToObject(ve,"x-immutable-api-key",G),ve["Content-Type"]="application/json",setSearchParams(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},be.data=serializeDataIfNeeded(ue,be,G),{url:toPathString(ye),options:be}}}},MetadataApiFp=function(G){const K=MetadataApiAxiosParamCreator(G);return{async getMetadata(ne,ue,pe,he){const ye=await K.getMetadata(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)},async listMetadata(ne,ue,pe,he,ye,me){const be=await K.listMetadata(ne,ue,pe,he,ye,me);return createRequestFunction(be,er,_a,G)},async listMetadataForChain(ne,ue,pe,he,ye){const me=await K.listMetadataForChain(ne,ue,pe,he,ye);return createRequestFunction(me,er,_a,G)},async listStacks(ne,ue,pe){const he=await K.listStacks(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async refreshMetadataByID(ne,ue,pe,he){const ye=await K.refreshMetadataByID(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)},async refreshNFTMetadataByTokenID(ne,ue,pe,he){const ye=await K.refreshNFTMetadataByTokenID(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)}}};const MetadataSearchApiAxiosParamCreator=function(G){return{listFilters:async(K,ne,ue={})=>{assertParamExists("listFilters","chainName",K),assertParamExists("listFilters","contractAddress",ne);const pe="/v1/chains/{chain_name}/search/filters/{contract_address}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},searchNFTs:async(K,ne,ue,pe,he,ye,me,be={})=>{assertParamExists("searchNFTs","chainName",K),assertParamExists("searchNFTs","contractAddress",ne);const ve="/v1/chains/{chain_name}/search/nfts".replace("{chain_name}",encodeURIComponent(String(K))),_e=new URL(ve,Ta);let Te;G&&(Te=G.baseOptions);const Ee={method:"GET",...Te,...be},Pe={};ne&&(Pe.contract_address=ne),void 0!==ue&&(Pe.account_address=ue),pe&&(Pe.stack_id=pe),void 0!==he&&(Pe.only_include_owner_listings=he),void 0!==ye&&(Pe.page_size=ye),void 0!==me&&(Pe.page_cursor=me),setSearchParams(_e,Pe);let Se=Te&&Te.headers?Te.headers:{};return Ee.headers={...Se,...be.headers},{url:toPathString(_e),options:Ee}},searchStacks:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee={})=>{assertParamExists("searchStacks","chainName",K),assertParamExists("searchStacks","contractAddress",ne);const Pe="/v1/chains/{chain_name}/search/stacks".replace("{chain_name}",encodeURIComponent(String(K))),Se=new URL(Pe,Ta);let Ce;G&&(Ce=G.baseOptions);const ke={method:"GET",...Ce,...Ee},Oe={};ne&&(Oe.contract_address=ne),void 0!==ue&&(Oe.account_address=ue),void 0!==pe&&(Oe.only_include_owner_listings=pe),void 0!==he&&(Oe.only_if_has_active_listings=he),void 0!==ye&&(Oe.traits=ye),void 0!==me&&(Oe.keyword=me),void 0!==be&&(Oe.payment_token=be),void 0!==ve&&(Oe.sort_by=ve),void 0!==_e&&(Oe.page_size=_e),void 0!==Te&&(Oe.page_cursor=Te),setSearchParams(Se,Oe);let xe=Ce&&Ce.headers?Ce.headers:{};return ke.headers={...xe,...Ee.headers},{url:toPathString(Se),options:ke}}}},MetadataSearchApiFp=function(G){const K=MetadataSearchApiAxiosParamCreator(G);return{async listFilters(ne,ue,pe){const he=await K.listFilters(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async searchNFTs(ne,ue,pe,he,ye,me,be,ve){const _e=await K.searchNFTs(ne,ue,pe,he,ye,me,be,ve);return createRequestFunction(_e,er,_a,G)},async searchStacks(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe){const Se=await K.searchStacks(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe);return createRequestFunction(Se,er,_a,G)}}};const NftOwnersApiAxiosParamCreator=function(G){return{listAllNFTOwners:async(K,ne,ue,pe,he={})=>{assertParamExists("listAllNFTOwners","chainName",K);const ye="/v1/chains/{chain_name}/nft-owners".replace("{chain_name}",encodeURIComponent(String(K))),me=new URL(ye,Ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};void 0!==ne&&(_e.from_updated_at=ne instanceof Date?ne.toISOString():ne),void 0!==ue&&(_e.page_cursor=ue),void 0!==pe&&(_e.page_size=pe),setSearchParams(me,_e);let Te=be&&be.headers?be.headers:{};return ve.headers={...Te,...he.headers},{url:toPathString(me),options:ve}},listNFTOwners:async(K,ne,ue,pe,he,ye={})=>{assertParamExists("listNFTOwners","contractAddress",K),assertParamExists("listNFTOwners","tokenId",ne),assertParamExists("listNFTOwners","chainName",ue);const me="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(K))).replace("{token_id}",encodeURIComponent(String(ne))).replace("{chain_name}",encodeURIComponent(String(ue))),be=new URL(me,Ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={};void 0!==pe&&(Te.page_cursor=pe),void 0!==he&&(Te.page_size=he),setSearchParams(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...ye.headers},{url:toPathString(be),options:_e}},listOwnersByContractAddress:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists("listOwnersByContractAddress","contractAddress",K),assertParamExists("listOwnersByContractAddress","chainName",ne);const be="/v1/chains/{chain_name}/collections/{contract_address}/owners".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),ve=new URL(be,Ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...me},Ee={};ue&&(Ee.account_address=ue),void 0!==pe&&(Ee.from_updated_at=pe instanceof Date?pe.toISOString():pe),void 0!==he&&(Ee.page_cursor=he),void 0!==ye&&(Ee.page_size=ye),setSearchParams(ve,Ee);let Pe=_e&&_e.headers?_e.headers:{};return Te.headers={...Pe,...me.headers},{url:toPathString(ve),options:Te}}}},NftOwnersApiFp=function(G){const K=NftOwnersApiAxiosParamCreator(G);return{async listAllNFTOwners(ne,ue,pe,he,ye){const me=await K.listAllNFTOwners(ne,ue,pe,he,ye);return createRequestFunction(me,er,_a,G)},async listNFTOwners(ne,ue,pe,he,ye,me){const be=await K.listNFTOwners(ne,ue,pe,he,ye,me);return createRequestFunction(be,er,_a,G)},async listOwnersByContractAddress(ne,ue,pe,he,ye,me,be){const ve=await K.listOwnersByContractAddress(ne,ue,pe,he,ye,me,be);return createRequestFunction(ve,er,_a,G)}}};class NftOwnersApi extends BaseAPI{listAllNFTOwners(G,K){return NftOwnersApiFp(this.configuration).listAllNFTOwners(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listNFTOwners(G,K){return NftOwnersApiFp(this.configuration).listNFTOwners(G.contractAddress,G.tokenId,G.chainName,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listOwnersByContractAddress(G,K){return NftOwnersApiFp(this.configuration).listOwnersByContractAddress(G.contractAddress,G.chainName,G.accountAddress,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}}const NftsApiAxiosParamCreator=function(G){return{createMintRequest:async(K,ne,ue,pe={})=>{assertParamExists("createMintRequest","contractAddress",K),assertParamExists("createMintRequest","chainName",ne),assertParamExists("createMintRequest","createMintRequestRequest",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"POST",...me,...pe},ve={};await setApiKeyToObject(ve,"x-immutable-api-key",G),ve["Content-Type"]="application/json",setSearchParams(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},be.data=serializeDataIfNeeded(ue,be,G),{url:toPathString(ye),options:be}},getMintRequest:async(K,ne,ue,pe={})=>{assertParamExists("getMintRequest","contractAddress",K),assertParamExists("getMintRequest","chainName",ne),assertParamExists("getMintRequest","referenceId",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))).replace("{reference_id}",encodeURIComponent(String(ue))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe},ve={};await setApiKeyToObject(ve,"x-immutable-api-key",G),setSearchParams(ye,{});let _e=me&&me.headers?me.headers:{};return be.headers={...ve,..._e,...pe.headers},{url:toPathString(ye),options:be}},getNFT:async(K,ne,ue,pe={})=>{assertParamExists("getNFT","contractAddress",K),assertParamExists("getNFT","tokenId",ne),assertParamExists("getNFT","chainName",ue);const he="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(K))).replace("{token_id}",encodeURIComponent(String(ne))).replace("{chain_name}",encodeURIComponent(String(ue))),ye=new URL(he,Ta);let me;G&&(me=G.baseOptions);const be={method:"GET",...me,...pe};setSearchParams(ye,{});let ve=me&&me.headers?me.headers:{};return be.headers={...ve,...pe.headers},{url:toPathString(ye),options:be}},listAllNFTs:async(K,ne,ue,pe,he={})=>{assertParamExists("listAllNFTs","chainName",K);const ye="/v1/chains/{chain_name}/nfts".replace("{chain_name}",encodeURIComponent(String(K))),me=new URL(ye,Ta);let be;G&&(be=G.baseOptions);const ve={method:"GET",...be,...he},_e={};void 0!==ne&&(_e.from_updated_at=ne instanceof Date?ne.toISOString():ne),void 0!==ue&&(_e.page_cursor=ue),void 0!==pe&&(_e.page_size=pe),setSearchParams(me,_e);let Te=be&&be.headers?be.headers:{};return ve.headers={...Te,...he.headers},{url:toPathString(me),options:ve}},listMintRequests:async(K,ne,ue,pe,he,ye={})=>{assertParamExists("listMintRequests","contractAddress",K),assertParamExists("listMintRequests","chainName",ne);const me="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),be=new URL(me,Ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={},Ee={};await setApiKeyToObject(Te,"x-immutable-api-key",G),void 0!==ue&&(Ee.page_cursor=ue),void 0!==pe&&(Ee.page_size=pe),void 0!==he&&(Ee.status=he),setSearchParams(be,Ee);let Pe=ve&&ve.headers?ve.headers:{};return _e.headers={...Te,...Pe,...ye.headers},{url:toPathString(be),options:_e}},listNFTs:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists("listNFTs","contractAddress",K),assertParamExists("listNFTs","chainName",ne);const be="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),ve=new URL(be,Ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...me},Ee={};ue&&(Ee.token_id=ue),void 0!==pe&&(Ee.from_updated_at=pe instanceof Date?pe.toISOString():pe),void 0!==he&&(Ee.page_cursor=he),void 0!==ye&&(Ee.page_size=ye),setSearchParams(ve,Ee);let Pe=_e&&_e.headers?_e.headers:{};return Te.headers={...Pe,...me.headers},{url:toPathString(ve),options:Te}},listNFTsByAccountAddress:async(K,ne,ue,pe,he,ye,me,be={})=>{assertParamExists("listNFTsByAccountAddress","accountAddress",K),assertParamExists("listNFTsByAccountAddress","chainName",ne);const ve="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),_e=new URL(ve,Ta);let Te;G&&(Te=G.baseOptions);const Ee={method:"GET",...Te,...be},Pe={};void 0!==ue&&(Pe.contract_address=ue),pe&&(Pe.token_id=pe),void 0!==he&&(Pe.from_updated_at=he instanceof Date?he.toISOString():he),void 0!==ye&&(Pe.page_cursor=ye),void 0!==me&&(Pe.page_size=me),setSearchParams(_e,Pe);let Se=Te&&Te.headers?Te.headers:{};return Ee.headers={...Se,...be.headers},{url:toPathString(_e),options:Ee}}}},NftsApiFp=function(G){const K=NftsApiAxiosParamCreator(G);return{async createMintRequest(ne,ue,pe,he){const ye=await K.createMintRequest(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)},async getMintRequest(ne,ue,pe,he){const ye=await K.getMintRequest(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)},async getNFT(ne,ue,pe,he){const ye=await K.getNFT(ne,ue,pe,he);return createRequestFunction(ye,er,_a,G)},async listAllNFTs(ne,ue,pe,he,ye){const me=await K.listAllNFTs(ne,ue,pe,he,ye);return createRequestFunction(me,er,_a,G)},async listMintRequests(ne,ue,pe,he,ye,me){const be=await K.listMintRequests(ne,ue,pe,he,ye,me);return createRequestFunction(be,er,_a,G)},async listNFTs(ne,ue,pe,he,ye,me,be){const ve=await K.listNFTs(ne,ue,pe,he,ye,me,be);return createRequestFunction(ve,er,_a,G)},async listNFTsByAccountAddress(ne,ue,pe,he,ye,me,be,ve){const _e=await K.listNFTsByAccountAddress(ne,ue,pe,he,ye,me,be,ve);return createRequestFunction(_e,er,_a,G)}}};class NftsApi extends BaseAPI{createMintRequest(G,K){return NftsApiFp(this.configuration).createMintRequest(G.contractAddress,G.chainName,G.createMintRequestRequest,K).then((G=>G(this.axios,this.basePath)))}getMintRequest(G,K){return NftsApiFp(this.configuration).getMintRequest(G.contractAddress,G.chainName,G.referenceId,K).then((G=>G(this.axios,this.basePath)))}getNFT(G,K){return NftsApiFp(this.configuration).getNFT(G.contractAddress,G.tokenId,G.chainName,K).then((G=>G(this.axios,this.basePath)))}listAllNFTs(G,K){return NftsApiFp(this.configuration).listAllNFTs(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listMintRequests(G,K){return NftsApiFp(this.configuration).listMintRequests(G.contractAddress,G.chainName,G.pageCursor,G.pageSize,G.status,K).then((G=>G(this.axios,this.basePath)))}listNFTs(G,K){return NftsApiFp(this.configuration).listNFTs(G.contractAddress,G.chainName,G.tokenId,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listNFTsByAccountAddress(G,K){return NftsApiFp(this.configuration).listNFTsByAccountAddress(G.accountAddress,G.chainName,G.contractAddress,G.tokenId,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}}const OrdersApiAxiosParamCreator=function(G){return{cancelOrders:async(K,ne,ue={})=>{assertParamExists("cancelOrders","chainName",K),assertParamExists("cancelOrders","cancelOrdersRequestBody",ne);const pe="/v1/chains/{chain_name}/orders/cancel".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},createBid:async(K,ne,ue={})=>{assertParamExists("createBid","chainName",K),assertParamExists("createBid","createBidRequestBody",ne);const pe="/v1/chains/{chain_name}/orders/bids".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},createCollectionBid:async(K,ne,ue={})=>{assertParamExists("createCollectionBid","chainName",K),assertParamExists("createCollectionBid","createCollectionBidRequestBody",ne);const pe="/v1/chains/{chain_name}/orders/collection-bids".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},createListing:async(K,ne,ue={})=>{assertParamExists("createListing","chainName",K),assertParamExists("createListing","createListingRequestBody",ne);const pe="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},fulfillmentData:async(K,ne,ue={})=>{assertParamExists("fulfillmentData","chainName",K),assertParamExists("fulfillmentData","fulfillmentDataRequest",ne);const pe="/v1/chains/{chain_name}/orders/fulfillment-data".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},getBid:async(K,ne,ue={})=>{assertParamExists("getBid","chainName",K),assertParamExists("getBid","bidId",ne);const pe="/v1/chains/{chain_name}/orders/bids/{bid_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{bid_id}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},getCollectionBid:async(K,ne,ue={})=>{assertParamExists("getCollectionBid","chainName",K),assertParamExists("getCollectionBid","collectionBidId",ne);const pe="/v1/chains/{chain_name}/orders/collection-bids/{collection_bid_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{collection_bid_id}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},getListing:async(K,ne,ue={})=>{assertParamExists("getListing","chainName",K),assertParamExists("getListing","listingId",ne);const pe="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{listing_id}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},getTrade:async(K,ne,ue={})=>{assertParamExists("getTrade","chainName",K),assertParamExists("getTrade","tradeId",ne);const pe="/v1/chains/{chain_name}/trades/{trade_id}".replace("{chain_name}",encodeURIComponent(String(K))).replace("{trade_id}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},listBids:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe={})=>{assertParamExists("listBids","chainName",K);const Se="/v1/chains/{chain_name}/orders/bids".replace("{chain_name}",encodeURIComponent(String(K))),Ce=new URL(Se,Ta);let ke;G&&(ke=G.baseOptions);const Oe={method:"GET",...ke,...Pe},xe={};void 0!==ne&&(xe.status=ne),void 0!==ue&&(xe.buy_item_contract_address=ue),void 0!==pe&&(xe.sell_item_contract_address=pe),void 0!==he&&(xe.account_address=he),void 0!==ye&&(xe.buy_item_metadata_id=ye),void 0!==me&&(xe.buy_item_token_id=me),void 0!==be&&(xe.from_updated_at=be instanceof Date?be.toISOString():be),void 0!==ve&&(xe.page_size=ve),void 0!==_e&&(xe.sort_by=_e),void 0!==Te&&(xe.sort_direction=Te),void 0!==Ee&&(xe.page_cursor=Ee),setSearchParams(Ce,xe);let Ne=ke&&ke.headers?ke.headers:{};return Oe.headers={...Ne,...Pe.headers},{url:toPathString(Ce),options:Oe}},listCollectionBids:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te={})=>{assertParamExists("listCollectionBids","chainName",K);const Ee="/v1/chains/{chain_name}/orders/collection-bids".replace("{chain_name}",encodeURIComponent(String(K))),Pe=new URL(Ee,Ta);let Se;G&&(Se=G.baseOptions);const Ce={method:"GET",...Se,...Te},ke={};void 0!==ne&&(ke.status=ne),void 0!==ue&&(ke.buy_item_contract_address=ue),void 0!==pe&&(ke.sell_item_contract_address=pe),void 0!==he&&(ke.account_address=he),void 0!==ye&&(ke.from_updated_at=ye instanceof Date?ye.toISOString():ye),void 0!==me&&(ke.page_size=me),void 0!==be&&(ke.sort_by=be),void 0!==ve&&(ke.sort_direction=ve),void 0!==_e&&(ke.page_cursor=_e),setSearchParams(Pe,ke);let Oe=Se&&Se.headers?Se.headers:{};return Ce.headers={...Oe,...Te.headers},{url:toPathString(Pe),options:Ce}},listListings:async(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se={})=>{assertParamExists("listListings","chainName",K);const Ce="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(K))),ke=new URL(Ce,Ta);let Oe;G&&(Oe=G.baseOptions);const xe={method:"GET",...Oe,...Se},Ne={};void 0!==ne&&(Ne.status=ne),void 0!==ue&&(Ne.sell_item_contract_address=ue),void 0!==pe&&(Ne.buy_item_type=pe),void 0!==he&&(Ne.buy_item_contract_address=he),void 0!==ye&&(Ne.account_address=ye),void 0!==me&&(Ne.sell_item_metadata_id=me),void 0!==be&&(Ne.sell_item_token_id=be),void 0!==ve&&(Ne.from_updated_at=ve instanceof Date?ve.toISOString():ve),void 0!==_e&&(Ne.page_size=_e),void 0!==Te&&(Ne.sort_by=Te),void 0!==Ee&&(Ne.sort_direction=Ee),void 0!==Pe&&(Ne.page_cursor=Pe),setSearchParams(ke,Ne);let Me=Oe&&Oe.headers?Oe.headers:{};return xe.headers={...Me,...Se.headers},{url:toPathString(ke),options:xe}},listTrades:async(K,ne,ue,pe,he,ye,me,be,ve={})=>{assertParamExists("listTrades","chainName",K);const _e="/v1/chains/{chain_name}/trades".replace("{chain_name}",encodeURIComponent(String(K))),Te=new URL(_e,Ta);let Ee;G&&(Ee=G.baseOptions);const Pe={method:"GET",...Ee,...ve},Se={};void 0!==ne&&(Se.account_address=ne),void 0!==ue&&(Se.sell_item_contract_address=ue),void 0!==pe&&(Se.from_indexed_at=pe instanceof Date?pe.toISOString():pe),void 0!==he&&(Se.page_size=he),void 0!==ye&&(Se.sort_by=ye),void 0!==me&&(Se.sort_direction=me),void 0!==be&&(Se.page_cursor=be),setSearchParams(Te,Se);let Ce=Ee&&Ee.headers?Ee.headers:{};return Pe.headers={...Ce,...ve.headers},{url:toPathString(Te),options:Pe}}}},OrdersApiFp=function(G){const K=OrdersApiAxiosParamCreator(G);return{async cancelOrders(ne,ue,pe){const he=await K.cancelOrders(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async createBid(ne,ue,pe){const he=await K.createBid(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async createCollectionBid(ne,ue,pe){const he=await K.createCollectionBid(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async createListing(ne,ue,pe){const he=await K.createListing(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async fulfillmentData(ne,ue,pe){const he=await K.fulfillmentData(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getBid(ne,ue,pe){const he=await K.getBid(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getCollectionBid(ne,ue,pe){const he=await K.getCollectionBid(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getListing(ne,ue,pe){const he=await K.getListing(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getTrade(ne,ue,pe){const he=await K.getTrade(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async listBids(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se){const Ce=await K.listBids(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se);return createRequestFunction(Ce,er,_a,G)},async listCollectionBids(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee){const Pe=await K.listCollectionBids(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee);return createRequestFunction(Pe,er,_a,G)},async listListings(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce){const ke=await K.listListings(ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce);return createRequestFunction(ke,er,_a,G)},async listTrades(ne,ue,pe,he,ye,me,be,ve,_e){const Te=await K.listTrades(ne,ue,pe,he,ye,me,be,ve,_e);return createRequestFunction(Te,er,_a,G)}}};let Ea=class OrdersApi extends BaseAPI{cancelOrders(G,K){return OrdersApiFp(this.configuration).cancelOrders(G.chainName,G.cancelOrdersRequestBody,K).then((G=>G(this.axios,this.basePath)))}createBid(G,K){return OrdersApiFp(this.configuration).createBid(G.chainName,G.createBidRequestBody,K).then((G=>G(this.axios,this.basePath)))}createCollectionBid(G,K){return OrdersApiFp(this.configuration).createCollectionBid(G.chainName,G.createCollectionBidRequestBody,K).then((G=>G(this.axios,this.basePath)))}createListing(G,K){return OrdersApiFp(this.configuration).createListing(G.chainName,G.createListingRequestBody,K).then((G=>G(this.axios,this.basePath)))}fulfillmentData(G,K){return OrdersApiFp(this.configuration).fulfillmentData(G.chainName,G.fulfillmentDataRequest,K).then((G=>G(this.axios,this.basePath)))}getBid(G,K){return OrdersApiFp(this.configuration).getBid(G.chainName,G.bidId,K).then((G=>G(this.axios,this.basePath)))}getCollectionBid(G,K){return OrdersApiFp(this.configuration).getCollectionBid(G.chainName,G.collectionBidId,K).then((G=>G(this.axios,this.basePath)))}getListing(G,K){return OrdersApiFp(this.configuration).getListing(G.chainName,G.listingId,K).then((G=>G(this.axios,this.basePath)))}getTrade(G,K){return OrdersApiFp(this.configuration).getTrade(G.chainName,G.tradeId,K).then((G=>G(this.axios,this.basePath)))}listBids(G,K){return OrdersApiFp(this.configuration).listBids(G.chainName,G.status,G.buyItemContractAddress,G.sellItemContractAddress,G.accountAddress,G.buyItemMetadataId,G.buyItemTokenId,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}listCollectionBids(G,K){return OrdersApiFp(this.configuration).listCollectionBids(G.chainName,G.status,G.buyItemContractAddress,G.sellItemContractAddress,G.accountAddress,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}listListings(G,K){return OrdersApiFp(this.configuration).listListings(G.chainName,G.status,G.sellItemContractAddress,G.buyItemType,G.buyItemContractAddress,G.accountAddress,G.sellItemMetadataId,G.sellItemTokenId,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}listTrades(G,K){return OrdersApiFp(this.configuration).listTrades(G.chainName,G.accountAddress,G.sellItemContractAddress,G.fromIndexedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}};const PassportApiAxiosParamCreator=function(G){return{createCounterfactualAddressV2:async(K,ne,ue={})=>{assertParamExists("createCounterfactualAddressV2","chainName",K),assertParamExists("createCounterfactualAddressV2","createCounterfactualAddressRequest",ne);const pe="/v2/chains/{chain_name}/passport/counterfactual-address".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setBearerAuthToObject(be,G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},getLinkedAddresses:async(K,ne,ue={})=>{assertParamExists("getLinkedAddresses","userId",K),assertParamExists("getLinkedAddresses","chainName",ne);const pe="/v1/chains/{chain_name}/passport/users/{user_id}/linked-addresses".replace("{user_id}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue},be={};await setBearerAuthToObject(be,G),setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},{url:toPathString(he),options:me}},getLinkedAddressesDeprecated:async(K,ne={})=>{assertParamExists("getLinkedAddressesDeprecated","userId",K);const ue="/passport-mr/v1/users/{userId}/linked-addresses".replace("{userId}",encodeURIComponent(String(K))),pe=new URL(ue,Ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne},me={};await setBearerAuthToObject(me,G),setSearchParams(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ne.headers},{url:toPathString(pe),options:ye}},getTransactionMetadata:async(K,ne,ue={})=>{assertParamExists("getTransactionMetadata","chainName",K),assertParamExists("getTransactionMetadata","getTransactionMetadataRequest",ne);const pe="/v1/chains/{chain_name}/passport/transaction-metadata".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setBearerAuthToObject(be,G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},getTypedDataMetadata:async(K,ne,ue={})=>{assertParamExists("getTypedDataMetadata","chainName",K),assertParamExists("getTypedDataMetadata","getTypedDataMetadataRequest",ne);const pe="/v1/chains/{chain_name}/passport/typeddata-metadata".replace("{chain_name}",encodeURIComponent(String(K))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"POST",...ye,...ue},be={};await setBearerAuthToObject(be,G),be["Content-Type"]="application/json",setSearchParams(he,{});let ve=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ve,...ue.headers},me.data=serializeDataIfNeeded(ne,me,G),{url:toPathString(he),options:me}},getUserMetadata:async(K,ne={})=>{assertParamExists("getUserMetadata","userId",K);const ue="/passport-mr/v1/users/{user_id}/metadata".replace("{user_id}",encodeURIComponent(String(K))),pe=new URL(ue,Ta);let he;G&&(he=G.baseOptions);const ye={method:"GET",...he,...ne},me={};await setApiKeyToObject(me,"x-immutable-api-key",G),setSearchParams(pe,{});let be=he&&he.headers?he.headers:{};return ye.headers={...me,...be,...ne.headers},{url:toPathString(pe),options:ye}}}},PassportApiFp=function(G){const K=PassportApiAxiosParamCreator(G);return{async createCounterfactualAddressV2(ne,ue,pe){const he=await K.createCounterfactualAddressV2(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getLinkedAddresses(ne,ue,pe){const he=await K.getLinkedAddresses(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getLinkedAddressesDeprecated(ne,ue){const pe=await K.getLinkedAddressesDeprecated(ne,ue);return createRequestFunction(pe,er,_a,G)},async getTransactionMetadata(ne,ue,pe){const he=await K.getTransactionMetadata(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getTypedDataMetadata(ne,ue,pe){const he=await K.getTypedDataMetadata(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async getUserMetadata(ne,ue){const pe=await K.getUserMetadata(ne,ue);return createRequestFunction(pe,er,_a,G)}}};class PassportApi extends BaseAPI{createCounterfactualAddressV2(G,K){return PassportApiFp(this.configuration).createCounterfactualAddressV2(G.chainName,G.createCounterfactualAddressRequest,K).then((G=>G(this.axios,this.basePath)))}getLinkedAddresses(G,K){return PassportApiFp(this.configuration).getLinkedAddresses(G.userId,G.chainName,K).then((G=>G(this.axios,this.basePath)))}getLinkedAddressesDeprecated(G,K){return PassportApiFp(this.configuration).getLinkedAddressesDeprecated(G.userId,K).then((G=>G(this.axios,this.basePath)))}getTransactionMetadata(G,K){return PassportApiFp(this.configuration).getTransactionMetadata(G.chainName,G.getTransactionMetadataRequest,K).then((G=>G(this.axios,this.basePath)))}getTypedDataMetadata(G,K){return PassportApiFp(this.configuration).getTypedDataMetadata(G.chainName,G.getTypedDataMetadataRequest,K).then((G=>G(this.axios,this.basePath)))}getUserMetadata(G,K){return PassportApiFp(this.configuration).getUserMetadata(G.userId,K).then((G=>G(this.axios,this.basePath)))}}const PassportProfileApiAxiosParamCreator=function(G){return{getUserInfo:async(K={})=>{const ne=new URL("/passport-profile/v1/user/info",Ta);let ue;G&&(ue=G.baseOptions);const pe={method:"GET",...ue,...K},he={};await setBearerAuthToObject(he,G),setSearchParams(ne,{});let ye=ue&&ue.headers?ue.headers:{};return pe.headers={...he,...ye,...K.headers},{url:toPathString(ne),options:pe}},linkWalletV2:async(K,ne={})=>{const ue=new URL("/passport-profile/v2/linked-wallets",Ta);let pe;G&&(pe=G.baseOptions);const he={method:"POST",...pe,...ne},ye={};await setBearerAuthToObject(ye,G),ye["Content-Type"]="application/json",setSearchParams(ue,{});let me=pe&&pe.headers?pe.headers:{};return he.headers={...ye,...me,...ne.headers},he.data=serializeDataIfNeeded(K,he,G),{url:toPathString(ue),options:he}}}},PassportProfileApiFp=function(G){const K=PassportProfileApiAxiosParamCreator(G);return{async getUserInfo(ne){const ue=await K.getUserInfo(ne);return createRequestFunction(ue,er,_a,G)},async linkWalletV2(ne,ue){const pe=await K.linkWalletV2(ne,ue);return createRequestFunction(pe,er,_a,G)}}};class PassportProfileApi extends BaseAPI{getUserInfo(G){return PassportProfileApiFp(this.configuration).getUserInfo(G).then((G=>G(this.axios,this.basePath)))}linkWalletV2(G={},K){return PassportProfileApiFp(this.configuration).linkWalletV2(G.linkWalletV2Request,K).then((G=>G(this.axios,this.basePath)))}}const PricingApiAxiosParamCreator=function(G){return{quotesForNFTs:async(K,ne,ue,pe,he,ye={})=>{assertParamExists("quotesForNFTs","chainName",K),assertParamExists("quotesForNFTs","contractAddress",ne),assertParamExists("quotesForNFTs","tokenId",ue);const me="/v1/chains/{chain_name}/quotes/{contract_address}/nfts".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))),be=new URL(me,Ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={};ue&&(Te.token_id=ue),void 0!==pe&&(Te.payment_token=pe),void 0!==he&&(Te.page_cursor=he),setSearchParams(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...ye.headers},{url:toPathString(be),options:_e}},quotesForStacks:async(K,ne,ue,pe,he,ye={})=>{assertParamExists("quotesForStacks","chainName",K),assertParamExists("quotesForStacks","contractAddress",ne),assertParamExists("quotesForStacks","stackId",ue);const me="/v1/chains/{chain_name}/quotes/{contract_address}/stacks".replace("{chain_name}",encodeURIComponent(String(K))).replace("{contract_address}",encodeURIComponent(String(ne))),be=new URL(me,Ta);let ve;G&&(ve=G.baseOptions);const _e={method:"GET",...ve,...ye},Te={};ue&&(Te.stack_id=ue),void 0!==pe&&(Te.payment_token=pe),void 0!==he&&(Te.page_cursor=he),setSearchParams(be,Te);let Ee=ve&&ve.headers?ve.headers:{};return _e.headers={...Ee,...ye.headers},{url:toPathString(be),options:_e}}}},PricingApiFp=function(G){const K=PricingApiAxiosParamCreator(G);return{async quotesForNFTs(ne,ue,pe,he,ye,me){const be=await K.quotesForNFTs(ne,ue,pe,he,ye,me);return createRequestFunction(be,er,_a,G)},async quotesForStacks(ne,ue,pe,he,ye,me){const be=await K.quotesForStacks(ne,ue,pe,he,ye,me);return createRequestFunction(be,er,_a,G)}}};const TokensApiAxiosParamCreator=function(G){return{getERC20Token:async(K,ne,ue={})=>{assertParamExists("getERC20Token","contractAddress",K),assertParamExists("getERC20Token","chainName",ne);const pe="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(K))).replace("{chain_name}",encodeURIComponent(String(ne))),he=new URL(pe,Ta);let ye;G&&(ye=G.baseOptions);const me={method:"GET",...ye,...ue};setSearchParams(he,{});let be=ye&&ye.headers?ye.headers:{};return me.headers={...be,...ue.headers},{url:toPathString(he),options:me}},listERC20Tokens:async(K,ne,ue,pe,he,ye,me={})=>{assertParamExists("listERC20Tokens","chainName",K);const be="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(K))),ve=new URL(be,Ta);let _e;G&&(_e=G.baseOptions);const Te={method:"GET",..._e,...me},Ee={};void 0!==ne&&(Ee.from_updated_at=ne instanceof Date?ne.toISOString():ne),ue&&(Ee.verification_status=ue),void 0!==pe&&(Ee.is_canonical=pe),void 0!==he&&(Ee.page_cursor=he),void 0!==ye&&(Ee.page_size=ye),setSearchParams(ve,Ee);let Pe=_e&&_e.headers?_e.headers:{};return Te.headers={...Pe,...me.headers},{url:toPathString(ve),options:Te}}}},TokensApiFp=function(G){const K=TokensApiAxiosParamCreator(G);return{async getERC20Token(ne,ue,pe){const he=await K.getERC20Token(ne,ue,pe);return createRequestFunction(he,er,_a,G)},async listERC20Tokens(ne,ue,pe,he,ye,me,be){const ve=await K.listERC20Tokens(ne,ue,pe,he,ye,me,be);return createRequestFunction(ve,er,_a,G)}}};var Pa,Sa,Ia,Ca,Ra,ka,Oa,xa,Na,Ma,Ba,Fa,Da,La,Ua,$a,qa,Ga,ja,Ha,Wa=Object.freeze({__proto__:null,APIError400AllOfCodeEnum:{ValidationError:"VALIDATION_ERROR"},APIError401AllOfCodeEnum:{UnauthorisedRequest:"UNAUTHORISED_REQUEST"},APIError403AllOfCodeEnum:{AuthenticationError:"AUTHENTICATION_ERROR"},APIError404AllOfCodeEnum:{ResourceNotFound:"RESOURCE_NOT_FOUND"},APIError409AllOfCodeEnum:{ConflictError:"CONFLICT_ERROR"},APIError429AllOfCodeEnum:{TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},APIError500AllOfCodeEnum:{InternalServerError:"INTERNAL_SERVER_ERROR"},APIError501AllOfCodeEnum:{NotImplementedError:"NOT_IMPLEMENTED_ERROR"},ActiveOrderStatusNameEnum:{Active:"ACTIVE"},ActivitiesApi:ActivitiesApi,ActivitiesApiAxiosParamCreator:ActivitiesApiAxiosParamCreator,ActivitiesApiFactory:function(G,K,ne){const ue=ActivitiesApiFp(G);return{getActivity:(G,pe)=>ue.getActivity(G.chainName,G.activityId,pe).then((G=>G(ne,K))),listActivities:(G,pe)=>ue.listActivities(G.chainName,G.contractAddress,G.tokenId,G.accountAddress,G.activityType,G.transactionHash,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listActivityHistory:(G,pe)=>ue.listActivityHistory(G.chainName,G.fromUpdatedAt,G.toUpdatedAt,G.contractAddress,G.activityType,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K)))}},ActivitiesApiFp:ActivitiesApiFp,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},AssetVerificationStatus:{Verified:"verified",Unverified:"unverified",Spam:"spam",Inactive:"inactive"},CancelledOrderStatusCancellationTypeEnum:{OnChain:"ON_CHAIN",OffChain:"OFF_CHAIN",Underfunded:"UNDERFUNDED"},CancelledOrderStatusNameEnum:{Cancelled:"CANCELLED"},ChainsApi:ChainsApi,ChainsApiAxiosParamCreator:ChainsApiAxiosParamCreator,ChainsApiFactory:function(G,K,ne){const ue=ChainsApiFp(G);return{listChains:(G={},pe)=>ue.listChains(G.pageCursor,G.pageSize,pe).then((G=>G(ne,K)))}},ChainsApiFp:ChainsApiFp,CollectionContractType:{Erc721:"ERC721",Erc1155:"ERC1155"},CollectionsApi:Aa,CollectionsApiAxiosParamCreator:CollectionsApiAxiosParamCreator,CollectionsApiFactory:function(G,K,ne){const ue=CollectionsApiFp(G);return{getCollection:(G,pe)=>ue.getCollection(G.contractAddress,G.chainName,pe).then((G=>G(ne,K))),listCollections:(G,pe)=>ue.listCollections(G.chainName,G.contractAddress,G.verificationStatus,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listCollectionsByNFTOwner:(G,pe)=>ue.listCollectionsByNFTOwner(G.accountAddress,G.chainName,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),refreshCollectionMetadata:(G,pe)=>ue.refreshCollectionMetadata(G.contractAddress,G.chainName,G.refreshCollectionMetadataRequest,pe).then((G=>G(ne,K)))}},CollectionsApiFp:CollectionsApiFp,Configuration:class Configuration{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(G={}){this.apiKey=G.apiKey,this.username=G.username,this.password=G.password,this.accessToken=G.accessToken,this.basePath=G.basePath,this.baseOptions=G.baseOptions,this.formDataCtor=G.formDataCtor}isJsonMime(G){const K=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==G&&(K.test(G)||"application/json-patch+json"===G.toLowerCase())}},CraftingApi:class CraftingApi extends BaseAPI{signCraftingPayload(G,K){return CraftingApiFp(this.configuration).signCraftingPayload(G.chainName,G.signCraftingRequest,K).then((G=>G(this.axios,this.basePath)))}},CraftingApiAxiosParamCreator:CraftingApiAxiosParamCreator,CraftingApiFactory:function(G,K,ne){const ue=CraftingApiFp(G);return{signCraftingPayload:(G,pe)=>ue.signCraftingPayload(G.chainName,G.signCraftingRequest,pe).then((G=>G(ne,K)))}},CraftingApiFp:CraftingApiFp,ERC1155CollectionItemTypeEnum:{Erc1155Collection:"ERC1155_COLLECTION"},ERC1155ItemTypeEnum:{Erc1155:"ERC1155"},ERC20ApproveMetadataTransactionTypeEnum:{Erc20Approve:"ERC20_APPROVE"},ERC20ItemTypeEnum:{Erc20:"ERC20"},ERC20TransferFromMetadataTransactionTypeEnum:{Erc20TransferFrom:"ERC20_TRANSFER_FROM"},ERC20TransferMetadataTransactionTypeEnum:{Erc20Transfer:"ERC20_TRANSFER"},ERC721ApproveMetadataTransactionTypeEnum:{Erc721Approve:"ERC721_APPROVE"},ERC721CollectionItemTypeEnum:{Erc721Collection:"ERC721_COLLECTION",Erc1155Collection:"ERC1155_COLLECTION"},ERC721ItemTypeEnum:{Erc721:"ERC721"},ERC721SafeTransferFromBatchMetadataTransactionTypeEnum:{Erc721SafeTransferFromBatch:"ERC721_SAFE_TRANSFER_FROM_BATCH"},ERC721TransferFromMetadataTransactionTypeEnum:{Erc721TransferFrom:"ERC721_TRANSFER_FROM"},ExpiredOrderStatusNameEnum:{Expired:"EXPIRED"},FailedOrderCancellationReasonCodeEnum:{Filled:"FILLED"},FeeTypeEnum:{Royalty:"ROYALTY",MakerEcosystem:"MAKER_ECOSYSTEM",TakerEcosystem:"TAKER_ECOSYSTEM",Protocol:"PROTOCOL"},FilledOrderStatusNameEnum:{Filled:"FILLED"},GetTransactionByIDChainTypeEnum:{Starkex:"starkex",Evm:"evm"},GuardianApi:GuardianApi,GuardianApiAxiosParamCreator:GuardianApiAxiosParamCreator,GuardianApiFactory:function(G,K,ne){const ue=GuardianApiFp(G);return{approvePendingERC191Message:(G,pe)=>ue.approvePendingERC191Message(G.messageID,pe).then((G=>G(ne,K))),approvePendingMessage:(G,pe)=>ue.approvePendingMessage(G.messageID,pe).then((G=>G(ne,K))),approvePendingTransaction:(G,pe)=>ue.approvePendingTransaction(G.payloadHash,G.transactionApprovalRequest,pe).then((G=>G(ne,K))),evaluateErc191Message:(G,pe)=>ue.evaluateErc191Message(G.eRC191MessageEvaluationRequest,pe).then((G=>G(ne,K))),evaluateMessage:(G,pe)=>ue.evaluateMessage(G.messageEvaluationRequest,pe).then((G=>G(ne,K))),evaluateTransaction:(G,pe)=>ue.evaluateTransaction(G.id,G.transactionEvaluationRequest,pe).then((G=>G(ne,K))),getErc191MessageByID:(G,pe)=>ue.getErc191MessageByID(G.messageID,pe).then((G=>G(ne,K))),getMessageByID:(G,pe)=>ue.getMessageByID(G.messageID,G.includeSimulation,pe).then((G=>G(ne,K))),getTransactionByID:(G,pe)=>ue.getTransactionByID(G.transactionID,G.chainType,G.chainID,G.includeSimulation,pe).then((G=>G(ne,K)))}},GuardianApiFp:GuardianApiFp,ImmutableVerificationStatusEnum:{Verified:"verified",Unverified:"unverified",Spam:"spam",Inactive:"inactive"},InactiveOrderStatusNameEnum:{Inactive:"INACTIVE"},ListBidsSortByEnum:{CreatedAt:"created_at",UpdatedAt:"updated_at",SellItemAmount:"sell_item_amount"},ListBidsSortDirectionEnum:{Asc:"asc",Desc:"desc"},ListCollectionBidsSortByEnum:{CreatedAt:"created_at",UpdatedAt:"updated_at",SellItemAmount:"sell_item_amount"},ListCollectionBidsSortDirectionEnum:{Asc:"asc",Desc:"desc"},ListListingsBuyItemTypeEnum:{Native:"NATIVE",Erc20:"ERC20"},ListListingsSortByEnum:{CreatedAt:"created_at",UpdatedAt:"updated_at",BuyItemAmount:"buy_item_amount"},ListListingsSortDirectionEnum:{Asc:"asc",Desc:"desc"},ListTradesSortByEnum:{IndexedAt:"indexed_at"},ListTradesSortDirectionEnum:{Asc:"asc",Desc:"desc"},MarketPriceERC20TokenTypeEnum:{Erc20:"ERC20"},MarketPriceFeesTypeEnum:{Royalty:"ROYALTY",MakerEcosystem:"MAKER_ECOSYSTEM",TakerEcosystem:"TAKER_ECOSYSTEM",Protocol:"PROTOCOL"},MarketPriceNativeTokenTypeEnum:{Native:"NATIVE"},MarketplaceContractType:{Erc721:"ERC721",Erc1155:"ERC1155"},MessageEvaluationResponseConfirmationMethodEnum:{Otp:"otp",Web:"web"},MetadataApi:class MetadataApi extends BaseAPI{getMetadata(G,K){return MetadataApiFp(this.configuration).getMetadata(G.chainName,G.contractAddress,G.metadataId,K).then((G=>G(this.axios,this.basePath)))}listMetadata(G,K){return MetadataApiFp(this.configuration).listMetadata(G.chainName,G.contractAddress,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listMetadataForChain(G,K){return MetadataApiFp(this.configuration).listMetadataForChain(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}listStacks(G,K){return MetadataApiFp(this.configuration).listStacks(G.chainName,G.stackId,K).then((G=>G(this.axios,this.basePath)))}refreshMetadataByID(G,K){return MetadataApiFp(this.configuration).refreshMetadataByID(G.chainName,G.contractAddress,G.refreshMetadataByIDRequest,K).then((G=>G(this.axios,this.basePath)))}refreshNFTMetadataByTokenID(G,K){return MetadataApiFp(this.configuration).refreshNFTMetadataByTokenID(G.contractAddress,G.chainName,G.refreshNFTMetadataByTokenIDRequest,K).then((G=>G(this.axios,this.basePath)))}},MetadataApiAxiosParamCreator:MetadataApiAxiosParamCreator,MetadataApiFactory:function(G,K,ne){const ue=MetadataApiFp(G);return{getMetadata:(G,pe)=>ue.getMetadata(G.chainName,G.contractAddress,G.metadataId,pe).then((G=>G(ne,K))),listMetadata:(G,pe)=>ue.listMetadata(G.chainName,G.contractAddress,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listMetadataForChain:(G,pe)=>ue.listMetadataForChain(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listStacks:(G,pe)=>ue.listStacks(G.chainName,G.stackId,pe).then((G=>G(ne,K))),refreshMetadataByID:(G,pe)=>ue.refreshMetadataByID(G.chainName,G.contractAddress,G.refreshMetadataByIDRequest,pe).then((G=>G(ne,K))),refreshNFTMetadataByTokenID:(G,pe)=>ue.refreshNFTMetadataByTokenID(G.contractAddress,G.chainName,G.refreshNFTMetadataByTokenIDRequest,pe).then((G=>G(ne,K)))}},MetadataApiFp:MetadataApiFp,MetadataSearchApi:class MetadataSearchApi extends BaseAPI{listFilters(G,K){return MetadataSearchApiFp(this.configuration).listFilters(G.chainName,G.contractAddress,K).then((G=>G(this.axios,this.basePath)))}searchNFTs(G,K){return MetadataSearchApiFp(this.configuration).searchNFTs(G.chainName,G.contractAddress,G.accountAddress,G.stackId,G.onlyIncludeOwnerListings,G.pageSize,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}searchStacks(G,K){return MetadataSearchApiFp(this.configuration).searchStacks(G.chainName,G.contractAddress,G.accountAddress,G.onlyIncludeOwnerListings,G.onlyIfHasActiveListings,G.traits,G.keyword,G.paymentToken,G.sortBy,G.pageSize,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}},MetadataSearchApiAxiosParamCreator:MetadataSearchApiAxiosParamCreator,MetadataSearchApiFactory:function(G,K,ne){const ue=MetadataSearchApiFp(G);return{listFilters:(G,pe)=>ue.listFilters(G.chainName,G.contractAddress,pe).then((G=>G(ne,K))),searchNFTs:(G,pe)=>ue.searchNFTs(G.chainName,G.contractAddress,G.accountAddress,G.stackId,G.onlyIncludeOwnerListings,G.pageSize,G.pageCursor,pe).then((G=>G(ne,K))),searchStacks:(G,pe)=>ue.searchStacks(G.chainName,G.contractAddress,G.accountAddress,G.onlyIncludeOwnerListings,G.onlyIfHasActiveListings,G.traits,G.keyword,G.paymentToken,G.sortBy,G.pageSize,G.pageCursor,pe).then((G=>G(ne,K)))}},MetadataSearchApiFp:MetadataSearchApiFp,MintRequestStatus:{Pending:"pending",Succeeded:"succeeded",Failed:"failed"},NFTContractType:{Erc721:"ERC721",Erc1155:"ERC1155"},NFTMetadataAttributeDisplayTypeEnum:{Number:"number",BoostPercentage:"boost_percentage",BoostNumber:"boost_number",Date:"date"},NFTSetApprovalForAllMetadataTransactionTypeEnum:{Erc721SetApprovalForAll:"ERC721_SET_APPROVAL_FOR_ALL",Erc1155SetApprovalForAll:"ERC1155_SET_APPROVAL_FOR_ALL"},NativeItemTypeEnum:{Native:"NATIVE",Erc20:"ERC20",Erc721:"ERC721",Erc1155:"ERC1155",Erc721Collection:"ERC721_COLLECTION",Erc1155Collection:"ERC1155_COLLECTION"},NftOwnersApi:NftOwnersApi,NftOwnersApiAxiosParamCreator:NftOwnersApiAxiosParamCreator,NftOwnersApiFactory:function(G,K,ne){const ue=NftOwnersApiFp(G);return{listAllNFTOwners:(G,pe)=>ue.listAllNFTOwners(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listNFTOwners:(G,pe)=>ue.listNFTOwners(G.contractAddress,G.tokenId,G.chainName,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listOwnersByContractAddress:(G,pe)=>ue.listOwnersByContractAddress(G.contractAddress,G.chainName,G.accountAddress,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K)))}},NftOwnersApiFp:NftOwnersApiFp,NftsApi:NftsApi,NftsApiAxiosParamCreator:NftsApiAxiosParamCreator,NftsApiFactory:function(G,K,ne){const ue=NftsApiFp(G);return{createMintRequest:(G,pe)=>ue.createMintRequest(G.contractAddress,G.chainName,G.createMintRequestRequest,pe).then((G=>G(ne,K))),getMintRequest:(G,pe)=>ue.getMintRequest(G.contractAddress,G.chainName,G.referenceId,pe).then((G=>G(ne,K))),getNFT:(G,pe)=>ue.getNFT(G.contractAddress,G.tokenId,G.chainName,pe).then((G=>G(ne,K))),listAllNFTs:(G,pe)=>ue.listAllNFTs(G.chainName,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listMintRequests:(G,pe)=>ue.listMintRequests(G.contractAddress,G.chainName,G.pageCursor,G.pageSize,G.status,pe).then((G=>G(ne,K))),listNFTs:(G,pe)=>ue.listNFTs(G.contractAddress,G.chainName,G.tokenId,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K))),listNFTsByAccountAddress:(G,pe)=>ue.listNFTsByAccountAddress(G.accountAddress,G.chainName,G.contractAddress,G.tokenId,G.fromUpdatedAt,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K)))}},NftsApiFp:NftsApiFp,OperatorAllowlistStatus:{Requested:"requested",Approved:"approved",Rejected:"rejected",Removed:"removed",Added:"added"},OrderStatusName:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Expired:"EXPIRED",Cancelled:"CANCELLED"},OrderTypeEnum:{Listing:"LISTING",Bid:"BID",CollectionBid:"COLLECTION_BID"},OrdersApi:Ea,OrdersApiAxiosParamCreator:OrdersApiAxiosParamCreator,OrdersApiFactory:function(G,K,ne){const ue=OrdersApiFp(G);return{cancelOrders:(G,pe)=>ue.cancelOrders(G.chainName,G.cancelOrdersRequestBody,pe).then((G=>G(ne,K))),createBid:(G,pe)=>ue.createBid(G.chainName,G.createBidRequestBody,pe).then((G=>G(ne,K))),createCollectionBid:(G,pe)=>ue.createCollectionBid(G.chainName,G.createCollectionBidRequestBody,pe).then((G=>G(ne,K))),createListing:(G,pe)=>ue.createListing(G.chainName,G.createListingRequestBody,pe).then((G=>G(ne,K))),fulfillmentData:(G,pe)=>ue.fulfillmentData(G.chainName,G.fulfillmentDataRequest,pe).then((G=>G(ne,K))),getBid:(G,pe)=>ue.getBid(G.chainName,G.bidId,pe).then((G=>G(ne,K))),getCollectionBid:(G,pe)=>ue.getCollectionBid(G.chainName,G.collectionBidId,pe).then((G=>G(ne,K))),getListing:(G,pe)=>ue.getListing(G.chainName,G.listingId,pe).then((G=>G(ne,K))),getTrade:(G,pe)=>ue.getTrade(G.chainName,G.tradeId,pe).then((G=>G(ne,K))),listBids:(G,pe)=>ue.listBids(G.chainName,G.status,G.buyItemContractAddress,G.sellItemContractAddress,G.accountAddress,G.buyItemMetadataId,G.buyItemTokenId,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,pe).then((G=>G(ne,K))),listCollectionBids:(G,pe)=>ue.listCollectionBids(G.chainName,G.status,G.buyItemContractAddress,G.sellItemContractAddress,G.accountAddress,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,pe).then((G=>G(ne,K))),listListings:(G,pe)=>ue.listListings(G.chainName,G.status,G.sellItemContractAddress,G.buyItemType,G.buyItemContractAddress,G.accountAddress,G.sellItemMetadataId,G.sellItemTokenId,G.fromUpdatedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,pe).then((G=>G(ne,K))),listTrades:(G,pe)=>ue.listTrades(G.chainName,G.accountAddress,G.sellItemContractAddress,G.fromIndexedAt,G.pageSize,G.sortBy,G.sortDirection,G.pageCursor,pe).then((G=>G(ne,K)))}},OrdersApiFp:OrdersApiFp,OrganisationTier:{Common:"common",Uncommon:"uncommon",Rare:"rare",Epic:"epic",Legendary:"legendary"},PassportApi:PassportApi,PassportApiAxiosParamCreator:PassportApiAxiosParamCreator,PassportApiFactory:function(G,K,ne){const ue=PassportApiFp(G);return{createCounterfactualAddressV2:(G,pe)=>ue.createCounterfactualAddressV2(G.chainName,G.createCounterfactualAddressRequest,pe).then((G=>G(ne,K))),getLinkedAddresses:(G,pe)=>ue.getLinkedAddresses(G.userId,G.chainName,pe).then((G=>G(ne,K))),getLinkedAddressesDeprecated:(G,pe)=>ue.getLinkedAddressesDeprecated(G.userId,pe).then((G=>G(ne,K))),getTransactionMetadata:(G,pe)=>ue.getTransactionMetadata(G.chainName,G.getTransactionMetadataRequest,pe).then((G=>G(ne,K))),getTypedDataMetadata:(G,pe)=>ue.getTypedDataMetadata(G.chainName,G.getTypedDataMetadataRequest,pe).then((G=>G(ne,K))),getUserMetadata:(G,pe)=>ue.getUserMetadata(G.userId,pe).then((G=>G(ne,K)))}},PassportApiFp:PassportApiFp,PassportProfileApi:PassportProfileApi,PassportProfileApiAxiosParamCreator:PassportProfileApiAxiosParamCreator,PassportProfileApiFactory:function(G,K,ne){const ue=PassportProfileApiFp(G);return{getUserInfo:G=>ue.getUserInfo(G).then((G=>G(ne,K))),linkWalletV2:(G={},pe)=>ue.linkWalletV2(G.linkWalletV2Request,pe).then((G=>G(ne,K)))}},PassportProfileApiFp:PassportProfileApiFp,PendingOrderStatusNameEnum:{Pending:"PENDING"},PricingApi:class PricingApi extends BaseAPI{quotesForNFTs(G,K){return PricingApiFp(this.configuration).quotesForNFTs(G.chainName,G.contractAddress,G.tokenId,G.paymentToken,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}quotesForStacks(G,K){return PricingApiFp(this.configuration).quotesForStacks(G.chainName,G.contractAddress,G.stackId,G.paymentToken,G.pageCursor,K).then((G=>G(this.axios,this.basePath)))}},PricingApiAxiosParamCreator:PricingApiAxiosParamCreator,PricingApiFactory:function(G,K,ne){const ue=PricingApiFp(G);return{quotesForNFTs:(G,pe)=>ue.quotesForNFTs(G.chainName,G.contractAddress,G.tokenId,G.paymentToken,G.pageCursor,pe).then((G=>G(ne,K))),quotesForStacks:(G,pe)=>ue.quotesForStacks(G.chainName,G.contractAddress,G.stackId,G.paymentToken,G.pageCursor,pe).then((G=>G(ne,K)))}},PricingApiFp:PricingApiFp,ProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED",PartialRestricted:"PARTIAL_RESTRICTED"},SaleFeeTypeEnum:{Royalty:"ROYALTY"},SeaportCreateListingMetadataTypedDataTypeEnum:{SeaportCreateListingMetadata:"SEAPORT_CREATE_LISTING_METADATA"},SeaportERC1155CollectionItemTypeEnum:{Erc1155Collection:"ERC1155Collection"},SeaportERC1155ItemTypeEnum:{Erc1155:"ERC1155"},SeaportERC20ItemTypeEnum:{Erc20:"ERC20"},SeaportERC721CollectionItemTypeEnum:{Erc721Collection:"ERC721Collection"},SeaportERC721ItemTypeEnum:{Erc721:"ERC721"},SeaportFeeTypeEnum:{Erc20:"ERC20",Native:"NATIVE"},SeaportFulfillAvailableAdvancedOrdersMetadataTransactionTypeEnum:{SeaportFulfillAvailableAdvancedOrders:"SEAPORT_FULFILL_AVAILABLE_ADVANCED_ORDERS"},SeaportNativeItemTypeEnum:{Native:"NATIVE"},SearchStacksSortByEnum:{CheapestFirst:"cheapest_first"},Severity:{Malicious:"malicious",Benign:"benign",Warning:"warning",Unknown:"unknown",Info:"info"},StarkExTransactionEvaluationRequestChainTypeEnum:{Starkex:"starkex"},TokenContractType:{Erc20:"ERC20"},TokensApi:class TokensApi extends BaseAPI{getERC20Token(G,K){return TokensApiFp(this.configuration).getERC20Token(G.contractAddress,G.chainName,K).then((G=>G(this.axios,this.basePath)))}listERC20Tokens(G,K){return TokensApiFp(this.configuration).listERC20Tokens(G.chainName,G.fromUpdatedAt,G.verificationStatus,G.isCanonical,G.pageCursor,G.pageSize,K).then((G=>G(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:TokensApiAxiosParamCreator,TokensApiFactory:function(G,K,ne){const ue=TokensApiFp(G);return{getERC20Token:(G,pe)=>ue.getERC20Token(G.contractAddress,G.chainName,pe).then((G=>G(ne,K))),listERC20Tokens:(G,pe)=>ue.listERC20Tokens(G.chainName,G.fromUpdatedAt,G.verificationStatus,G.isCanonical,G.pageCursor,G.pageSize,pe).then((G=>G(ne,K)))}},TokensApiFp:TokensApiFp,TransactionApprovalRequestChainTypeEnum:{Starkex:"starkex",Evm:"evm"},TransactionEvaluationResponseConfirmationMethodEnum:{Otp:"otp",Web:"web"},UnknownMetadataTransactionTypeEnum:{Unknown:"UNKNOWN"},UnknownTypedDataMetadataTypedDataTypeEnum:{Unknown:"UNKNOWN"},ValidationStatus:{Success:"success",Error:"error",SimulationFailed:"simulation_failed"},VerificationRequestContractType:{Erc20:"ERC20",Erc721:"ERC721",Erc1155:"ERC1155"},VerificationRequestStatus:{Completed:"completed",Pending:"pending"},ZkEvmTransactionEvaluationRequestChainTypeEnum:{Evm:"evm"}});!function(G){G.CheapestFirst="cheapest_first"}(Pa||(Pa={})),function(G){G.ValidationError="VALIDATION_ERROR"}(Sa||(Sa={})),function(G){G.UnauthorisedRequest="UNAUTHORISED_REQUEST"}(Ia||(Ia={})),function(G){G.AuthenticationError="AUTHENTICATION_ERROR"}(Ca||(Ca={})),function(G){G.ResourceNotFound="RESOURCE_NOT_FOUND"}(Ra||(Ra={})),function(G){G.ConflictError="CONFLICT_ERROR"}(ka||(ka={})),function(G){G.TooManyRequestsError="TOO_MANY_REQUESTS_ERROR"}(Oa||(Oa={})),function(G){G.InternalServerError="INTERNAL_SERVER_ERROR"}(xa||(xa={})),function(G){G.Mint="mint",G.Burn="burn",G.Transfer="transfer",G.Sale="sale",G.Deposit="deposit",G.Withdrawal="withdrawal"}(Na||(Na={})),function(G){G.Verified="verified",G.Unverified="unverified",G.Spam="spam",G.Inactive="inactive"}(Ma||(Ma={})),function(G){G.Erc721="ERC721",G.Erc1155="ERC1155"}(Ba||(Ba={})),function(G){G.Erc20="ERC20"}(Fa||(Fa={})),function(G){G.Royalty="ROYALTY",G.MakerEcosystem="MAKER_ECOSYSTEM",G.TakerEcosystem="TAKER_ECOSYSTEM",G.Protocol="PROTOCOL"}(Da||(Da={})),function(G){G.Native="NATIVE"}(La||(La={})),function(G){G.Erc721="ERC721",G.Erc1155="ERC1155"}(Ua||(Ua={})),function(G){G.Pending="pending",G.Succeeded="succeeded",G.Failed="failed"}($a||($a={})),function(G){G.Erc721="ERC721",G.Erc1155="ERC1155"}(qa||(qa={})),function(G){G.Number="number",G.BoostPercentage="boost_percentage",G.BoostNumber="boost_number",G.Date="date"}(Ga||(Ga={})),function(G){G.Royalty="ROYALTY"}(ja||(ja={})),function(G){G.Erc20="ERC20"}(Ha||(Ha={}));var za=Object.freeze({__proto__:null,get APIError400AllOfCodeEnum(){return Sa},get APIError401AllOfCodeEnum(){return Ia},get APIError403AllOfCodeEnum(){return Ca},get APIError404AllOfCodeEnum(){return Ra},get APIError409AllOfCodeEnum(){return ka},get APIError429AllOfCodeEnum(){return Oa},get APIError500AllOfCodeEnum(){return xa},get ActivityType(){return Na},get AssetVerificationStatus(){return Ma},get CollectionContractType(){return Ba},get MarketPriceERC20TokenTypeEnum(){return Fa},get MarketPriceFeesTypeEnum(){return Da},get MarketPriceNativeTokenTypeEnum(){return La},get MarketplaceContractType(){return Ua},get MintRequestStatus(){return $a},get NFTContractType(){return qa},get NFTMetadataAttributeDisplayTypeEnum(){return Ga},get SaleFeeTypeEnum(){return ja},get SearchStacksSortByEnum(){return Pa},get TokenContractType(){return Ha}});class ImxApiClients{config;assetApi;balanceApi;collectionApi;depositsApi;encodingApi;exchangeApi;metadataApi;metadataRefreshesApi;mintsApi;nftCheckoutPrimaryApi;ordersApi;projectsApi;tokensApi;tradesApi;transfersApi;usersApi;withdrawalsApi;constructor(G){this.config=G,this.assetApi=new ra(G),this.balanceApi=new na(G),this.collectionApi=new aa(G),this.depositsApi=new ia(G),this.encodingApi=new sa(G),this.exchangeApi=new oa(G),this.metadataApi=new ca(G),this.metadataRefreshesApi=new da(G),this.mintsApi=new ua(G),this.nftCheckoutPrimaryApi=new fa(G),this.ordersApi=new la(G),this.projectsApi=new pa(G),this.tokensApi=new ha(G),this.tradesApi=new ya(G),this.transfersApi=new ma(G),this.usersApi=new ba(G),this.withdrawalsApi=new ga(G)}}class MultiRollupApiClients{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;passportProfileApi;guardianApi;constructor(G){this.config=G,this.activitiesApi=new ActivitiesApi(G.indexer),this.chainsApi=new ChainsApi(G.indexer),this.collectionApi=new Aa(G.indexer),this.nftOwnersApi=new NftOwnersApi(G.indexer),this.nftsApi=new NftsApi(G.indexer),this.ordersApi=new Ea(G.orderBook),this.passportApi=new PassportApi(G.passport),this.passportProfileApi=new PassportProfileApi(G.passport),this.guardianApi=new GuardianApi(G.passport)}}const Va={"x-sdk-version":"ts-immutable-sdk-1.78.11"},createConfig$1=({basePath:G,headers:K})=>{if(!G.trim())throw Error("basePath can not be empty");const ne={...Va,...K||{}};return new va({basePath:G,baseOptions:{headers:ne}})},imxApiConfig_getProduction=()=>createConfig$1({basePath:"https://api.x.immutable.com"}),imxApiConfig_getSandbox=()=>createConfig$1({basePath:"https://api.sandbox.x.immutable.com"}),multiRollupConfig_getProduction=()=>({indexer:createConfig$1({basePath:"https://api.immutable.com"}),orderBook:createConfig$1({basePath:"https://api.immutable.com"}),passport:createConfig$1({basePath:"https://api.immutable.com"})}),multiRollupConfig_getSandbox=()=>({indexer:createConfig$1({basePath:"https://api.sandbox.immutable.com"}),orderBook:createConfig$1({basePath:"https://api.sandbox.immutable.com"}),passport:createConfig$1({basePath:"https://api.sandbox.immutable.com"})});class APIError extends Error{code;details;link;traceId;constructor({message:G,code:K,details:ne,link:ue,trace_id:pe}){super(G),this.code=K,this.details=ne,this.link=ue,this.traceId=pe}}const Ka={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-1.78.11"},createAPIConfiguration=G=>{const{baseConfig:K,basePath:ne,headers:ue}=G;if(!ne.trim())throw Error("basePath can not be empty");const pe={...ue||{},...addKeysToHeadersOverride(K,G)||{},...Ka},he={...K,basePath:ne,baseOptions:{headers:pe}};return new Wa.Configuration(he)};class BlockchainDataConfiguration{apiConfig;baseConfig;constructor({baseConfig:G,overrides:K}){if(this.baseConfig=G,K)this.apiConfig=createAPIConfiguration(K);else switch(G.environment){case Jn.SANDBOX:this.apiConfig=createAPIConfiguration({basePath:"https://api.sandbox.immutable.com",baseConfig:G});break;case Jn.PRODUCTION:this.apiConfig=createAPIConfiguration({basePath:"https://api.immutable.com",baseConfig:G});break;default:this.apiConfig=createAPIConfiguration({basePath:"https://api.sandbox.immutable.com",baseConfig:G})}}}function formatError$2(G){if(er.isAxiosError(G)&&G.response){const K=G.response.data;return K.code&&K.message?new APIError({code:K.code,message:K.message,details:K.details||null,link:K.link||"",trace_id:K.trace_id||""}):new APIError({code:G.code??G.response?.status.toString()??"unknown_error_code",message:String(G),details:null,link:"",trace_id:""})}return new APIError({code:"unknown_error_code",message:String(G),details:null,link:"",trace_id:""})}class BlockchainData{config;activities;chains;collections;nfts;nftOwners;tokens;metadata;crafting;pricing;metadataSearch;constructor(G){this.config=new BlockchainDataConfiguration(G),this.activities=new Wa.ActivitiesApi(this.config.apiConfig),this.chains=new Wa.ChainsApi(this.config.apiConfig),this.collections=new Wa.CollectionsApi(this.config.apiConfig),this.nfts=new Wa.NftsApi(this.config.apiConfig),this.nftOwners=new Wa.NftOwnersApi(this.config.apiConfig),this.tokens=new Wa.TokensApi(this.config.apiConfig),this.metadata=new Wa.MetadataApi(this.config.apiConfig),this.crafting=new Wa.CraftingApi(this.config.apiConfig),this.pricing=new Wa.PricingApi(this.config.apiConfig),this.metadataSearch=new Wa.MetadataSearchApi(this.config.apiConfig)}async listActivities(G){return await this.activities.listActivities(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listActivityHistory(G){return await this.activities.listActivityHistory(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getActivity(G){return await this.activities.getActivity(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listChains(G){return await this.chains.listChains(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listCollections(G){return await this.collections.listCollections(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listCollectionsByNFTOwner(G){return await this.collections.listCollectionsByNFTOwner(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getCollection(G){return await this.collections.getCollection(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getNFT(G){return await this.nfts.getNFT(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTs(G){return await this.nfts.listNFTs(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTsByAccountAddress(G){return await this.nfts.listNFTsByAccountAddress(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listAllNFTs(G){return await this.nfts.listAllNFTs(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async createMintRequest(G){return await this.nfts.createMintRequest(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listMintRequests(G){return await this.nfts.listMintRequests(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getMintRequest(G){return await this.nfts.getMintRequest(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTOwners(G){return await this.nftOwners.listNFTOwners(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTOwnersByContractAddress(G){return await this.nftOwners.listOwnersByContractAddress(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listAllNFTOwners(G){return await this.nftOwners.listAllNFTOwners(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listTokens(G){return await this.tokens.listERC20Tokens(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getToken(G){return await this.tokens.getERC20Token(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async getMetadata(G){return await this.metadata.getMetadata(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTMetadataByContractAddress(G){return await this.metadata.listMetadata(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listNFTMetadataByChain(G){return await this.metadata.listMetadataForChain(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async refreshCollectionMetadata(G){return await this.collections.refreshCollectionMetadata(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async refreshNFTMetadata(G){return await this.metadata.refreshNFTMetadataByTokenID(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async refreshStackedMetadata(G){return await this.metadata.refreshMetadataByID(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async signCraftingPayload(G){return await this.crafting.signCraftingPayload(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listFilters(G){return await this.metadataSearch.listFilters(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async searchNFTs(G){return await this.metadataSearch.searchNFTs(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async searchStacks(G){return await this.metadataSearch.searchStacks(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async quotesForNFTs(G){return await this.pricing.quotesForNFTs(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async quotesForStacks(G){return await this.pricing.quotesForStacks(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}async listStacks(G){return await this.metadata.listStacks(G).then((G=>G.data)).catch((G=>{throw formatError$2(G)}))}}var Ja=Object.freeze({__proto__:null,APIError:APIError,BlockchainData:BlockchainData,Types:za}),Xa={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(G){!function(){var K="input is invalid type",ne="object"==typeof window,ue=ne?window:{};ue.JS_SHA3_NO_WINDOW&&(ne=!1);var pe=!ne&&"object"==typeof self;!ue.JS_SHA3_NO_NODE_JS&&!1?ue=pn:pe&&(ue=self);var he=!ue.JS_SHA3_NO_COMMON_JS&&G.exports,ye=!ue.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,me="0123456789abcdef".split(""),be=[4,1024,262144,67108864],ve=[0,8,16,24],_e=[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],Te=[224,256,384,512],Ee=[128,256],Pe=["hex","buffer","arrayBuffer","array","digest"],Se={128:168,256:136};!ue.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(G){return"[object Array]"===Object.prototype.toString.call(G)}),!ye||!ue.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(G){return"object"==typeof G&&G.buffer&&G.buffer.constructor===ArrayBuffer});for(var createOutputMethod=function(G,K,ne){return function(ue){return new Keccak(G,K,G).update(ue)[ne]()}},createShakeOutputMethod=function(G,K,ne){return function(ue,pe){return new Keccak(G,K,pe).update(ue)[ne]()}},createCshakeOutputMethod=function(G,K,ne){return function(K,ue,pe,he){return ke["cshake"+G].update(K,ue,pe,he)[ne]()}},createKmacOutputMethod=function(G,K,ne){return function(K,ue,pe,he){return ke["kmac"+G].update(K,ue,pe,he)[ne]()}},createOutputMethods=function(G,K,ne,ue){for(var pe=0;pe<Pe.length;++pe){var he=Pe[pe];G[he]=K(ne,ue,he)}return G},createMethod=function(G,K){var ne=createOutputMethod(G,K,"hex");return ne.create=function(){return new Keccak(G,K,G)},ne.update=function(G){return ne.create().update(G)},createOutputMethods(ne,createOutputMethod,G,K)},Ce=[{name:"keccak",padding:[1,256,65536,16777216],bits:Te,createMethod:createMethod},{name:"sha3",padding:[6,1536,393216,100663296],bits:Te,createMethod:createMethod},{name:"shake",padding:[31,7936,2031616,520093696],bits:Ee,createMethod:function(G,K){var ne=createShakeOutputMethod(G,K,"hex");return ne.create=function(ne){return new Keccak(G,K,ne)},ne.update=function(G,K){return ne.create(K).update(G)},createOutputMethods(ne,createShakeOutputMethod,G,K)}},{name:"cshake",padding:be,bits:Ee,createMethod:function(G,K){var ne=Se[G],ue=createCshakeOutputMethod(G,0,"hex");return ue.create=function(ue,pe,he){return pe||he?new Keccak(G,K,ue).bytepad([pe,he],ne):ke["shake"+G].create(ue)},ue.update=function(G,K,ne,pe){return ue.create(K,ne,pe).update(G)},createOutputMethods(ue,createCshakeOutputMethod,G,K)}},{name:"kmac",padding:be,bits:Ee,createMethod:function(G,K){var ne=Se[G],ue=createKmacOutputMethod(G,0,"hex");return ue.create=function(ue,pe,he){return new Kmac(G,K,pe).bytepad(["KMAC",he],ne).bytepad([ue],ne)},ue.update=function(G,K,ne,pe){return ue.create(G,ne,pe).update(K)},createOutputMethods(ue,createKmacOutputMethod,G,K)}}],ke={},Oe=[],xe=0;xe<Ce.length;++xe)for(var Ne=Ce[xe],Me=Ne.bits,Be=0;Be<Me.length;++Be){var Fe=Ne.name+"_"+Me[Be];if(Oe.push(Fe),ke[Fe]=Ne.createMethod(Me[Be],Ne.padding),"sha3"!==Ne.name){var De=Ne.name+Me[Be];Oe.push(De),ke[De]=ke[Fe]}}function Keccak(G,K,ne){this.blocks=[],this.s=[],this.padding=K,this.outputBits=ne,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(G<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=ne>>5,this.extraBytes=(31&ne)>>3;for(var ue=0;ue<50;++ue)this.s[ue]=0}function Kmac(G,K,ne){Keccak.call(this,G,K,ne)}Keccak.prototype.update=function(G){if(this.finalized)throw new Error("finalize already called");var ne,ue=typeof G;if("string"!==ue){if("object"!==ue)throw new Error(K);if(null===G)throw new Error(K);if(ye&&G.constructor===ArrayBuffer)G=new Uint8Array(G);else if(!(Array.isArray(G)||ye&&ArrayBuffer.isView(G)))throw new Error(K);ne=!0}for(var pe,he,me=this.blocks,be=this.byteCount,_e=G.length,Te=this.blockCount,Ee=0,Pe=this.s;Ee<_e;){if(this.reset)for(this.reset=!1,me[0]=this.block,pe=1;pe<Te+1;++pe)me[pe]=0;if(ne)for(pe=this.start;Ee<_e&&pe<be;++Ee)me[pe>>2]|=G[Ee]<<ve[3&pe++];else for(pe=this.start;Ee<_e&&pe<be;++Ee)(he=G.charCodeAt(Ee))<128?me[pe>>2]|=he<<ve[3&pe++]:he<2048?(me[pe>>2]|=(192|he>>6)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]):he<55296||he>=57344?(me[pe>>2]|=(224|he>>12)<<ve[3&pe++],me[pe>>2]|=(128|he>>6&63)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]):(he=65536+((1023&he)<<10|1023&G.charCodeAt(++Ee)),me[pe>>2]|=(240|he>>18)<<ve[3&pe++],me[pe>>2]|=(128|he>>12&63)<<ve[3&pe++],me[pe>>2]|=(128|he>>6&63)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]);if(this.lastByteIndex=pe,pe>=be){for(this.start=pe-be,this.block=me[Te],pe=0;pe<Te;++pe)Pe[pe]^=me[pe];f(Pe),this.reset=!0}else this.start=pe}return this},Keccak.prototype.encode=function(G,K){var ne=255&G,ue=1,pe=[ne];for(ne=255&(G>>=8);ne>0;)pe.unshift(ne),ne=255&(G>>=8),++ue;return K?pe.push(ue):pe.unshift(ue),this.update(pe),pe.length},Keccak.prototype.encodeString=function(G){var ne,ue=typeof G;if("string"!==ue){if("object"!==ue)throw new Error(K);if(null===G)throw new Error(K);if(ye&&G.constructor===ArrayBuffer)G=new Uint8Array(G);else if(!(Array.isArray(G)||ye&&ArrayBuffer.isView(G)))throw new Error(K);ne=!0}var pe=0,he=G.length;if(ne)pe=he;else for(var me=0;me<G.length;++me){var be=G.charCodeAt(me);be<128?pe+=1:be<2048?pe+=2:be<55296||be>=57344?pe+=3:(be=65536+((1023&be)<<10|1023&G.charCodeAt(++me)),pe+=4)}return pe+=this.encode(8*pe),this.update(G),pe},Keccak.prototype.bytepad=function(G,K){for(var ne=this.encode(K),ue=0;ue<G.length;++ue)ne+=this.encodeString(G[ue]);var pe=K-ne%K,he=[];return he.length=pe,this.update(he),this},Keccak.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var G=this.blocks,K=this.lastByteIndex,ne=this.blockCount,ue=this.s;if(G[K>>2]|=this.padding[3&K],this.lastByteIndex===this.byteCount)for(G[0]=G[ne],K=1;K<ne+1;++K)G[K]=0;for(G[ne-1]|=2147483648,K=0;K<ne;++K)ue[K]^=G[K];f(ue)}},Keccak.prototype.toString=Keccak.prototype.hex=function(){this.finalize();for(var G,K=this.blockCount,ne=this.s,ue=this.outputBlocks,pe=this.extraBytes,he=0,ye=0,be="";ye<ue;){for(he=0;he<K&&ye<ue;++he,++ye)G=ne[he],be+=me[G>>4&15]+me[15&G]+me[G>>12&15]+me[G>>8&15]+me[G>>20&15]+me[G>>16&15]+me[G>>28&15]+me[G>>24&15];ye%K==0&&(f(ne),he=0)}return pe&&(G=ne[he],be+=me[G>>4&15]+me[15&G],pe>1&&(be+=me[G>>12&15]+me[G>>8&15]),pe>2&&(be+=me[G>>20&15]+me[G>>16&15])),be},Keccak.prototype.arrayBuffer=function(){this.finalize();var G,K=this.blockCount,ne=this.s,ue=this.outputBlocks,pe=this.extraBytes,he=0,ye=0,me=this.outputBits>>3;G=pe?new ArrayBuffer(ue+1<<2):new ArrayBuffer(me);for(var be=new Uint32Array(G);ye<ue;){for(he=0;he<K&&ye<ue;++he,++ye)be[ye]=ne[he];ye%K==0&&f(ne)}return pe&&(be[he]=ne[he],G=G.slice(0,me)),G},Keccak.prototype.buffer=Keccak.prototype.arrayBuffer,Keccak.prototype.digest=Keccak.prototype.array=function(){this.finalize();for(var G,K,ne=this.blockCount,ue=this.s,pe=this.outputBlocks,he=this.extraBytes,ye=0,me=0,be=[];me<pe;){for(ye=0;ye<ne&&me<pe;++ye,++me)G=me<<2,K=ue[ye],be[G]=255&K,be[G+1]=K>>8&255,be[G+2]=K>>16&255,be[G+3]=K>>24&255;me%ne==0&&f(ue)}return he&&(G=me<<2,K=ue[ye],be[G]=255&K,he>1&&(be[G+1]=K>>8&255),he>2&&(be[G+2]=K>>16&255)),be},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0),Keccak.prototype.finalize.call(this)};var f=function(G){var K,ne,ue,pe,he,ye,me,be,ve,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye,et,tt,rt,nt,at,it,ot,ct,dt,ut,ft,yt,wt,At,St,kt,Bt,Lt,Ut,$t,Ht,Vt,er,tr,rr,cr,dr,Rr,kr,$r,qr,Hr,Vr;for(ue=0;ue<48;ue+=2)pe=G[0]^G[10]^G[20]^G[30]^G[40],he=G[1]^G[11]^G[21]^G[31]^G[41],ye=G[2]^G[12]^G[22]^G[32]^G[42],me=G[3]^G[13]^G[23]^G[33]^G[43],be=G[4]^G[14]^G[24]^G[34]^G[44],ve=G[5]^G[15]^G[25]^G[35]^G[45],Te=G[6]^G[16]^G[26]^G[36]^G[46],Ee=G[7]^G[17]^G[27]^G[37]^G[47],K=(Pe=G[8]^G[18]^G[28]^G[38]^G[48])^(ye<<1|me>>>31),ne=(Se=G[9]^G[19]^G[29]^G[39]^G[49])^(me<<1|ye>>>31),G[0]^=K,G[1]^=ne,G[10]^=K,G[11]^=ne,G[20]^=K,G[21]^=ne,G[30]^=K,G[31]^=ne,G[40]^=K,G[41]^=ne,K=pe^(be<<1|ve>>>31),ne=he^(ve<<1|be>>>31),G[2]^=K,G[3]^=ne,G[12]^=K,G[13]^=ne,G[22]^=K,G[23]^=ne,G[32]^=K,G[33]^=ne,G[42]^=K,G[43]^=ne,K=ye^(Te<<1|Ee>>>31),ne=me^(Ee<<1|Te>>>31),G[4]^=K,G[5]^=ne,G[14]^=K,G[15]^=ne,G[24]^=K,G[25]^=ne,G[34]^=K,G[35]^=ne,G[44]^=K,G[45]^=ne,K=be^(Pe<<1|Se>>>31),ne=ve^(Se<<1|Pe>>>31),G[6]^=K,G[7]^=ne,G[16]^=K,G[17]^=ne,G[26]^=K,G[27]^=ne,G[36]^=K,G[37]^=ne,G[46]^=K,G[47]^=ne,K=Te^(pe<<1|he>>>31),ne=Ee^(he<<1|pe>>>31),G[8]^=K,G[9]^=ne,G[18]^=K,G[19]^=ne,G[28]^=K,G[29]^=ne,G[38]^=K,G[39]^=ne,G[48]^=K,G[49]^=ne,Ce=G[0],ke=G[1],kt=G[11]<<4|G[10]>>>28,Bt=G[10]<<4|G[11]>>>28,Xe=G[20]<<3|G[21]>>>29,Qe=G[21]<<3|G[20]>>>29,$r=G[31]<<9|G[30]>>>23,qr=G[30]<<9|G[31]>>>23,yt=G[40]<<18|G[41]>>>14,wt=G[41]<<18|G[40]>>>14,nt=G[2]<<1|G[3]>>>31,at=G[3]<<1|G[2]>>>31,Oe=G[13]<<12|G[12]>>>20,xe=G[12]<<12|G[13]>>>20,Lt=G[22]<<10|G[23]>>>22,Ut=G[23]<<10|G[22]>>>22,Ye=G[33]<<13|G[32]>>>19,et=G[32]<<13|G[33]>>>19,Hr=G[42]<<2|G[43]>>>30,Vr=G[43]<<2|G[42]>>>30,tr=G[5]<<30|G[4]>>>2,rr=G[4]<<30|G[5]>>>2,it=G[14]<<6|G[15]>>>26,ot=G[15]<<6|G[14]>>>26,Ne=G[25]<<11|G[24]>>>21,Me=G[24]<<11|G[25]>>>21,$t=G[34]<<15|G[35]>>>17,Ht=G[35]<<15|G[34]>>>17,tt=G[45]<<29|G[44]>>>3,rt=G[44]<<29|G[45]>>>3,Ue=G[6]<<28|G[7]>>>4,je=G[7]<<28|G[6]>>>4,cr=G[17]<<23|G[16]>>>9,dr=G[16]<<23|G[17]>>>9,ct=G[26]<<25|G[27]>>>7,dt=G[27]<<25|G[26]>>>7,Be=G[36]<<21|G[37]>>>11,Fe=G[37]<<21|G[36]>>>11,Vt=G[47]<<24|G[46]>>>8,er=G[46]<<24|G[47]>>>8,At=G[8]<<27|G[9]>>>5,St=G[9]<<27|G[8]>>>5,ze=G[18]<<20|G[19]>>>12,Je=G[19]<<20|G[18]>>>12,Rr=G[29]<<7|G[28]>>>25,kr=G[28]<<7|G[29]>>>25,ut=G[38]<<8|G[39]>>>24,ft=G[39]<<8|G[38]>>>24,De=G[48]<<14|G[49]>>>18,Le=G[49]<<14|G[48]>>>18,G[0]=Ce^~Oe&Ne,G[1]=ke^~xe&Me,G[10]=Ue^~ze&Xe,G[11]=je^~Je&Qe,G[20]=nt^~it&ct,G[21]=at^~ot&dt,G[30]=At^~kt&Lt,G[31]=St^~Bt&Ut,G[40]=tr^~cr&Rr,G[41]=rr^~dr&kr,G[2]=Oe^~Ne&Be,G[3]=xe^~Me&Fe,G[12]=ze^~Xe&Ye,G[13]=Je^~Qe&et,G[22]=it^~ct&ut,G[23]=ot^~dt&ft,G[32]=kt^~Lt&$t,G[33]=Bt^~Ut&Ht,G[42]=cr^~Rr&$r,G[43]=dr^~kr&qr,G[4]=Ne^~Be&De,G[5]=Me^~Fe&Le,G[14]=Xe^~Ye&tt,G[15]=Qe^~et&rt,G[24]=ct^~ut&yt,G[25]=dt^~ft&wt,G[34]=Lt^~$t&Vt,G[35]=Ut^~Ht&er,G[44]=Rr^~$r&Hr,G[45]=kr^~qr&Vr,G[6]=Be^~De&Ce,G[7]=Fe^~Le&ke,G[16]=Ye^~tt&Ue,G[17]=et^~rt&je,G[26]=ut^~yt&nt,G[27]=ft^~wt&at,G[36]=$t^~Vt&At,G[37]=Ht^~er&St,G[46]=$r^~Hr&tr,G[47]=qr^~Vr&rr,G[8]=De^~Ce&Oe,G[9]=Le^~ke&xe,G[18]=tt^~Ue&ze,G[19]=rt^~je&Je,G[28]=yt^~nt&it,G[29]=wt^~at&ot,G[38]=Vt^~At&kt,G[39]=er^~St&Bt,G[48]=Hr^~tr&cr,G[49]=Vr^~rr&dr,G[0]^=_e[ue],G[1]^=_e[ue+1]};if(he)G.exports=ke;else for(xe=0;xe<Oe.length;++xe)ue[Oe[xe]]=ke[Oe[xe]]}()}(Xa);var Qa=getDefaultExportFromCjs$1(Xa.exports);let Za=!1,Ya=!1;const ei={debug:1,default:2,info:2,warning:3,error:4,off:5};let ti=ei.default,ri=null;const ni=function _checkNormalize$1(){try{const G=[];if(["NFD","NFC","NFKD","NFKC"].forEach((K=>{try{if("test"!=="test".normalize(K))throw new Error("bad normalize")}catch(ne){G.push(K)}})),G.length)throw new Error("missing "+G.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(G){return G.message}return null}();var ai,ii;!function(G){G.DEBUG="DEBUG",G.INFO="INFO",G.WARNING="WARNING",G.ERROR="ERROR",G.OFF="OFF"}(ai||(ai={})),function(G){G.UNKNOWN_ERROR="UNKNOWN_ERROR",G.NOT_IMPLEMENTED="NOT_IMPLEMENTED",G.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",G.NETWORK_ERROR="NETWORK_ERROR",G.SERVER_ERROR="SERVER_ERROR",G.TIMEOUT="TIMEOUT",G.BUFFER_OVERRUN="BUFFER_OVERRUN",G.NUMERIC_FAULT="NUMERIC_FAULT",G.MISSING_NEW="MISSING_NEW",G.INVALID_ARGUMENT="INVALID_ARGUMENT",G.MISSING_ARGUMENT="MISSING_ARGUMENT",G.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",G.CALL_EXCEPTION="CALL_EXCEPTION",G.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",G.NONCE_EXPIRED="NONCE_EXPIRED",G.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",G.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",G.TRANSACTION_REPLACED="TRANSACTION_REPLACED",G.ACTION_REJECTED="ACTION_REJECTED"}(ii||(ii={}));const si="0123456789abcdef";let oi=class Logger{constructor(G){Object.defineProperty(this,"version",{enumerable:!0,value:G,writable:!1})}_log(G,K){const ne=G.toLowerCase();null==ei[ne]&&this.throwArgumentError("invalid log level name","logLevel",G),ti>ei[ne]||console.log.apply(console,K)}debug(...G){this._log(Logger.levels.DEBUG,G)}info(...G){this._log(Logger.levels.INFO,G)}warn(...G){this._log(Logger.levels.WARNING,G)}makeError(G,K,ne){if(Ya)return this.makeError("censored error",K,{});K||(K=Logger.errors.UNKNOWN_ERROR),ne||(ne={});const ue=[];Object.keys(ne).forEach((G=>{const K=ne[G];try{if(K instanceof Uint8Array){let ne="";for(let G=0;G<K.length;G++)ne+=si[K[G]>>4],ne+=si[15&K[G]];ue.push(G+"=Uint8Array(0x"+ne+")")}else ue.push(G+"="+JSON.stringify(K))}catch(K){ue.push(G+"="+JSON.stringify(ne[G].toString()))}})),ue.push(`code=${K}`),ue.push(`version=${this.version}`);const pe=G;let he="";switch(K){case ii.NUMERIC_FAULT:{he="NUMERIC_FAULT";const K=G;switch(K){case"overflow":case"underflow":case"division-by-zero":he+="-"+K;break;case"negative-power":case"negative-width":he+="-unsupported";break;case"unbound-bitwise-result":he+="-unbound-result"}break}case ii.CALL_EXCEPTION:case ii.INSUFFICIENT_FUNDS:case ii.MISSING_NEW:case ii.NONCE_EXPIRED:case ii.REPLACEMENT_UNDERPRICED:case ii.TRANSACTION_REPLACED:case ii.UNPREDICTABLE_GAS_LIMIT:he=K}he&&(G+=" [ See: https://links.ethers.org/v5-errors-"+he+" ]"),ue.length&&(G+=" ("+ue.join(", ")+")");const ye=new Error(G);return ye.reason=pe,ye.code=K,Object.keys(ne).forEach((function(G){ye[G]=ne[G]})),ye}throwError(G,K,ne){throw this.makeError(G,K,ne)}throwArgumentError(G,K,ne){return this.throwError(G,Logger.errors.INVALID_ARGUMENT,{argument:K,value:ne})}assert(G,K,ne,ue){G||this.throwError(K,ne,ue)}assertArgument(G,K,ne,ue){G||this.throwArgumentError(K,ne,ue)}checkNormalize(G){ni&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ni})}checkSafeUint53(G,K){"number"==typeof G&&(null==K&&(K="value not safe"),(G<0||G>=9007199254740991)&&this.throwError(K,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:G}),G%1&&this.throwError(K,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:G}))}checkArgumentCount(G,K,ne){ne=ne?": "+ne:"",G<K&&this.throwError("missing argument"+ne,Logger.errors.MISSING_ARGUMENT,{count:G,expectedCount:K}),G>K&&this.throwError("too many arguments"+ne,Logger.errors.UNEXPECTED_ARGUMENT,{count:G,expectedCount:K})}checkNew(G,K){G!==Object&&null!=G||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:K.name})}checkAbstract(G,K){G===K?this.throwError("cannot instantiate abstract class "+JSON.stringify(K.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:G.name,operation:"new"}):G!==Object&&null!=G||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:K.name})}static globalLogger(){return ri||(ri=new Logger("logger/5.7.0")),ri}static setCensorship(G,K){if(!G&&K&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Za){if(!G)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Ya=!!G,Za=!!K}static setLogLevel(G){const K=ei[G.toLowerCase()];null!=K?ti=K:Logger.globalLogger().warn("invalid log level - "+G)}static from(G){return new Logger(G)}};oi.errors=ii,oi.levels=ai;const ci=new oi("bytes/5.7.0");function isHexable$1(G){return!!G.toHexString}function addSlice$1(G){return G.slice||(G.slice=function(){const K=Array.prototype.slice.call(arguments);return addSlice$1(new Uint8Array(Array.prototype.slice.apply(G,K)))}),G}function isBytesLike$2(G){return isHexString$4(G)&&!(G.length%2)||isBytes$1(G)}function isInteger$1(G){return"number"==typeof G&&G==G&&G%1==0}function isBytes$1(G){if(null==G)return!1;if(G.constructor===Uint8Array)return!0;if("string"==typeof G)return!1;if(!isInteger$1(G.length)||G.length<0)return!1;for(let K=0;K<G.length;K++){const ne=G[K];if(!isInteger$1(ne)||ne<0||ne>=256)return!1}return!0}function arrayify$1(G,K){if(K||(K={}),"number"==typeof G){ci.checkSafeUint53(G,"invalid arrayify value");const K=[];for(;G;)K.unshift(255&G),G=parseInt(String(G/256));return 0===K.length&&K.push(0),addSlice$1(new Uint8Array(K))}if(K.allowMissingPrefix&&"string"==typeof G&&"0x"!==G.substring(0,2)&&(G="0x"+G),isHexable$1(G)&&(G=G.toHexString()),isHexString$4(G)){let ne=G.substring(2);ne.length%2&&("left"===K.hexPad?ne="0"+ne:"right"===K.hexPad?ne+="0":ci.throwArgumentError("hex data is odd-length","value",G));const ue=[];for(let G=0;G<ne.length;G+=2)ue.push(parseInt(ne.substring(G,G+2),16));return addSlice$1(new Uint8Array(ue))}return isBytes$1(G)?addSlice$1(new Uint8Array(G)):ci.throwArgumentError("invalid arrayify value","value",G)}function concat$2(G){const K=G.map((G=>arrayify$1(G))),ne=K.reduce(((G,K)=>G+K.length),0),ue=new Uint8Array(ne);return K.reduce(((G,K)=>(ue.set(K,G),G+K.length)),0),addSlice$1(ue)}function stripZeros$1(G){let K=arrayify$1(G);if(0===K.length)return K;let ne=0;for(;ne<K.length&&0===K[ne];)ne++;return ne&&(K=K.slice(ne)),K}function zeroPad$2(G,K){(G=arrayify$1(G)).length>K&&ci.throwArgumentError("value out of range","value",arguments[0]);const ne=new Uint8Array(K);return ne.set(G,K-G.length),addSlice$1(ne)}function isHexString$4(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(!K||G.length===2+2*K)}const di="0123456789abcdef";function hexlify$2(G,K){if(K||(K={}),"number"==typeof G){ci.checkSafeUint53(G,"invalid hexlify value");let K="";for(;G;)K=di[15&G]+K,G=Math.floor(G/16);return K.length?(K.length%2&&(K="0"+K),"0x"+K):"0x00"}if("bigint"==typeof G)return(G=G.toString(16)).length%2?"0x0"+G:"0x"+G;if(K.allowMissingPrefix&&"string"==typeof G&&"0x"!==G.substring(0,2)&&(G="0x"+G),isHexable$1(G))return G.toHexString();if(isHexString$4(G))return G.length%2&&("left"===K.hexPad?G="0x0"+G.substring(2):"right"===K.hexPad?G+="0":ci.throwArgumentError("hex data is odd-length","value",G)),G.toLowerCase();if(isBytes$1(G)){let K="0x";for(let ne=0;ne<G.length;ne++){let ue=G[ne];K+=di[(240&ue)>>4]+di[15&ue]}return K}return ci.throwArgumentError("invalid hexlify value","value",G)}function hexDataLength$1(G){if("string"!=typeof G)G=hexlify$2(G);else if(!isHexString$4(G)||G.length%2)return null;return(G.length-2)/2}function hexDataSlice$1(G,K,ne){return"string"!=typeof G?G=hexlify$2(G):(!isHexString$4(G)||G.length%2)&&ci.throwArgumentError("invalid hexData","value",G),K=2+2*K,null!=ne?"0x"+G.substring(K,2+2*ne):"0x"+G.substring(K)}function hexConcat$1(G){let K="0x";return G.forEach((G=>{K+=hexlify$2(G).substring(2)})),K}function hexValue$1(G){const K=hexStripZeros$1(hexlify$2(G,{hexPad:"left"}));return"0x"===K?"0x0":K}function hexStripZeros$1(G){"string"!=typeof G&&(G=hexlify$2(G)),isHexString$4(G)||ci.throwArgumentError("invalid hex string","value",G),G=G.substring(2);let K=0;for(;K<G.length&&"0"===G[K];)K++;return"0x"+G.substring(K)}function hexZeroPad$1(G,K){for("string"!=typeof G?G=hexlify$2(G):isHexString$4(G)||ci.throwArgumentError("invalid hex string","value",G),G.length>2*K+2&&ci.throwArgumentError("value out of range","value",arguments[1]);G.length<2*K+2;)G="0x0"+G.substring(2);return G}function splitSignature(G){const K={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike$2(G)){let ne=arrayify$1(G);64===ne.length?(K.v=27+(ne[32]>>7),ne[32]&=127,K.r=hexlify$2(ne.slice(0,32)),K.s=hexlify$2(ne.slice(32,64))):65===ne.length?(K.r=hexlify$2(ne.slice(0,32)),K.s=hexlify$2(ne.slice(32,64)),K.v=ne[64]):ci.throwArgumentError("invalid signature string","signature",G),K.v<27&&(0===K.v||1===K.v?K.v+=27:ci.throwArgumentError("signature invalid v byte","signature",G)),K.recoveryParam=1-K.v%2,K.recoveryParam&&(ne[32]|=128),K._vs=hexlify$2(ne.slice(32,64))}else{if(K.r=G.r,K.s=G.s,K.v=G.v,K.recoveryParam=G.recoveryParam,K._vs=G._vs,null!=K._vs){const ne=zeroPad$2(arrayify$1(K._vs),32);K._vs=hexlify$2(ne);const ue=ne[0]>=128?1:0;null==K.recoveryParam?K.recoveryParam=ue:K.recoveryParam!==ue&&ci.throwArgumentError("signature recoveryParam mismatch _vs","signature",G),ne[0]&=127;const pe=hexlify$2(ne);null==K.s?K.s=pe:K.s!==pe&&ci.throwArgumentError("signature v mismatch _vs","signature",G)}if(null==K.recoveryParam)null==K.v?ci.throwArgumentError("signature missing v and recoveryParam","signature",G):0===K.v||1===K.v?K.recoveryParam=K.v:K.recoveryParam=1-K.v%2;else if(null==K.v)K.v=27+K.recoveryParam;else{const ne=0===K.v||1===K.v?K.v:1-K.v%2;K.recoveryParam!==ne&&ci.throwArgumentError("signature recoveryParam mismatch v","signature",G)}null!=K.r&&isHexString$4(K.r)?K.r=hexZeroPad$1(K.r,32):ci.throwArgumentError("signature missing or invalid r","signature",G),null!=K.s&&isHexString$4(K.s)?K.s=hexZeroPad$1(K.s,32):ci.throwArgumentError("signature missing or invalid s","signature",G);const ne=arrayify$1(K.s);ne[0]>=128&&ci.throwArgumentError("signature s out of range","signature",G),K.recoveryParam&&(ne[0]|=128);const ue=hexlify$2(ne);K._vs&&(isHexString$4(K._vs)||ci.throwArgumentError("signature invalid _vs","signature",G),K._vs=hexZeroPad$1(K._vs,32)),null==K._vs?K._vs=ue:K._vs!==ue&&ci.throwArgumentError("signature _vs mismatch v and s","signature",G)}return K.yParityAndS=K._vs,K.compact=K.r+K.yParityAndS.substring(2),K}function keccak256$3(G){return"0x"+Qa.keccak_256(arrayify$1(G))}const ui="0x0000000000000000000000000000000000000000";var fi={exports:{}},li="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},pi=[],hi=[],yi="undefined"!=typeof Uint8Array?Uint8Array:Array,mi=!1;function init$2(){mi=!0;for(var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=0;K<64;++K)pi[K]=G[K],hi[G.charCodeAt(K)]=K;hi["-".charCodeAt(0)]=62,hi["_".charCodeAt(0)]=63}function encodeChunk(G,K,ne){for(var ue,pe,he=[],ye=K;ye<ne;ye+=3)ue=(G[ye]<<16)+(G[ye+1]<<8)+G[ye+2],he.push(pi[(pe=ue)>>18&63]+pi[pe>>12&63]+pi[pe>>6&63]+pi[63&pe]);return he.join("")}function fromByteArray(G){var K;mi||init$2();for(var ne=G.length,ue=ne%3,pe="",he=[],ye=16383,me=0,be=ne-ue;me<be;me+=ye)he.push(encodeChunk(G,me,me+ye>be?be:me+ye));return 1===ue?(K=G[ne-1],pe+=pi[K>>2],pe+=pi[K<<4&63],pe+="=="):2===ue&&(K=(G[ne-2]<<8)+G[ne-1],pe+=pi[K>>10],pe+=pi[K>>4&63],pe+=pi[K<<2&63],pe+="="),he.push(pe),he.join("")}function read(G,K,ne,ue,pe){var he,ye,me=8*pe-ue-1,be=(1<<me)-1,ve=be>>1,_e=-7,Te=ne?pe-1:0,Ee=ne?-1:1,Pe=G[K+Te];for(Te+=Ee,he=Pe&(1<<-_e)-1,Pe>>=-_e,_e+=me;_e>0;he=256*he+G[K+Te],Te+=Ee,_e-=8);for(ye=he&(1<<-_e)-1,he>>=-_e,_e+=ue;_e>0;ye=256*ye+G[K+Te],Te+=Ee,_e-=8);if(0===he)he=1-ve;else{if(he===be)return ye?NaN:1/0*(Pe?-1:1);ye+=Math.pow(2,ue),he-=ve}return(Pe?-1:1)*ye*Math.pow(2,he-ue)}function write(G,K,ne,ue,pe,he){var ye,me,be,ve=8*he-pe-1,_e=(1<<ve)-1,Te=_e>>1,Ee=23===pe?Math.pow(2,-24)-Math.pow(2,-77):0,Pe=ue?0:he-1,Se=ue?1:-1,Ce=K<0||0===K&&1/K<0?1:0;for(K=Math.abs(K),isNaN(K)||K===1/0?(me=isNaN(K)?1:0,ye=_e):(ye=Math.floor(Math.log(K)/Math.LN2),K*(be=Math.pow(2,-ye))<1&&(ye--,be*=2),(K+=ye+Te>=1?Ee/be:Ee*Math.pow(2,1-Te))*be>=2&&(ye++,be/=2),ye+Te>=_e?(me=0,ye=_e):ye+Te>=1?(me=(K*be-1)*Math.pow(2,pe),ye+=Te):(me=K*Math.pow(2,Te-1)*Math.pow(2,pe),ye=0));pe>=8;G[ne+Pe]=255&me,Pe+=Se,me/=256,pe-=8);for(ye=ye<<pe|me,ve+=pe;ve>0;G[ne+Pe]=255&ye,Pe+=Se,ye/=256,ve-=8);G[ne+Pe-Se]|=128*Ce}var bi={}.toString,gi=Array.isArray||function(G){return"[object Array]"==bi.call(G)};Buffer$h.TYPED_ARRAY_SUPPORT=void 0===li.TYPED_ARRAY_SUPPORT||li.TYPED_ARRAY_SUPPORT;var vi=kMaxLength();function kMaxLength(){return Buffer$h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(G,K){if(kMaxLength()<K)throw new RangeError("Invalid typed array length");return Buffer$h.TYPED_ARRAY_SUPPORT?(G=new Uint8Array(K)).__proto__=Buffer$h.prototype:(null===G&&(G=new Buffer$h(K)),G.length=K),G}function Buffer$h(G,K,ne){if(!(Buffer$h.TYPED_ARRAY_SUPPORT||this instanceof Buffer$h))return new Buffer$h(G,K,ne);if("number"==typeof G){if("string"==typeof K)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,G)}return from(this,G,K,ne)}function from(G,K,ne,ue){if("number"==typeof K)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&K instanceof ArrayBuffer?function fromArrayBuffer(G,K,ne,ue){if(K.byteLength,ne<0||K.byteLength<ne)throw new RangeError("'offset' is out of bounds");if(K.byteLength<ne+(ue||0))throw new RangeError("'length' is out of bounds");K=void 0===ne&&void 0===ue?new Uint8Array(K):void 0===ue?new Uint8Array(K,ne):new Uint8Array(K,ne,ue);Buffer$h.TYPED_ARRAY_SUPPORT?(G=K).__proto__=Buffer$h.prototype:G=fromArrayLike(G,K);return G}(G,K,ne,ue):"string"==typeof K?function fromString(G,K,ne){"string"==typeof ne&&""!==ne||(ne="utf8");if(!Buffer$h.isEncoding(ne))throw new TypeError('"encoding" must be a valid string encoding');var ue=0|byteLength(K,ne);G=createBuffer(G,ue);var pe=G.write(K,ne);pe!==ue&&(G=G.slice(0,pe));return G}(G,K,ne):function fromObject(G,K){if(internalIsBuffer(K)){var ne=0|checked(K.length);return 0===(G=createBuffer(G,ne)).length||K.copy(G,0,0,ne),G}if(K){if("undefined"!=typeof ArrayBuffer&&K.buffer instanceof ArrayBuffer||"length"in K)return"number"!=typeof K.length||function isnan(G){return G!=G}(K.length)?createBuffer(G,0):fromArrayLike(G,K);if("Buffer"===K.type&&gi(K.data))return fromArrayLike(G,K.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(G,K)}function assertSize(G){if("number"!=typeof G)throw new TypeError('"size" argument must be a number');if(G<0)throw new RangeError('"size" argument must not be negative')}function allocUnsafe(G,K){if(assertSize(K),G=createBuffer(G,K<0?0:0|checked(K)),!Buffer$h.TYPED_ARRAY_SUPPORT)for(var ne=0;ne<K;++ne)G[ne]=0;return G}function fromArrayLike(G,K){var ne=K.length<0?0:0|checked(K.length);G=createBuffer(G,ne);for(var ue=0;ue<ne;ue+=1)G[ue]=255&K[ue];return G}function checked(G){if(G>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|G}function internalIsBuffer(G){return!(null==G||!G._isBuffer)}function byteLength(G,K){if(internalIsBuffer(G))return G.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(G)||G instanceof ArrayBuffer))return G.byteLength;"string"!=typeof G&&(G=""+G);var ne=G.length;if(0===ne)return 0;for(var ue=!1;;)switch(K){case"ascii":case"latin1":case"binary":return ne;case"utf8":case"utf-8":case void 0:return utf8ToBytes$3(G).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ne;case"hex":return ne>>>1;case"base64":return base64ToBytes(G).length;default:if(ue)return utf8ToBytes$3(G).length;K=(""+K).toLowerCase(),ue=!0}}function slowToString(G,K,ne){var ue=!1;if((void 0===K||K<0)&&(K=0),K>this.length)return"";if((void 0===ne||ne>this.length)&&(ne=this.length),ne<=0)return"";if((ne>>>=0)<=(K>>>=0))return"";for(G||(G="utf8");;)switch(G){case"hex":return hexSlice(this,K,ne);case"utf8":case"utf-8":return utf8Slice(this,K,ne);case"ascii":return asciiSlice(this,K,ne);case"latin1":case"binary":return latin1Slice(this,K,ne);case"base64":return base64Slice(this,K,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,K,ne);default:if(ue)throw new TypeError("Unknown encoding: "+G);G=(G+"").toLowerCase(),ue=!0}}function swap$1(G,K,ne){var ue=G[K];G[K]=G[ne],G[ne]=ue}function bidirectionalIndexOf(G,K,ne,ue,pe){if(0===G.length)return-1;if("string"==typeof ne?(ue=ne,ne=0):ne>2147483647?ne=2147483647:ne<-2147483648&&(ne=-2147483648),ne=+ne,isNaN(ne)&&(ne=pe?0:G.length-1),ne<0&&(ne=G.length+ne),ne>=G.length){if(pe)return-1;ne=G.length-1}else if(ne<0){if(!pe)return-1;ne=0}if("string"==typeof K&&(K=Buffer$h.from(K,ue)),internalIsBuffer(K))return 0===K.length?-1:arrayIndexOf(G,K,ne,ue,pe);if("number"==typeof K)return K&=255,Buffer$h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?pe?Uint8Array.prototype.indexOf.call(G,K,ne):Uint8Array.prototype.lastIndexOf.call(G,K,ne):arrayIndexOf(G,[K],ne,ue,pe);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(G,K,ne,ue,pe){var he,ye=1,me=G.length,be=K.length;if(void 0!==ue&&("ucs2"===(ue=String(ue).toLowerCase())||"ucs-2"===ue||"utf16le"===ue||"utf-16le"===ue)){if(G.length<2||K.length<2)return-1;ye=2,me/=2,be/=2,ne/=2}function read(G,K){return 1===ye?G[K]:G.readUInt16BE(K*ye)}if(pe){var ve=-1;for(he=ne;he<me;he++)if(read(G,he)===read(K,-1===ve?0:he-ve)){if(-1===ve&&(ve=he),he-ve+1===be)return ve*ye}else-1!==ve&&(he-=he-ve),ve=-1}else for(ne+be>me&&(ne=me-be),he=ne;he>=0;he--){for(var _e=!0,Te=0;Te<be;Te++)if(read(G,he+Te)!==read(K,Te)){_e=!1;break}if(_e)return he}return-1}function hexWrite(G,K,ne,ue){ne=Number(ne)||0;var pe=G.length-ne;ue?(ue=Number(ue))>pe&&(ue=pe):ue=pe;var he=K.length;if(he%2!=0)throw new TypeError("Invalid hex string");ue>he/2&&(ue=he/2);for(var ye=0;ye<ue;++ye){var me=parseInt(K.substr(2*ye,2),16);if(isNaN(me))return ye;G[ne+ye]=me}return ye}function utf8Write(G,K,ne,ue){return blitBuffer(utf8ToBytes$3(K,G.length-ne),G,ne,ue)}function asciiWrite(G,K,ne,ue){return blitBuffer(function asciiToBytes(G){for(var K=[],ne=0;ne<G.length;++ne)K.push(255&G.charCodeAt(ne));return K}(K),G,ne,ue)}function latin1Write(G,K,ne,ue){return asciiWrite(G,K,ne,ue)}function base64Write(G,K,ne,ue){return blitBuffer(base64ToBytes(K),G,ne,ue)}function ucs2Write(G,K,ne,ue){return blitBuffer(function utf16leToBytes(G,K){for(var ne,ue,pe,he=[],ye=0;ye<G.length&&!((K-=2)<0);++ye)ue=(ne=G.charCodeAt(ye))>>8,pe=ne%256,he.push(pe),he.push(ue);return he}(K,G.length-ne),G,ne,ue)}function base64Slice(G,K,ne){return 0===K&&ne===G.length?fromByteArray(G):fromByteArray(G.slice(K,ne))}function utf8Slice(G,K,ne){ne=Math.min(G.length,ne);for(var ue=[],pe=K;pe<ne;){var he,ye,me,be,ve=G[pe],_e=null,Te=ve>239?4:ve>223?3:ve>191?2:1;if(pe+Te<=ne)switch(Te){case 1:ve<128&&(_e=ve);break;case 2:128==(192&(he=G[pe+1]))&&(be=(31&ve)<<6|63&he)>127&&(_e=be);break;case 3:he=G[pe+1],ye=G[pe+2],128==(192&he)&&128==(192&ye)&&(be=(15&ve)<<12|(63&he)<<6|63&ye)>2047&&(be<55296||be>57343)&&(_e=be);break;case 4:he=G[pe+1],ye=G[pe+2],me=G[pe+3],128==(192&he)&&128==(192&ye)&&128==(192&me)&&(be=(15&ve)<<18|(63&he)<<12|(63&ye)<<6|63&me)>65535&&be<1114112&&(_e=be)}null===_e?(_e=65533,Te=1):_e>65535&&(_e-=65536,ue.push(_e>>>10&1023|55296),_e=56320|1023&_e),ue.push(_e),pe+=Te}return function decodeCodePointsArray(G){var K=G.length;if(K<=wi)return String.fromCharCode.apply(String,G);var ne="",ue=0;for(;ue<K;)ne+=String.fromCharCode.apply(String,G.slice(ue,ue+=wi));return ne}(ue)}Buffer$h.poolSize=8192,Buffer$h._augment=function(G){return G.__proto__=Buffer$h.prototype,G},Buffer$h.from=function(G,K,ne){return from(null,G,K,ne)},Buffer$h.TYPED_ARRAY_SUPPORT&&(Buffer$h.prototype.__proto__=Uint8Array.prototype,Buffer$h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer$h[Symbol.species]),Buffer$h.alloc=function(G,K,ne){return function alloc(G,K,ne,ue){return assertSize(K),K<=0?createBuffer(G,K):void 0!==ne?"string"==typeof ue?createBuffer(G,K).fill(ne,ue):createBuffer(G,K).fill(ne):createBuffer(G,K)}(null,G,K,ne)},Buffer$h.allocUnsafe=function(G){return allocUnsafe(null,G)},Buffer$h.allocUnsafeSlow=function(G){return allocUnsafe(null,G)},Buffer$h.isBuffer=isBuffer$3,Buffer$h.compare=function compare(G,K){if(!internalIsBuffer(G)||!internalIsBuffer(K))throw new TypeError("Arguments must be Buffers");if(G===K)return 0;for(var ne=G.length,ue=K.length,pe=0,he=Math.min(ne,ue);pe<he;++pe)if(G[pe]!==K[pe]){ne=G[pe],ue=K[pe];break}return ne<ue?-1:ue<ne?1:0},Buffer$h.isEncoding=function isEncoding(G){switch(String(G).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer$h.concat=function concat(G,K){if(!gi(G))throw new TypeError('"list" argument must be an Array of Buffers');if(0===G.length)return Buffer$h.alloc(0);var ne;if(void 0===K)for(K=0,ne=0;ne<G.length;++ne)K+=G[ne].length;var ue=Buffer$h.allocUnsafe(K),pe=0;for(ne=0;ne<G.length;++ne){var he=G[ne];if(!internalIsBuffer(he))throw new TypeError('"list" argument must be an Array of Buffers');he.copy(ue,pe),pe+=he.length}return ue},Buffer$h.byteLength=byteLength,Buffer$h.prototype._isBuffer=!0,Buffer$h.prototype.swap16=function swap16(){var G=this.length;if(G%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var K=0;K<G;K+=2)swap$1(this,K,K+1);return this},Buffer$h.prototype.swap32=function swap32(){var G=this.length;if(G%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var K=0;K<G;K+=4)swap$1(this,K,K+3),swap$1(this,K+1,K+2);return this},Buffer$h.prototype.swap64=function swap64(){var G=this.length;if(G%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var K=0;K<G;K+=8)swap$1(this,K,K+7),swap$1(this,K+1,K+6),swap$1(this,K+2,K+5),swap$1(this,K+3,K+4);return this},Buffer$h.prototype.toString=function toString(){var G=0|this.length;return 0===G?"":0===arguments.length?utf8Slice(this,0,G):slowToString.apply(this,arguments)},Buffer$h.prototype.equals=function equals(G){if(!internalIsBuffer(G))throw new TypeError("Argument must be a Buffer");return this===G||0===Buffer$h.compare(this,G)},Buffer$h.prototype.inspect=function inspect(){var G="";return this.length>0&&(G=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(G+=" ... ")),"<Buffer "+G+">"},Buffer$h.prototype.compare=function compare(G,K,ne,ue,pe){if(!internalIsBuffer(G))throw new TypeError("Argument must be a Buffer");if(void 0===K&&(K=0),void 0===ne&&(ne=G?G.length:0),void 0===ue&&(ue=0),void 0===pe&&(pe=this.length),K<0||ne>G.length||ue<0||pe>this.length)throw new RangeError("out of range index");if(ue>=pe&&K>=ne)return 0;if(ue>=pe)return-1;if(K>=ne)return 1;if(this===G)return 0;for(var he=(pe>>>=0)-(ue>>>=0),ye=(ne>>>=0)-(K>>>=0),me=Math.min(he,ye),be=this.slice(ue,pe),ve=G.slice(K,ne),_e=0;_e<me;++_e)if(be[_e]!==ve[_e]){he=be[_e],ye=ve[_e];break}return he<ye?-1:ye<he?1:0},Buffer$h.prototype.includes=function includes(G,K,ne){return-1!==this.indexOf(G,K,ne)},Buffer$h.prototype.indexOf=function indexOf(G,K,ne){return bidirectionalIndexOf(this,G,K,ne,!0)},Buffer$h.prototype.lastIndexOf=function lastIndexOf(G,K,ne){return bidirectionalIndexOf(this,G,K,ne,!1)},Buffer$h.prototype.write=function write(G,K,ne,ue){if(void 0===K)ue="utf8",ne=this.length,K=0;else if(void 0===ne&&"string"==typeof K)ue=K,ne=this.length,K=0;else{if(!isFinite(K))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");K|=0,isFinite(ne)?(ne|=0,void 0===ue&&(ue="utf8")):(ue=ne,ne=void 0)}var pe=this.length-K;if((void 0===ne||ne>pe)&&(ne=pe),G.length>0&&(ne<0||K<0)||K>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");for(var he=!1;;)switch(ue){case"hex":return hexWrite(this,G,K,ne);case"utf8":case"utf-8":return utf8Write(this,G,K,ne);case"ascii":return asciiWrite(this,G,K,ne);case"latin1":case"binary":return latin1Write(this,G,K,ne);case"base64":return base64Write(this,G,K,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,G,K,ne);default:if(he)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),he=!0}},Buffer$h.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var wi=4096;function asciiSlice(G,K,ne){var ue="";ne=Math.min(G.length,ne);for(var pe=K;pe<ne;++pe)ue+=String.fromCharCode(127&G[pe]);return ue}function latin1Slice(G,K,ne){var ue="";ne=Math.min(G.length,ne);for(var pe=K;pe<ne;++pe)ue+=String.fromCharCode(G[pe]);return ue}function hexSlice(G,K,ne){var ue=G.length;(!K||K<0)&&(K=0),(!ne||ne<0||ne>ue)&&(ne=ue);for(var pe="",he=K;he<ne;++he)pe+=toHex$5(G[he]);return pe}function utf16leSlice(G,K,ne){for(var ue=G.slice(K,ne),pe="",he=0;he<ue.length;he+=2)pe+=String.fromCharCode(ue[he]+256*ue[he+1]);return pe}function checkOffset(G,K,ne){if(G%1!=0||G<0)throw new RangeError("offset is not uint");if(G+K>ne)throw new RangeError("Trying to access beyond buffer length")}function checkInt(G,K,ne,ue,pe,he){if(!internalIsBuffer(G))throw new TypeError('"buffer" argument must be a Buffer instance');if(K>pe||K<he)throw new RangeError('"value" argument is out of bounds');if(ne+ue>G.length)throw new RangeError("Index out of range")}function objectWriteUInt16(G,K,ne,ue){K<0&&(K=65535+K+1);for(var pe=0,he=Math.min(G.length-ne,2);pe<he;++pe)G[ne+pe]=(K&255<<8*(ue?pe:1-pe))>>>8*(ue?pe:1-pe)}function objectWriteUInt32(G,K,ne,ue){K<0&&(K=4294967295+K+1);for(var pe=0,he=Math.min(G.length-ne,4);pe<he;++pe)G[ne+pe]=K>>>8*(ue?pe:3-pe)&255}function checkIEEE754(G,K,ne,ue,pe,he){if(ne+ue>G.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("Index out of range")}function writeFloat(G,K,ne,ue,pe){return pe||checkIEEE754(G,0,ne,4),write(G,K,ne,ue,23,4),ne+4}function writeDouble(G,K,ne,ue,pe){return pe||checkIEEE754(G,0,ne,8),write(G,K,ne,ue,52,8),ne+8}Buffer$h.prototype.slice=function slice(G,K){var ne,ue=this.length;if((G=~~G)<0?(G+=ue)<0&&(G=0):G>ue&&(G=ue),(K=void 0===K?ue:~~K)<0?(K+=ue)<0&&(K=0):K>ue&&(K=ue),K<G&&(K=G),Buffer$h.TYPED_ARRAY_SUPPORT)(ne=this.subarray(G,K)).__proto__=Buffer$h.prototype;else{var pe=K-G;ne=new Buffer$h(pe,void 0);for(var he=0;he<pe;++he)ne[he]=this[he+G]}return ne},Buffer$h.prototype.readUIntLE=function readUIntLE(G,K,ne){G|=0,K|=0,ne||checkOffset(G,K,this.length);for(var ue=this[G],pe=1,he=0;++he<K&&(pe*=256);)ue+=this[G+he]*pe;return ue},Buffer$h.prototype.readUIntBE=function readUIntBE(G,K,ne){G|=0,K|=0,ne||checkOffset(G,K,this.length);for(var ue=this[G+--K],pe=1;K>0&&(pe*=256);)ue+=this[G+--K]*pe;return ue},Buffer$h.prototype.readUInt8=function readUInt8(G,K){return K||checkOffset(G,1,this.length),this[G]},Buffer$h.prototype.readUInt16LE=function readUInt16LE(G,K){return K||checkOffset(G,2,this.length),this[G]|this[G+1]<<8},Buffer$h.prototype.readUInt16BE=function readUInt16BE(G,K){return K||checkOffset(G,2,this.length),this[G]<<8|this[G+1]},Buffer$h.prototype.readUInt32LE=function readUInt32LE(G,K){return K||checkOffset(G,4,this.length),(this[G]|this[G+1]<<8|this[G+2]<<16)+16777216*this[G+3]},Buffer$h.prototype.readUInt32BE=function readUInt32BE(G,K){return K||checkOffset(G,4,this.length),16777216*this[G]+(this[G+1]<<16|this[G+2]<<8|this[G+3])},Buffer$h.prototype.readIntLE=function readIntLE(G,K,ne){G|=0,K|=0,ne||checkOffset(G,K,this.length);for(var ue=this[G],pe=1,he=0;++he<K&&(pe*=256);)ue+=this[G+he]*pe;return ue>=(pe*=128)&&(ue-=Math.pow(2,8*K)),ue},Buffer$h.prototype.readIntBE=function readIntBE(G,K,ne){G|=0,K|=0,ne||checkOffset(G,K,this.length);for(var ue=K,pe=1,he=this[G+--ue];ue>0&&(pe*=256);)he+=this[G+--ue]*pe;return he>=(pe*=128)&&(he-=Math.pow(2,8*K)),he},Buffer$h.prototype.readInt8=function readInt8(G,K){return K||checkOffset(G,1,this.length),128&this[G]?-1*(255-this[G]+1):this[G]},Buffer$h.prototype.readInt16LE=function readInt16LE(G,K){K||checkOffset(G,2,this.length);var ne=this[G]|this[G+1]<<8;return 32768&ne?4294901760|ne:ne},Buffer$h.prototype.readInt16BE=function readInt16BE(G,K){K||checkOffset(G,2,this.length);var ne=this[G+1]|this[G]<<8;return 32768&ne?4294901760|ne:ne},Buffer$h.prototype.readInt32LE=function readInt32LE(G,K){return K||checkOffset(G,4,this.length),this[G]|this[G+1]<<8|this[G+2]<<16|this[G+3]<<24},Buffer$h.prototype.readInt32BE=function readInt32BE(G,K){return K||checkOffset(G,4,this.length),this[G]<<24|this[G+1]<<16|this[G+2]<<8|this[G+3]},Buffer$h.prototype.readFloatLE=function readFloatLE(G,K){return K||checkOffset(G,4,this.length),read(this,G,!0,23,4)},Buffer$h.prototype.readFloatBE=function readFloatBE(G,K){return K||checkOffset(G,4,this.length),read(this,G,!1,23,4)},Buffer$h.prototype.readDoubleLE=function readDoubleLE(G,K){return K||checkOffset(G,8,this.length),read(this,G,!0,52,8)},Buffer$h.prototype.readDoubleBE=function readDoubleBE(G,K){return K||checkOffset(G,8,this.length),read(this,G,!1,52,8)},Buffer$h.prototype.writeUIntLE=function writeUIntLE(G,K,ne,ue){(G=+G,K|=0,ne|=0,ue)||checkInt(this,G,K,ne,Math.pow(2,8*ne)-1,0);var pe=1,he=0;for(this[K]=255&G;++he<ne&&(pe*=256);)this[K+he]=G/pe&255;return K+ne},Buffer$h.prototype.writeUIntBE=function writeUIntBE(G,K,ne,ue){(G=+G,K|=0,ne|=0,ue)||checkInt(this,G,K,ne,Math.pow(2,8*ne)-1,0);var pe=ne-1,he=1;for(this[K+pe]=255&G;--pe>=0&&(he*=256);)this[K+pe]=G/he&255;return K+ne},Buffer$h.prototype.writeUInt8=function writeUInt8(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,1,255,0),Buffer$h.TYPED_ARRAY_SUPPORT||(G=Math.floor(G)),this[K]=255&G,K+1},Buffer$h.prototype.writeUInt16LE=function writeUInt16LE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,2,65535,0),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=255&G,this[K+1]=G>>>8):objectWriteUInt16(this,G,K,!0),K+2},Buffer$h.prototype.writeUInt16BE=function writeUInt16BE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,2,65535,0),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=G>>>8,this[K+1]=255&G):objectWriteUInt16(this,G,K,!1),K+2},Buffer$h.prototype.writeUInt32LE=function writeUInt32LE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,4,4294967295,0),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K+3]=G>>>24,this[K+2]=G>>>16,this[K+1]=G>>>8,this[K]=255&G):objectWriteUInt32(this,G,K,!0),K+4},Buffer$h.prototype.writeUInt32BE=function writeUInt32BE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,4,4294967295,0),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=G>>>24,this[K+1]=G>>>16,this[K+2]=G>>>8,this[K+3]=255&G):objectWriteUInt32(this,G,K,!1),K+4},Buffer$h.prototype.writeIntLE=function writeIntLE(G,K,ne,ue){if(G=+G,K|=0,!ue){var pe=Math.pow(2,8*ne-1);checkInt(this,G,K,ne,pe-1,-pe)}var he=0,ye=1,me=0;for(this[K]=255&G;++he<ne&&(ye*=256);)G<0&&0===me&&0!==this[K+he-1]&&(me=1),this[K+he]=(G/ye>>0)-me&255;return K+ne},Buffer$h.prototype.writeIntBE=function writeIntBE(G,K,ne,ue){if(G=+G,K|=0,!ue){var pe=Math.pow(2,8*ne-1);checkInt(this,G,K,ne,pe-1,-pe)}var he=ne-1,ye=1,me=0;for(this[K+he]=255&G;--he>=0&&(ye*=256);)G<0&&0===me&&0!==this[K+he+1]&&(me=1),this[K+he]=(G/ye>>0)-me&255;return K+ne},Buffer$h.prototype.writeInt8=function writeInt8(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,1,127,-128),Buffer$h.TYPED_ARRAY_SUPPORT||(G=Math.floor(G)),G<0&&(G=255+G+1),this[K]=255&G,K+1},Buffer$h.prototype.writeInt16LE=function writeInt16LE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,2,32767,-32768),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=255&G,this[K+1]=G>>>8):objectWriteUInt16(this,G,K,!0),K+2},Buffer$h.prototype.writeInt16BE=function writeInt16BE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,2,32767,-32768),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=G>>>8,this[K+1]=255&G):objectWriteUInt16(this,G,K,!1),K+2},Buffer$h.prototype.writeInt32LE=function writeInt32LE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,4,2147483647,-2147483648),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=255&G,this[K+1]=G>>>8,this[K+2]=G>>>16,this[K+3]=G>>>24):objectWriteUInt32(this,G,K,!0),K+4},Buffer$h.prototype.writeInt32BE=function writeInt32BE(G,K,ne){return G=+G,K|=0,ne||checkInt(this,G,K,4,2147483647,-2147483648),G<0&&(G=4294967295+G+1),Buffer$h.TYPED_ARRAY_SUPPORT?(this[K]=G>>>24,this[K+1]=G>>>16,this[K+2]=G>>>8,this[K+3]=255&G):objectWriteUInt32(this,G,K,!1),K+4},Buffer$h.prototype.writeFloatLE=function writeFloatLE(G,K,ne){return writeFloat(this,G,K,!0,ne)},Buffer$h.prototype.writeFloatBE=function writeFloatBE(G,K,ne){return writeFloat(this,G,K,!1,ne)},Buffer$h.prototype.writeDoubleLE=function writeDoubleLE(G,K,ne){return writeDouble(this,G,K,!0,ne)},Buffer$h.prototype.writeDoubleBE=function writeDoubleBE(G,K,ne){return writeDouble(this,G,K,!1,ne)},Buffer$h.prototype.copy=function copy(G,K,ne,ue){if(ne||(ne=0),ue||0===ue||(ue=this.length),K>=G.length&&(K=G.length),K||(K=0),ue>0&&ue<ne&&(ue=ne),ue===ne)return 0;if(0===G.length||0===this.length)return 0;if(K<0)throw new RangeError("targetStart out of bounds");if(ne<0||ne>=this.length)throw new RangeError("sourceStart out of bounds");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),G.length-K<ue-ne&&(ue=G.length-K+ne);var pe,he=ue-ne;if(this===G&&ne<K&&K<ue)for(pe=he-1;pe>=0;--pe)G[pe+K]=this[pe+ne];else if(he<1e3||!Buffer$h.TYPED_ARRAY_SUPPORT)for(pe=0;pe<he;++pe)G[pe+K]=this[pe+ne];else Uint8Array.prototype.set.call(G,this.subarray(ne,ne+he),K);return he},Buffer$h.prototype.fill=function fill(G,K,ne,ue){if("string"==typeof G){if("string"==typeof K?(ue=K,K=0,ne=this.length):"string"==typeof ne&&(ue=ne,ne=this.length),1===G.length){var pe=G.charCodeAt(0);pe<256&&(G=pe)}if(void 0!==ue&&"string"!=typeof ue)throw new TypeError("encoding must be a string");if("string"==typeof ue&&!Buffer$h.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue)}else"number"==typeof G&&(G&=255);if(K<0||this.length<K||this.length<ne)throw new RangeError("Out of range index");if(ne<=K)return this;var he;if(K>>>=0,ne=void 0===ne?this.length:ne>>>0,G||(G=0),"number"==typeof G)for(he=K;he<ne;++he)this[he]=G;else{var ye=internalIsBuffer(G)?G:utf8ToBytes$3(new Buffer$h(G,ue).toString()),me=ye.length;for(he=0;he<ne-K;++he)this[he+K]=ye[he%me]}return this};var _i=/[^+\/0-9A-Za-z-_]/g;function toHex$5(G){return G<16?"0"+G.toString(16):G.toString(16)}function utf8ToBytes$3(G,K){var ne;K=K||1/0;for(var ue=G.length,pe=null,he=[],ye=0;ye<ue;++ye){if((ne=G.charCodeAt(ye))>55295&&ne<57344){if(!pe){if(ne>56319){(K-=3)>-1&&he.push(239,191,189);continue}if(ye+1===ue){(K-=3)>-1&&he.push(239,191,189);continue}pe=ne;continue}if(ne<56320){(K-=3)>-1&&he.push(239,191,189),pe=ne;continue}ne=65536+(pe-55296<<10|ne-56320)}else pe&&(K-=3)>-1&&he.push(239,191,189);if(pe=null,ne<128){if((K-=1)<0)break;he.push(ne)}else if(ne<2048){if((K-=2)<0)break;he.push(ne>>6|192,63&ne|128)}else if(ne<65536){if((K-=3)<0)break;he.push(ne>>12|224,ne>>6&63|128,63&ne|128)}else{if(!(ne<1114112))throw new Error("Invalid code point");if((K-=4)<0)break;he.push(ne>>18|240,ne>>12&63|128,ne>>6&63|128,63&ne|128)}}return he}function base64ToBytes(G){return function toByteArray(G){var K,ne,ue,pe,he,ye;mi||init$2();var me=G.length;if(me%4>0)throw new Error("Invalid string. Length must be a multiple of 4");he="="===G[me-2]?2:"="===G[me-1]?1:0,ye=new yi(3*me/4-he),ue=he>0?me-4:me;var be=0;for(K=0,ne=0;K<ue;K+=4,ne+=3)pe=hi[G.charCodeAt(K)]<<18|hi[G.charCodeAt(K+1)]<<12|hi[G.charCodeAt(K+2)]<<6|hi[G.charCodeAt(K+3)],ye[be++]=pe>>16&255,ye[be++]=pe>>8&255,ye[be++]=255&pe;return 2===he?(pe=hi[G.charCodeAt(K)]<<2|hi[G.charCodeAt(K+1)]>>4,ye[be++]=255&pe):1===he&&(pe=hi[G.charCodeAt(K)]<<10|hi[G.charCodeAt(K+1)]<<4|hi[G.charCodeAt(K+2)]>>2,ye[be++]=pe>>8&255,ye[be++]=255&pe),ye}(function base64clean(G){if((G=function stringtrim(G){return G.trim?G.trim():G.replace(/^\s+|\s+$/g,"")}(G).replace(_i,"")).length<2)return"";for(;G.length%4!=0;)G+="=";return G}(G))}function blitBuffer(G,K,ne,ue){for(var pe=0;pe<ue&&!(pe+ne>=K.length||pe>=G.length);++pe)K[pe+ne]=G[pe];return pe}function isBuffer$3(G){return null!=G&&(!!G._isBuffer||isFastBuffer(G)||function isSlowBuffer(G){return"function"==typeof G.readFloatLE&&"function"==typeof G.slice&&isFastBuffer(G.slice(0,0))}(G))}function isFastBuffer(G){return!!G.constructor&&"function"==typeof G.constructor.isBuffer&&G.constructor.isBuffer(G)}var Ti=getAugmentedNamespace$1(Object.freeze({__proto__:null,Buffer:Buffer$h,INSPECT_MAX_BYTES:50,SlowBuffer:function SlowBuffer(G){return+G!=G&&(G=0),Buffer$h.alloc(+G)},isBuffer:isBuffer$3,kMaxLength:vi}));!function(G){!function(G,K){function assert(G,K){if(!G)throw new Error(K||"Assertion failed")}function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G}function BN(G,K,ne){if(BN.isBN(G))return G;this.negative=0,this.words=null,this.length=0,this.red=null,null!==G&&("le"!==K&&"be"!==K||(ne=K,K=10),this._init(G||0,K||10,ne||"be"))}var ne;"object"==typeof G?G.exports=BN:K.BN=BN,BN.BN=BN,BN.wordSize=26;try{ne="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Ti.Buffer}catch(G){}function parseHex4Bits(G,K){var ne=G.charCodeAt(K);return ne>=48&&ne<=57?ne-48:ne>=65&&ne<=70?ne-55:ne>=97&&ne<=102?ne-87:void assert(!1,"Invalid character in "+G)}function parseHexByte(G,K,ne){var ue=parseHex4Bits(G,ne);return ne-1>=K&&(ue|=parseHex4Bits(G,ne-1)<<4),ue}function parseBase(G,K,ne,ue){for(var pe=0,he=0,ye=Math.min(G.length,ne),me=K;me<ye;me++){var be=G.charCodeAt(me)-48;pe*=ue,he=be>=49?be-49+10:be>=17?be-17+10:be,assert(be>=0&&he<ue,"Invalid character"),pe+=he}return pe}function move(G,K){G.words=K.words,G.length=K.length,G.negative=K.negative,G.red=K.red}if(BN.isBN=function isBN(G){return G instanceof BN||null!==G&&"object"==typeof G&&G.constructor.wordSize===BN.wordSize&&Array.isArray(G.words)},BN.max=function max(G,K){return G.cmp(K)>0?G:K},BN.min=function min(G,K){return G.cmp(K)<0?G:K},BN.prototype._init=function init(G,K,ne){if("number"==typeof G)return this._initNumber(G,K,ne);if("object"==typeof G)return this._initArray(G,K,ne);"hex"===K&&(K=16),assert(K===(0|K)&&K>=2&&K<=36);var ue=0;"-"===(G=G.toString().replace(/\s+/g,""))[0]&&(ue++,this.negative=1),ue<G.length&&(16===K?this._parseHex(G,ue,ne):(this._parseBase(G,K,ue),"le"===ne&&this._initArray(this.toArray(),K,ne)))},BN.prototype._initNumber=function _initNumber(G,K,ne){G<0&&(this.negative=1,G=-G),G<67108864?(this.words=[67108863&G],this.length=1):G<4503599627370496?(this.words=[67108863&G,G/67108864&67108863],this.length=2):(assert(G<9007199254740992),this.words=[67108863&G,G/67108864&67108863,1],this.length=3),"le"===ne&&this._initArray(this.toArray(),K,ne)},BN.prototype._initArray=function _initArray(G,K,ne){if(assert("number"==typeof G.length),G.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(G.length/3),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he,ye=0;if("be"===ne)for(ue=G.length-1,pe=0;ue>=0;ue-=3)he=G[ue]|G[ue-1]<<8|G[ue-2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);else if("le"===ne)for(ue=0,pe=0;ue<G.length;ue+=3)he=G[ue]|G[ue+1]<<8|G[ue+2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);return this._strip()},BN.prototype._parseHex=function _parseHex(G,K,ne){this.length=Math.ceil((G.length-K)/6),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he=0,ye=0;if("be"===ne)for(ue=G.length-1;ue>=K;ue-=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;else for(ue=(G.length-K)%2==0?K+1:K;ue<G.length;ue+=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;this._strip()},BN.prototype._parseBase=function _parseBase(G,K,ne){this.words=[0],this.length=1;for(var ue=0,pe=1;pe<=67108863;pe*=K)ue++;ue--,pe=pe/K|0;for(var he=G.length-ne,ye=he%ue,me=Math.min(he,he-ye)+ne,be=0,ve=ne;ve<me;ve+=ue)be=parseBase(G,ve,ve+ue,K),this.imuln(pe),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be);if(0!==ye){var _e=1;for(be=parseBase(G,ve,G.length,K),ve=0;ve<ye;ve++)_e*=K;this.imuln(_e),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be)}this._strip()},BN.prototype.copy=function copy(G){G.words=new Array(this.length);for(var K=0;K<this.length;K++)G.words[K]=this.words[K];G.length=this.length,G.negative=this.negative,G.red=this.red},BN.prototype._move=function _move(G){move(G,this)},BN.prototype.clone=function clone(){var G=new BN(null);return this.copy(G),G},BN.prototype._expand=function _expand(G){for(;this.length<G;)this.words[this.length++]=0;return this},BN.prototype._strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(G){BN.prototype.inspect=inspect}else BN.prototype.inspect=inspect;function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var ue=["","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"],pe=[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],he=[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];BN.prototype.toString=function toString(G,K){var ne;if(K=0|K||1,16===(G=G||10)||"hex"===G){ne="";for(var ye=0,me=0,be=0;be<this.length;be++){var ve=this.words[be],_e=(16777215&(ve<<ye|me)).toString(16);me=ve>>>24-ye&16777215,(ye+=2)>=26&&(ye-=26,be--),ne=0!==me||be!==this.length-1?ue[6-_e.length]+_e+ne:_e+ne}for(0!==me&&(ne=me.toString(16)+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}if(G===(0|G)&&G>=2&&G<=36){var Te=pe[G],Ee=he[G];ne="";var Pe=this.clone();for(Pe.negative=0;!Pe.isZero();){var Se=Pe.modrn(Ee).toString(G);ne=(Pe=Pe.idivn(Ee)).isZero()?Se+ne:ue[Te-Se.length]+Se+ne}for(this.isZero()&&(ne="0"+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var G=this.words[0];return 2===this.length?G+=67108864*this.words[1]:3===this.length&&1===this.words[2]?G+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-G:G},BN.prototype.toJSON=function toJSON(){return this.toString(16,2)},ne&&(BN.prototype.toBuffer=function toBuffer(G,K){return this.toArrayLike(ne,G,K)}),BN.prototype.toArray=function toArray(G,K){return this.toArrayLike(Array,G,K)};function smallMulTo(G,K,ne){ne.negative=K.negative^G.negative;var ue=G.length+K.length|0;ne.length=ue,ue=ue-1|0;var pe=0|G.words[0],he=0|K.words[0],ye=pe*he,me=67108863&ye,be=ye/67108864|0;ne.words[0]=me;for(var ve=1;ve<ue;ve++){for(var _e=be>>>26,Te=67108863&be,Ee=Math.min(ve,K.length-1),Pe=Math.max(0,ve-G.length+1);Pe<=Ee;Pe++){var Se=ve-Pe|0;_e+=(ye=(pe=0|G.words[Se])*(he=0|K.words[Pe])+Te)/67108864|0,Te=67108863&ye}ne.words[ve]=0|Te,be=0|_e}return 0!==be?ne.words[ve]=0|be:ne.length--,ne._strip()}BN.prototype.toArrayLike=function toArrayLike(G,K,ne){this._strip();var ue=this.byteLength(),pe=ne||Math.max(1,ue);assert(ue<=pe,"byte array longer than desired length"),assert(pe>0,"Requested array length <= 0");var he=function allocate(G,K){return G.allocUnsafe?G.allocUnsafe(K):new G(K)}(G,pe);return this["_toArrayLike"+("le"===K?"LE":"BE")](he,ue),he},BN.prototype._toArrayLikeLE=function _toArrayLikeLE(G,K){for(var ne=0,ue=0,pe=0,he=0;pe<this.length;pe++){var ye=this.words[pe]<<he|ue;G[ne++]=255&ye,ne<G.length&&(G[ne++]=ye>>8&255),ne<G.length&&(G[ne++]=ye>>16&255),6===he?(ne<G.length&&(G[ne++]=ye>>24&255),ue=0,he=0):(ue=ye>>>24,he+=2)}if(ne<G.length)for(G[ne++]=ue;ne<G.length;)G[ne++]=0},BN.prototype._toArrayLikeBE=function _toArrayLikeBE(G,K){for(var ne=G.length-1,ue=0,pe=0,he=0;pe<this.length;pe++){var ye=this.words[pe]<<he|ue;G[ne--]=255&ye,ne>=0&&(G[ne--]=ye>>8&255),ne>=0&&(G[ne--]=ye>>16&255),6===he?(ne>=0&&(G[ne--]=ye>>24&255),ue=0,he=0):(ue=ye>>>24,he+=2)}if(ne>=0)for(G[ne--]=ue;ne>=0;)G[ne--]=0},Math.clz32?BN.prototype._countBits=function _countBits(G){return 32-Math.clz32(G)}:BN.prototype._countBits=function _countBits(G){var K=G,ne=0;return K>=4096&&(ne+=13,K>>>=13),K>=64&&(ne+=7,K>>>=7),K>=8&&(ne+=4,K>>>=4),K>=2&&(ne+=2,K>>>=2),ne+K},BN.prototype._zeroBits=function _zeroBits(G){if(0===G)return 26;var K=G,ne=0;return 0==(8191&K)&&(ne+=13,K>>>=13),0==(127&K)&&(ne+=7,K>>>=7),0==(15&K)&&(ne+=4,K>>>=4),0==(3&K)&&(ne+=2,K>>>=2),0==(1&K)&&ne++,ne},BN.prototype.bitLength=function bitLength(){var G=this.words[this.length-1],K=this._countBits(G);return 26*(this.length-1)+K},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var G=0,K=0;K<this.length;K++){var ne=this._zeroBits(this.words[K]);if(G+=ne,26!==ne)break}return G},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(G){return 0!==this.negative?this.abs().inotn(G).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(G){return this.testn(G-1)?this.notn(G).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(G){for(;this.length<G.length;)this.words[this.length++]=0;for(var K=0;K<G.length;K++)this.words[K]=this.words[K]|G.words[K];return this._strip()},BN.prototype.ior=function ior(G){return assert(0==(this.negative|G.negative)),this.iuor(G)},BN.prototype.or=function or(G){return this.length>G.length?this.clone().ior(G):G.clone().ior(this)},BN.prototype.uor=function uor(G){return this.length>G.length?this.clone().iuor(G):G.clone().iuor(this)},BN.prototype.iuand=function iuand(G){var K;K=this.length>G.length?G:this;for(var ne=0;ne<K.length;ne++)this.words[ne]=this.words[ne]&G.words[ne];return this.length=K.length,this._strip()},BN.prototype.iand=function iand(G){return assert(0==(this.negative|G.negative)),this.iuand(G)},BN.prototype.and=function and(G){return this.length>G.length?this.clone().iand(G):G.clone().iand(this)},BN.prototype.uand=function uand(G){return this.length>G.length?this.clone().iuand(G):G.clone().iuand(this)},BN.prototype.iuxor=function iuxor(G){var K,ne;this.length>G.length?(K=this,ne=G):(K=G,ne=this);for(var ue=0;ue<ne.length;ue++)this.words[ue]=K.words[ue]^ne.words[ue];if(this!==K)for(;ue<K.length;ue++)this.words[ue]=K.words[ue];return this.length=K.length,this._strip()},BN.prototype.ixor=function ixor(G){return assert(0==(this.negative|G.negative)),this.iuxor(G)},BN.prototype.xor=function xor(G){return this.length>G.length?this.clone().ixor(G):G.clone().ixor(this)},BN.prototype.uxor=function uxor(G){return this.length>G.length?this.clone().iuxor(G):G.clone().iuxor(this)},BN.prototype.inotn=function inotn(G){assert("number"==typeof G&&G>=0);var K=0|Math.ceil(G/26),ne=G%26;this._expand(K),ne>0&&K--;for(var ue=0;ue<K;ue++)this.words[ue]=67108863&~this.words[ue];return ne>0&&(this.words[ue]=~this.words[ue]&67108863>>26-ne),this._strip()},BN.prototype.notn=function notn(G){return this.clone().inotn(G)},BN.prototype.setn=function setn(G,K){assert("number"==typeof G&&G>=0);var ne=G/26|0,ue=G%26;return this._expand(ne+1),this.words[ne]=K?this.words[ne]|1<<ue:this.words[ne]&~(1<<ue),this._strip()},BN.prototype.iadd=function iadd(G){var K,ne,ue;if(0!==this.negative&&0===G.negative)return this.negative=0,K=this.isub(G),this.negative^=1,this._normSign();if(0===this.negative&&0!==G.negative)return G.negative=0,K=this.isub(G),G.negative=1,K._normSign();this.length>G.length?(ne=this,ue=G):(ne=G,ue=this);for(var pe=0,he=0;he<ue.length;he++)K=(0|ne.words[he])+(0|ue.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;for(;0!==pe&&he<ne.length;he++)K=(0|ne.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;if(this.length=ne.length,0!==pe)this.words[this.length]=pe,this.length++;else if(ne!==this)for(;he<ne.length;he++)this.words[he]=ne.words[he];return this},BN.prototype.add=function add(G){var K;return 0!==G.negative&&0===this.negative?(G.negative=0,K=this.sub(G),G.negative^=1,K):0===G.negative&&0!==this.negative?(this.negative=0,K=G.sub(this),this.negative=1,K):this.length>G.length?this.clone().iadd(G):G.clone().iadd(this)},BN.prototype.isub=function isub(G){if(0!==G.negative){G.negative=0;var K=this.iadd(G);return G.negative=1,K._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(G),this.negative=1,this._normSign();var ne,ue,pe=this.cmp(G);if(0===pe)return this.negative=0,this.length=1,this.words[0]=0,this;pe>0?(ne=this,ue=G):(ne=G,ue=this);for(var he=0,ye=0;ye<ue.length;ye++)he=(K=(0|ne.words[ye])-(0|ue.words[ye])+he)>>26,this.words[ye]=67108863&K;for(;0!==he&&ye<ne.length;ye++)he=(K=(0|ne.words[ye])+he)>>26,this.words[ye]=67108863&K;if(0===he&&ye<ne.length&&ne!==this)for(;ye<ne.length;ye++)this.words[ye]=ne.words[ye];return this.length=Math.max(this.length,ye),ne!==this&&(this.negative=1),this._strip()},BN.prototype.sub=function sub(G){return this.clone().isub(G)};var ye=function comb10MulTo(G,K,ne){var ue,pe,he,ye=G.words,me=K.words,be=ne.words,ve=0,_e=0|ye[0],Te=8191&_e,Ee=_e>>>13,Pe=0|ye[1],Se=8191&Pe,Ce=Pe>>>13,ke=0|ye[2],Oe=8191&ke,xe=ke>>>13,Ne=0|ye[3],Me=8191&Ne,Be=Ne>>>13,Fe=0|ye[4],De=8191&Fe,Le=Fe>>>13,Ue=0|ye[5],je=8191&Ue,ze=Ue>>>13,Je=0|ye[6],Xe=8191&Je,Qe=Je>>>13,Ye=0|ye[7],et=8191&Ye,tt=Ye>>>13,rt=0|ye[8],nt=8191&rt,at=rt>>>13,it=0|ye[9],ot=8191&it,ct=it>>>13,dt=0|me[0],ut=8191&dt,ft=dt>>>13,yt=0|me[1],wt=8191&yt,At=yt>>>13,St=0|me[2],kt=8191&St,Bt=St>>>13,Lt=0|me[3],Ut=8191&Lt,$t=Lt>>>13,Ht=0|me[4],Vt=8191&Ht,er=Ht>>>13,tr=0|me[5],rr=8191&tr,cr=tr>>>13,dr=0|me[6],Rr=8191&dr,kr=dr>>>13,$r=0|me[7],qr=8191&$r,Hr=$r>>>13,Vr=0|me[8],Zr=8191&Vr,en=Vr>>>13,tn=0|me[9],an=8191&tn,sn=tn>>>13;ne.negative=G.negative^K.negative,ne.length=19;var un=(ve+(ue=Math.imul(Te,ut))|0)+((8191&(pe=(pe=Math.imul(Te,ft))+Math.imul(Ee,ut)|0))<<13)|0;ve=((he=Math.imul(Ee,ft))+(pe>>>13)|0)+(un>>>26)|0,un&=67108863,ue=Math.imul(Se,ut),pe=(pe=Math.imul(Se,ft))+Math.imul(Ce,ut)|0,he=Math.imul(Ce,ft);var fn=(ve+(ue=ue+Math.imul(Te,wt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,At)|0)+Math.imul(Ee,wt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,At)|0)+(pe>>>13)|0)+(fn>>>26)|0,fn&=67108863,ue=Math.imul(Oe,ut),pe=(pe=Math.imul(Oe,ft))+Math.imul(xe,ut)|0,he=Math.imul(xe,ft),ue=ue+Math.imul(Se,wt)|0,pe=(pe=pe+Math.imul(Se,At)|0)+Math.imul(Ce,wt)|0,he=he+Math.imul(Ce,At)|0;var pn=(ve+(ue=ue+Math.imul(Te,kt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Bt)|0)+Math.imul(Ee,kt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Bt)|0)+(pe>>>13)|0)+(pn>>>26)|0,pn&=67108863,ue=Math.imul(Me,ut),pe=(pe=Math.imul(Me,ft))+Math.imul(Be,ut)|0,he=Math.imul(Be,ft),ue=ue+Math.imul(Oe,wt)|0,pe=(pe=pe+Math.imul(Oe,At)|0)+Math.imul(xe,wt)|0,he=he+Math.imul(xe,At)|0,ue=ue+Math.imul(Se,kt)|0,pe=(pe=pe+Math.imul(Se,Bt)|0)+Math.imul(Ce,kt)|0,he=he+Math.imul(Ce,Bt)|0;var hn=(ve+(ue=ue+Math.imul(Te,Ut)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,$t)|0)+Math.imul(Ee,Ut)|0))<<13)|0;ve=((he=he+Math.imul(Ee,$t)|0)+(pe>>>13)|0)+(hn>>>26)|0,hn&=67108863,ue=Math.imul(De,ut),pe=(pe=Math.imul(De,ft))+Math.imul(Le,ut)|0,he=Math.imul(Le,ft),ue=ue+Math.imul(Me,wt)|0,pe=(pe=pe+Math.imul(Me,At)|0)+Math.imul(Be,wt)|0,he=he+Math.imul(Be,At)|0,ue=ue+Math.imul(Oe,kt)|0,pe=(pe=pe+Math.imul(Oe,Bt)|0)+Math.imul(xe,kt)|0,he=he+Math.imul(xe,Bt)|0,ue=ue+Math.imul(Se,Ut)|0,pe=(pe=pe+Math.imul(Se,$t)|0)+Math.imul(Ce,Ut)|0,he=he+Math.imul(Ce,$t)|0;var yn=(ve+(ue=ue+Math.imul(Te,Vt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,er)|0)+Math.imul(Ee,Vt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,er)|0)+(pe>>>13)|0)+(yn>>>26)|0,yn&=67108863,ue=Math.imul(je,ut),pe=(pe=Math.imul(je,ft))+Math.imul(ze,ut)|0,he=Math.imul(ze,ft),ue=ue+Math.imul(De,wt)|0,pe=(pe=pe+Math.imul(De,At)|0)+Math.imul(Le,wt)|0,he=he+Math.imul(Le,At)|0,ue=ue+Math.imul(Me,kt)|0,pe=(pe=pe+Math.imul(Me,Bt)|0)+Math.imul(Be,kt)|0,he=he+Math.imul(Be,Bt)|0,ue=ue+Math.imul(Oe,Ut)|0,pe=(pe=pe+Math.imul(Oe,$t)|0)+Math.imul(xe,Ut)|0,he=he+Math.imul(xe,$t)|0,ue=ue+Math.imul(Se,Vt)|0,pe=(pe=pe+Math.imul(Se,er)|0)+Math.imul(Ce,Vt)|0,he=he+Math.imul(Ce,er)|0;var mn=(ve+(ue=ue+Math.imul(Te,rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,cr)|0)+Math.imul(Ee,rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,cr)|0)+(pe>>>13)|0)+(mn>>>26)|0,mn&=67108863,ue=Math.imul(Xe,ut),pe=(pe=Math.imul(Xe,ft))+Math.imul(Qe,ut)|0,he=Math.imul(Qe,ft),ue=ue+Math.imul(je,wt)|0,pe=(pe=pe+Math.imul(je,At)|0)+Math.imul(ze,wt)|0,he=he+Math.imul(ze,At)|0,ue=ue+Math.imul(De,kt)|0,pe=(pe=pe+Math.imul(De,Bt)|0)+Math.imul(Le,kt)|0,he=he+Math.imul(Le,Bt)|0,ue=ue+Math.imul(Me,Ut)|0,pe=(pe=pe+Math.imul(Me,$t)|0)+Math.imul(Be,Ut)|0,he=he+Math.imul(Be,$t)|0,ue=ue+Math.imul(Oe,Vt)|0,pe=(pe=pe+Math.imul(Oe,er)|0)+Math.imul(xe,Vt)|0,he=he+Math.imul(xe,er)|0,ue=ue+Math.imul(Se,rr)|0,pe=(pe=pe+Math.imul(Se,cr)|0)+Math.imul(Ce,rr)|0,he=he+Math.imul(Ce,cr)|0;var bn=(ve+(ue=ue+Math.imul(Te,Rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,kr)|0)+Math.imul(Ee,Rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,kr)|0)+(pe>>>13)|0)+(bn>>>26)|0,bn&=67108863,ue=Math.imul(et,ut),pe=(pe=Math.imul(et,ft))+Math.imul(tt,ut)|0,he=Math.imul(tt,ft),ue=ue+Math.imul(Xe,wt)|0,pe=(pe=pe+Math.imul(Xe,At)|0)+Math.imul(Qe,wt)|0,he=he+Math.imul(Qe,At)|0,ue=ue+Math.imul(je,kt)|0,pe=(pe=pe+Math.imul(je,Bt)|0)+Math.imul(ze,kt)|0,he=he+Math.imul(ze,Bt)|0,ue=ue+Math.imul(De,Ut)|0,pe=(pe=pe+Math.imul(De,$t)|0)+Math.imul(Le,Ut)|0,he=he+Math.imul(Le,$t)|0,ue=ue+Math.imul(Me,Vt)|0,pe=(pe=pe+Math.imul(Me,er)|0)+Math.imul(Be,Vt)|0,he=he+Math.imul(Be,er)|0,ue=ue+Math.imul(Oe,rr)|0,pe=(pe=pe+Math.imul(Oe,cr)|0)+Math.imul(xe,rr)|0,he=he+Math.imul(xe,cr)|0,ue=ue+Math.imul(Se,Rr)|0,pe=(pe=pe+Math.imul(Se,kr)|0)+Math.imul(Ce,Rr)|0,he=he+Math.imul(Ce,kr)|0;var gn=(ve+(ue=ue+Math.imul(Te,qr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Hr)|0)+Math.imul(Ee,qr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Hr)|0)+(pe>>>13)|0)+(gn>>>26)|0,gn&=67108863,ue=Math.imul(nt,ut),pe=(pe=Math.imul(nt,ft))+Math.imul(at,ut)|0,he=Math.imul(at,ft),ue=ue+Math.imul(et,wt)|0,pe=(pe=pe+Math.imul(et,At)|0)+Math.imul(tt,wt)|0,he=he+Math.imul(tt,At)|0,ue=ue+Math.imul(Xe,kt)|0,pe=(pe=pe+Math.imul(Xe,Bt)|0)+Math.imul(Qe,kt)|0,he=he+Math.imul(Qe,Bt)|0,ue=ue+Math.imul(je,Ut)|0,pe=(pe=pe+Math.imul(je,$t)|0)+Math.imul(ze,Ut)|0,he=he+Math.imul(ze,$t)|0,ue=ue+Math.imul(De,Vt)|0,pe=(pe=pe+Math.imul(De,er)|0)+Math.imul(Le,Vt)|0,he=he+Math.imul(Le,er)|0,ue=ue+Math.imul(Me,rr)|0,pe=(pe=pe+Math.imul(Me,cr)|0)+Math.imul(Be,rr)|0,he=he+Math.imul(Be,cr)|0,ue=ue+Math.imul(Oe,Rr)|0,pe=(pe=pe+Math.imul(Oe,kr)|0)+Math.imul(xe,Rr)|0,he=he+Math.imul(xe,kr)|0,ue=ue+Math.imul(Se,qr)|0,pe=(pe=pe+Math.imul(Se,Hr)|0)+Math.imul(Ce,qr)|0,he=he+Math.imul(Ce,Hr)|0;var vn=(ve+(ue=ue+Math.imul(Te,Zr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,en)|0)+Math.imul(Ee,Zr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,en)|0)+(pe>>>13)|0)+(vn>>>26)|0,vn&=67108863,ue=Math.imul(ot,ut),pe=(pe=Math.imul(ot,ft))+Math.imul(ct,ut)|0,he=Math.imul(ct,ft),ue=ue+Math.imul(nt,wt)|0,pe=(pe=pe+Math.imul(nt,At)|0)+Math.imul(at,wt)|0,he=he+Math.imul(at,At)|0,ue=ue+Math.imul(et,kt)|0,pe=(pe=pe+Math.imul(et,Bt)|0)+Math.imul(tt,kt)|0,he=he+Math.imul(tt,Bt)|0,ue=ue+Math.imul(Xe,Ut)|0,pe=(pe=pe+Math.imul(Xe,$t)|0)+Math.imul(Qe,Ut)|0,he=he+Math.imul(Qe,$t)|0,ue=ue+Math.imul(je,Vt)|0,pe=(pe=pe+Math.imul(je,er)|0)+Math.imul(ze,Vt)|0,he=he+Math.imul(ze,er)|0,ue=ue+Math.imul(De,rr)|0,pe=(pe=pe+Math.imul(De,cr)|0)+Math.imul(Le,rr)|0,he=he+Math.imul(Le,cr)|0,ue=ue+Math.imul(Me,Rr)|0,pe=(pe=pe+Math.imul(Me,kr)|0)+Math.imul(Be,Rr)|0,he=he+Math.imul(Be,kr)|0,ue=ue+Math.imul(Oe,qr)|0,pe=(pe=pe+Math.imul(Oe,Hr)|0)+Math.imul(xe,qr)|0,he=he+Math.imul(xe,Hr)|0,ue=ue+Math.imul(Se,Zr)|0,pe=(pe=pe+Math.imul(Se,en)|0)+Math.imul(Ce,Zr)|0,he=he+Math.imul(Ce,en)|0;var Tn=(ve+(ue=ue+Math.imul(Te,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,sn)|0)+Math.imul(Ee,an)|0))<<13)|0;ve=((he=he+Math.imul(Ee,sn)|0)+(pe>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ue=Math.imul(ot,wt),pe=(pe=Math.imul(ot,At))+Math.imul(ct,wt)|0,he=Math.imul(ct,At),ue=ue+Math.imul(nt,kt)|0,pe=(pe=pe+Math.imul(nt,Bt)|0)+Math.imul(at,kt)|0,he=he+Math.imul(at,Bt)|0,ue=ue+Math.imul(et,Ut)|0,pe=(pe=pe+Math.imul(et,$t)|0)+Math.imul(tt,Ut)|0,he=he+Math.imul(tt,$t)|0,ue=ue+Math.imul(Xe,Vt)|0,pe=(pe=pe+Math.imul(Xe,er)|0)+Math.imul(Qe,Vt)|0,he=he+Math.imul(Qe,er)|0,ue=ue+Math.imul(je,rr)|0,pe=(pe=pe+Math.imul(je,cr)|0)+Math.imul(ze,rr)|0,he=he+Math.imul(ze,cr)|0,ue=ue+Math.imul(De,Rr)|0,pe=(pe=pe+Math.imul(De,kr)|0)+Math.imul(Le,Rr)|0,he=he+Math.imul(Le,kr)|0,ue=ue+Math.imul(Me,qr)|0,pe=(pe=pe+Math.imul(Me,Hr)|0)+Math.imul(Be,qr)|0,he=he+Math.imul(Be,Hr)|0,ue=ue+Math.imul(Oe,Zr)|0,pe=(pe=pe+Math.imul(Oe,en)|0)+Math.imul(xe,Zr)|0,he=he+Math.imul(xe,en)|0;var En=(ve+(ue=ue+Math.imul(Se,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Se,sn)|0)+Math.imul(Ce,an)|0))<<13)|0;ve=((he=he+Math.imul(Ce,sn)|0)+(pe>>>13)|0)+(En>>>26)|0,En&=67108863,ue=Math.imul(ot,kt),pe=(pe=Math.imul(ot,Bt))+Math.imul(ct,kt)|0,he=Math.imul(ct,Bt),ue=ue+Math.imul(nt,Ut)|0,pe=(pe=pe+Math.imul(nt,$t)|0)+Math.imul(at,Ut)|0,he=he+Math.imul(at,$t)|0,ue=ue+Math.imul(et,Vt)|0,pe=(pe=pe+Math.imul(et,er)|0)+Math.imul(tt,Vt)|0,he=he+Math.imul(tt,er)|0,ue=ue+Math.imul(Xe,rr)|0,pe=(pe=pe+Math.imul(Xe,cr)|0)+Math.imul(Qe,rr)|0,he=he+Math.imul(Qe,cr)|0,ue=ue+Math.imul(je,Rr)|0,pe=(pe=pe+Math.imul(je,kr)|0)+Math.imul(ze,Rr)|0,he=he+Math.imul(ze,kr)|0,ue=ue+Math.imul(De,qr)|0,pe=(pe=pe+Math.imul(De,Hr)|0)+Math.imul(Le,qr)|0,he=he+Math.imul(Le,Hr)|0,ue=ue+Math.imul(Me,Zr)|0,pe=(pe=pe+Math.imul(Me,en)|0)+Math.imul(Be,Zr)|0,he=he+Math.imul(Be,en)|0;var In=(ve+(ue=ue+Math.imul(Oe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Oe,sn)|0)+Math.imul(xe,an)|0))<<13)|0;ve=((he=he+Math.imul(xe,sn)|0)+(pe>>>13)|0)+(In>>>26)|0,In&=67108863,ue=Math.imul(ot,Ut),pe=(pe=Math.imul(ot,$t))+Math.imul(ct,Ut)|0,he=Math.imul(ct,$t),ue=ue+Math.imul(nt,Vt)|0,pe=(pe=pe+Math.imul(nt,er)|0)+Math.imul(at,Vt)|0,he=he+Math.imul(at,er)|0,ue=ue+Math.imul(et,rr)|0,pe=(pe=pe+Math.imul(et,cr)|0)+Math.imul(tt,rr)|0,he=he+Math.imul(tt,cr)|0,ue=ue+Math.imul(Xe,Rr)|0,pe=(pe=pe+Math.imul(Xe,kr)|0)+Math.imul(Qe,Rr)|0,he=he+Math.imul(Qe,kr)|0,ue=ue+Math.imul(je,qr)|0,pe=(pe=pe+Math.imul(je,Hr)|0)+Math.imul(ze,qr)|0,he=he+Math.imul(ze,Hr)|0,ue=ue+Math.imul(De,Zr)|0,pe=(pe=pe+Math.imul(De,en)|0)+Math.imul(Le,Zr)|0,he=he+Math.imul(Le,en)|0;var Rn=(ve+(ue=ue+Math.imul(Me,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Me,sn)|0)+Math.imul(Be,an)|0))<<13)|0;ve=((he=he+Math.imul(Be,sn)|0)+(pe>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,ue=Math.imul(ot,Vt),pe=(pe=Math.imul(ot,er))+Math.imul(ct,Vt)|0,he=Math.imul(ct,er),ue=ue+Math.imul(nt,rr)|0,pe=(pe=pe+Math.imul(nt,cr)|0)+Math.imul(at,rr)|0,he=he+Math.imul(at,cr)|0,ue=ue+Math.imul(et,Rr)|0,pe=(pe=pe+Math.imul(et,kr)|0)+Math.imul(tt,Rr)|0,he=he+Math.imul(tt,kr)|0,ue=ue+Math.imul(Xe,qr)|0,pe=(pe=pe+Math.imul(Xe,Hr)|0)+Math.imul(Qe,qr)|0,he=he+Math.imul(Qe,Hr)|0,ue=ue+Math.imul(je,Zr)|0,pe=(pe=pe+Math.imul(je,en)|0)+Math.imul(ze,Zr)|0,he=he+Math.imul(ze,en)|0;var Nn=(ve+(ue=ue+Math.imul(De,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(De,sn)|0)+Math.imul(Le,an)|0))<<13)|0;ve=((he=he+Math.imul(Le,sn)|0)+(pe>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,ue=Math.imul(ot,rr),pe=(pe=Math.imul(ot,cr))+Math.imul(ct,rr)|0,he=Math.imul(ct,cr),ue=ue+Math.imul(nt,Rr)|0,pe=(pe=pe+Math.imul(nt,kr)|0)+Math.imul(at,Rr)|0,he=he+Math.imul(at,kr)|0,ue=ue+Math.imul(et,qr)|0,pe=(pe=pe+Math.imul(et,Hr)|0)+Math.imul(tt,qr)|0,he=he+Math.imul(tt,Hr)|0,ue=ue+Math.imul(Xe,Zr)|0,pe=(pe=pe+Math.imul(Xe,en)|0)+Math.imul(Qe,Zr)|0,he=he+Math.imul(Qe,en)|0;var Bn=(ve+(ue=ue+Math.imul(je,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(je,sn)|0)+Math.imul(ze,an)|0))<<13)|0;ve=((he=he+Math.imul(ze,sn)|0)+(pe>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,ue=Math.imul(ot,Rr),pe=(pe=Math.imul(ot,kr))+Math.imul(ct,Rr)|0,he=Math.imul(ct,kr),ue=ue+Math.imul(nt,qr)|0,pe=(pe=pe+Math.imul(nt,Hr)|0)+Math.imul(at,qr)|0,he=he+Math.imul(at,Hr)|0,ue=ue+Math.imul(et,Zr)|0,pe=(pe=pe+Math.imul(et,en)|0)+Math.imul(tt,Zr)|0,he=he+Math.imul(tt,en)|0;var Fn=(ve+(ue=ue+Math.imul(Xe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Xe,sn)|0)+Math.imul(Qe,an)|0))<<13)|0;ve=((he=he+Math.imul(Qe,sn)|0)+(pe>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,ue=Math.imul(ot,qr),pe=(pe=Math.imul(ot,Hr))+Math.imul(ct,qr)|0,he=Math.imul(ct,Hr),ue=ue+Math.imul(nt,Zr)|0,pe=(pe=pe+Math.imul(nt,en)|0)+Math.imul(at,Zr)|0,he=he+Math.imul(at,en)|0;var Dn=(ve+(ue=ue+Math.imul(et,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(et,sn)|0)+Math.imul(tt,an)|0))<<13)|0;ve=((he=he+Math.imul(tt,sn)|0)+(pe>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,ue=Math.imul(ot,Zr),pe=(pe=Math.imul(ot,en))+Math.imul(ct,Zr)|0,he=Math.imul(ct,en);var Un=(ve+(ue=ue+Math.imul(nt,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(nt,sn)|0)+Math.imul(at,an)|0))<<13)|0;ve=((he=he+Math.imul(at,sn)|0)+(pe>>>13)|0)+(Un>>>26)|0,Un&=67108863;var $n=(ve+(ue=Math.imul(ot,an))|0)+((8191&(pe=(pe=Math.imul(ot,sn))+Math.imul(ct,an)|0))<<13)|0;return ve=((he=Math.imul(ct,sn))+(pe>>>13)|0)+($n>>>26)|0,$n&=67108863,be[0]=un,be[1]=fn,be[2]=pn,be[3]=hn,be[4]=yn,be[5]=mn,be[6]=bn,be[7]=gn,be[8]=vn,be[9]=Tn,be[10]=En,be[11]=In,be[12]=Rn,be[13]=Nn,be[14]=Bn,be[15]=Fn,be[16]=Dn,be[17]=Un,be[18]=$n,0!==ve&&(be[19]=ve,ne.length++),ne};function bigMulTo(G,K,ne){ne.negative=K.negative^G.negative,ne.length=G.length+K.length;for(var ue=0,pe=0,he=0;he<ne.length-1;he++){var ye=pe;pe=0;for(var me=67108863&ue,be=Math.min(he,K.length-1),ve=Math.max(0,he-G.length+1);ve<=be;ve++){var _e=he-ve,Te=(0|G.words[_e])*(0|K.words[ve]),Ee=67108863&Te;me=67108863&(Ee=Ee+me|0),pe+=(ye=(ye=ye+(Te/67108864|0)|0)+(Ee>>>26)|0)>>>26,ye&=67108863}ne.words[he]=me,ue=ye,ye=pe}return 0!==ue?ne.words[he]=ue:ne.length--,ne._strip()}function jumboMulTo(G,K,ne){return bigMulTo(G,K,ne)}Math.imul||(ye=smallMulTo),BN.prototype.mulTo=function mulTo(G,K){var ne=this.length+G.length;return 10===this.length&&10===G.length?ye(this,G,K):ne<63?smallMulTo(this,G,K):ne<1024?bigMulTo(this,G,K):jumboMulTo(this,G,K)},BN.prototype.mul=function mul(G){var K=new BN(null);return K.words=new Array(this.length+G.length),this.mulTo(G,K)},BN.prototype.mulf=function mulf(G){var K=new BN(null);return K.words=new Array(this.length+G.length),jumboMulTo(this,G,K)},BN.prototype.imul=function imul(G){return this.clone().mulTo(G,this)},BN.prototype.imuln=function imuln(G){var K=G<0;K&&(G=-G),assert("number"==typeof G),assert(G<67108864);for(var ne=0,ue=0;ue<this.length;ue++){var pe=(0|this.words[ue])*G,he=(67108863&pe)+(67108863&ne);ne>>=26,ne+=pe/67108864|0,ne+=he>>>26,this.words[ue]=67108863&he}return 0!==ne&&(this.words[ue]=ne,this.length++),K?this.ineg():this},BN.prototype.muln=function muln(G){return this.clone().imuln(G)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(G){var K=function toBitArray(G){for(var K=new Array(G.bitLength()),ne=0;ne<K.length;ne++){var ue=ne/26|0,pe=ne%26;K[ne]=G.words[ue]>>>pe&1}return K}(G);if(0===K.length)return new BN(1);for(var ne=this,ue=0;ue<K.length&&0===K[ue];ue++,ne=ne.sqr());if(++ue<K.length)for(var pe=ne.sqr();ue<K.length;ue++,pe=pe.sqr())0!==K[ue]&&(ne=ne.mul(pe));return ne},BN.prototype.iushln=function iushln(G){assert("number"==typeof G&&G>=0);var K,ne=G%26,ue=(G-ne)/26,pe=67108863>>>26-ne<<26-ne;if(0!==ne){var he=0;for(K=0;K<this.length;K++){var ye=this.words[K]&pe,me=(0|this.words[K])-ye<<ne;this.words[K]=me|he,he=ye>>>26-ne}he&&(this.words[K]=he,this.length++)}if(0!==ue){for(K=this.length-1;K>=0;K--)this.words[K+ue]=this.words[K];for(K=0;K<ue;K++)this.words[K]=0;this.length+=ue}return this._strip()},BN.prototype.ishln=function ishln(G){return assert(0===this.negative),this.iushln(G)},BN.prototype.iushrn=function iushrn(G,K,ne){var ue;assert("number"==typeof G&&G>=0),ue=K?(K-K%26)/26:0;var pe=G%26,he=Math.min((G-pe)/26,this.length),ye=67108863^67108863>>>pe<<pe,me=ne;if(ue-=he,ue=Math.max(0,ue),me){for(var be=0;be<he;be++)me.words[be]=this.words[be];me.length=he}if(0===he);else if(this.length>he)for(this.length-=he,be=0;be<this.length;be++)this.words[be]=this.words[be+he];else this.words[0]=0,this.length=1;var ve=0;for(be=this.length-1;be>=0&&(0!==ve||be>=ue);be--){var _e=0|this.words[be];this.words[be]=ve<<26-pe|_e>>>pe,ve=_e&ye}return me&&0!==ve&&(me.words[me.length++]=ve),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},BN.prototype.ishrn=function ishrn(G,K,ne){return assert(0===this.negative),this.iushrn(G,K,ne)},BN.prototype.shln=function shln(G){return this.clone().ishln(G)},BN.prototype.ushln=function ushln(G){return this.clone().iushln(G)},BN.prototype.shrn=function shrn(G){return this.clone().ishrn(G)},BN.prototype.ushrn=function ushrn(G){return this.clone().iushrn(G)},BN.prototype.testn=function testn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26,ue=1<<K;return!(this.length<=ne)&&!!(this.words[ne]&ue)},BN.prototype.imaskn=function imaskn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=ne)return this;if(0!==K&&ne++,this.length=Math.min(ne,this.length),0!==K){var ue=67108863^67108863>>>K<<K;this.words[this.length-1]&=ue}return this._strip()},BN.prototype.maskn=function maskn(G){return this.clone().imaskn(G)},BN.prototype.iaddn=function iaddn(G){return assert("number"==typeof G),assert(G<67108864),G<0?this.isubn(-G):0!==this.negative?1===this.length&&(0|this.words[0])<=G?(this.words[0]=G-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(G),this.negative=1,this):this._iaddn(G)},BN.prototype._iaddn=function _iaddn(G){this.words[0]+=G;for(var K=0;K<this.length&&this.words[K]>=67108864;K++)this.words[K]-=67108864,K===this.length-1?this.words[K+1]=1:this.words[K+1]++;return this.length=Math.max(this.length,K+1),this},BN.prototype.isubn=function isubn(G){if(assert("number"==typeof G),assert(G<67108864),G<0)return this.iaddn(-G);if(0!==this.negative)return this.negative=0,this.iaddn(G),this.negative=1,this;if(this.words[0]-=G,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var K=0;K<this.length&&this.words[K]<0;K++)this.words[K]+=67108864,this.words[K+1]-=1;return this._strip()},BN.prototype.addn=function addn(G){return this.clone().iaddn(G)},BN.prototype.subn=function subn(G){return this.clone().isubn(G)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(G,K,ne){var ue,pe,he=G.length+ne;this._expand(he);var ye=0;for(ue=0;ue<G.length;ue++){pe=(0|this.words[ue+ne])+ye;var me=(0|G.words[ue])*K;ye=((pe-=67108863&me)>>26)-(me/67108864|0),this.words[ue+ne]=67108863&pe}for(;ue<this.length-ne;ue++)ye=(pe=(0|this.words[ue+ne])+ye)>>26,this.words[ue+ne]=67108863&pe;if(0===ye)return this._strip();for(assert(-1===ye),ye=0,ue=0;ue<this.length;ue++)ye=(pe=-(0|this.words[ue])+ye)>>26,this.words[ue]=67108863&pe;return this.negative=1,this._strip()},BN.prototype._wordDiv=function _wordDiv(G,K){var ne=(this.length,G.length),ue=this.clone(),pe=G,he=0|pe.words[pe.length-1];0!==(ne=26-this._countBits(he))&&(pe=pe.ushln(ne),ue.iushln(ne),he=0|pe.words[pe.length-1]);var ye,me=ue.length-pe.length;if("mod"!==K){(ye=new BN(null)).length=me+1,ye.words=new Array(ye.length);for(var be=0;be<ye.length;be++)ye.words[be]=0}var ve=ue.clone()._ishlnsubmul(pe,1,me);0===ve.negative&&(ue=ve,ye&&(ye.words[me]=1));for(var _e=me-1;_e>=0;_e--){var Te=67108864*(0|ue.words[pe.length+_e])+(0|ue.words[pe.length+_e-1]);for(Te=Math.min(Te/he|0,67108863),ue._ishlnsubmul(pe,Te,_e);0!==ue.negative;)Te--,ue.negative=0,ue._ishlnsubmul(pe,1,_e),ue.isZero()||(ue.negative^=1);ye&&(ye.words[_e]=Te)}return ye&&ye._strip(),ue._strip(),"div"!==K&&0!==ne&&ue.iushrn(ne),{div:ye||null,mod:ue}},BN.prototype.divmod=function divmod(G,K,ne){return assert(!G.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===G.negative?(he=this.neg().divmod(G,K),"mod"!==K&&(ue=he.div.neg()),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.iadd(G)),{div:ue,mod:pe}):0===this.negative&&0!==G.negative?(he=this.divmod(G.neg(),K),"mod"!==K&&(ue=he.div.neg()),{div:ue,mod:he.mod}):0!=(this.negative&G.negative)?(he=this.neg().divmod(G.neg(),K),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.isub(G)),{div:he.div,mod:pe}):G.length>this.length||this.cmp(G)<0?{div:new BN(0),mod:this}:1===G.length?"div"===K?{div:this.divn(G.words[0]),mod:null}:"mod"===K?{div:null,mod:new BN(this.modrn(G.words[0]))}:{div:this.divn(G.words[0]),mod:new BN(this.modrn(G.words[0]))}:this._wordDiv(G,K);var ue,pe,he},BN.prototype.div=function div(G){return this.divmod(G,"div",!1).div},BN.prototype.mod=function mod(G){return this.divmod(G,"mod",!1).mod},BN.prototype.umod=function umod(G){return this.divmod(G,"mod",!0).mod},BN.prototype.divRound=function divRound(G){var K=this.divmod(G);if(K.mod.isZero())return K.div;var ne=0!==K.div.negative?K.mod.isub(G):K.mod,ue=G.ushrn(1),pe=G.andln(1),he=ne.cmp(ue);return he<0||1===pe&&0===he?K.div:0!==K.div.negative?K.div.isubn(1):K.div.iaddn(1)},BN.prototype.modrn=function modrn(G){var K=G<0;K&&(G=-G),assert(G<=67108863);for(var ne=(1<<26)%G,ue=0,pe=this.length-1;pe>=0;pe--)ue=(ne*ue+(0|this.words[pe]))%G;return K?-ue:ue},BN.prototype.modn=function modn(G){return this.modrn(G)},BN.prototype.idivn=function idivn(G){var K=G<0;K&&(G=-G),assert(G<=67108863);for(var ne=0,ue=this.length-1;ue>=0;ue--){var pe=(0|this.words[ue])+67108864*ne;this.words[ue]=pe/G|0,ne=pe%G}return this._strip(),K?this.ineg():this},BN.prototype.divn=function divn(G){return this.clone().idivn(G)},BN.prototype.egcd=function egcd(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue=new BN(1),pe=new BN(0),he=new BN(0),ye=new BN(1),me=0;K.isEven()&&ne.isEven();)K.iushrn(1),ne.iushrn(1),++me;for(var be=ne.clone(),ve=K.clone();!K.isZero();){for(var _e=0,Te=1;0==(K.words[0]&Te)&&_e<26;++_e,Te<<=1);if(_e>0)for(K.iushrn(_e);_e-- >0;)(ue.isOdd()||pe.isOdd())&&(ue.iadd(be),pe.isub(ve)),ue.iushrn(1),pe.iushrn(1);for(var Ee=0,Pe=1;0==(ne.words[0]&Pe)&&Ee<26;++Ee,Pe<<=1);if(Ee>0)for(ne.iushrn(Ee);Ee-- >0;)(he.isOdd()||ye.isOdd())&&(he.iadd(be),ye.isub(ve)),he.iushrn(1),ye.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),ue.isub(he),pe.isub(ye)):(ne.isub(K),he.isub(ue),ye.isub(pe))}return{a:he,b:ye,gcd:ne.iushln(me)}},BN.prototype._invmp=function _invmp(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue,pe=new BN(1),he=new BN(0),ye=ne.clone();K.cmpn(1)>0&&ne.cmpn(1)>0;){for(var me=0,be=1;0==(K.words[0]&be)&&me<26;++me,be<<=1);if(me>0)for(K.iushrn(me);me-- >0;)pe.isOdd()&&pe.iadd(ye),pe.iushrn(1);for(var ve=0,_e=1;0==(ne.words[0]&_e)&&ve<26;++ve,_e<<=1);if(ve>0)for(ne.iushrn(ve);ve-- >0;)he.isOdd()&&he.iadd(ye),he.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),pe.isub(he)):(ne.isub(K),he.isub(pe))}return(ue=0===K.cmpn(1)?pe:he).cmpn(0)<0&&ue.iadd(G),ue},BN.prototype.gcd=function gcd(G){if(this.isZero())return G.abs();if(G.isZero())return this.abs();var K=this.clone(),ne=G.clone();K.negative=0,ne.negative=0;for(var ue=0;K.isEven()&&ne.isEven();ue++)K.iushrn(1),ne.iushrn(1);for(;;){for(;K.isEven();)K.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var pe=K.cmp(ne);if(pe<0){var he=K;K=ne,ne=he}else if(0===pe||0===ne.cmpn(1))break;K.isub(ne)}return ne.iushln(ue)},BN.prototype.invm=function invm(G){return this.egcd(G).a.umod(G)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(G){return this.words[0]&G},BN.prototype.bincn=function bincn(G){assert("number"==typeof G);var K=G%26,ne=(G-K)/26,ue=1<<K;if(this.length<=ne)return this._expand(ne+1),this.words[ne]|=ue,this;for(var pe=ue,he=ne;0!==pe&&he<this.length;he++){var ye=0|this.words[he];pe=(ye+=pe)>>>26,ye&=67108863,this.words[he]=ye}return 0!==pe&&(this.words[he]=pe,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(G){var K,ne=G<0;if(0!==this.negative&&!ne)return-1;if(0===this.negative&&ne)return 1;if(this._strip(),this.length>1)K=1;else{ne&&(G=-G),assert(G<=67108863,"Number is too big");var ue=0|this.words[0];K=ue===G?0:ue<G?-1:1}return 0!==this.negative?0|-K:K},BN.prototype.cmp=function cmp(G){if(0!==this.negative&&0===G.negative)return-1;if(0===this.negative&&0!==G.negative)return 1;var K=this.ucmp(G);return 0!==this.negative?0|-K:K},BN.prototype.ucmp=function ucmp(G){if(this.length>G.length)return 1;if(this.length<G.length)return-1;for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=0|this.words[ne],pe=0|G.words[ne];if(ue!==pe){ue<pe?K=-1:ue>pe&&(K=1);break}}return K},BN.prototype.gtn=function gtn(G){return 1===this.cmpn(G)},BN.prototype.gt=function gt(G){return 1===this.cmp(G)},BN.prototype.gten=function gten(G){return this.cmpn(G)>=0},BN.prototype.gte=function gte(G){return this.cmp(G)>=0},BN.prototype.ltn=function ltn(G){return-1===this.cmpn(G)},BN.prototype.lt=function lt(G){return-1===this.cmp(G)},BN.prototype.lten=function lten(G){return this.cmpn(G)<=0},BN.prototype.lte=function lte(G){return this.cmp(G)<=0},BN.prototype.eqn=function eqn(G){return 0===this.cmpn(G)},BN.prototype.eq=function eq(G){return 0===this.cmp(G)},BN.red=function red(G){return new Red(G)},BN.prototype.toRed=function toRed(G){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),G.convertTo(this)._forceRed(G)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(G){return this.red=G,this},BN.prototype.forceRed=function forceRed(G){return assert(!this.red,"Already a number in reduction context"),this._forceRed(G)},BN.prototype.redAdd=function redAdd(G){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,G)},BN.prototype.redIAdd=function redIAdd(G){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,G)},BN.prototype.redSub=function redSub(G){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,G)},BN.prototype.redISub=function redISub(G){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,G)},BN.prototype.redShl=function redShl(G){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,G)},BN.prototype.redMul=function redMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.mul(this,G)},BN.prototype.redIMul=function redIMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.imul(this,G)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(G){return assert(this.red&&!G.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,G)};var me={k256:null,p224:null,p192:null,p25519:null};function MPrime(G,K){this.name=G,this.p=new BN(K,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(G){if("string"==typeof G){var K=BN._prime(G);this.m=K.p,this.prime=K}else assert(G.gtn(1),"modulus must be greater than 1"),this.m=G,this.prime=null}function Mont(G){Red.call(this,G),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(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)}MPrime.prototype._tmp=function _tmp(){var G=new BN(null);return G.words=new Array(Math.ceil(this.n/13)),G},MPrime.prototype.ireduce=function ireduce(G){var K,ne=G;do{this.split(ne,this.tmp),K=(ne=(ne=this.imulK(ne)).iadd(this.tmp)).bitLength()}while(K>this.n);var ue=K<this.n?-1:ne.ucmp(this.p);return 0===ue?(ne.words[0]=0,ne.length=1):ue>0?ne.isub(this.p):void 0!==ne.strip?ne.strip():ne._strip(),ne},MPrime.prototype.split=function split(G,K){G.iushrn(this.n,0,K)},MPrime.prototype.imulK=function imulK(G){return G.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(G,K){for(var ne=4194303,ue=Math.min(G.length,9),pe=0;pe<ue;pe++)K.words[pe]=G.words[pe];if(K.length=ue,G.length<=9)return G.words[0]=0,void(G.length=1);var he=G.words[9];for(K.words[K.length++]=he&ne,pe=10;pe<G.length;pe++){var ye=0|G.words[pe];G.words[pe-10]=(ye&ne)<<4|he>>>22,he=ye}he>>>=22,G.words[pe-10]=he,0===he&&G.length>10?G.length-=10:G.length-=9},K256.prototype.imulK=function imulK(G){G.words[G.length]=0,G.words[G.length+1]=0,G.length+=2;for(var K=0,ne=0;ne<G.length;ne++){var ue=0|G.words[ne];K+=977*ue,G.words[ne]=67108863&K,K=64*ue+(K/67108864|0)}return 0===G.words[G.length-1]&&(G.length--,0===G.words[G.length-1]&&G.length--),G},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(G){for(var K=0,ne=0;ne<G.length;ne++){var ue=19*(0|G.words[ne])+K,pe=67108863&ue;ue>>>=26,G.words[ne]=pe,K=ue}return 0!==K&&(G.words[G.length++]=K),G},BN._prime=function prime(G){if(me[G])return me[G];var prime;if("k256"===G)prime=new K256;else if("p224"===G)prime=new P224;else if("p192"===G)prime=new P192;else{if("p25519"!==G)throw new Error("Unknown prime "+G);prime=new P25519}return me[G]=prime,prime},Red.prototype._verify1=function _verify1(G){assert(0===G.negative,"red works only with positives"),assert(G.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(G,K){assert(0==(G.negative|K.negative),"red works only with positives"),assert(G.red&&G.red===K.red,"red works only with red numbers")},Red.prototype.imod=function imod(G){return this.prime?this.prime.ireduce(G)._forceRed(this):(move(G,G.umod(this.m)._forceRed(this)),G)},Red.prototype.neg=function neg(G){return G.isZero()?G.clone():this.m.sub(G)._forceRed(this)},Red.prototype.add=function add(G,K){this._verify2(G,K);var ne=G.add(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Red.prototype.iadd=function iadd(G,K){this._verify2(G,K);var ne=G.iadd(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Red.prototype.sub=function sub(G,K){this._verify2(G,K);var ne=G.sub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Red.prototype.isub=function isub(G,K){this._verify2(G,K);var ne=G.isub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Red.prototype.shl=function shl(G,K){return this._verify1(G),this.imod(G.ushln(K))},Red.prototype.imul=function imul(G,K){return this._verify2(G,K),this.imod(G.imul(K))},Red.prototype.mul=function mul(G,K){return this._verify2(G,K),this.imod(G.mul(K))},Red.prototype.isqr=function isqr(G){return this.imul(G,G.clone())},Red.prototype.sqr=function sqr(G){return this.mul(G,G)},Red.prototype.sqrt=function sqrt(G){if(G.isZero())return G.clone();var K=this.m.andln(3);if(assert(K%2==1),3===K){var ne=this.m.add(new BN(1)).iushrn(2);return this.pow(G,ne)}for(var ue=this.m.subn(1),pe=0;!ue.isZero()&&0===ue.andln(1);)pe++,ue.iushrn(1);assert(!ue.isZero());var he=new BN(1).toRed(this),ye=he.redNeg(),me=this.m.subn(1).iushrn(1),be=this.m.bitLength();for(be=new BN(2*be*be).toRed(this);0!==this.pow(be,me).cmp(ye);)be.redIAdd(ye);for(var ve=this.pow(be,ue),_e=this.pow(G,ue.addn(1).iushrn(1)),Te=this.pow(G,ue),Ee=pe;0!==Te.cmp(he);){for(var Pe=Te,Se=0;0!==Pe.cmp(he);Se++)Pe=Pe.redSqr();assert(Se<Ee);var Ce=this.pow(ve,new BN(1).iushln(Ee-Se-1));_e=_e.redMul(Ce),ve=Ce.redSqr(),Te=Te.redMul(ve),Ee=Se}return _e},Red.prototype.invm=function invm(G){var K=G._invmp(this.m);return 0!==K.negative?(K.negative=0,this.imod(K).redNeg()):this.imod(K)},Red.prototype.pow=function pow(G,K){if(K.isZero())return new BN(1).toRed(this);if(0===K.cmpn(1))return G.clone();var ne=new Array(16);ne[0]=new BN(1).toRed(this),ne[1]=G;for(var ue=2;ue<ne.length;ue++)ne[ue]=this.mul(ne[ue-1],G);var pe=ne[0],he=0,ye=0,me=K.bitLength()%26;for(0===me&&(me=26),ue=K.length-1;ue>=0;ue--){for(var be=K.words[ue],ve=me-1;ve>=0;ve--){var _e=be>>ve&1;pe!==ne[0]&&(pe=this.sqr(pe)),0!==_e||0!==he?(he<<=1,he|=_e,(4===++ye||0===ue&&0===ve)&&(pe=this.mul(pe,ne[he]),ye=0,he=0)):ye=0}me=26}return pe},Red.prototype.convertTo=function convertTo(G){var K=G.umod(this.m);return K===G?K.clone():K},Red.prototype.convertFrom=function convertFrom(G){var K=G.clone();return K.red=null,K},BN.mont=function mont(G){return new Mont(G)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(G){return this.imod(G.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(G){var K=this.imod(G.mul(this.rinv));return K.red=null,K},Mont.prototype.imul=function imul(G,K){if(G.isZero()||K.isZero())return G.words[0]=0,G.length=1,G;var ne=G.imul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.mul=function mul(G,K){if(G.isZero()||K.isZero())return new BN(0)._forceRed(this);var ne=G.mul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.invm=function invm(G){return this.imod(G._invmp(this.m).mul(this.r2))._forceRed(this)}}(G,pn)}(fi);var Ai=fi.exports,Ei=getDefaultExportFromCjs$1(Ai);const Pi="bignumber/5.7.0";var Si=Ei.BN;const Ii=new oi(Pi),Ci={},Ri=9007199254740991;let ki=!1,Oi=class BigNumber{constructor(G,K){G!==Ci&&Ii.throwError("cannot call constructor directly; use BigNumber.from",oi.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=K,this._isBigNumber=!0,Object.freeze(this)}fromTwos(G){return toBigNumber$1(toBN$1(this).fromTwos(G))}toTwos(G){return toBigNumber$1(toBN$1(this).toTwos(G))}abs(){return"-"===this._hex[0]?BigNumber.from(this._hex.substring(1)):this}add(G){return toBigNumber$1(toBN$1(this).add(toBN$1(G)))}sub(G){return toBigNumber$1(toBN$1(this).sub(toBN$1(G)))}div(G){return BigNumber.from(G).isZero()&&throwFault$2("division-by-zero","div"),toBigNumber$1(toBN$1(this).div(toBN$1(G)))}mul(G){return toBigNumber$1(toBN$1(this).mul(toBN$1(G)))}mod(G){const K=toBN$1(G);return K.isNeg()&&throwFault$2("division-by-zero","mod"),toBigNumber$1(toBN$1(this).umod(K))}pow(G){const K=toBN$1(G);return K.isNeg()&&throwFault$2("negative-power","pow"),toBigNumber$1(toBN$1(this).pow(K))}and(G){const K=toBN$1(G);return(this.isNegative()||K.isNeg())&&throwFault$2("unbound-bitwise-result","and"),toBigNumber$1(toBN$1(this).and(K))}or(G){const K=toBN$1(G);return(this.isNegative()||K.isNeg())&&throwFault$2("unbound-bitwise-result","or"),toBigNumber$1(toBN$1(this).or(K))}xor(G){const K=toBN$1(G);return(this.isNegative()||K.isNeg())&&throwFault$2("unbound-bitwise-result","xor"),toBigNumber$1(toBN$1(this).xor(K))}mask(G){return(this.isNegative()||G<0)&&throwFault$2("negative-width","mask"),toBigNumber$1(toBN$1(this).maskn(G))}shl(G){return(this.isNegative()||G<0)&&throwFault$2("negative-width","shl"),toBigNumber$1(toBN$1(this).shln(G))}shr(G){return(this.isNegative()||G<0)&&throwFault$2("negative-width","shr"),toBigNumber$1(toBN$1(this).shrn(G))}eq(G){return toBN$1(this).eq(toBN$1(G))}lt(G){return toBN$1(this).lt(toBN$1(G))}lte(G){return toBN$1(this).lte(toBN$1(G))}gt(G){return toBN$1(this).gt(toBN$1(G))}gte(G){return toBN$1(this).gte(toBN$1(G))}isNegative(){return"-"===this._hex[0]}isZero(){return toBN$1(this).isZero()}toNumber(){try{return toBN$1(this).toNumber()}catch(G){throwFault$2("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(G){}return Ii.throwError("this platform does not support BigInt",oi.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?ki||(ki=!0,Ii.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ii.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",oi.errors.UNEXPECTED_ARGUMENT,{}):Ii.throwError("BigNumber.toString does not accept parameters",oi.errors.UNEXPECTED_ARGUMENT,{})),toBN$1(this).toString(10)}toHexString(){return this._hex}toJSON(G){return{type:"BigNumber",hex:this.toHexString()}}static from(G){if(G instanceof BigNumber)return G;if("string"==typeof G)return G.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(Ci,toHex$4(G)):G.match(/^-?[0-9]+$/)?new BigNumber(Ci,toHex$4(new Si(G))):Ii.throwArgumentError("invalid BigNumber string","value",G);if("number"==typeof G)return G%1&&throwFault$2("underflow","BigNumber.from",G),(G>=Ri||G<=-Ri)&&throwFault$2("overflow","BigNumber.from",G),BigNumber.from(String(G));const K=G;if("bigint"==typeof K)return BigNumber.from(K.toString());if(isBytes$1(K))return BigNumber.from(hexlify$2(K));if(K)if(K.toHexString){const G=K.toHexString();if("string"==typeof G)return BigNumber.from(G)}else{let G=K._hex;if(null==G&&"BigNumber"===K.type&&(G=K.hex),"string"==typeof G&&(isHexString$4(G)||"-"===G[0]&&isHexString$4(G.substring(1))))return BigNumber.from(G)}return Ii.throwArgumentError("invalid BigNumber value","value",G)}static isBigNumber(G){return!(!G||!G._isBigNumber)}};function toHex$4(G){if("string"!=typeof G)return toHex$4(G.toString(16));if("-"===G[0])return"-"===(G=G.substring(1))[0]&&Ii.throwArgumentError("invalid hex","value",G),"0x00"===(G=toHex$4(G))?G:"-"+G;if("0x"!==G.substring(0,2)&&(G="0x"+G),"0x"===G)return"0x00";for(G.length%2&&(G="0x0"+G.substring(2));G.length>4&&"0x00"===G.substring(0,4);)G="0x"+G.substring(4);return G}function toBigNumber$1(G){return Oi.from(toHex$4(G))}function toBN$1(G){const K=Oi.from(G).toHexString();return"-"===K[0]?new Si("-"+K.substring(3),16):new Si(K.substring(2),16)}function throwFault$2(G,K,ne){const ue={fault:G,operation:K};return null!=ne&&(ue.value=ne),Ii.throwError(G,oi.errors.NUMERIC_FAULT,ue)}const xi=new oi(Pi),Ni={},Mi=Oi.from(0),Bi=Oi.from(-1);function throwFault$1(G,K,ne,ue){const pe={fault:K,operation:ne};return void 0!==ue&&(pe.value=ue),xi.throwError(G,oi.errors.NUMERIC_FAULT,pe)}let Fi="0";for(;Fi.length<256;)Fi+=Fi;function getMultiplier(G){if("number"!=typeof G)try{G=Oi.from(G).toNumber()}catch(G){}return"number"==typeof G&&G>=0&&G<=256&&!(G%1)?"1"+Fi.substring(0,G):xi.throwArgumentError("invalid decimal size","decimals",G)}function formatFixed(G,K){null==K&&(K=0);const ne=getMultiplier(K),ue=(G=Oi.from(G)).lt(Mi);ue&&(G=G.mul(Bi));let pe=G.mod(ne).toString();for(;pe.length<ne.length-1;)pe="0"+pe;pe=pe.match(/^([0-9]*[1-9]|0)(0*)/)[1];const he=G.div(ne).toString();return G=1===ne.length?he:he+"."+pe,ue&&(G="-"+G),G}function parseFixed(G,K){null==K&&(K=0);const ne=getMultiplier(K);"string"==typeof G&&G.match(/^-?[0-9.]+$/)||xi.throwArgumentError("invalid decimal value","value",G);const ue="-"===G.substring(0,1);ue&&(G=G.substring(1)),"."===G&&xi.throwArgumentError("missing value","value",G);const pe=G.split(".");pe.length>2&&xi.throwArgumentError("too many decimal points","value",G);let he=pe[0],ye=pe[1];for(he||(he="0"),ye||(ye="0");"0"===ye[ye.length-1];)ye=ye.substring(0,ye.length-1);for(ye.length>ne.length-1&&throwFault$1("fractional component exceeds decimals","underflow","parseFixed"),""===ye&&(ye="0");ye.length<ne.length-1;)ye+="0";const me=Oi.from(he),be=Oi.from(ye);let ve=me.mul(ne).add(be);return ue&&(ve=ve.mul(Bi)),ve}class FixedFormat{constructor(G,K,ne,ue){G!==Ni&&xi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",oi.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=K,this.width=ne,this.decimals=ue,this.name=(K?"":"u")+"fixed"+String(ne)+"x"+String(ue),this._multiplier=getMultiplier(ue),Object.freeze(this)}static from(G){if(G instanceof FixedFormat)return G;"number"==typeof G&&(G=`fixed128x${G}`);let K=!0,ne=128,ue=18;if("string"==typeof G)if("fixed"===G);else if("ufixed"===G)K=!1;else{const pe=G.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);pe||xi.throwArgumentError("invalid fixed format","format",G),K="u"!==pe[1],ne=parseInt(pe[2]),ue=parseInt(pe[3])}else if(G){const check=(K,ne,ue)=>null==G[K]?ue:(typeof G[K]!==ne&&xi.throwArgumentError("invalid fixed format ("+K+" not "+ne+")","format."+K,G[K]),G[K]);K=check("signed","boolean",K),ne=check("width","number",ne),ue=check("decimals","number",ue)}return ne%8&&xi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",ne),ue>80&&xi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",ue),new FixedFormat(Ni,K,ne,ue)}}class FixedNumber{constructor(G,K,ne,ue){G!==Ni&&xi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",oi.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=ue,this._hex=K,this._value=ne,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(G){this.format.name!==G.format.name&&xi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",G)}addUnsafe(G){this._checkFormat(G);const K=parseFixed(this._value,this.format.decimals),ne=parseFixed(G._value,G.format.decimals);return FixedNumber.fromValue(K.add(ne),this.format.decimals,this.format)}subUnsafe(G){this._checkFormat(G);const K=parseFixed(this._value,this.format.decimals),ne=parseFixed(G._value,G.format.decimals);return FixedNumber.fromValue(K.sub(ne),this.format.decimals,this.format)}mulUnsafe(G){this._checkFormat(G);const K=parseFixed(this._value,this.format.decimals),ne=parseFixed(G._value,G.format.decimals);return FixedNumber.fromValue(K.mul(ne).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(G){this._checkFormat(G);const K=parseFixed(this._value,this.format.decimals),ne=parseFixed(G._value,G.format.decimals);return FixedNumber.fromValue(K.mul(this.format._multiplier).div(ne),this.format.decimals,this.format)}floor(){const G=this.toString().split(".");1===G.length&&G.push("0");let K=FixedNumber.from(G[0],this.format);const ne=!G[1].match(/^(0*)$/);return this.isNegative()&&ne&&(K=K.subUnsafe(Di.toFormat(K.format))),K}ceiling(){const G=this.toString().split(".");1===G.length&&G.push("0");let K=FixedNumber.from(G[0],this.format);const ne=!G[1].match(/^(0*)$/);return!this.isNegative()&&ne&&(K=K.addUnsafe(Di.toFormat(K.format))),K}round(G){null==G&&(G=0);const K=this.toString().split(".");if(1===K.length&&K.push("0"),(G<0||G>80||G%1)&&xi.throwArgumentError("invalid decimal count","decimals",G),K[1].length<=G)return this;const ne=FixedNumber.from("1"+Fi.substring(0,G),this.format),ue=Li.toFormat(this.format);return this.mulUnsafe(ne).addUnsafe(ue).floor().divUnsafe(ne)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(G){if(null==G)return this._hex;G%8&&xi.throwArgumentError("invalid byte width","width",G);return hexZeroPad$1(Oi.from(this._hex).fromTwos(this.format.width).toTwos(G).toHexString(),G/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(G){return FixedNumber.fromString(this._value,G)}static fromValue(G,K,ne){return null!=ne||null==K||function isBigNumberish(G){return null!=G&&(Oi.isBigNumber(G)||"number"==typeof G&&G%1==0||"string"==typeof G&&!!G.match(/^-?[0-9]+$/)||isHexString$4(G)||"bigint"==typeof G||isBytes$1(G))}(K)||(ne=K,K=null),null==K&&(K=0),null==ne&&(ne="fixed"),FixedNumber.fromString(formatFixed(G,K),FixedFormat.from(ne))}static fromString(G,K){null==K&&(K="fixed");const ne=FixedFormat.from(K),ue=parseFixed(G,ne.decimals);!ne.signed&&ue.lt(Mi)&&throwFault$1("unsigned value cannot be negative","overflow","value",G);let pe=null;ne.signed?pe=ue.toTwos(ne.width).toHexString():(pe=ue.toHexString(),pe=hexZeroPad$1(pe,ne.width/8));const he=formatFixed(ue,ne.decimals);return new FixedNumber(Ni,pe,he,ne)}static fromBytes(G,K){null==K&&(K="fixed");const ne=FixedFormat.from(K);if(arrayify$1(G).length>ne.width/8)throw new Error("overflow");let ue=Oi.from(G);ne.signed&&(ue=ue.fromTwos(ne.width));const pe=ue.toTwos((ne.signed?0:1)+ne.width).toHexString(),he=formatFixed(ue,ne.decimals);return new FixedNumber(Ni,pe,he,ne)}static from(G,K){if("string"==typeof G)return FixedNumber.fromString(G,K);if(isBytes$1(G))return FixedNumber.fromBytes(G,K);try{return FixedNumber.fromValue(G,0,K)}catch(G){if(G.code!==oi.errors.INVALID_ARGUMENT)throw G}return xi.throwArgumentError("invalid FixedNumber value","value",G)}static isFixedNumber(G){return!(!G||!G._isFixedNumber)}}const Di=FixedNumber.from(1),Li=FixedNumber.from("0.5"),Ui=Oi.from(-1),$i=Oi.from(0),qi=Oi.from(1),Gi=Oi.from(2),ji=Oi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Hi="0x0000000000000000000000000000000000000000000000000000000000000000",Wi=new oi("strings/5.7.0");var zi,Vi;function ignoreFunc$2(G,K,ne,ue,pe){if(G===Vi.BAD_PREFIX||G===Vi.UNEXPECTED_CONTINUE){let G=0;for(let ue=K+1;ue<ne.length&&ne[ue]>>6==2;ue++)G++;return G}return G===Vi.OVERRUN?ne.length-K-1:0}!function(G){G.current="",G.NFC="NFC",G.NFD="NFD",G.NFKC="NFKC",G.NFKD="NFKD"}(zi||(zi={})),function(G){G.UNEXPECTED_CONTINUE="unexpected continuation byte",G.BAD_PREFIX="bad codepoint prefix",G.OVERRUN="string overrun",G.MISSING_CONTINUE="missing continuation byte",G.OUT_OF_RANGE="out of UTF-8 range",G.UTF16_SURROGATE="UTF-16 surrogate",G.OVERLONG="overlong representation"}(Vi||(Vi={}));const Ki=Object.freeze({error:function errorFunc$2(G,K,ne,ue,pe){return Wi.throwArgumentError(`invalid codepoint at offset ${K}; ${G}`,"bytes",ne)},ignore:ignoreFunc$2,replace:function replaceFunc$2(G,K,ne,ue,pe){return G===Vi.OVERLONG?(ue.push(pe),0):(ue.push(65533),ignoreFunc$2(G,K,ne))}});function getUtf8CodePoints$2(G,K){null==K&&(K=Ki.error),G=arrayify$1(G);const ne=[];let ue=0;for(;ue<G.length;){const pe=G[ue++];if(pe>>7==0){ne.push(pe);continue}let he=null,ye=null;if(192==(224&pe))he=1,ye=127;else if(224==(240&pe))he=2,ye=2047;else{if(240!=(248&pe)){ue+=K(128==(192&pe)?Vi.UNEXPECTED_CONTINUE:Vi.BAD_PREFIX,ue-1,G,ne);continue}he=3,ye=65535}if(ue-1+he>=G.length){ue+=K(Vi.OVERRUN,ue-1,G,ne);continue}let me=pe&(1<<8-he-1)-1;for(let pe=0;pe<he;pe++){let pe=G[ue];if(128!=(192&pe)){ue+=K(Vi.MISSING_CONTINUE,ue,G,ne),me=null;break}me=me<<6|63&pe,ue++}null!==me&&(me>1114111?ue+=K(Vi.OUT_OF_RANGE,ue-1-he,G,ne,me):me>=55296&&me<=57343?ue+=K(Vi.UTF16_SURROGATE,ue-1-he,G,ne,me):me<=ye?ue+=K(Vi.OVERLONG,ue-1-he,G,ne,me):ne.push(me))}return ne}function toUtf8Bytes$2(G,K=zi.current){K!=zi.current&&(Wi.checkNormalize(),G=G.normalize(K));let ne=[];for(let K=0;K<G.length;K++){const ue=G.charCodeAt(K);if(ue<128)ne.push(ue);else if(ue<2048)ne.push(ue>>6|192),ne.push(63&ue|128);else if(55296==(64512&ue)){K++;const pe=G.charCodeAt(K);if(K>=G.length||56320!=(64512&pe))throw new Error("invalid utf-8 string");const he=65536+((1023&ue)<<10)+(1023&pe);ne.push(he>>18|240),ne.push(he>>12&63|128),ne.push(he>>6&63|128),ne.push(63&he|128)}else ne.push(ue>>12|224),ne.push(ue>>6&63|128),ne.push(63&ue|128)}return arrayify$1(ne)}function escapeChar(G){const K="0000"+G.toString(16);return"\\u"+K.substring(K.length-4)}function _toUtf8String$2(G){return G.map((G=>G<=65535?String.fromCharCode(G):(G-=65536,String.fromCharCode(55296+(G>>10&1023),56320+(1023&G))))).join("")}function toUtf8String$2(G,K){return _toUtf8String$2(getUtf8CodePoints$2(G,K))}function toUtf8CodePoints(G,K=zi.current){return getUtf8CodePoints$2(toUtf8Bytes$2(G,K))}function createTable(G,K){K||(K=function(G){return[parseInt(G,16)]});let ne=0,ue={};return G.split(",").forEach((G=>{let pe=G.split(":");ne+=parseInt(pe[0],16),ue[ne]=K(pe[1])})),ue}function createRangeTable(G){let K=0;return G.split(",").map((G=>{let ne=G.split("-");1===ne.length?ne[1]="0":""===ne[1]&&(ne[1]="1");let ue=K+parseInt(ne[0],16);return K=parseInt(ne[1],16),{l:ue,h:K}}))}function matchMap(G,K){let ne=0;for(let ue=0;ue<K.length;ue++){let pe=K[ue];if(ne+=pe.l,G>=ne&&G<=ne+pe.h&&(G-ne)%(pe.d||1)==0){if(pe.e&&-1!==pe.e.indexOf(G-ne))continue;return pe}}return null}const Ji=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Xi="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((G=>parseInt(G,16))),Qi=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Zi=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Yi=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),es=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function bytes2(G){if(G.length%4!=0)throw new Error("bad data");let K=[];for(let ne=0;ne<G.length;ne+=4)K.push(parseInt(G.substring(ne,ne+4),16));return K})),rs=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");var ns={},as=isTypedArray$3;isTypedArray$3.strict=isStrictTypedArray,isTypedArray$3.loose=isLooseTypedArray;var is=Object.prototype.toString,ss={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function isTypedArray$3(G){return isStrictTypedArray(G)||isLooseTypedArray(G)}function isStrictTypedArray(G){return G instanceof Int8Array||G instanceof Int16Array||G instanceof Int32Array||G instanceof Uint8Array||G instanceof Uint8ClampedArray||G instanceof Uint16Array||G instanceof Uint32Array||G instanceof Float32Array||G instanceof Float64Array}function isLooseTypedArray(G){return ss[is.call(G)]}var os=as.strict,cs=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(ns,"__esModule",{value:!0});const ds=cs(as),us=cs((function typedarrayToBuffer(G){if(os(G)){var K=Buffer.from(G.buffer);return G.byteLength!==G.buffer.byteLength&&(K=K.slice(G.byteOffset,G.byteOffset+G.byteLength)),K}return Buffer.from(G)})),fs="hex",ls="utf8",ps="0";function bufferToArray(G){return new Uint8Array(G)}function bufferToHex$1(G,K=!1){const ne=G.toString(fs);return K?addHexPrefix(ne):ne}function bufferToUtf8(G){return G.toString(ls)}function bufferToNumber(G){return G.readUIntBE(0,G.length)}function arrayToBuffer(G){return us.default(G)}function arrayToHex(G,K=!1){return bufferToHex$1(arrayToBuffer(G),K)}function arrayToUtf8(G){return bufferToUtf8(arrayToBuffer(G))}function arrayToNumber(G){return bufferToNumber(arrayToBuffer(G))}function arrayToBinary(G){return Array.from(G).map(numberToBinary).join("")}function hexToBuffer$1(G){return Buffer.from(removeHexPrefix(G),fs)}ns.bufferToArray=bufferToArray,ns.bufferToHex=bufferToHex$1,ns.bufferToUtf8=bufferToUtf8,ns.bufferToNumber=bufferToNumber,ns.bufferToBinary=function bufferToBinary(G){return arrayToBinary(bufferToArray(G))},ns.arrayToBuffer=arrayToBuffer,ns.arrayToHex=arrayToHex,ns.arrayToUtf8=arrayToUtf8,ns.arrayToNumber=arrayToNumber,ns.arrayToBinary=arrayToBinary;var hs=ns.hexToBuffer=hexToBuffer$1;function hexToArray(G){return bufferToArray(hexToBuffer$1(G))}function hexToBinary(G){return arrayToBinary(hexToArray(G))}ns.hexToArray=hexToArray,ns.hexToUtf8=function hexToUtf8(G){return bufferToUtf8(hexToBuffer$1(G))},ns.hexToNumber=function hexToNumber$1(G){return arrayToNumber(hexToArray(G))};var ys=ns.hexToBinary=hexToBinary;function utf8ToBuffer(G){return Buffer.from(G,ls)}function utf8ToArray(G){return bufferToArray(utf8ToBuffer(G))}ns.utf8ToBuffer=utf8ToBuffer,ns.utf8ToArray=utf8ToArray;var ms=ns.utf8ToHex=function utf8ToHex(G,K=!1){return bufferToHex$1(utf8ToBuffer(G),K)};ns.utf8ToNumber=function utf8ToNumber(G){const K=parseInt(G,10);return function assert$u(G,K){if(!G)throw new Error(K)}(function isDefined$1(G){return!function isUndefined$2(G){return void 0===G}(G)}(K),"Number can only safely store up to 53 bits"),K},ns.utf8ToBinary=function utf8ToBinary(G){return arrayToBinary(utf8ToArray(G))},ns.numberToBuffer=function numberToBuffer(G){return binaryToBuffer(numberToBinary(G))},ns.numberToArray=function numberToArray(G){return binaryToArray(numberToBinary(G))};var bs=ns.numberToHex=function numberToHex(G,K){return binaryToHex(numberToBinary(G),K)};function numberToBinary(G){return sanitizeBytes((G>>>0).toString(2))}function binaryToBuffer(G){return arrayToBuffer(binaryToArray(G))}function binaryToArray(G){return new Uint8Array(splitBytes(G).map((G=>parseInt(G,2))))}function binaryToHex(G,K){return arrayToHex(binaryToArray(G),K)}ns.numberToUtf8=function numberToUtf8(G){return`${G}`},ns.numberToBinary=numberToBinary,ns.binaryToBuffer=binaryToBuffer,ns.binaryToArray=binaryToArray,ns.binaryToHex=binaryToHex,ns.binaryToUtf8=function binaryToUtf8(G){return arrayToUtf8(binaryToArray(G))};var gs=ns.binaryToNumber=function binaryToNumber(G){return arrayToNumber(binaryToArray(G))};function isBinaryString(G){return!("string"!=typeof G||!new RegExp(/^[01]+$/).test(G))&&G.length%8==0}function isHexString$3(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(!K||G.length===2+2*K)}function isBuffer$2(G){return Buffer.isBuffer(G)}function isTypedArray$1(G){return ds.default.strict(G)&&!isBuffer$2(G)}function isArrayBuffer$1(G){return!isTypedArray$1(G)&&!isBuffer$2(G)&&void 0!==G.byteLength}function calcByteLength(G,K=8){const ne=G%K;return ne?(G-ne)/K*K+K:G}function splitBytes(G,K=8){const ne=sanitizeBytes(G).match(new RegExp(`.{${K}}`,"gi"));return Array.from(ne||[])}function swapBytes(G){return splitBytes(G).map(reverseString).join("")}function sanitizeBytes(G,K=8,ne=ps){return padLeft(G,calcByteLength(G.length,K),ne)}ns.isBinaryString=isBinaryString,ns.isHexString=isHexString$3,ns.isBuffer=isBuffer$2,ns.isTypedArray=isTypedArray$1,ns.isArrayBuffer=isArrayBuffer$1,ns.getType=function getType(G){return isBuffer$2(G)?"buffer":isTypedArray$1(G)?"typed-array":isArrayBuffer$1(G)?"array-buffer":Array.isArray(G)?"array":typeof G},ns.getEncoding=function getEncoding(G){return isBinaryString(G)?"binary":isHexString$3(G)?fs:ls},ns.concatBuffers=function concatBuffers(...G){return Buffer.concat(G)},ns.concatArrays=function concatArrays(...G){let K=[];return G.forEach((G=>K=K.concat(Array.from(G)))),new Uint8Array([...K])},ns.trimLeft=function trimLeft(G,K){const ne=G.length-K;return ne>0&&(G=G.slice(ne)),G},ns.trimRight=function trimRight(G,K){return G.slice(0,K)},ns.calcByteLength=calcByteLength,ns.splitBytes=splitBytes,ns.swapBytes=swapBytes,ns.swapHex=function swapHex(G){return binaryToHex(swapBytes(hexToBinary(G)))};var vs=ns.sanitizeBytes=sanitizeBytes;function padLeft(G,K,ne=ps){return padString(G,K,!0,ne)}var ws=ns.padLeft=padLeft;function removeHexPrefix(G){return G.replace(/^0x/,"")}ns.padRight=function padRight(G,K,ne=ps){return padString(G,K,!1,ne)};var _s=ns.removeHexPrefix=removeHexPrefix;function addHexPrefix(G){return G.startsWith("0x")?G:`0x${G}`}var Ts=ns.addHexPrefix=addHexPrefix;var As=ns.sanitizeHex=function sanitizeHex(G){return(G=sanitizeBytes(G=removeHexPrefix(G),2))&&(G=addHexPrefix(G)),G};function reverseString(G){return G.split("").reverse().join("")}function padString(G,K,ne,ue=ps){const pe=K-G.length;let he=G;if(pe>0){const K=ue.repeat(pe);he=ne?K+G:G+K}return he}ns.removeHexLeadingZeros=function removeHexLeadingZeros(G){const K=G.startsWith("0x");return G=(G=removeHexPrefix(G)).startsWith(ps)?G.substring(1):G,K?addHexPrefix(G):G};var __awaiter$e=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Es=new oi("properties/5.7.0");function defineReadOnly$1(G,K,ne){Object.defineProperty(G,K,{enumerable:!0,value:ne,writable:!1})}function getStatic$1(G,K){for(let ne=0;ne<32;ne++){if(G[K])return G[K];if(!G.prototype||"object"!=typeof G.prototype)break;G=Object.getPrototypeOf(G.prototype).constructor}return null}function resolveProperties$2(G){return __awaiter$e(this,void 0,void 0,(function*(){const K=Object.keys(G).map((K=>{const ne=G[K];return Promise.resolve(ne).then((G=>({key:K,value:G})))}));return(yield Promise.all(K)).reduce(((G,K)=>(G[K.key]=K.value,G)),{})}))}function checkProperties(G,K){G&&"object"==typeof G||Es.throwArgumentError("invalid object","object",G),Object.keys(G).forEach((ne=>{K[ne]||Es.throwArgumentError("invalid object key - "+ne,"transaction:"+ne,G)}))}function shallowCopy$1(G){const K={};for(const ne in G)K[ne]=G[ne];return K}const Ps={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen$1(G){if(null==G||Ps[typeof G])return!0;if(Array.isArray(G)||"object"==typeof G){if(!Object.isFrozen(G))return!1;const K=Object.keys(G);for(let ne=0;ne<K.length;ne++){let ue=null;try{ue=G[K[ne]]}catch(G){continue}if(!_isFrozen$1(ue))return!1}return!0}return Es.throwArgumentError("Cannot deepCopy "+typeof G,"object",G)}function _deepCopy$1(G){if(_isFrozen$1(G))return G;if(Array.isArray(G))return Object.freeze(G.map((G=>deepCopy$2(G))));if("object"==typeof G){const K={};for(const ne in G){const ue=G[ne];void 0!==ue&&defineReadOnly$1(K,ne,deepCopy$2(ue))}return K}return Es.throwArgumentError("Cannot deepCopy "+typeof G,"object",G)}function deepCopy$2(G){return _deepCopy$1(G)}let Ss=class Description{constructor(G){for(const K in G)this[K]=deepCopy$2(G[K])}};const Is="abi/5.7.0",Cs=new oi(Is),Rs={};let ks={calldata:!0,memory:!0,storage:!0},Os={calldata:!0,memory:!0};function checkModifier$1(G,K){if("bytes"===G||"string"===G){if(ks[K])return!0}else if("address"===G){if("payable"===K)return!0}else if((G.indexOf("[")>=0||"tuple"===G)&&Os[K])return!0;return(ks[K]||"payable"===K)&&Cs.throwArgumentError("invalid modifier","name",K),!1}function populate$2(G,K){for(let ne in K)defineReadOnly$1(G,ne,K[ne])}const xs=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Ns=new RegExp(/^(.*)\[([0-9]*)\]$/);let Ms=class ParamType{constructor(G,K){G!==Rs&&Cs.throwError("use fromString",oi.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate$2(this,K);let ne=this.type.match(Ns);populate$2(this,ne?{arrayLength:parseInt(ne[2]||"-1"),arrayChildren:ParamType.fromObject({type:ne[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(G){if(G||(G=xs.sighash),xs[G]||Cs.throwArgumentError("invalid format type","format",G),G===xs.json){let K={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(K.indexed=this.indexed),this.components&&(K.components=this.components.map((K=>JSON.parse(K.format(G))))),JSON.stringify(K)}let K="";return"array"===this.baseType?(K+=this.arrayChildren.format(G),K+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(G!==xs.sighash&&(K+=this.type),K+="("+this.components.map((K=>K.format(G))).join(G===xs.full?", ":",")+")"):K+=this.type,G!==xs.sighash&&(!0===this.indexed&&(K+=" indexed"),G===xs.full&&this.name&&(K+=" "+this.name)),K}static from(G,K){return"string"==typeof G?ParamType.fromString(G,K):ParamType.fromObject(G)}static fromObject(G){return ParamType.isParamType(G)?G:new ParamType(Rs,{name:G.name||null,type:verifyType$1(G.type),indexed:null==G.indexed?null:!!G.indexed,components:G.components?G.components.map(ParamType.fromObject):null})}static fromString(G,K){return function ParamTypify(G){return ParamType.fromObject({name:G.name,type:G.type,indexed:G.indexed,components:G.components})}(function parseParamType$1(G,K){let ne=G;function throwError(K){Cs.throwArgumentError(`unexpected character at position ${K}`,"param",G)}function newNode(G){let ne={type:"",name:"",parent:G,state:{allowType:!0}};return K&&(ne.indexed=!1),ne}G=G.replace(/\s/g," ");let ue={type:"",name:"",state:{allowType:!0}},pe=ue;for(let ne=0;ne<G.length;ne++){let ue=G[ne];switch(ue){case"(":pe.state.allowType&&""===pe.type?pe.type="tuple":pe.state.allowParams||throwError(ne),pe.state.allowType=!1,pe.type=verifyType$1(pe.type),pe.components=[newNode(pe)],pe=pe.components[0];break;case")":delete pe.state,"indexed"===pe.name&&(K||throwError(ne),pe.indexed=!0,pe.name=""),checkModifier$1(pe.type,pe.name)&&(pe.name=""),pe.type=verifyType$1(pe.type);let G=pe;pe=pe.parent,pe||throwError(ne),delete G.parent,pe.state.allowParams=!1,pe.state.allowName=!0,pe.state.allowArray=!0;break;case",":delete pe.state,"indexed"===pe.name&&(K||throwError(ne),pe.indexed=!0,pe.name=""),checkModifier$1(pe.type,pe.name)&&(pe.name=""),pe.type=verifyType$1(pe.type);let he=newNode(pe.parent);pe.parent.components.push(he),delete pe.parent,pe=he;break;case" ":pe.state.allowType&&""!==pe.type&&(pe.type=verifyType$1(pe.type),delete pe.state.allowType,pe.state.allowName=!0,pe.state.allowParams=!0),pe.state.allowName&&""!==pe.name&&("indexed"===pe.name?(K||throwError(ne),pe.indexed&&throwError(ne),pe.indexed=!0,pe.name=""):checkModifier$1(pe.type,pe.name)?pe.name="":pe.state.allowName=!1);break;case"[":pe.state.allowArray||throwError(ne),pe.type+=ue,pe.state.allowArray=!1,pe.state.allowName=!1,pe.state.readArray=!0;break;case"]":pe.state.readArray||throwError(ne),pe.type+=ue,pe.state.readArray=!1,pe.state.allowArray=!0,pe.state.allowName=!0;break;default:pe.state.allowType?(pe.type+=ue,pe.state.allowParams=!0,pe.state.allowArray=!0):pe.state.allowName?(pe.name+=ue,delete pe.state.allowArray):pe.state.readArray?pe.type+=ue:throwError(ne)}}return pe.parent&&Cs.throwArgumentError("unexpected eof","param",G),delete ue.state,"indexed"===pe.name?(K||throwError(ne.length-7),pe.indexed&&throwError(ne.length-7),pe.indexed=!0,pe.name=""):checkModifier$1(pe.type,pe.name)&&(pe.name=""),ue.type=verifyType$1(ue.type),ue}(G,!!K))}static isParamType(G){return!(null==G||!G._isParamType)}};function parseParams$1(G,K){return function splitNesting$1(G){G=G.trim();let K=[],ne="",ue=0;for(let pe=0;pe<G.length;pe++){let he=G[pe];","===he&&0===ue?(K.push(ne),ne=""):(ne+=he,"("===he?ue++:")"===he&&(ue--,-1===ue&&Cs.throwArgumentError("unbalanced parenthesis","value",G)))}ne&&K.push(ne);return K}(G).map((G=>Ms.fromString(G,K)))}let Bs=class Fragment{constructor(G,K){G!==Rs&&Cs.throwError("use a static from method",oi.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate$2(this,K),this._isFragment=!0,Object.freeze(this)}static from(G){return Fragment.isFragment(G)?G:"string"==typeof G?Fragment.fromString(G):Fragment.fromObject(G)}static fromObject(G){if(Fragment.isFragment(G))return G;switch(G.type){case"function":return Ls.fromObject(G);case"event":return Fs.fromObject(G);case"constructor":return Ds.fromObject(G);case"error":return Us.fromObject(G);case"fallback":case"receive":return null}return Cs.throwArgumentError("invalid fragment object","value",G)}static fromString(G){return"event"===(G=(G=(G=G.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Fs.fromString(G.substring(5).trim()):"function"===G.split(" ")[0]?Ls.fromString(G.substring(8).trim()):"constructor"===G.split("(")[0].trim()?Ds.fromString(G.trim()):"error"===G.split(" ")[0]?Us.fromString(G.substring(5).trim()):Cs.throwArgumentError("unsupported fragment","value",G)}static isFragment(G){return!(!G||!G._isFragment)}},Fs=class EventFragment extends Bs{format(G){if(G||(G=xs.sighash),xs[G]||Cs.throwArgumentError("invalid format type","format",G),G===xs.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==xs.sighash&&(K+="event "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===xs.full?", ":",")+") ",G!==xs.sighash&&this.anonymous&&(K+="anonymous "),K.trim()}static from(G){return"string"==typeof G?EventFragment.fromString(G):EventFragment.fromObject(G)}static fromObject(G){if(EventFragment.isEventFragment(G))return G;"event"!==G.type&&Cs.throwArgumentError("invalid event object","value",G);const K={name:verifyIdentifier$1(G.name),anonymous:G.anonymous,inputs:G.inputs?G.inputs.map(Ms.fromObject):[],type:"event"};return new EventFragment(Rs,K)}static fromString(G){let K=G.match(qs);K||Cs.throwArgumentError("invalid event string","value",G);let ne=!1;return K[3].split(" ").forEach((G=>{switch(G.trim()){case"anonymous":ne=!0;break;case"":break;default:Cs.warn("unknown modifier: "+G)}})),EventFragment.fromObject({name:K[1].trim(),anonymous:ne,inputs:parseParams$1(K[2],!0),type:"event"})}static isEventFragment(G){return G&&G._isFragment&&"event"===G.type}};function parseGas$1(G,K){K.gas=null;let ne=G.split("@");return 1!==ne.length?(ne.length>2&&Cs.throwArgumentError("invalid human-readable ABI signature","value",G),ne[1].match(/^[0-9]+$/)||Cs.throwArgumentError("invalid human-readable ABI signature gas","value",G),K.gas=Oi.from(ne[1]),ne[0]):G}function parseModifiers$1(G,K){K.constant=!1,K.payable=!1,K.stateMutability="nonpayable",G.split(" ").forEach((G=>{switch(G.trim()){case"constant":K.constant=!0;break;case"payable":K.payable=!0,K.stateMutability="payable";break;case"nonpayable":K.payable=!1,K.stateMutability="nonpayable";break;case"pure":K.constant=!0,K.stateMutability="pure";break;case"view":K.constant=!0,K.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+G)}}))}function verifyState$1(G){let K={constant:!1,payable:!0,stateMutability:"payable"};return null!=G.stateMutability?(K.stateMutability=G.stateMutability,K.constant="view"===K.stateMutability||"pure"===K.stateMutability,null!=G.constant&&!!G.constant!==K.constant&&Cs.throwArgumentError("cannot have constant function with mutability "+K.stateMutability,"value",G),K.payable="payable"===K.stateMutability,null!=G.payable&&!!G.payable!==K.payable&&Cs.throwArgumentError("cannot have payable function with mutability "+K.stateMutability,"value",G)):null!=G.payable?(K.payable=!!G.payable,null!=G.constant||K.payable||"constructor"===G.type||Cs.throwArgumentError("unable to determine stateMutability","value",G),K.constant=!!G.constant,K.constant?K.stateMutability="view":K.stateMutability=K.payable?"payable":"nonpayable",K.payable&&K.constant&&Cs.throwArgumentError("cannot have constant payable function","value",G)):null!=G.constant?(K.constant=!!G.constant,K.payable=!K.constant,K.stateMutability=K.constant?"view":"payable"):"constructor"!==G.type&&Cs.throwArgumentError("unable to determine stateMutability","value",G),K}let Ds=class ConstructorFragment extends Bs{format(G){if(G||(G=xs.sighash),xs[G]||Cs.throwArgumentError("invalid format type","format",G),G===xs.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});G===xs.sighash&&Cs.throwError("cannot format a constructor for sighash",oi.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let K="constructor("+this.inputs.map((K=>K.format(G))).join(G===xs.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(K+=this.stateMutability+" "),K.trim()}static from(G){return"string"==typeof G?ConstructorFragment.fromString(G):ConstructorFragment.fromObject(G)}static fromObject(G){if(ConstructorFragment.isConstructorFragment(G))return G;"constructor"!==G.type&&Cs.throwArgumentError("invalid constructor object","value",G);let K=verifyState$1(G);K.constant&&Cs.throwArgumentError("constructor cannot be constant","value",G);const ne={name:null,type:G.type,inputs:G.inputs?G.inputs.map(Ms.fromObject):[],payable:K.payable,stateMutability:K.stateMutability,gas:G.gas?Oi.from(G.gas):null};return new ConstructorFragment(Rs,ne)}static fromString(G){let K={type:"constructor"},ne=(G=parseGas$1(G,K)).match(qs);return ne&&"constructor"===ne[1].trim()||Cs.throwArgumentError("invalid constructor string","value",G),K.inputs=parseParams$1(ne[2].trim(),!1),parseModifiers$1(ne[3].trim(),K),ConstructorFragment.fromObject(K)}static isConstructorFragment(G){return G&&G._isFragment&&"constructor"===G.type}},Ls=class FunctionFragment extends Ds{format(G){if(G||(G=xs.sighash),xs[G]||Cs.throwArgumentError("invalid format type","format",G),G===xs.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G)))),outputs:this.outputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==xs.sighash&&(K+="function "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===xs.full?", ":",")+") ",G!==xs.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(K+=this.stateMutability+" "):this.constant&&(K+="view "),this.outputs&&this.outputs.length&&(K+="returns ("+this.outputs.map((K=>K.format(G))).join(", ")+") "),null!=this.gas&&(K+="@"+this.gas.toString()+" ")),K.trim()}static from(G){return"string"==typeof G?FunctionFragment.fromString(G):FunctionFragment.fromObject(G)}static fromObject(G){if(FunctionFragment.isFunctionFragment(G))return G;"function"!==G.type&&Cs.throwArgumentError("invalid function object","value",G);let K=verifyState$1(G);const ne={type:G.type,name:verifyIdentifier$1(G.name),constant:K.constant,inputs:G.inputs?G.inputs.map(Ms.fromObject):[],outputs:G.outputs?G.outputs.map(Ms.fromObject):[],payable:K.payable,stateMutability:K.stateMutability,gas:G.gas?Oi.from(G.gas):null};return new FunctionFragment(Rs,ne)}static fromString(G){let K={type:"function"},ne=(G=parseGas$1(G,K)).split(" returns ");ne.length>2&&Cs.throwArgumentError("invalid function string","value",G);let ue=ne[0].match(qs);if(ue||Cs.throwArgumentError("invalid function signature","value",G),K.name=ue[1].trim(),K.name&&verifyIdentifier$1(K.name),K.inputs=parseParams$1(ue[2],!1),parseModifiers$1(ue[3].trim(),K),ne.length>1){let ue=ne[1].match(qs);""==ue[1].trim()&&""==ue[3].trim()||Cs.throwArgumentError("unexpected tokens","value",G),K.outputs=parseParams$1(ue[2],!1)}else K.outputs=[];return FunctionFragment.fromObject(K)}static isFunctionFragment(G){return G&&G._isFragment&&"function"===G.type}};function checkForbidden$1(G){const K=G.format();return"Error(string)"!==K&&"Panic(uint256)"!==K||Cs.throwArgumentError(`cannot specify user defined ${K} error`,"fragment",G),G}let Us=class ErrorFragment extends Bs{format(G){if(G||(G=xs.sighash),xs[G]||Cs.throwArgumentError("invalid format type","format",G),G===xs.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==xs.sighash&&(K+="error "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===xs.full?", ":",")+") ",K.trim()}static from(G){return"string"==typeof G?ErrorFragment.fromString(G):ErrorFragment.fromObject(G)}static fromObject(G){if(ErrorFragment.isErrorFragment(G))return G;"error"!==G.type&&Cs.throwArgumentError("invalid error object","value",G);const K={type:G.type,name:verifyIdentifier$1(G.name),inputs:G.inputs?G.inputs.map(Ms.fromObject):[]};return checkForbidden$1(new ErrorFragment(Rs,K))}static fromString(G){let K={type:"error"},ne=G.match(qs);return ne||Cs.throwArgumentError("invalid error signature","value",G),K.name=ne[1].trim(),K.name&&verifyIdentifier$1(K.name),K.inputs=parseParams$1(ne[2],!1),checkForbidden$1(ErrorFragment.fromObject(K))}static isErrorFragment(G){return G&&G._isFragment&&"error"===G.type}};function verifyType$1(G){return G.match(/^uint($|[^1-9])/)?G="uint256"+G.substring(4):G.match(/^int($|[^1-9])/)&&(G="int256"+G.substring(3)),G}const $s=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier$1(G){return G&&G.match($s)||Cs.throwArgumentError(`invalid identifier "${G}"`,"value",G),G}const qs=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Gs=new oi(Is);function checkResultErrors$1(G){const K=[],checkErrors=function(G,ne){if(Array.isArray(ne))for(let ue in ne){const pe=G.slice();pe.push(ue);try{checkErrors(pe,ne[ue])}catch(G){K.push({path:pe,error:G})}}};return checkErrors([],G),K}let js=class Coder{constructor(G,K,ne,ue){this.name=G,this.type=K,this.localName=ne,this.dynamic=ue}_throwError(G,K){Gs.throwArgumentError(G,this.localName,K)}},Hs=class Writer{constructor(G){defineReadOnly$1(this,"wordSize",G||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(G)}get data(){return hexConcat$1(this._data)}get length(){return this._dataLength}_writeData(G){return this._data.push(G),this._dataLength+=G.length,G.length}appendWriter(G){return this._writeData(concat$2(G._data))}writeBytes(G){let K=arrayify$1(G);const ne=K.length%this.wordSize;return ne&&(K=concat$2([K,this._padding.slice(ne)])),this._writeData(K)}_getValue(G){let K=arrayify$1(Oi.from(G));return K.length>this.wordSize&&Gs.throwError("value out-of-bounds",oi.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:K.length}),K.length%this.wordSize&&(K=concat$2([this._padding.slice(K.length%this.wordSize),K])),K}writeValue(G){return this._writeData(this._getValue(G))}writeUpdatableValue(){const G=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,K=>{this._data[G]=this._getValue(K)}}};const Ws=new oi("rlp/5.7.0");function arrayifyInteger$2(G){const K=[];for(;G;)K.unshift(255&G),G>>=8;return K}function unarrayifyInteger$1(G,K,ne){let ue=0;for(let pe=0;pe<ne;pe++)ue=256*ue+G[K+pe];return ue}function _encode$2(G){if(Array.isArray(G)){let K=[];if(G.forEach((function(G){K=K.concat(_encode$2(G))})),K.length<=55)return K.unshift(192+K.length),K;const ne=arrayifyInteger$2(K.length);return ne.unshift(247+ne.length),ne.concat(K)}isBytesLike$2(G)||Ws.throwArgumentError("RLP object must be BytesLike","object",G);const K=Array.prototype.slice.call(arrayify$1(G));if(1===K.length&&K[0]<=127)return K;if(K.length<=55)return K.unshift(128+K.length),K;const ne=arrayifyInteger$2(K.length);return ne.unshift(183+ne.length),ne.concat(K)}function encode$6(G){return hexlify$2(_encode$2(G))}function _decodeChildren$1(G,K,ne,ue){const pe=[];for(;ne<K+1+ue;){const he=_decode$2(G,ne);pe.push(he.result),(ne+=he.consumed)>K+1+ue&&Ws.throwError("child data too short",oi.errors.BUFFER_OVERRUN,{})}return{consumed:1+ue,result:pe}}function _decode$2(G,K){if(0===G.length&&Ws.throwError("data too short",oi.errors.BUFFER_OVERRUN,{}),G[K]>=248){const ne=G[K]-247;K+1+ne>G.length&&Ws.throwError("data short segment too short",oi.errors.BUFFER_OVERRUN,{});const ue=unarrayifyInteger$1(G,K+1,ne);return K+1+ne+ue>G.length&&Ws.throwError("data long segment too short",oi.errors.BUFFER_OVERRUN,{}),_decodeChildren$1(G,K,K+1+ne,ne+ue)}if(G[K]>=192){const ne=G[K]-192;return K+1+ne>G.length&&Ws.throwError("data array too short",oi.errors.BUFFER_OVERRUN,{}),_decodeChildren$1(G,K,K+1,ne)}if(G[K]>=184){const ne=G[K]-183;K+1+ne>G.length&&Ws.throwError("data array too short",oi.errors.BUFFER_OVERRUN,{});const ue=unarrayifyInteger$1(G,K+1,ne);K+1+ne+ue>G.length&&Ws.throwError("data array too short",oi.errors.BUFFER_OVERRUN,{});return{consumed:1+ne+ue,result:hexlify$2(G.slice(K+1+ne,K+1+ne+ue))}}if(G[K]>=128){const ne=G[K]-128;K+1+ne>G.length&&Ws.throwError("data too short",oi.errors.BUFFER_OVERRUN,{});return{consumed:1+ne,result:hexlify$2(G.slice(K+1,K+1+ne))}}return{consumed:1,result:hexlify$2(G[K])}}function decode$3(G){const K=arrayify$1(G),ne=_decode$2(K,0);return ne.consumed!==K.length&&Ws.throwArgumentError("invalid rlp data","data",G),ne.result}var zs=Object.freeze({__proto__:null,decode:decode$3,encode:encode$6});const Vs=new oi("address/5.7.0");function getChecksumAddress$2(G){isHexString$4(G,20)||Vs.throwArgumentError("invalid address","address",G);const K=(G=G.toLowerCase()).substring(2).split(""),ne=new Uint8Array(40);for(let G=0;G<40;G++)ne[G]=K[G].charCodeAt(0);const ue=arrayify$1(keccak256$3(ne));for(let G=0;G<40;G+=2)ue[G>>1]>>4>=8&&(K[G]=K[G].toUpperCase()),(15&ue[G>>1])>=8&&(K[G+1]=K[G+1].toUpperCase());return"0x"+K.join("")}const Ks={};for(let G=0;G<10;G++)Ks[String(G)]=String(G);for(let G=0;G<26;G++)Ks[String.fromCharCode(65+G)]=String(10+G);const Js=Math.floor(function log10$1(G){return Math.log10?Math.log10(G):Math.log(G)/Math.LN10}(9007199254740991));function ibanChecksum$2(G){let K=(G=(G=G.toUpperCase()).substring(4)+G.substring(0,2)+"00").split("").map((G=>Ks[G])).join("");for(;K.length>=Js;){let G=K.substring(0,Js);K=parseInt(G,10)%97+K.substring(G.length)}let ne=String(98-parseInt(K,10)%97);for(;ne.length<2;)ne="0"+ne;return ne}function getAddress$2(G){let K=null;if("string"!=typeof G&&Vs.throwArgumentError("invalid address","address",G),G.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==G.substring(0,2)&&(G="0x"+G),K=getChecksumAddress$2(G),G.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&K!==G&&Vs.throwArgumentError("bad address checksum","address",G);else if(G.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(G.substring(2,4)!==ibanChecksum$2(G)&&Vs.throwArgumentError("bad icap checksum","address",G),K=function _base36To16$1(G){return new Si(G,36).toString(16)}(G.substring(4));K.length<40;)K="0"+K;K=getChecksumAddress$2("0x"+K)}else Vs.throwArgumentError("invalid address","address",G);return K}function getContractAddress$1(G){let K=null;try{K=getAddress$2(G.from)}catch(K){Vs.throwArgumentError("missing from address","transaction",G)}return getAddress$2(hexDataSlice$1(keccak256$3(encode$6([K,stripZeros$1(arrayify$1(Oi.from(G.nonce).toHexString()))])),12))}function getCreate2Address(G,K,ne){return 32!==hexDataLength$1(K)&&Vs.throwArgumentError("salt must be 32 bytes","salt",K),32!==hexDataLength$1(ne)&&Vs.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",ne),getAddress$2(hexDataSlice$1(keccak256$3(concat$2(["0xff",getAddress$2(G),K,ne])),12))}let Xs=class AddressCoder extends js{constructor(G){super("address","address",G,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(G,K){try{K=getAddress$2(K)}catch(G){this._throwError(G.message,K)}return G.writeValue(K)}decode(G){return getAddress$2(hexZeroPad$1(G.readValue().toHexString(),20))}},Qs=class AnonymousCoder extends js{constructor(G){super(G.name,G.type,void 0,G.dynamic),this.coder=G}defaultValue(){return this.coder.defaultValue()}encode(G,K){return this.coder.encode(G,K)}decode(G){return this.coder.decode(G)}};const Zs=new oi(Is);function pack$3(G,K,ne){let ue=null;if(Array.isArray(ne))ue=ne;else if(ne&&"object"==typeof ne){let G={};ue=K.map((K=>{const ue=K.localName;return ue||Zs.throwError("cannot encode object for signature with missing names",oi.errors.INVALID_ARGUMENT,{argument:"values",coder:K,value:ne}),G[ue]&&Zs.throwError("cannot encode object for signature with duplicate names",oi.errors.INVALID_ARGUMENT,{argument:"values",coder:K,value:ne}),G[ue]=!0,ne[ue]}))}else Zs.throwArgumentError("invalid tuple value","tuple",ne);K.length!==ue.length&&Zs.throwArgumentError("types/value length mismatch","tuple",ne);let pe=new Hs(G.wordSize),he=new Hs(G.wordSize),ye=[];K.forEach(((G,K)=>{let ne=ue[K];if(G.dynamic){let K=he.length;G.encode(he,ne);let ue=pe.writeUpdatableValue();ye.push((G=>{ue(G+K)}))}else G.encode(pe,ne)})),ye.forEach((G=>{G(pe.length)}));let me=G.appendWriter(pe);return me+=G.appendWriter(he),me}function unpack$2(G,K){let ne=[],ue=G.subReader(0);K.forEach((K=>{let pe=null;if(K.dynamic){let ne=G.readValue(),he=ue.subReader(ne.toNumber());try{pe=K.decode(he)}catch(G){if(G.code===oi.errors.BUFFER_OVERRUN)throw G;pe=G,pe.baseType=K.name,pe.name=K.localName,pe.type=K.type}}else try{pe=K.decode(G)}catch(G){if(G.code===oi.errors.BUFFER_OVERRUN)throw G;pe=G,pe.baseType=K.name,pe.name=K.localName,pe.type=K.type}null!=pe&&ne.push(pe)}));const pe=K.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});K.forEach(((G,K)=>{let ue=G.localName;if(!ue||1!==pe[ue])return;if("length"===ue&&(ue="_length"),null!=ne[ue])return;const he=ne[K];he instanceof Error?Object.defineProperty(ne,ue,{enumerable:!0,get:()=>{throw he}}):ne[ue]=he}));for(let G=0;G<ne.length;G++){const K=ne[G];K instanceof Error&&Object.defineProperty(ne,G,{enumerable:!0,get:()=>{throw K}})}return Object.freeze(ne)}let Ys=class ArrayCoder extends js{constructor(G,K,ne){super("array",G.type+"["+(K>=0?K:"")+"]",ne,-1===K||G.dynamic),this.coder=G,this.length=K}defaultValue(){const G=this.coder.defaultValue(),K=[];for(let ne=0;ne<this.length;ne++)K.push(G);return K}encode(G,K){Array.isArray(K)||this._throwError("expected array value",K);let ne=this.length;-1===ne&&(ne=K.length,G.writeValue(K.length)),Zs.checkArgumentCount(K.length,ne,"coder array"+(this.localName?" "+this.localName:""));let ue=[];for(let G=0;G<K.length;G++)ue.push(this.coder);return pack$3(G,ue,K)}decode(G){let K=this.length;-1===K&&(K=G.readValue().toNumber(),32*K>G._data.length&&Zs.throwError("insufficient data length",oi.errors.BUFFER_OVERRUN,{length:G._data.length,count:K}));let ne=[];for(let G=0;G<K;G++)ne.push(new Qs(this.coder));return G.coerce(this.name,unpack$2(G,ne))}},eo=class BooleanCoder extends js{constructor(G){super("bool","bool",G,!1)}defaultValue(){return!1}encode(G,K){return G.writeValue(K?1:0)}decode(G){return G.coerce(this.type,!G.readValue().isZero())}},to=class DynamicBytesCoder extends js{constructor(G,K){super(G,G,K,!0)}defaultValue(){return"0x"}encode(G,K){K=arrayify$1(K);let ne=G.writeValue(K.length);return ne+=G.writeBytes(K),ne}decode(G){return G.readBytes(G.readValue().toNumber(),!0)}},ro=class BytesCoder extends to{constructor(G){super("bytes",G)}decode(G){return G.coerce(this.name,hexlify$2(super.decode(G)))}},no=class FixedBytesCoder extends js{constructor(G,K){let ne="bytes"+String(G);super(ne,ne,K,!1),this.size=G}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(G,K){let ne=arrayify$1(K);return ne.length!==this.size&&this._throwError("incorrect data length",K),G.writeBytes(ne)}decode(G){return G.coerce(this.name,hexlify$2(G.readBytes(this.size)))}},ao=class NullCoder extends js{constructor(G){super("null","",G,!1)}defaultValue(){return null}encode(G,K){return null!=K&&this._throwError("not null",K),G.writeBytes([])}decode(G){return G.readBytes(0),G.coerce(this.name,null)}},io=class NumberCoder extends js{constructor(G,K,ne){const ue=(K?"int":"uint")+8*G;super(ue,ue,ne,!1),this.size=G,this.signed=K}defaultValue(){return 0}encode(G,K){let ne=Oi.from(K),ue=ji.mask(8*G.wordSize);if(this.signed){let G=ue.mask(8*this.size-1);(ne.gt(G)||ne.lt(G.add(qi).mul(Ui)))&&this._throwError("value out-of-bounds",K)}else(ne.lt($i)||ne.gt(ue.mask(8*this.size)))&&this._throwError("value out-of-bounds",K);return ne=ne.toTwos(8*this.size).mask(8*this.size),this.signed&&(ne=ne.fromTwos(8*this.size).toTwos(8*G.wordSize)),G.writeValue(ne)}decode(G){let K=G.readValue().mask(8*this.size);return this.signed&&(K=K.fromTwos(8*this.size)),G.coerce(this.name,K)}},so=class StringCoder extends to{constructor(G){super("string",G)}defaultValue(){return""}encode(G,K){return super.encode(G,toUtf8Bytes$2(K))}decode(G){return toUtf8String$2(super.decode(G))}},oo=class TupleCoder extends js{constructor(G,K){let ne=!1;const ue=[];G.forEach((G=>{G.dynamic&&(ne=!0),ue.push(G.type)}));super("tuple","tuple("+ue.join(",")+")",K,ne),this.coders=G}defaultValue(){const G=[];this.coders.forEach((K=>{G.push(K.defaultValue())}));const K=this.coders.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});return this.coders.forEach(((ne,ue)=>{let pe=ne.localName;pe&&1===K[pe]&&("length"===pe&&(pe="_length"),null==G[pe]&&(G[pe]=G[ue]))})),Object.freeze(G)}encode(G,K){return pack$3(G,this.coders,K)}decode(G){return G.coerce(this.name,unpack$2(G,this.coders))}};const co=new oi(Is),uo=new RegExp(/^bytes([0-9]*)$/),fo=new RegExp(/^(u?int)([0-9]*)$/);let lo=class AbiCoder{constructor(G){defineReadOnly$1(this,"coerceFunc",G||null)}_getCoder(G){switch(G.baseType){case"address":return new Xs(G.name);case"bool":return new eo(G.name);case"string":return new so(G.name);case"bytes":return new ro(G.name);case"array":return new Ys(this._getCoder(G.arrayChildren),G.arrayLength,G.name);case"tuple":return new oo((G.components||[]).map((G=>this._getCoder(G))),G.name);case"":return new ao(G.name)}let K=G.type.match(fo);if(K){let ne=parseInt(K[2]||"256");return(0===ne||ne>256||ne%8!=0)&&co.throwArgumentError("invalid "+K[1]+" bit length","param",G),new io(ne/8,"int"===K[1],G.name)}if(K=G.type.match(uo),K){let ne=parseInt(K[1]);return(0===ne||ne>32)&&co.throwArgumentError("invalid bytes length","param",G),new no(ne,G.name)}return co.throwArgumentError("invalid type","type",G.type)}_getWordSize(){return 32}_getReader(G,K){return new class Reader{constructor(G,K,ne,ue){defineReadOnly$1(this,"_data",arrayify$1(G)),defineReadOnly$1(this,"wordSize",K||32),defineReadOnly$1(this,"_coerceFunc",ne),defineReadOnly$1(this,"allowLoose",ue),this._offset=0}get data(){return hexlify$2(this._data)}get consumed(){return this._offset}static coerce(G,K){let ne=G.match("^u?int([0-9]+)$");return ne&&parseInt(ne[1])<=48&&(K=K.toNumber()),K}coerce(G,K){return this._coerceFunc?this._coerceFunc(G,K):Reader.coerce(G,K)}_peekBytes(G,K,ne){let ue=Math.ceil(K/this.wordSize)*this.wordSize;return this._offset+ue>this._data.length&&(this.allowLoose&&ne&&this._offset+K<=this._data.length?ue=K:Gs.throwError("data out-of-bounds",oi.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+ue})),this._data.slice(this._offset,this._offset+ue)}subReader(G){return new Reader(this._data.slice(this._offset+G),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(G,K){let ne=this._peekBytes(0,G,!!K);return this._offset+=ne.length,ne.slice(0,G)}readValue(){return Oi.from(this.readBytes(this.wordSize))}}(G,this._getWordSize(),this.coerceFunc,K)}_getWriter(){return new Hs(this._getWordSize())}getDefaultValue(G){const K=G.map((G=>this._getCoder(Ms.from(G))));return new oo(K,"_").defaultValue()}encode(G,K){G.length!==K.length&&co.throwError("types/values length mismatch",oi.errors.INVALID_ARGUMENT,{count:{types:G.length,values:K.length},value:{types:G,values:K}});const ne=G.map((G=>this._getCoder(Ms.from(G)))),ue=new oo(ne,"_"),pe=this._getWriter();return ue.encode(pe,K),pe.data}decode(G,K,ne){const ue=G.map((G=>this._getCoder(Ms.from(G))));return new oo(ue,"_").decode(this._getReader(arrayify$1(K),ne))}};const po=new lo;function id$3(G){return keccak256$3(toUtf8Bytes$2(G))}const ho="hash/5.7.0";function decode$2(G){G=atob(G);const K=[];for(let ne=0;ne<G.length;ne++)K.push(G.charCodeAt(ne));return arrayify$1(K)}function encode$5(G){G=arrayify$1(G);let K="";for(let ne=0;ne<G.length;ne++)K+=String.fromCharCode(G[ne]);return btoa(K)}var yo=Object.freeze({__proto__:null,decode:decode$2,encode:encode$5});function flat(G,K){null==K&&(K=1);const ne=[],ue=ne.forEach,flatDeep=function(G,K){ue.call(G,(function(G){K>0&&Array.isArray(G)?flatDeep(G,K-1):ne.push(G)}))};return flatDeep(G,K),ne}function read_compressed_payload$1(G){return function read_payload$1(G){let K=0;return()=>G[K++]}(function decode_arithmetic$1(G){let K=0;function u16(){return G[K++]<<8|G[K++]}let ne=u16(),ue=1,pe=[0,1];for(let G=1;G<ne;G++)pe.push(ue+=u16());let he=u16(),ye=K;K+=he;let me=0,be=0;function read_bit(){return 0==me&&(be=be<<8|G[K++],me=8),be>>--me&1}const ve=Math.pow(2,31),_e=ve>>>1,Te=_e>>1,Ee=ve-1;let Pe=0;for(let G=0;G<31;G++)Pe=Pe<<1|read_bit();let Se=[],Ce=0,ke=ve;for(;;){let G=Math.floor(((Pe-Ce+1)*ue-1)/ke),K=0,he=ne;for(;he-K>1;){let ne=K+he>>>1;G<pe[ne]?he=ne:K=ne}if(0==K)break;Se.push(K);let ye=Ce+Math.floor(ke*pe[K]/ue),me=Ce+Math.floor(ke*pe[K+1]/ue)-1;for(;0==((ye^me)&_e);)Pe=Pe<<1&Ee|read_bit(),ye=ye<<1&Ee,me=me<<1&Ee|1;for(;ye&~me&Te;)Pe=Pe&_e|Pe<<1&Ee>>>1|read_bit(),ye=ye<<1^_e,me=(me^_e)<<1|_e|1;Ce=ye,ke=1+me-ye}let Oe=ne-4;return Se.map((K=>{switch(K-Oe){case 3:return Oe+65792+(G[ye++]<<16|G[ye++]<<8|G[ye++]);case 2:return Oe+256+(G[ye++]<<8|G[ye++]);case 1:return Oe+G[ye++];default:return K-1}}))}(G))}function signed$1(G){return 1&G?~G>>1:G>>1}function read_ascending(G,K){let ne=Array(G);for(let ue=0,pe=-1;ue<G;ue++)ne[ue]=pe+=1+K();return ne}function read_deltas$1(G,K){let ne=Array(G);for(let ue=0,pe=0;ue<G;ue++)ne[ue]=pe+=signed$1(K());return ne}function read_member_array(G,K){let ne=read_ascending(G(),G),ue=G(),pe=read_ascending(ue,G),he=function read_counts(G,K){let ne=Array(G);for(let ue=0;ue<G;ue++)ne[ue]=1+K();return ne}(ue,G);for(let G=0;G<ue;G++)for(let K=0;K<he[G];K++)ne.push(pe[G]+K);return K?ne.map((G=>K[G])):ne}function read_transposed$1(G,K,ne){let ue=Array(G).fill(void 0).map((()=>[]));for(let pe=0;pe<K;pe++)read_deltas$1(G,ne).forEach(((G,K)=>ue[K].push(G)));return ue}function read_linear_table$1(G,K){let ne=1+K(),ue=K(),pe=function read_zero_terminated_array(G){let K=[];for(;;){let ne=G();if(0==ne)break;K.push(ne)}return K}(K);return flat(read_transposed$1(pe.length,1+G,K).map(((G,K)=>{const he=G[0],ye=G.slice(1);return Array(pe[K]).fill(void 0).map(((G,K)=>{let pe=K*ue;return[he+K*ne,ye.map((G=>G+pe))]}))})))}function read_replacement_table$1(G,K){return read_transposed$1(1+K(),1+G,K).map((G=>[G[0],G.slice(1)]))}const mo=function getData(){return read_compressed_payload$1(decode$2("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}(),bo=new Set(read_member_array(mo)),go=new Set(read_member_array(mo)),vo=function read_mapped_map(G){let K=[];for(;;){let ne=G();if(0==ne)break;K.push(read_linear_table$1(ne,G))}for(;;){let ne=G()-1;if(ne<0)break;K.push(read_replacement_table$1(ne,G))}return function fromEntries(G){const K={};for(let ne=0;ne<G.length;ne++){const ue=G[ne];K[ue[0]]=ue[1]}return K}(flat(K))}(mo),wo=function read_emoji_trie(G){let K=read_member_array(G).sort(((G,K)=>G-K));return function read(){let ne=[];for(;;){let ue=read_member_array(G,K);if(0==ue.length)break;ne.push({set:new Set(ue),node:read()})}ne.sort(((G,K)=>K.set.size-G.set.size));let ue=G(),pe=ue%3;ue=ue/3|0;let he=!!(1&ue);return ue>>=1,{branches:ne,valid:pe,fe0f:he,save:1==ue,check:2==ue}}()}(mo),_o=45,To=95;function explode_cp$1(G){return toUtf8CodePoints(G)}function filter_fe0f$1(G){return G.filter((G=>65039!=G))}function ens_normalize_post_check(G){for(let K of G.split(".")){let G=explode_cp$1(K);try{for(let K=G.lastIndexOf(To)-1;K>=0;K--)if(G[K]!==To)throw new Error("underscore only allowed at start");if(G.length>=4&&G.every((G=>G<128))&&G[2]===_o&&G[3]===_o)throw new Error("invalid label extension")}catch(G){throw new Error(`Invalid label "${K}": ${G.message}`)}}return G}function ens_normalize$1(G){return ens_normalize_post_check(function normalize(G,K){let ne=explode_cp$1(G).reverse(),ue=[];for(;ne.length;){let G=consume_emoji_reversed$1(ne);if(G){ue.push(...K(G));continue}let pe=ne.pop();if(bo.has(pe)){ue.push(pe);continue}if(go.has(pe))continue;let he=vo[pe];if(!he)throw new Error(`Disallowed codepoint: 0x${pe.toString(16).toUpperCase()}`);ue.push(...he)}return ens_normalize_post_check(function nfc$1(G){return G.normalize("NFC")}(String.fromCodePoint(...ue)))}(G,filter_fe0f$1))}function consume_emoji_reversed$1(G,K){var ne;let ue,pe,he=wo,ye=[],me=G.length;for(;me;){let K=G[--me];if(he=null===(ne=he.branches.find((G=>G.set.has(K))))||void 0===ne?void 0:ne.node,!he)break;if(he.save)pe=K;else if(he.check&&K===pe)break;ye.push(K),he.fe0f&&(ye.push(65039),me>0&&65039==G[me-1]&&me--),he.valid&&(ue=ye.slice(),2==he.valid&&ue.splice(1,1),G.length=me)}return ue}const Ao=new oi(ho),Eo=new Uint8Array(32);function checkComponent$1(G){if(0===G.length)throw new Error("invalid ENS name; empty component");return G}function ensNameSplit$1(G){const K=toUtf8Bytes$2(ens_normalize$1(G)),ne=[];if(0===G.length)return ne;let ue=0;for(let G=0;G<K.length;G++){46===K[G]&&(ne.push(checkComponent$1(K.slice(ue,G))),ue=G+1)}if(ue>=K.length)throw new Error("invalid ENS name; empty component");return ne.push(checkComponent$1(K.slice(ue))),ne}function namehash$2(G){"string"!=typeof G&&Ao.throwArgumentError("invalid ENS name; not a string","name",G);let K=Eo;const ne=ensNameSplit$1(G);for(;ne.length;)K=keccak256$3(concat$2([K,keccak256$3(ne.pop())]));return hexlify$2(K)}function dnsEncode$1(G){return hexlify$2(concat$2(ensNameSplit$1(G).map((G=>{if(G.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const K=new Uint8Array(G.length+1);return K.set(G,1),K[0]=K.length-1,K}))))+"00"}Eo.fill(0);const Po="Ethereum Signed Message:\n";function hashMessage(G){return"string"==typeof G&&(G=toUtf8Bytes$2(G)),keccak256$3(concat$2([toUtf8Bytes$2(Po),toUtf8Bytes$2(String(G.length)),G]))}var __awaiter$d=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const So=new oi(ho),Io=new Uint8Array(32);Io.fill(0);const Co=Oi.from(-1),Ro=Oi.from(0),ko=Oi.from(1),Oo=Oi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const xo=hexZeroPad$1(ko.toHexString(),32),No=hexZeroPad$1(Ro.toHexString(),32),Mo={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Bo=["name","version","chainId","verifyingContract","salt"];function checkString$1(G){return function(K){return"string"!=typeof K&&So.throwArgumentError(`invalid domain value for ${JSON.stringify(G)}`,`domain.${G}`,K),K}}const Fo={name:checkString$1("name"),version:checkString$1("version"),chainId:function(G){try{return Oi.from(G).toString()}catch(G){}return So.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",G)},verifyingContract:function(G){try{return getAddress$2(G).toLowerCase()}catch(G){}return So.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",G)},salt:function(G){try{const K=arrayify$1(G);if(32!==K.length)throw new Error("bad length");return hexlify$2(K)}catch(G){}return So.throwArgumentError('invalid domain value "salt"',"domain.salt",G)}};function getBaseEncoder$1(G){{const K=G.match(/^(u?)int(\d*)$/);if(K){const ne=""===K[1],ue=parseInt(K[2]||"256");(ue%8!=0||ue>256||K[2]&&K[2]!==String(ue))&&So.throwArgumentError("invalid numeric width","type",G);const pe=Oo.mask(ne?ue-1:ue),he=ne?pe.add(ko).mul(Co):Ro;return function(K){const ne=Oi.from(K);return(ne.lt(he)||ne.gt(pe))&&So.throwArgumentError(`value out-of-bounds for ${G}`,"value",K),hexZeroPad$1(ne.toTwos(256).toHexString(),32)}}}{const K=G.match(/^bytes(\d+)$/);if(K){const ne=parseInt(K[1]);return(0===ne||ne>32||K[1]!==String(ne))&&So.throwArgumentError("invalid bytes width","type",G),function(K){return arrayify$1(K).length!==ne&&So.throwArgumentError(`invalid length for ${G}`,"value",K),function hexPadRight$1(G){const K=arrayify$1(G),ne=K.length%32;return ne?hexConcat$1([K,Io.slice(ne)]):hexlify$2(K)}(K)}}}switch(G){case"address":return function(G){return hexZeroPad$1(getAddress$2(G),32)};case"bool":return function(G){return G?xo:No};case"bytes":return function(G){return keccak256$3(G)};case"string":return function(G){return id$3(G)}}return null}function encodeType$1(G,K){return`${G}(${K.map((({name:G,type:K})=>K+" "+G)).join(",")})`}let Do=class TypedDataEncoder{constructor(G){defineReadOnly$1(this,"types",Object.freeze(deepCopy$2(G))),defineReadOnly$1(this,"_encoderCache",{}),defineReadOnly$1(this,"_types",{});const K={},ne={},ue={};Object.keys(G).forEach((G=>{K[G]={},ne[G]=[],ue[G]={}}));for(const ue in G){const pe={};G[ue].forEach((he=>{pe[he.name]&&So.throwArgumentError(`duplicate variable name ${JSON.stringify(he.name)} in ${JSON.stringify(ue)}`,"types",G),pe[he.name]=!0;const ye=he.type.match(/^([^\x5b]*)(\x5b|$)/)[1];ye===ue&&So.throwArgumentError(`circular type reference to ${JSON.stringify(ye)}`,"types",G);getBaseEncoder$1(ye)||(ne[ye]||So.throwArgumentError(`unknown type ${JSON.stringify(ye)}`,"types",G),ne[ye].push(ue),K[ue][ye]=!0)}))}const pe=Object.keys(ne).filter((G=>0===ne[G].length));0===pe.length?So.throwArgumentError("missing primary type","types",G):pe.length>1&&So.throwArgumentError(`ambiguous primary types or unused types: ${pe.map((G=>JSON.stringify(G))).join(", ")}`,"types",G),defineReadOnly$1(this,"primaryType",pe[0]),function checkCircular(pe,he){he[pe]&&So.throwArgumentError(`circular type reference to ${JSON.stringify(pe)}`,"types",G),he[pe]=!0,Object.keys(K[pe]).forEach((G=>{ne[G]&&(checkCircular(G,he),Object.keys(he).forEach((K=>{ue[K][G]=!0})))})),delete he[pe]}(this.primaryType,{});for(const K in ue){const ne=Object.keys(ue[K]);ne.sort(),this._types[K]=encodeType$1(K,G[K])+ne.map((K=>encodeType$1(K,G[K]))).join("")}}getEncoder(G){let K=this._encoderCache[G];return K||(K=this._encoderCache[G]=this._getEncoder(G)),K}_getEncoder(G){{const K=getBaseEncoder$1(G);if(K)return K}const K=G.match(/^(.*)(\x5b(\d*)\x5d)$/);if(K){const G=K[1],ne=this.getEncoder(G),ue=parseInt(K[3]);return K=>{ue>=0&&K.length!==ue&&So.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",K);let pe=K.map(ne);return this._types[G]&&(pe=pe.map(keccak256$3)),keccak256$3(hexConcat$1(pe))}}const ne=this.types[G];if(ne){const K=id$3(this._types[G]);return G=>{const ue=ne.map((({name:K,type:ne})=>{const ue=this.getEncoder(ne)(G[K]);return this._types[ne]?keccak256$3(ue):ue}));return ue.unshift(K),hexConcat$1(ue)}}return So.throwArgumentError(`unknown type: ${G}`,"type",G)}encodeType(G){const K=this._types[G];return K||So.throwArgumentError(`unknown type: ${JSON.stringify(G)}`,"name",G),K}encodeData(G,K){return this.getEncoder(G)(K)}hashStruct(G,K){return keccak256$3(this.encodeData(G,K))}encode(G){return this.encodeData(this.primaryType,G)}hash(G){return this.hashStruct(this.primaryType,G)}_visit(G,K,ne){if(getBaseEncoder$1(G))return ne(G,K);const ue=G.match(/^(.*)(\x5b(\d*)\x5d)$/);if(ue){const G=ue[1],pe=parseInt(ue[3]);return pe>=0&&K.length!==pe&&So.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",K),K.map((K=>this._visit(G,K,ne)))}const pe=this.types[G];return pe?pe.reduce(((G,{name:ue,type:pe})=>(G[ue]=this._visit(pe,K[ue],ne),G)),{}):So.throwArgumentError(`unknown type: ${G}`,"type",G)}visit(G,K){return this._visit(this.primaryType,G,K)}static from(G){return new TypedDataEncoder(G)}static getPrimaryType(G){return TypedDataEncoder.from(G).primaryType}static hashStruct(G,K,ne){return TypedDataEncoder.from(K).hashStruct(G,ne)}static hashDomain(G){const K=[];for(const ne in G){const ue=Mo[ne];ue||So.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(ne)}`,"domain",G),K.push({name:ne,type:ue})}return K.sort(((G,K)=>Bo.indexOf(G.name)-Bo.indexOf(K.name))),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:K},G)}static encode(G,K,ne){return hexConcat$1(["0x1901",TypedDataEncoder.hashDomain(G),TypedDataEncoder.from(K).hash(ne)])}static hash(G,K,ne){return keccak256$3(TypedDataEncoder.encode(G,K,ne))}static resolveNames(G,K,ne,ue){return __awaiter$d(this,void 0,void 0,(function*(){G=shallowCopy$1(G);const pe={};G.verifyingContract&&!isHexString$4(G.verifyingContract,20)&&(pe[G.verifyingContract]="0x");const he=TypedDataEncoder.from(K);he.visit(ne,((G,K)=>("address"!==G||isHexString$4(K,20)||(pe[K]="0x"),K)));for(const G in pe)pe[G]=yield ue(G);return G.verifyingContract&&pe[G.verifyingContract]&&(G.verifyingContract=pe[G.verifyingContract]),ne=he.visit(ne,((G,K)=>"address"===G&&pe[K]?pe[K]:K)),{domain:G,value:ne}}))}static getPayload(G,K,ne){TypedDataEncoder.hashDomain(G);const ue={},pe=[];Bo.forEach((K=>{const ne=G[K];null!=ne&&(ue[K]=Fo[K](ne),pe.push({name:K,type:Mo[K]}))}));const he=TypedDataEncoder.from(K),ye=shallowCopy$1(K);return ye.EIP712Domain?So.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",K):ye.EIP712Domain=pe,he.encode(ne),{types:ye,domain:ue,primaryType:he.primaryType,message:he.visit(ne,((G,K)=>{if(G.match(/^bytes(\d*)/))return hexlify$2(arrayify$1(K));if(G.match(/^u?int/))return Oi.from(K).toString();switch(G){case"address":return K.toLowerCase();case"bool":return!!K;case"string":return"string"!=typeof K&&So.throwArgumentError("invalid string","value",K),K}return So.throwArgumentError("unsupported type","type",G)}))}}};const Lo=new oi(Is);let Uo=class LogDescription extends Ss{},$o=class TransactionDescription extends Ss{},qo=class ErrorDescription extends Ss{},Go=class Indexed extends Ss{static isIndexed(G){return!(!G||!G._isIndexed)}};const jo={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError$1(G,K){const ne=new Error(`deferred error during ABI decoding triggered accessing ${G}`);return ne.error=K,ne}let Ho=class Interface{constructor(G){let K=[];K="string"==typeof G?JSON.parse(G):G,defineReadOnly$1(this,"fragments",K.map((G=>Bs.from(G))).filter((G=>null!=G))),defineReadOnly$1(this,"_abiCoder",getStatic$1(new.target,"getAbiCoder")()),defineReadOnly$1(this,"functions",{}),defineReadOnly$1(this,"errors",{}),defineReadOnly$1(this,"events",{}),defineReadOnly$1(this,"structs",{}),this.fragments.forEach((G=>{let K=null;switch(G.type){case"constructor":return this.deploy?void Lo.warn("duplicate definition - constructor"):void defineReadOnly$1(this,"deploy",G);case"function":K=this.functions;break;case"event":K=this.events;break;case"error":K=this.errors;break;default:return}let ne=G.format();K[ne]?Lo.warn("duplicate definition - "+ne):K[ne]=G})),this.deploy||defineReadOnly$1(this,"deploy",Ds.from({payable:!1,type:"constructor"})),defineReadOnly$1(this,"_isInterface",!0)}format(G){G||(G=xs.full),G===xs.sighash&&Lo.throwArgumentError("interface does not support formatting sighash","format",G);const K=this.fragments.map((K=>K.format(G)));return G===xs.json?JSON.stringify(K.map((G=>JSON.parse(G)))):K}static getAbiCoder(){return po}static getAddress(G){return getAddress$2(G)}static getSighash(G){return hexDataSlice$1(id$3(G.format()),0,4)}static getEventTopic(G){return id$3(G.format())}getFunction(G){if(isHexString$4(G)){for(const K in this.functions)if(G===this.getSighash(K))return this.functions[K];Lo.throwArgumentError("no matching function","sighash",G)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.functions).filter((G=>G.split("(")[0]===K));return 0===ne.length?Lo.throwArgumentError("no matching function","name",K):ne.length>1&&Lo.throwArgumentError("multiple matching functions","name",K),this.functions[ne[0]]}const K=this.functions[Ls.fromString(G).format()];return K||Lo.throwArgumentError("no matching function","signature",G),K}getEvent(G){if(isHexString$4(G)){const K=G.toLowerCase();for(const G in this.events)if(K===this.getEventTopic(G))return this.events[G];Lo.throwArgumentError("no matching event","topichash",K)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.events).filter((G=>G.split("(")[0]===K));return 0===ne.length?Lo.throwArgumentError("no matching event","name",K):ne.length>1&&Lo.throwArgumentError("multiple matching events","name",K),this.events[ne[0]]}const K=this.events[Fs.fromString(G).format()];return K||Lo.throwArgumentError("no matching event","signature",G),K}getError(G){if(isHexString$4(G)){const K=getStatic$1(this.constructor,"getSighash");for(const ne in this.errors){if(G===K(this.errors[ne]))return this.errors[ne]}Lo.throwArgumentError("no matching error","sighash",G)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.errors).filter((G=>G.split("(")[0]===K));return 0===ne.length?Lo.throwArgumentError("no matching error","name",K):ne.length>1&&Lo.throwArgumentError("multiple matching errors","name",K),this.errors[ne[0]]}const K=this.errors[Ls.fromString(G).format()];return K||Lo.throwArgumentError("no matching error","signature",G),K}getSighash(G){if("string"==typeof G)try{G=this.getFunction(G)}catch(K){try{G=this.getError(G)}catch(G){throw K}}return getStatic$1(this.constructor,"getSighash")(G)}getEventTopic(G){return"string"==typeof G&&(G=this.getEvent(G)),getStatic$1(this.constructor,"getEventTopic")(G)}_decodeParams(G,K){return this._abiCoder.decode(G,K)}_encodeParams(G,K){return this._abiCoder.encode(G,K)}encodeDeploy(G){return this._encodeParams(this.deploy.inputs,G||[])}decodeErrorResult(G,K){"string"==typeof G&&(G=this.getError(G));const ne=arrayify$1(K);return hexlify$2(ne.slice(0,4))!==this.getSighash(G)&&Lo.throwArgumentError(`data signature does not match error ${G.name}.`,"data",hexlify$2(ne)),this._decodeParams(G.inputs,ne.slice(4))}encodeErrorResult(G,K){return"string"==typeof G&&(G=this.getError(G)),hexlify$2(concat$2([this.getSighash(G),this._encodeParams(G.inputs,K||[])]))}decodeFunctionData(G,K){"string"==typeof G&&(G=this.getFunction(G));const ne=arrayify$1(K);return hexlify$2(ne.slice(0,4))!==this.getSighash(G)&&Lo.throwArgumentError(`data signature does not match function ${G.name}.`,"data",hexlify$2(ne)),this._decodeParams(G.inputs,ne.slice(4))}encodeFunctionData(G,K){return"string"==typeof G&&(G=this.getFunction(G)),hexlify$2(concat$2([this.getSighash(G),this._encodeParams(G.inputs,K||[])]))}decodeFunctionResult(G,K){"string"==typeof G&&(G=this.getFunction(G));let ne=arrayify$1(K),ue=null,pe="",he=null,ye=null,me=null;switch(ne.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(G.outputs,ne)}catch(G){}break;case 4:{const G=hexlify$2(ne.slice(0,4)),K=jo[G];if(K)he=this._abiCoder.decode(K.inputs,ne.slice(4)),ye=K.name,me=K.signature,K.reason&&(ue=he[0]),"Error"===ye?pe=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(he[0])}`:"Panic"===ye&&(pe=`; VM Exception while processing transaction: reverted with panic code ${he[0]}`);else try{const K=this.getError(G);he=this._abiCoder.decode(K.inputs,ne.slice(4)),ye=K.name,me=K.format()}catch(G){}break}}return Lo.throwError("call revert exception"+pe,oi.errors.CALL_EXCEPTION,{method:G.format(),data:hexlify$2(K),errorArgs:he,errorName:ye,errorSignature:me,reason:ue})}encodeFunctionResult(G,K){return"string"==typeof G&&(G=this.getFunction(G)),hexlify$2(this._abiCoder.encode(G.outputs,K||[]))}encodeFilterTopics(G,K){"string"==typeof G&&(G=this.getEvent(G)),K.length>G.inputs.length&&Lo.throwError("too many arguments for "+G.format(),oi.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:K});let ne=[];G.anonymous||ne.push(this.getEventTopic(G));const encodeTopic=(G,K)=>"string"===G.type?id$3(K):"bytes"===G.type?keccak256$3(hexlify$2(K)):("bool"===G.type&&"boolean"==typeof K&&(K=K?"0x01":"0x00"),G.type.match(/^u?int/)&&(K=Oi.from(K).toHexString()),"address"===G.type&&this._abiCoder.encode(["address"],[K]),hexZeroPad$1(hexlify$2(K),32));for(K.forEach(((K,ue)=>{let pe=G.inputs[ue];pe.indexed?null==K?ne.push(null):"array"===pe.baseType||"tuple"===pe.baseType?Lo.throwArgumentError("filtering with tuples or arrays not supported","contract."+pe.name,K):Array.isArray(K)?ne.push(K.map((G=>encodeTopic(pe,G)))):ne.push(encodeTopic(pe,K)):null!=K&&Lo.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+pe.name,K)}));ne.length&&null===ne[ne.length-1];)ne.pop();return ne}encodeEventLog(G,K){"string"==typeof G&&(G=this.getEvent(G));const ne=[],ue=[],pe=[];return G.anonymous||ne.push(this.getEventTopic(G)),K.length!==G.inputs.length&&Lo.throwArgumentError("event arguments/values mismatch","values",K),G.inputs.forEach(((G,he)=>{const ye=K[he];if(G.indexed)if("string"===G.type)ne.push(id$3(ye));else if("bytes"===G.type)ne.push(keccak256$3(ye));else{if("tuple"===G.baseType||"array"===G.baseType)throw new Error("not implemented");ne.push(this._abiCoder.encode([G.type],[ye]))}else ue.push(G),pe.push(ye)})),{data:this._abiCoder.encode(ue,pe),topics:ne}}decodeEventLog(G,K,ne){if("string"==typeof G&&(G=this.getEvent(G)),null!=ne&&!G.anonymous){let K=this.getEventTopic(G);isHexString$4(ne[0],32)&&ne[0].toLowerCase()===K||Lo.throwError("fragment/topic mismatch",oi.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:K,value:ne[0]}),ne=ne.slice(1)}let ue=[],pe=[],he=[];G.inputs.forEach(((G,K)=>{G.indexed?"string"===G.type||"bytes"===G.type||"tuple"===G.baseType||"array"===G.baseType?(ue.push(Ms.fromObject({type:"bytes32",name:G.name})),he.push(!0)):(ue.push(G),he.push(!1)):(pe.push(G),he.push(!1))}));let ye=null!=ne?this._abiCoder.decode(ue,concat$2(ne)):null,me=this._abiCoder.decode(pe,K,!0),be=[],ve=0,_e=0;G.inputs.forEach(((G,K)=>{if(G.indexed)if(null==ye)be[K]=new Go({_isIndexed:!0,hash:null});else if(he[K])be[K]=new Go({_isIndexed:!0,hash:ye[_e++]});else try{be[K]=ye[_e++]}catch(G){be[K]=G}else try{be[K]=me[ve++]}catch(G){be[K]=G}if(G.name&&null==be[G.name]){const ne=be[K];ne instanceof Error?Object.defineProperty(be,G.name,{enumerable:!0,get:()=>{throw wrapAccessError$1(`property ${JSON.stringify(G.name)}`,ne)}}):be[G.name]=ne}}));for(let G=0;G<be.length;G++){const K=be[G];K instanceof Error&&Object.defineProperty(be,G,{enumerable:!0,get:()=>{throw wrapAccessError$1(`index ${G}`,K)}})}return Object.freeze(be)}parseTransaction(G){let K=this.getFunction(G.data.substring(0,10).toLowerCase());return K?new $o({args:this._abiCoder.decode(K.inputs,"0x"+G.data.substring(10)),functionFragment:K,name:K.name,signature:K.format(),sighash:this.getSighash(K),value:Oi.from(G.value||"0")}):null}parseLog(G){let K=this.getEvent(G.topics[0]);return!K||K.anonymous?null:new Uo({eventFragment:K,name:K.name,signature:K.format(),topic:this.getEventTopic(K),args:this.decodeEventLog(K,G.data,G.topics)})}parseError(G){const K=hexlify$2(G);let ne=this.getError(K.substring(0,10).toLowerCase());return ne?new qo({args:this._abiCoder.decode(ne.inputs,"0x"+K.substring(10)),errorFragment:ne,name:ne.name,signature:ne.format(),sighash:this.getSighash(ne)}):null}static isInterface(G){return!(!G||!G._isInterface)}};var Wo=Object.freeze({__proto__:null,AbiCoder:lo,ConstructorFragment:Ds,ErrorFragment:Us,EventFragment:Fs,FormatTypes:xs,Fragment:Bs,FunctionFragment:Ls,Indexed:Go,Interface:Ho,LogDescription:Uo,ParamType:Ms,TransactionDescription:$o,checkResultErrors:checkResultErrors$1,defaultAbiCoder:po});var __awaiter$c=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const zo=new oi("abstract-provider/5.7.0");class ForkEvent extends Ss{static isForkEvent(G){return!(!G||!G._isForkEvent)}}let Vo=class Provider{constructor(){zo.checkAbstract(new.target,Provider),defineReadOnly$1(this,"_isProvider",!0)}getFeeData(){return __awaiter$c(this,void 0,void 0,(function*(){const{block:G,gasPrice:K}=yield resolveProperties$2({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((G=>null))});let ne=null,ue=null,pe=null;return G&&G.baseFeePerGas&&(ne=G.baseFeePerGas,pe=Oi.from("1500000000"),ue=G.baseFeePerGas.mul(2).add(pe)),{lastBaseFeePerGas:ne,maxFeePerGas:ue,maxPriorityFeePerGas:pe,gasPrice:K}}))}addListener(G,K){return this.on(G,K)}removeListener(G,K){return this.off(G,K)}static isProvider(G){return!(!G||!G._isProvider)}};var __awaiter$b=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Ko=new oi("abstract-signer/5.7.0"),Jo=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Xo=[oi.errors.INSUFFICIENT_FUNDS,oi.errors.NONCE_EXPIRED,oi.errors.REPLACEMENT_UNDERPRICED];let Qo=class Signer{constructor(){Ko.checkAbstract(new.target,Signer),defineReadOnly$1(this,"_isSigner",!0)}getBalance(G){return __awaiter$b(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),G)}))}getTransactionCount(G){return __awaiter$b(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),G)}))}estimateGas(G){return __awaiter$b(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const K=yield resolveProperties$2(this.checkTransaction(G));return yield this.provider.estimateGas(K)}))}call(G,K){return __awaiter$b(this,void 0,void 0,(function*(){this._checkProvider("call");const ne=yield resolveProperties$2(this.checkTransaction(G));return yield this.provider.call(ne,K)}))}sendTransaction(G){return __awaiter$b(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const K=yield this.populateTransaction(G),ne=yield this.signTransaction(K);return yield this.provider.sendTransaction(ne)}))}getChainId(){return __awaiter$b(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return __awaiter$b(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return __awaiter$b(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(G){return __awaiter$b(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(G)}))}checkTransaction(G){for(const K in G)-1===Jo.indexOf(K)&&Ko.throwArgumentError("invalid transaction key: "+K,"transaction",G);const K=shallowCopy$1(G);return null==K.from?K.from=this.getAddress():K.from=Promise.all([Promise.resolve(K.from),this.getAddress()]).then((K=>(K[0].toLowerCase()!==K[1].toLowerCase()&&Ko.throwArgumentError("from address mismatch","transaction",G),K[0]))),K}populateTransaction(G){return __awaiter$b(this,void 0,void 0,(function*(){const K=yield resolveProperties$2(this.checkTransaction(G));null!=K.to&&(K.to=Promise.resolve(K.to).then((G=>__awaiter$b(this,void 0,void 0,(function*(){if(null==G)return null;const K=yield this.resolveName(G);return null==K&&Ko.throwArgumentError("provided ENS name resolves to null","tx.to",G),K})))),K.to.catch((G=>{})));const ne=null!=K.maxFeePerGas||null!=K.maxPriorityFeePerGas;if(null==K.gasPrice||2!==K.type&&!ne?0!==K.type&&1!==K.type||!ne||Ko.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",G):Ko.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",G),2!==K.type&&null!=K.type||null==K.maxFeePerGas||null==K.maxPriorityFeePerGas)if(0===K.type||1===K.type)null==K.gasPrice&&(K.gasPrice=this.getGasPrice());else{const G=yield this.getFeeData();if(null==K.type)if(null!=G.maxFeePerGas&&null!=G.maxPriorityFeePerGas)if(K.type=2,null!=K.gasPrice){const G=K.gasPrice;delete K.gasPrice,K.maxFeePerGas=G,K.maxPriorityFeePerGas=G}else null==K.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null==K.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas);else null!=G.gasPrice?(ne&&Ko.throwError("network does not support EIP-1559",oi.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==K.gasPrice&&(K.gasPrice=G.gasPrice),K.type=0):Ko.throwError("failed to get consistent fee data",oi.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===K.type&&(null==K.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null==K.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas))}else K.type=2;return null==K.nonce&&(K.nonce=this.getTransactionCount("pending")),null==K.gasLimit&&(K.gasLimit=this.estimateGas(K).catch((G=>{if(Xo.indexOf(G.code)>=0)throw G;return Ko.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",oi.errors.UNPREDICTABLE_GAS_LIMIT,{error:G,tx:K})}))),null==K.chainId?K.chainId=this.getChainId():K.chainId=Promise.all([Promise.resolve(K.chainId),this.getChainId()]).then((K=>(0!==K[1]&&K[0]!==K[1]&&Ko.throwArgumentError("chainId address mismatch","transaction",G),K[0]))),yield resolveProperties$2(K)}))}_checkProvider(G){this.provider||Ko.throwError("missing provider",oi.errors.UNSUPPORTED_OPERATION,{operation:G||"_checkProvider"})}static isSigner(G){return!(!G||!G._isSigner)}},Zo=class VoidSigner extends Qo{constructor(G,K){super(),defineReadOnly$1(this,"address",G),defineReadOnly$1(this,"provider",K||null)}getAddress(){return Promise.resolve(this.address)}_fail(G,K){return Promise.resolve().then((()=>{Ko.throwError(G,oi.errors.UNSUPPORTED_OPERATION,{operation:K})}))}signMessage(G){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(G){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(G,K,ne){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(G){return new VoidSigner(this.address,G)}};var Yo={},ec={},tc=assert$t;function assert$t(G,K){if(!G)throw new Error(K||"Assertion failed")}assert$t.equal=function assertEqual(G,K,ne){if(G!=K)throw new Error(ne||"Assertion failed: "+G+" != "+K)};var rc="function"==typeof Object.create?function inherits(G,K){G.super_=K,G.prototype=Object.create(K.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}})}:function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G},nc=getAugmentedNamespace$1(Object.freeze({__proto__:null,default:rc})),ac=tc,ic=nc;function isSurrogatePair(G,K){return 55296==(64512&G.charCodeAt(K))&&(!(K<0||K+1>=G.length)&&56320==(64512&G.charCodeAt(K+1)))}function htonl(G){return(G>>>24|G>>>8&65280|G<<8&16711680|(255&G)<<24)>>>0}function zero2(G){return 1===G.length?"0"+G:G}function zero8(G){return 7===G.length?"0"+G:6===G.length?"00"+G:5===G.length?"000"+G:4===G.length?"0000"+G:3===G.length?"00000"+G:2===G.length?"000000"+G:1===G.length?"0000000"+G:G}ec.inherits=ic,ec.toArray=function toArray$1(G,K){if(Array.isArray(G))return G.slice();if(!G)return[];var ne=[];if("string"==typeof G)if(K){if("hex"===K)for((G=G.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(G="0"+G),pe=0;pe<G.length;pe+=2)ne.push(parseInt(G[pe]+G[pe+1],16))}else for(var ue=0,pe=0;pe<G.length;pe++){var he=G.charCodeAt(pe);he<128?ne[ue++]=he:he<2048?(ne[ue++]=he>>6|192,ne[ue++]=63&he|128):isSurrogatePair(G,pe)?(he=65536+((1023&he)<<10)+(1023&G.charCodeAt(++pe)),ne[ue++]=he>>18|240,ne[ue++]=he>>12&63|128,ne[ue++]=he>>6&63|128,ne[ue++]=63&he|128):(ne[ue++]=he>>12|224,ne[ue++]=he>>6&63|128,ne[ue++]=63&he|128)}else for(pe=0;pe<G.length;pe++)ne[pe]=0|G[pe];return ne},ec.toHex=function toHex$3(G){for(var K="",ne=0;ne<G.length;ne++)K+=zero2(G[ne].toString(16));return K},ec.htonl=htonl,ec.toHex32=function toHex32(G,K){for(var ne="",ue=0;ue<G.length;ue++){var pe=G[ue];"little"===K&&(pe=htonl(pe)),ne+=zero8(pe.toString(16))}return ne},ec.zero2=zero2,ec.zero8=zero8,ec.join32=function join32(G,K,ne,ue){var pe=ne-K;ac(pe%4==0);for(var he=new Array(pe/4),ye=0,me=K;ye<he.length;ye++,me+=4){var be;be="big"===ue?G[me]<<24|G[me+1]<<16|G[me+2]<<8|G[me+3]:G[me+3]<<24|G[me+2]<<16|G[me+1]<<8|G[me],he[ye]=be>>>0}return he},ec.split32=function split32(G,K){for(var ne=new Array(4*G.length),ue=0,pe=0;ue<G.length;ue++,pe+=4){var he=G[ue];"big"===K?(ne[pe]=he>>>24,ne[pe+1]=he>>>16&255,ne[pe+2]=he>>>8&255,ne[pe+3]=255&he):(ne[pe+3]=he>>>24,ne[pe+2]=he>>>16&255,ne[pe+1]=he>>>8&255,ne[pe]=255&he)}return ne},ec.rotr32=function rotr32$1(G,K){return G>>>K|G<<32-K},ec.rotl32=function rotl32$2(G,K){return G<<K|G>>>32-K},ec.sum32=function sum32$3(G,K){return G+K>>>0},ec.sum32_3=function sum32_3$1(G,K,ne){return G+K+ne>>>0},ec.sum32_4=function sum32_4$2(G,K,ne,ue){return G+K+ne+ue>>>0},ec.sum32_5=function sum32_5$2(G,K,ne,ue,pe){return G+K+ne+ue+pe>>>0},ec.sum64=function sum64$1(G,K,ne,ue){var pe=G[K],he=ue+G[K+1]>>>0,ye=(he<ue?1:0)+ne+pe;G[K]=ye>>>0,G[K+1]=he},ec.sum64_hi=function sum64_hi$1(G,K,ne,ue){return(K+ue>>>0<K?1:0)+G+ne>>>0},ec.sum64_lo=function sum64_lo$1(G,K,ne,ue){return K+ue>>>0},ec.sum64_4_hi=function sum64_4_hi$1(G,K,ne,ue,pe,he,ye,me){var be=0,ve=K;return be+=(ve=ve+ue>>>0)<K?1:0,be+=(ve=ve+he>>>0)<he?1:0,G+ne+pe+ye+(be+=(ve=ve+me>>>0)<me?1:0)>>>0},ec.sum64_4_lo=function sum64_4_lo$1(G,K,ne,ue,pe,he,ye,me){return K+ue+he+me>>>0},ec.sum64_5_hi=function sum64_5_hi$1(G,K,ne,ue,pe,he,ye,me,be,ve){var _e=0,Te=K;return _e+=(Te=Te+ue>>>0)<K?1:0,_e+=(Te=Te+he>>>0)<he?1:0,_e+=(Te=Te+me>>>0)<me?1:0,G+ne+pe+ye+be+(_e+=(Te=Te+ve>>>0)<ve?1:0)>>>0},ec.sum64_5_lo=function sum64_5_lo$1(G,K,ne,ue,pe,he,ye,me,be,ve){return K+ue+he+me+ve>>>0},ec.rotr64_hi=function rotr64_hi$1(G,K,ne){return(K<<32-ne|G>>>ne)>>>0},ec.rotr64_lo=function rotr64_lo$1(G,K,ne){return(G<<32-ne|K>>>ne)>>>0},ec.shr64_hi=function shr64_hi$1(G,K,ne){return G>>>ne},ec.shr64_lo=function shr64_lo$1(G,K,ne){return(G<<32-ne|K>>>ne)>>>0};var sc={},oc=ec,cc=tc;function BlockHash$4(){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}sc.BlockHash=BlockHash$4,BlockHash$4.prototype.update=function update(G,K){if(G=oc.toArray(G,K),this.pending?this.pending=this.pending.concat(G):this.pending=G,this.pendingTotal+=G.length,this.pending.length>=this._delta8){var ne=(G=this.pending).length%this._delta8;this.pending=G.slice(G.length-ne,G.length),0===this.pending.length&&(this.pending=null),G=oc.join32(G,0,G.length-ne,this.endian);for(var ue=0;ue<G.length;ue+=this._delta32)this._update(G,ue,ue+this._delta32)}return this},BlockHash$4.prototype.digest=function digest(G){return this.update(this._pad()),cc(null===this.pending),this._digest(G)},BlockHash$4.prototype._pad=function pad(){var G=this.pendingTotal,K=this._delta8,ne=K-(G+this.padLength)%K,ue=new Array(ne+this.padLength);ue[0]=128;for(var pe=1;pe<ne;pe++)ue[pe]=0;if(G<<=3,"big"===this.endian){for(var he=8;he<this.padLength;he++)ue[pe++]=0;ue[pe++]=0,ue[pe++]=0,ue[pe++]=0,ue[pe++]=0,ue[pe++]=G>>>24&255,ue[pe++]=G>>>16&255,ue[pe++]=G>>>8&255,ue[pe++]=255&G}else for(ue[pe++]=255&G,ue[pe++]=G>>>8&255,ue[pe++]=G>>>16&255,ue[pe++]=G>>>24&255,ue[pe++]=0,ue[pe++]=0,ue[pe++]=0,ue[pe++]=0,he=8;he<this.padLength;he++)ue[pe++]=0;return ue};var dc={},uc={},fc=ec.rotr32;function ch32$1(G,K,ne){return G&K^~G&ne}function maj32$1(G,K,ne){return G&K^G&ne^K&ne}function p32(G,K,ne){return G^K^ne}uc.ft_1=function ft_1$1(G,K,ne,ue){return 0===G?ch32$1(K,ne,ue):1===G||3===G?p32(K,ne,ue):2===G?maj32$1(K,ne,ue):void 0},uc.ch32=ch32$1,uc.maj32=maj32$1,uc.p32=p32,uc.s0_256=function s0_256$1(G){return fc(G,2)^fc(G,13)^fc(G,22)},uc.s1_256=function s1_256$1(G){return fc(G,6)^fc(G,11)^fc(G,25)},uc.g0_256=function g0_256$1(G){return fc(G,7)^fc(G,18)^G>>>3},uc.g1_256=function g1_256$1(G){return fc(G,17)^fc(G,19)^G>>>10};var lc=ec,pc=sc,hc=uc,yc=lc.rotl32,mc=lc.sum32,bc=lc.sum32_5,gc=hc.ft_1,vc=pc.BlockHash,wc=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;vc.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}lc.inherits(SHA1,vc);var _c=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function _update(G,K){for(var ne=this.W,ue=0;ue<16;ue++)ne[ue]=G[K+ue];for(;ue<ne.length;ue++)ne[ue]=yc(ne[ue-3]^ne[ue-8]^ne[ue-14]^ne[ue-16],1);var pe=this.h[0],he=this.h[1],ye=this.h[2],me=this.h[3],be=this.h[4];for(ue=0;ue<ne.length;ue++){var ve=~~(ue/20),_e=bc(yc(pe,5),gc(ve,he,ye,me),be,ne[ue],wc[ve]);be=me,me=ye,ye=yc(he,30),he=pe,pe=_e}this.h[0]=mc(this.h[0],pe),this.h[1]=mc(this.h[1],he),this.h[2]=mc(this.h[2],ye),this.h[3]=mc(this.h[3],me),this.h[4]=mc(this.h[4],be)},SHA1.prototype._digest=function digest(G){return"hex"===G?lc.toHex32(this.h,"big"):lc.split32(this.h,"big")};var Tc=ec,Ac=sc,Ec=uc,Pc=tc,Sc=Tc.sum32,Ic=Tc.sum32_4,Cc=Tc.sum32_5,Rc=Ec.ch32,kc=Ec.maj32,Oc=Ec.s0_256,xc=Ec.s1_256,Nc=Ec.g0_256,Mc=Ec.g1_256,Bc=Ac.BlockHash,Fc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function SHA256$2(){if(!(this instanceof SHA256$2))return new SHA256$2;Bc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Fc,this.W=new Array(64)}Tc.inherits(SHA256$2,Bc);var Dc=SHA256$2;SHA256$2.blockSize=512,SHA256$2.outSize=256,SHA256$2.hmacStrength=192,SHA256$2.padLength=64,SHA256$2.prototype._update=function _update(G,K){for(var ne=this.W,ue=0;ue<16;ue++)ne[ue]=G[K+ue];for(;ue<ne.length;ue++)ne[ue]=Ic(Mc(ne[ue-2]),ne[ue-7],Nc(ne[ue-15]),ne[ue-16]);var pe=this.h[0],he=this.h[1],ye=this.h[2],me=this.h[3],be=this.h[4],ve=this.h[5],_e=this.h[6],Te=this.h[7];for(Pc(this.k.length===ne.length),ue=0;ue<ne.length;ue++){var Ee=Cc(Te,xc(be),Rc(be,ve,_e),this.k[ue],ne[ue]),Pe=Sc(Oc(pe),kc(pe,he,ye));Te=_e,_e=ve,ve=be,be=Sc(me,Ee),me=ye,ye=he,he=pe,pe=Sc(Ee,Pe)}this.h[0]=Sc(this.h[0],pe),this.h[1]=Sc(this.h[1],he),this.h[2]=Sc(this.h[2],ye),this.h[3]=Sc(this.h[3],me),this.h[4]=Sc(this.h[4],be),this.h[5]=Sc(this.h[5],ve),this.h[6]=Sc(this.h[6],_e),this.h[7]=Sc(this.h[7],Te)},SHA256$2.prototype._digest=function digest(G){return"hex"===G?Tc.toHex32(this.h,"big"):Tc.split32(this.h,"big")};var Lc=ec,Uc=Dc;function SHA224(){if(!(this instanceof SHA224))return new SHA224;Uc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Lc.inherits(SHA224,Uc);var $c=SHA224;SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function digest(G){return"hex"===G?Lc.toHex32(this.h.slice(0,7),"big"):Lc.split32(this.h.slice(0,7),"big")};var qc=ec,Gc=sc,jc=tc,Hc=qc.rotr64_hi,Wc=qc.rotr64_lo,zc=qc.shr64_hi,Vc=qc.shr64_lo,Kc=qc.sum64,Jc=qc.sum64_hi,Xc=qc.sum64_lo,Qc=qc.sum64_4_hi,Zc=qc.sum64_4_lo,Yc=qc.sum64_5_hi,ed=qc.sum64_5_lo,td=Gc.BlockHash,rd=[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 SHA512$2(){if(!(this instanceof SHA512$2))return new SHA512$2;td.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=rd,this.W=new Array(160)}qc.inherits(SHA512$2,td);var nd=SHA512$2;function ch64_hi(G,K,ne,ue,pe){var he=G&ne^~G&pe;return he<0&&(he+=4294967296),he}function ch64_lo(G,K,ne,ue,pe,he){var ye=K&ue^~K&he;return ye<0&&(ye+=4294967296),ye}function maj64_hi(G,K,ne,ue,pe){var he=G&ne^G&pe^ne&pe;return he<0&&(he+=4294967296),he}function maj64_lo(G,K,ne,ue,pe,he){var ye=K&ue^K&he^ue&he;return ye<0&&(ye+=4294967296),ye}function s0_512_hi(G,K){var ne=Hc(G,K,28)^Hc(K,G,2)^Hc(K,G,7);return ne<0&&(ne+=4294967296),ne}function s0_512_lo(G,K){var ne=Wc(G,K,28)^Wc(K,G,2)^Wc(K,G,7);return ne<0&&(ne+=4294967296),ne}function s1_512_hi(G,K){var ne=Hc(G,K,14)^Hc(G,K,18)^Hc(K,G,9);return ne<0&&(ne+=4294967296),ne}function s1_512_lo(G,K){var ne=Wc(G,K,14)^Wc(G,K,18)^Wc(K,G,9);return ne<0&&(ne+=4294967296),ne}function g0_512_hi(G,K){var ne=Hc(G,K,1)^Hc(G,K,8)^zc(G,K,7);return ne<0&&(ne+=4294967296),ne}function g0_512_lo(G,K){var ne=Wc(G,K,1)^Wc(G,K,8)^Vc(G,K,7);return ne<0&&(ne+=4294967296),ne}function g1_512_hi(G,K){var ne=Hc(G,K,19)^Hc(K,G,29)^zc(G,K,6);return ne<0&&(ne+=4294967296),ne}function g1_512_lo(G,K){var ne=Wc(G,K,19)^Wc(K,G,29)^Vc(G,K,6);return ne<0&&(ne+=4294967296),ne}SHA512$2.blockSize=1024,SHA512$2.outSize=512,SHA512$2.hmacStrength=192,SHA512$2.padLength=128,SHA512$2.prototype._prepareBlock=function _prepareBlock(G,K){for(var ne=this.W,ue=0;ue<32;ue++)ne[ue]=G[K+ue];for(;ue<ne.length;ue+=2){var pe=g1_512_hi(ne[ue-4],ne[ue-3]),he=g1_512_lo(ne[ue-4],ne[ue-3]),ye=ne[ue-14],me=ne[ue-13],be=g0_512_hi(ne[ue-30],ne[ue-29]),ve=g0_512_lo(ne[ue-30],ne[ue-29]),_e=ne[ue-32],Te=ne[ue-31];ne[ue]=Qc(pe,he,ye,me,be,ve,_e,Te),ne[ue+1]=Zc(pe,he,ye,me,be,ve,_e,Te)}},SHA512$2.prototype._update=function _update(G,K){this._prepareBlock(G,K);var ne=this.W,ue=this.h[0],pe=this.h[1],he=this.h[2],ye=this.h[3],me=this.h[4],be=this.h[5],ve=this.h[6],_e=this.h[7],Te=this.h[8],Ee=this.h[9],Pe=this.h[10],Se=this.h[11],Ce=this.h[12],ke=this.h[13],Oe=this.h[14],xe=this.h[15];jc(this.k.length===ne.length);for(var Ne=0;Ne<ne.length;Ne+=2){var Me=Oe,Be=xe,Fe=s1_512_hi(Te,Ee),De=s1_512_lo(Te,Ee),Le=ch64_hi(Te,Ee,Pe,Se,Ce),Ue=ch64_lo(Te,Ee,Pe,Se,Ce,ke),je=this.k[Ne],ze=this.k[Ne+1],Je=ne[Ne],Xe=ne[Ne+1],Qe=Yc(Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe),Ye=ed(Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe);Me=s0_512_hi(ue,pe),Be=s0_512_lo(ue,pe),Fe=maj64_hi(ue,pe,he,ye,me),De=maj64_lo(ue,pe,he,ye,me,be);var et=Jc(Me,Be,Fe,De),tt=Xc(Me,Be,Fe,De);Oe=Ce,xe=ke,Ce=Pe,ke=Se,Pe=Te,Se=Ee,Te=Jc(ve,_e,Qe,Ye),Ee=Xc(_e,_e,Qe,Ye),ve=me,_e=be,me=he,be=ye,he=ue,ye=pe,ue=Jc(Qe,Ye,et,tt),pe=Xc(Qe,Ye,et,tt)}Kc(this.h,0,ue,pe),Kc(this.h,2,he,ye),Kc(this.h,4,me,be),Kc(this.h,6,ve,_e),Kc(this.h,8,Te,Ee),Kc(this.h,10,Pe,Se),Kc(this.h,12,Ce,ke),Kc(this.h,14,Oe,xe)},SHA512$2.prototype._digest=function digest(G){return"hex"===G?qc.toHex32(this.h,"big"):qc.split32(this.h,"big")};var ad=ec,sd=nd;function SHA384(){if(!(this instanceof SHA384))return new SHA384;sd.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ad.inherits(SHA384,sd);var od=SHA384;SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function digest(G){return"hex"===G?ad.toHex32(this.h.slice(0,12),"big"):ad.split32(this.h.slice(0,12),"big")},dc.sha1=_c,dc.sha224=$c,dc.sha256=Dc,dc.sha384=od,dc.sha512=nd;var cd={},dd=ec,ud=sc,fd=dd.rotl32,ld=dd.sum32,pd=dd.sum32_3,hd=dd.sum32_4,yd=ud.BlockHash;function RIPEMD160$3(){if(!(this instanceof RIPEMD160$3))return new RIPEMD160$3;yd.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f$5(G,K,ne,ue){return G<=15?K^ne^ue:G<=31?K&ne|~K&ue:G<=47?(K|~ne)^ue:G<=63?K&ue|ne&~ue:K^(ne|~ue)}function K$4(G){return G<=15?0:G<=31?1518500249:G<=47?1859775393:G<=63?2400959708:2840853838}function Kh(G){return G<=15?1352829926:G<=31?1548603684:G<=47?1836072691:G<=63?2053994217:0}dd.inherits(RIPEMD160$3,yd),cd.ripemd160=RIPEMD160$3,RIPEMD160$3.blockSize=512,RIPEMD160$3.outSize=160,RIPEMD160$3.hmacStrength=192,RIPEMD160$3.padLength=64,RIPEMD160$3.prototype._update=function update(G,K){for(var ne=this.h[0],ue=this.h[1],pe=this.h[2],he=this.h[3],ye=this.h[4],me=ne,be=ue,ve=pe,_e=he,Te=ye,Ee=0;Ee<80;Ee++){var Pe=ld(fd(hd(ne,f$5(Ee,ue,pe,he),G[md[Ee]+K],K$4(Ee)),gd[Ee]),ye);ne=ye,ye=he,he=fd(pe,10),pe=ue,ue=Pe,Pe=ld(fd(hd(me,f$5(79-Ee,be,ve,_e),G[bd[Ee]+K],Kh(Ee)),vd[Ee]),Te),me=Te,Te=_e,_e=fd(ve,10),ve=be,be=Pe}Pe=pd(this.h[1],pe,_e),this.h[1]=pd(this.h[2],he,Te),this.h[2]=pd(this.h[3],ye,me),this.h[3]=pd(this.h[4],ne,be),this.h[4]=pd(this.h[0],ue,ve),this.h[0]=Pe},RIPEMD160$3.prototype._digest=function digest(G){return"hex"===G?dd.toHex32(this.h,"little"):dd.split32(this.h,"little")};var md=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],bd=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],gd=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],vd=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],wd=ec,_d=tc;function Hmac$2(G,K,ne){if(!(this instanceof Hmac$2))return new Hmac$2(G,K,ne);this.Hash=G,this.blockSize=G.blockSize/8,this.outSize=G.outSize/8,this.inner=null,this.outer=null,this._init(wd.toArray(K,ne))}var Td=Hmac$2;Hmac$2.prototype._init=function init(G){G.length>this.blockSize&&(G=(new this.Hash).update(G).digest()),_d(G.length<=this.blockSize);for(var K=G.length;K<this.blockSize;K++)G.push(0);for(K=0;K<G.length;K++)G[K]^=54;for(this.inner=(new this.Hash).update(G),K=0;K<G.length;K++)G[K]^=106;this.outer=(new this.Hash).update(G)},Hmac$2.prototype.update=function update(G,K){return this.inner.update(G,K),this},Hmac$2.prototype.digest=function digest(G){return this.outer.update(this.inner.digest()),this.outer.digest(G)},function(G){var K=G;K.utils=ec,K.common=sc,K.sha=dc,K.ripemd=cd,K.hmac=Td,K.sha1=K.sha.sha1,K.sha256=K.sha.sha256,K.sha224=K.sha.sha224,K.sha384=K.sha.sha384,K.sha512=K.sha.sha512,K.ripemd160=K.ripemd.ripemd160}(Yo);var Ad=getDefaultExportFromCjs$1(Yo);function createCommonjsModule$1(G,K,ne){return ne={path:K,exports:{},require:function(G,K){return function commonjsRequire$1(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==K&&ne.path)}},G(ne,ne.exports),ne.exports}var Ed=assert$n;function assert$n(G,K){if(!G)throw new Error(K||"Assertion failed")}assert$n.equal=function assertEqual(G,K,ne){if(G!=K)throw new Error(ne||"Assertion failed: "+G+" != "+K)};var Pd=createCommonjsModule$1((function(G,K){var ne=K;function zero2(G){return 1===G.length?"0"+G:G}function toHex(G){for(var K="",ne=0;ne<G.length;ne++)K+=zero2(G[ne].toString(16));return K}ne.toArray=function toArray(G,K){if(Array.isArray(G))return G.slice();if(!G)return[];var ne=[];if("string"!=typeof G){for(var ue=0;ue<G.length;ue++)ne[ue]=0|G[ue];return ne}if("hex"===K){(G=G.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(G="0"+G);for(ue=0;ue<G.length;ue+=2)ne.push(parseInt(G[ue]+G[ue+1],16))}else for(ue=0;ue<G.length;ue++){var pe=G.charCodeAt(ue),he=pe>>8,ye=255&pe;he?ne.push(he,ye):ne.push(ye)}return ne},ne.zero2=zero2,ne.toHex=toHex,ne.encode=function encode(G,K){return"hex"===K?toHex(G):G}})),Sd=createCommonjsModule$1((function(G,K){var ne=K;ne.assert=Ed,ne.toArray=Pd.toArray,ne.zero2=Pd.zero2,ne.toHex=Pd.toHex,ne.encode=Pd.encode,ne.getNAF=function getNAF(G,K,ne){var ue=new Array(Math.max(G.bitLength(),ne)+1);ue.fill(0);for(var pe=1<<K+1,he=G.clone(),ye=0;ye<ue.length;ye++){var me,be=he.andln(pe-1);he.isOdd()?(me=be>(pe>>1)-1?(pe>>1)-be:be,he.isubn(me)):me=0,ue[ye]=me,he.iushrn(1)}return ue},ne.getJSF=function getJSF(G,K){var ne=[[],[]];G=G.clone(),K=K.clone();for(var ue,pe=0,he=0;G.cmpn(-pe)>0||K.cmpn(-he)>0;){var ye,me,be=G.andln(3)+pe&3,ve=K.andln(3)+he&3;3===be&&(be=-1),3===ve&&(ve=-1),ye=0==(1&be)?0:3!==(ue=G.andln(7)+pe&7)&&5!==ue||2!==ve?be:-be,ne[0].push(ye),me=0==(1&ve)?0:3!==(ue=K.andln(7)+he&7)&&5!==ue||2!==be?ve:-ve,ne[1].push(me),2*pe===ye+1&&(pe=1-pe),2*he===me+1&&(he=1-he),G.iushrn(1),K.iushrn(1)}return ne},ne.cachedProperty=function cachedProperty(G,K,ne){var ue="_"+K;G.prototype[K]=function cachedProperty(){return void 0!==this[ue]?this[ue]:this[ue]=ne.call(this)}},ne.parseBytes=function parseBytes(G){return"string"==typeof G?ne.toArray(G,"hex"):G},ne.intFromLE=function intFromLE(G){return new Ei(G,"hex","le")}})),Id=Sd.getNAF,Cd=Sd.getJSF,Rd=Sd.assert;function BaseCurve$2(G,K){this.type=G,this.p=new Ei(K.p,16),this.red=K.prime?Ei.red(K.prime):Ei.mont(this.p),this.zero=new Ei(0).toRed(this.red),this.one=new Ei(1).toRed(this.red),this.two=new Ei(2).toRed(this.red),this.n=K.n&&new Ei(K.n,16),this.g=K.g&&this.pointFromJSON(K.g,K.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 ne=this.n&&this.p.div(this.n);!ne||ne.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var kd=BaseCurve$2;function BasePoint$2(G,K){this.curve=G,this.type=K,this.precomputed=null}BaseCurve$2.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve$2.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve$2.prototype._fixedNafMul=function _fixedNafMul(G,K){Rd(G.precomputed);var ne=G._getDoubles(),ue=Id(K,1,this._bitLength),pe=(1<<ne.step+1)-(ne.step%2==0?2:1);pe/=3;var he,ye,me=[];for(he=0;he<ue.length;he+=ne.step){ye=0;for(var be=he+ne.step-1;be>=he;be--)ye=(ye<<1)+ue[be];me.push(ye)}for(var ve=this.jpoint(null,null,null),_e=this.jpoint(null,null,null),Te=pe;Te>0;Te--){for(he=0;he<me.length;he++)(ye=me[he])===Te?_e=_e.mixedAdd(ne.points[he]):ye===-Te&&(_e=_e.mixedAdd(ne.points[he].neg()));ve=ve.add(_e)}return ve.toP()},BaseCurve$2.prototype._wnafMul=function _wnafMul(G,K){var ne=4,ue=G._getNAFPoints(ne);ne=ue.wnd;for(var pe=ue.points,he=Id(K,ne,this._bitLength),ye=this.jpoint(null,null,null),me=he.length-1;me>=0;me--){for(var be=0;me>=0&&0===he[me];me--)be++;if(me>=0&&be++,ye=ye.dblp(be),me<0)break;var ve=he[me];Rd(0!==ve),ye="affine"===G.type?ve>0?ye.mixedAdd(pe[ve-1>>1]):ye.mixedAdd(pe[-ve-1>>1].neg()):ve>0?ye.add(pe[ve-1>>1]):ye.add(pe[-ve-1>>1].neg())}return"affine"===G.type?ye.toP():ye},BaseCurve$2.prototype._wnafMulAdd=function _wnafMulAdd(G,K,ne,ue,pe){var he,ye,me,be=this._wnafT1,ve=this._wnafT2,_e=this._wnafT3,Te=0;for(he=0;he<ue;he++){var Ee=(me=K[he])._getNAFPoints(G);be[he]=Ee.wnd,ve[he]=Ee.points}for(he=ue-1;he>=1;he-=2){var Pe=he-1,Se=he;if(1===be[Pe]&&1===be[Se]){var Ce=[K[Pe],null,null,K[Se]];0===K[Pe].y.cmp(K[Se].y)?(Ce[1]=K[Pe].add(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg())):0===K[Pe].y.cmp(K[Se].y.redNeg())?(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].add(K[Se].neg())):(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg()));var ke=[-3,-1,-5,-7,0,7,5,1,3],Oe=Cd(ne[Pe],ne[Se]);for(Te=Math.max(Oe[0].length,Te),_e[Pe]=new Array(Te),_e[Se]=new Array(Te),ye=0;ye<Te;ye++){var xe=0|Oe[0][ye],Ne=0|Oe[1][ye];_e[Pe][ye]=ke[3*(xe+1)+(Ne+1)],_e[Se][ye]=0,ve[Pe]=Ce}}else _e[Pe]=Id(ne[Pe],be[Pe],this._bitLength),_e[Se]=Id(ne[Se],be[Se],this._bitLength),Te=Math.max(_e[Pe].length,Te),Te=Math.max(_e[Se].length,Te)}var Me=this.jpoint(null,null,null),Be=this._wnafT4;for(he=Te;he>=0;he--){for(var Fe=0;he>=0;){var De=!0;for(ye=0;ye<ue;ye++)Be[ye]=0|_e[ye][he],0!==Be[ye]&&(De=!1);if(!De)break;Fe++,he--}if(he>=0&&Fe++,Me=Me.dblp(Fe),he<0)break;for(ye=0;ye<ue;ye++){var Le=Be[ye];0!==Le&&(Le>0?me=ve[ye][Le-1>>1]:Le<0&&(me=ve[ye][-Le-1>>1].neg()),Me="affine"===me.type?Me.mixedAdd(me):Me.add(me))}}for(he=0;he<ue;he++)ve[he]=null;return pe?Me:Me.toP()},BaseCurve$2.BasePoint=BasePoint$2,BasePoint$2.prototype.eq=function eq(){throw new Error("Not implemented")},BasePoint$2.prototype.validate=function validate(){return this.curve.validate(this)},BaseCurve$2.prototype.decodePoint=function decodePoint(G,K){G=Sd.toArray(G,K);var ne=this.p.byteLength();if((4===G[0]||6===G[0]||7===G[0])&&G.length-1==2*ne)return 6===G[0]?Rd(G[G.length-1]%2==0):7===G[0]&&Rd(G[G.length-1]%2==1),this.point(G.slice(1,1+ne),G.slice(1+ne,1+2*ne));if((2===G[0]||3===G[0])&&G.length-1===ne)return this.pointFromX(G.slice(1,1+ne),3===G[0]);throw new Error("Unknown point format")},BasePoint$2.prototype.encodeCompressed=function encodeCompressed(G){return this.encode(G,!0)},BasePoint$2.prototype._encode=function _encode(G){var K=this.curve.p.byteLength(),ne=this.getX().toArray("be",K);return G?[this.getY().isEven()?2:3].concat(ne):[4].concat(ne,this.getY().toArray("be",K))},BasePoint$2.prototype.encode=function encode(G,K){return Sd.encode(this._encode(K),G)},BasePoint$2.prototype.precompute=function precompute(G){if(this.precomputed)return this;var K={doubles:null,naf:null,beta:null};return K.naf=this._getNAFPoints(8),K.doubles=this._getDoubles(4,G),K.beta=this._getBeta(),this.precomputed=K,this},BasePoint$2.prototype._hasDoubles=function _hasDoubles(G){if(!this.precomputed)return!1;var K=this.precomputed.doubles;return!!K&&K.points.length>=Math.ceil((G.bitLength()+1)/K.step)},BasePoint$2.prototype._getDoubles=function _getDoubles(G,K){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ne=[this],ue=this,pe=0;pe<K;pe+=G){for(var he=0;he<G;he++)ue=ue.dbl();ne.push(ue)}return{step:G,points:ne}},BasePoint$2.prototype._getNAFPoints=function _getNAFPoints(G){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var K=[this],ne=(1<<G)-1,ue=1===ne?null:this.dbl(),pe=1;pe<ne;pe++)K[pe]=K[pe-1].add(ue);return{wnd:G,points:K}},BasePoint$2.prototype._getBeta=function _getBeta(){return null},BasePoint$2.prototype.dblp=function dblp(G){for(var K=this,ne=0;ne<G;ne++)K=K.dbl();return K};var Od=createCommonjsModule$1((function(G){"function"==typeof Object.create?G.exports=function inherits(G,K){K&&(G.super_=K,G.prototype=Object.create(K.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}))}:G.exports=function inherits(G,K){if(K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G}}})),xd=Sd.assert;function ShortCurve$2(G){kd.call(this,"short",G),this.a=new Ei(G.a,16).toRed(this.red),this.b=new Ei(G.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(G),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Od(ShortCurve$2,kd);var Nd=ShortCurve$2;function Point$6(G,K,ne,ue){kd.BasePoint.call(this,G,"affine"),null===K&&null===ne?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ei(K,16),this.y=new Ei(ne,16),ue&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint$2(G,K,ne,ue){kd.BasePoint.call(this,G,"jacobian"),null===K&&null===ne&&null===ue?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ei(0)):(this.x=new Ei(K,16),this.y=new Ei(ne,16),this.z=new Ei(ue,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}ShortCurve$2.prototype._getEndomorphism=function _getEndomorphism(G){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var K,ne;if(G.beta)K=new Ei(G.beta,16).toRed(this.red);else{var ue=this._getEndoRoots(this.p);K=(K=ue[0].cmp(ue[1])<0?ue[0]:ue[1]).toRed(this.red)}if(G.lambda)ne=new Ei(G.lambda,16);else{var pe=this._getEndoRoots(this.n);0===this.g.mul(pe[0]).x.cmp(this.g.x.redMul(K))?ne=pe[0]:(ne=pe[1],xd(0===this.g.mul(ne).x.cmp(this.g.x.redMul(K))))}return{beta:K,lambda:ne,basis:G.basis?G.basis.map((function(G){return{a:new Ei(G.a,16),b:new Ei(G.b,16)}})):this._getEndoBasis(ne)}}},ShortCurve$2.prototype._getEndoRoots=function _getEndoRoots(G){var K=G===this.p?this.red:Ei.mont(G),ne=new Ei(2).toRed(K).redInvm(),ue=ne.redNeg(),pe=new Ei(3).toRed(K).redNeg().redSqrt().redMul(ne);return[ue.redAdd(pe).fromRed(),ue.redSub(pe).fromRed()]},ShortCurve$2.prototype._getEndoBasis=function _getEndoBasis(G){for(var K,ne,ue,pe,he,ye,me,be,ve,_e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),Te=G,Ee=this.n.clone(),Pe=new Ei(1),Se=new Ei(0),Ce=new Ei(0),ke=new Ei(1),Oe=0;0!==Te.cmpn(0);){var xe=Ee.div(Te);be=Ee.sub(xe.mul(Te)),ve=Ce.sub(xe.mul(Pe));var Ne=ke.sub(xe.mul(Se));if(!ue&&be.cmp(_e)<0)K=me.neg(),ne=Pe,ue=be.neg(),pe=ve;else if(ue&&2==++Oe)break;me=be,Ee=Te,Te=be,Ce=Pe,Pe=ve,ke=Se,Se=Ne}he=be.neg(),ye=ve;var Me=ue.sqr().add(pe.sqr());return he.sqr().add(ye.sqr()).cmp(Me)>=0&&(he=K,ye=ne),ue.negative&&(ue=ue.neg(),pe=pe.neg()),he.negative&&(he=he.neg(),ye=ye.neg()),[{a:ue,b:pe},{a:he,b:ye}]},ShortCurve$2.prototype._endoSplit=function _endoSplit(G){var K=this.endo.basis,ne=K[0],ue=K[1],pe=ue.b.mul(G).divRound(this.n),he=ne.b.neg().mul(G).divRound(this.n),ye=pe.mul(ne.a),me=he.mul(ue.a),be=pe.mul(ne.b),ve=he.mul(ue.b);return{k1:G.sub(ye).sub(me),k2:be.add(ve).neg()}},ShortCurve$2.prototype.pointFromX=function pointFromX(G,K){(G=new Ei(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr().redMul(G).redIAdd(G.redMul(this.a)).redIAdd(this.b),ue=ne.redSqrt();if(0!==ue.redSqr().redSub(ne).cmp(this.zero))throw new Error("invalid point");var pe=ue.fromRed().isOdd();return(K&&!pe||!K&&pe)&&(ue=ue.redNeg()),this.point(G,ue)},ShortCurve$2.prototype.validate=function validate(G){if(G.inf)return!0;var K=G.x,ne=G.y,ue=this.a.redMul(K),pe=K.redSqr().redMul(K).redIAdd(ue).redIAdd(this.b);return 0===ne.redSqr().redISub(pe).cmpn(0)},ShortCurve$2.prototype._endoWnafMulAdd=function _endoWnafMulAdd(G,K,ne){for(var ue=this._endoWnafT1,pe=this._endoWnafT2,he=0;he<G.length;he++){var ye=this._endoSplit(K[he]),me=G[he],be=me._getBeta();ye.k1.negative&&(ye.k1.ineg(),me=me.neg(!0)),ye.k2.negative&&(ye.k2.ineg(),be=be.neg(!0)),ue[2*he]=me,ue[2*he+1]=be,pe[2*he]=ye.k1,pe[2*he+1]=ye.k2}for(var ve=this._wnafMulAdd(1,ue,pe,2*he,ne),_e=0;_e<2*he;_e++)ue[_e]=null,pe[_e]=null;return ve},Od(Point$6,kd.BasePoint),ShortCurve$2.prototype.point=function point(G,K,ne){return new Point$6(this,G,K,ne)},ShortCurve$2.prototype.pointFromJSON=function pointFromJSON(G,K){return Point$6.fromJSON(this,G,K)},Point$6.prototype._getBeta=function _getBeta(){if(this.curve.endo){var G=this.precomputed;if(G&&G.beta)return G.beta;var K=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(G){var ne=this.curve,endoMul=function(G){return ne.point(G.x.redMul(ne.endo.beta),G.y)};G.beta=K,K.precomputed={beta:null,naf:G.naf&&{wnd:G.naf.wnd,points:G.naf.points.map(endoMul)},doubles:G.doubles&&{step:G.doubles.step,points:G.doubles.points.map(endoMul)}}}return K}},Point$6.prototype.toJSON=function toJSON(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$6.fromJSON=function fromJSON(G,K,ne){"string"==typeof K&&(K=JSON.parse(K));var ue=G.point(K[0],K[1],ne);if(!K[2])return ue;function obj2point(K){return G.point(K[0],K[1],ne)}var pe=K[2];return ue.precomputed={beta:null,doubles:pe.doubles&&{step:pe.doubles.step,points:[ue].concat(pe.doubles.points.map(obj2point))},naf:pe.naf&&{wnd:pe.naf.wnd,points:[ue].concat(pe.naf.points.map(obj2point))}},ue},Point$6.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$6.prototype.isInfinity=function isInfinity(){return this.inf},Point$6.prototype.add=function add(G){if(this.inf)return G;if(G.inf)return this;if(this.eq(G))return this.dbl();if(this.neg().eq(G))return this.curve.point(null,null);if(0===this.x.cmp(G.x))return this.curve.point(null,null);var K=this.y.redSub(G.y);0!==K.cmpn(0)&&(K=K.redMul(this.x.redSub(G.x).redInvm()));var ne=K.redSqr().redISub(this.x).redISub(G.x),ue=K.redMul(this.x.redSub(ne)).redISub(this.y);return this.curve.point(ne,ue)},Point$6.prototype.dbl=function dbl(){if(this.inf)return this;var G=this.y.redAdd(this.y);if(0===G.cmpn(0))return this.curve.point(null,null);var K=this.curve.a,ne=this.x.redSqr(),ue=G.redInvm(),pe=ne.redAdd(ne).redIAdd(ne).redIAdd(K).redMul(ue),he=pe.redSqr().redISub(this.x.redAdd(this.x)),ye=pe.redMul(this.x.redSub(he)).redISub(this.y);return this.curve.point(he,ye)},Point$6.prototype.getX=function getX(){return this.x.fromRed()},Point$6.prototype.getY=function getY(){return this.y.fromRed()},Point$6.prototype.mul=function mul(G){return G=new Ei(G,16),this.isInfinity()?this:this._hasDoubles(G)?this.curve._fixedNafMul(this,G):this.curve.endo?this.curve._endoWnafMulAdd([this],[G]):this.curve._wnafMul(this,G)},Point$6.prototype.mulAdd=function mulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe):this.curve._wnafMulAdd(1,ue,pe,2)},Point$6.prototype.jmulAdd=function jmulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe,!0):this.curve._wnafMulAdd(1,ue,pe,2,!0)},Point$6.prototype.eq=function eq(G){return this===G||this.inf===G.inf&&(this.inf||0===this.x.cmp(G.x)&&0===this.y.cmp(G.y))},Point$6.prototype.neg=function neg(G){if(this.inf)return this;var K=this.curve.point(this.x,this.y.redNeg());if(G&&this.precomputed){var ne=this.precomputed,negate=function(G){return G.neg()};K.precomputed={naf:ne.naf&&{wnd:ne.naf.wnd,points:ne.naf.points.map(negate)},doubles:ne.doubles&&{step:ne.doubles.step,points:ne.doubles.points.map(negate)}}}return K},Point$6.prototype.toJ=function toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Od(JPoint$2,kd.BasePoint),ShortCurve$2.prototype.jpoint=function jpoint(G,K,ne){return new JPoint$2(this,G,K,ne)},JPoint$2.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var G=this.z.redInvm(),K=G.redSqr(),ne=this.x.redMul(K),ue=this.y.redMul(K).redMul(G);return this.curve.point(ne,ue)},JPoint$2.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint$2.prototype.add=function add(G){if(this.isInfinity())return G;if(G.isInfinity())return this;var K=G.z.redSqr(),ne=this.z.redSqr(),ue=this.x.redMul(K),pe=G.x.redMul(ne),he=this.y.redMul(K.redMul(G.z)),ye=G.y.redMul(ne.redMul(this.z)),me=ue.redSub(pe),be=he.redSub(ye);if(0===me.cmpn(0))return 0!==be.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var ve=me.redSqr(),_e=ve.redMul(me),Te=ue.redMul(ve),Ee=be.redSqr().redIAdd(_e).redISub(Te).redISub(Te),Pe=be.redMul(Te.redISub(Ee)).redISub(he.redMul(_e)),Se=this.z.redMul(G.z).redMul(me);return this.curve.jpoint(Ee,Pe,Se)},JPoint$2.prototype.mixedAdd=function mixedAdd(G){if(this.isInfinity())return G.toJ();if(G.isInfinity())return this;var K=this.z.redSqr(),ne=this.x,ue=G.x.redMul(K),pe=this.y,he=G.y.redMul(K).redMul(this.z),ye=ne.redSub(ue),me=pe.redSub(he);if(0===ye.cmpn(0))return 0!==me.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var be=ye.redSqr(),ve=be.redMul(ye),_e=ne.redMul(be),Te=me.redSqr().redIAdd(ve).redISub(_e).redISub(_e),Ee=me.redMul(_e.redISub(Te)).redISub(pe.redMul(ve)),Pe=this.z.redMul(ye);return this.curve.jpoint(Te,Ee,Pe)},JPoint$2.prototype.dblp=function dblp(G){if(0===G)return this;if(this.isInfinity())return this;if(!G)return this.dbl();var K;if(this.curve.zeroA||this.curve.threeA){var ne=this;for(K=0;K<G;K++)ne=ne.dbl();return ne}var ue=this.curve.a,pe=this.curve.tinv,he=this.x,ye=this.y,me=this.z,be=me.redSqr().redSqr(),ve=ye.redAdd(ye);for(K=0;K<G;K++){var _e=he.redSqr(),Te=ve.redSqr(),Ee=Te.redSqr(),Pe=_e.redAdd(_e).redIAdd(_e).redIAdd(ue.redMul(be)),Se=he.redMul(Te),Ce=Pe.redSqr().redISub(Se.redAdd(Se)),ke=Se.redISub(Ce),Oe=Pe.redMul(ke);Oe=Oe.redIAdd(Oe).redISub(Ee);var xe=ve.redMul(me);K+1<G&&(be=be.redMul(Ee)),he=Ce,me=xe,ve=Oe}return this.curve.jpoint(he,ve.redMul(pe),me)},JPoint$2.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint$2.prototype._zeroDbl=function _zeroDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue),be=me.redSqr().redISub(ye).redISub(ye),ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),G=be,K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.x.redSqr(),Te=this.y.redSqr(),Ee=Te.redSqr(),Pe=this.x.redAdd(Te).redSqr().redISub(_e).redISub(Ee);Pe=Pe.redIAdd(Pe);var Se=_e.redAdd(_e).redIAdd(_e),Ce=Se.redSqr(),ke=Ee.redIAdd(Ee);ke=(ke=ke.redIAdd(ke)).redIAdd(ke),G=Ce.redISub(Pe).redISub(Pe),K=Se.redMul(Pe.redISub(G)).redISub(ke),ne=(ne=this.y.redMul(this.z)).redIAdd(ne)}return this.curve.jpoint(G,K,ne)},JPoint$2.prototype._threeDbl=function _threeDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue).redIAdd(this.curve.a),be=me.redSqr().redISub(ye).redISub(ye);G=be;var ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.z.redSqr(),Te=this.y.redSqr(),Ee=this.x.redMul(Te),Pe=this.x.redSub(_e).redMul(this.x.redAdd(_e));Pe=Pe.redAdd(Pe).redIAdd(Pe);var Se=Ee.redIAdd(Ee),Ce=(Se=Se.redIAdd(Se)).redAdd(Se);G=Pe.redSqr().redISub(Ce),ne=this.y.redAdd(this.z).redSqr().redISub(Te).redISub(_e);var ke=Te.redSqr();ke=(ke=(ke=ke.redIAdd(ke)).redIAdd(ke)).redIAdd(ke),K=Pe.redMul(Se.redISub(G)).redISub(ke)}return this.curve.jpoint(G,K,ne)},JPoint$2.prototype._dbl=function _dbl(){var G=this.curve.a,K=this.x,ne=this.y,ue=this.z,pe=ue.redSqr().redSqr(),he=K.redSqr(),ye=ne.redSqr(),me=he.redAdd(he).redIAdd(he).redIAdd(G.redMul(pe)),be=K.redAdd(K),ve=(be=be.redIAdd(be)).redMul(ye),_e=me.redSqr().redISub(ve.redAdd(ve)),Te=ve.redISub(_e),Ee=ye.redSqr();Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=me.redMul(Te).redISub(Ee),Se=ne.redAdd(ne).redMul(ue);return this.curve.jpoint(_e,Pe,Se)},JPoint$2.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var G=this.x.redSqr(),K=this.y.redSqr(),ne=this.z.redSqr(),ue=K.redSqr(),pe=G.redAdd(G).redIAdd(G),he=pe.redSqr(),ye=this.x.redAdd(K).redSqr().redISub(G).redISub(ue),me=(ye=(ye=(ye=ye.redIAdd(ye)).redAdd(ye).redIAdd(ye)).redISub(he)).redSqr(),be=ue.redIAdd(ue);be=(be=(be=be.redIAdd(be)).redIAdd(be)).redIAdd(be);var ve=pe.redIAdd(ye).redSqr().redISub(he).redISub(me).redISub(be),_e=K.redMul(ve);_e=(_e=_e.redIAdd(_e)).redIAdd(_e);var Te=this.x.redMul(me).redISub(_e);Te=(Te=Te.redIAdd(Te)).redIAdd(Te);var Ee=this.y.redMul(ve.redMul(be.redISub(ve)).redISub(ye.redMul(me)));Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=this.z.redAdd(ye).redSqr().redISub(ne).redISub(me);return this.curve.jpoint(Te,Ee,Pe)},JPoint$2.prototype.mul=function mul(G,K){return G=new Ei(G,K),this.curve._wnafMul(this,G)},JPoint$2.prototype.eq=function eq(G){if("affine"===G.type)return this.eq(G.toJ());if(this===G)return!0;var K=this.z.redSqr(),ne=G.z.redSqr();if(0!==this.x.redMul(ne).redISub(G.x.redMul(K)).cmpn(0))return!1;var ue=K.redMul(this.z),pe=ne.redMul(G.z);return 0===this.y.redMul(pe).redISub(G.y.redMul(ue)).cmpn(0)},JPoint$2.prototype.eqXToP=function eqXToP(G){var K=this.z.redSqr(),ne=G.toRed(this.curve.red).redMul(K);if(0===this.x.cmp(ne))return!0;for(var ue=G.clone(),pe=this.curve.redN.redMul(K);;){if(ue.iadd(this.curve.n),ue.cmp(this.curve.p)>=0)return!1;if(ne.redIAdd(pe),0===this.x.cmp(ne))return!0}},JPoint$2.prototype.inspect=function inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint$2.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)};var Md=createCommonjsModule$1((function(G,K){var ne=K;ne.base=kd,ne.short=Nd,ne.mont=null,ne.edwards=null})),Bd=createCommonjsModule$1((function(G,K){var ne,ue=K,pe=Sd.assert;function PresetCurve(G){"short"===G.type?this.curve=new Md.short(G):"edwards"===G.type?this.curve=new Md.edwards(G):this.curve=new Md.mont(G),this.g=this.curve.g,this.n=this.curve.n,this.hash=G.hash,pe(this.g.validate(),"Invalid curve"),pe(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(G,K){Object.defineProperty(ue,G,{configurable:!0,enumerable:!0,get:function(){var ne=new PresetCurve(K);return Object.defineProperty(ue,G,{configurable:!0,enumerable:!0,value:ne}),ne}})}ue.PresetCurve=PresetCurve,defineCurve("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:Ad.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("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:Ad.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("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:Ad.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("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:Ad.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"]}),defineCurve("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:Ad.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"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ad.sha256,gRed:!1,g:["9"]}),defineCurve("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:Ad.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{ne=null.crash()}catch(G){ne=void 0}defineCurve("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:Ad.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",ne]})}));function HmacDRBG$3(G){if(!(this instanceof HmacDRBG$3))return new HmacDRBG$3(G);this.hash=G.hash,this.predResist=!!G.predResist,this.outLen=this.hash.outSize,this.minEntropy=G.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var K=Pd.toArray(G.entropy,G.entropyEnc||"hex"),ne=Pd.toArray(G.nonce,G.nonceEnc||"hex"),ue=Pd.toArray(G.pers,G.persEnc||"hex");Ed(K.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(K,ne,ue)}var Fd=HmacDRBG$3;HmacDRBG$3.prototype._init=function init(G,K,ne){var ue=G.concat(K).concat(ne);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var pe=0;pe<this.V.length;pe++)this.K[pe]=0,this.V[pe]=1;this._update(ue),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG$3.prototype._hmac=function hmac(){return new Ad.hmac(this.hash,this.K)},HmacDRBG$3.prototype._update=function update(G){var K=this._hmac().update(this.V).update([0]);G&&(K=K.update(G)),this.K=K.digest(),this.V=this._hmac().update(this.V).digest(),G&&(this.K=this._hmac().update(this.V).update([1]).update(G).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG$3.prototype.reseed=function reseed(G,K,ne,ue){"string"!=typeof K&&(ue=ne,ne=K,K=null),G=Pd.toArray(G,K),ne=Pd.toArray(ne,ue),Ed(G.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(G.concat(ne||[])),this._reseed=1},HmacDRBG$3.prototype.generate=function generate(G,K,ne,ue){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof K&&(ue=ne,ne=K,K=null),ne&&(ne=Pd.toArray(ne,ue||"hex"),this._update(ne));for(var pe=[];pe.length<G;)this.V=this._hmac().update(this.V).digest(),pe=pe.concat(this.V);var he=pe.slice(0,G);return this._update(ne),this._reseed++,Pd.encode(he,K)};var Dd=Sd.assert;function KeyPair$8(G,K){this.ec=G,this.priv=null,this.pub=null,K.priv&&this._importPrivate(K.priv,K.privEnc),K.pub&&this._importPublic(K.pub,K.pubEnc)}var Ld=KeyPair$8;KeyPair$8.fromPublic=function fromPublic(G,K,ne){return K instanceof KeyPair$8?K:new KeyPair$8(G,{pub:K,pubEnc:ne})},KeyPair$8.fromPrivate=function fromPrivate(G,K,ne){return K instanceof KeyPair$8?K:new KeyPair$8(G,{priv:K,privEnc:ne})},KeyPair$8.prototype.validate=function validate(){var G=this.getPublic();return G.isInfinity()?{result:!1,reason:"Invalid public key"}:G.validate()?G.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair$8.prototype.getPublic=function getPublic(G,K){return"string"==typeof G&&(K=G,G=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),K?this.pub.encode(K,G):this.pub},KeyPair$8.prototype.getPrivate=function getPrivate(G){return"hex"===G?this.priv.toString(16,2):this.priv},KeyPair$8.prototype._importPrivate=function _importPrivate(G,K){this.priv=new Ei(G,K||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$8.prototype._importPublic=function _importPublic(G,K){if(G.x||G.y)return"mont"===this.ec.curve.type?Dd(G.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Dd(G.x&&G.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(G.x,G.y));this.pub=this.ec.curve.decodePoint(G,K)},KeyPair$8.prototype.derive=function derive(G){return G.validate()||Dd(G.validate(),"public point not validated"),G.mul(this.priv).getX()},KeyPair$8.prototype.sign=function sign(G,K,ne){return this.ec.sign(G,this,K,ne)},KeyPair$8.prototype.verify=function verify(G,K){return this.ec.verify(G,K,this)},KeyPair$8.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Ud=Sd.assert;function Signature$9(G,K){if(G instanceof Signature$9)return G;this._importDER(G,K)||(Ud(G.r&&G.s,"Signature without r or s"),this.r=new Ei(G.r,16),this.s=new Ei(G.s,16),void 0===G.recoveryParam?this.recoveryParam=null:this.recoveryParam=G.recoveryParam)}var $d=Signature$9;function Position$3(){this.place=0}function getLength$3(G,K){var ne=G[K.place++];if(!(128&ne))return ne;var ue=15&ne;if(0===ue||ue>4)return!1;for(var pe=0,he=0,ye=K.place;he<ue;he++,ye++)pe<<=8,pe|=G[ye],pe>>>=0;return!(pe<=127)&&(K.place=ye,pe)}function rmPadding$2(G){for(var K=0,ne=G.length-1;!G[K]&&!(128&G[K+1])&&K<ne;)K++;return 0===K?G:G.slice(K)}function constructLength$2(G,K){if(K<128)G.push(K);else{var ne=1+(Math.log(K)/Math.LN2>>>3);for(G.push(128|ne);--ne;)G.push(K>>>(ne<<3)&255);G.push(K)}}Signature$9.prototype._importDER=function _importDER(G,K){G=Sd.toArray(G,K);var ne=new Position$3;if(48!==G[ne.place++])return!1;var ue=getLength$3(G,ne);if(!1===ue)return!1;if(ue+ne.place!==G.length)return!1;if(2!==G[ne.place++])return!1;var pe=getLength$3(G,ne);if(!1===pe)return!1;var he=G.slice(ne.place,pe+ne.place);if(ne.place+=pe,2!==G[ne.place++])return!1;var ye=getLength$3(G,ne);if(!1===ye)return!1;if(G.length!==ye+ne.place)return!1;var me=G.slice(ne.place,ye+ne.place);if(0===he[0]){if(!(128&he[1]))return!1;he=he.slice(1)}if(0===me[0]){if(!(128&me[1]))return!1;me=me.slice(1)}return this.r=new Ei(he),this.s=new Ei(me),this.recoveryParam=null,!0},Signature$9.prototype.toDER=function toDER(G){var K=this.r.toArray(),ne=this.s.toArray();for(128&K[0]&&(K=[0].concat(K)),128&ne[0]&&(ne=[0].concat(ne)),K=rmPadding$2(K),ne=rmPadding$2(ne);!(ne[0]||128&ne[1]);)ne=ne.slice(1);var ue=[2];constructLength$2(ue,K.length),(ue=ue.concat(K)).push(2),constructLength$2(ue,ne.length);var pe=ue.concat(ne),he=[48];return constructLength$2(he,pe.length),he=he.concat(pe),Sd.encode(he,G)};var rand$2=function(){throw new Error("unsupported")},qd=Sd.assert;function EC$3(G){if(!(this instanceof EC$3))return new EC$3(G);"string"==typeof G&&(qd(Object.prototype.hasOwnProperty.call(Bd,G),"Unknown curve "+G),G=Bd[G]),G instanceof Bd.PresetCurve&&(G={curve:G}),this.curve=G.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=G.curve.g,this.g.precompute(G.curve.n.bitLength()+1),this.hash=G.hash||G.curve.hash}var Gd=EC$3;EC$3.prototype.keyPair=function keyPair(G){return new Ld(this,G)},EC$3.prototype.keyFromPrivate=function keyFromPrivate(G,K){return Ld.fromPrivate(this,G,K)},EC$3.prototype.keyFromPublic=function keyFromPublic(G,K){return Ld.fromPublic(this,G,K)},EC$3.prototype.genKeyPair=function genKeyPair(G){G||(G={});for(var K=new Fd({hash:this.hash,pers:G.pers,persEnc:G.persEnc||"utf8",entropy:G.entropy||rand$2(this.hash.hmacStrength),entropyEnc:G.entropy&&G.entropyEnc||"utf8",nonce:this.n.toArray()}),ne=this.n.byteLength(),ue=this.n.sub(new Ei(2));;){var pe=new Ei(K.generate(ne));if(!(pe.cmp(ue)>0))return pe.iaddn(1),this.keyFromPrivate(pe)}},EC$3.prototype._truncateToN=function _truncateToN(G,K){var ne=8*G.byteLength()-this.n.bitLength();return ne>0&&(G=G.ushrn(ne)),!K&&G.cmp(this.n)>=0?G.sub(this.n):G},EC$3.prototype.sign=function sign(G,K,ne,ue){"object"==typeof ne&&(ue=ne,ne=null),ue||(ue={}),K=this.keyFromPrivate(K,ne),G=this._truncateToN(new Ei(G,16));for(var pe=this.n.byteLength(),he=K.getPrivate().toArray("be",pe),ye=G.toArray("be",pe),me=new Fd({hash:this.hash,entropy:he,nonce:ye,pers:ue.pers,persEnc:ue.persEnc||"utf8"}),be=this.n.sub(new Ei(1)),ve=0;;ve++){var _e=ue.k?ue.k(ve):new Ei(me.generate(this.n.byteLength()));if(!((_e=this._truncateToN(_e,!0)).cmpn(1)<=0||_e.cmp(be)>=0)){var Te=this.g.mul(_e);if(!Te.isInfinity()){var Ee=Te.getX(),Pe=Ee.umod(this.n);if(0!==Pe.cmpn(0)){var Se=_e.invm(this.n).mul(Pe.mul(K.getPrivate()).iadd(G));if(0!==(Se=Se.umod(this.n)).cmpn(0)){var Ce=(Te.getY().isOdd()?1:0)|(0!==Ee.cmp(Pe)?2:0);return ue.canonical&&Se.cmp(this.nh)>0&&(Se=this.n.sub(Se),Ce^=1),new $d({r:Pe,s:Se,recoveryParam:Ce})}}}}}},EC$3.prototype.verify=function verify(G,K,ne,ue){G=this._truncateToN(new Ei(G,16)),ne=this.keyFromPublic(ne,ue);var pe=(K=new $d(K,"hex")).r,he=K.s;if(pe.cmpn(1)<0||pe.cmp(this.n)>=0)return!1;if(he.cmpn(1)<0||he.cmp(this.n)>=0)return!1;var ye,me=he.invm(this.n),be=me.mul(G).umod(this.n),ve=me.mul(pe).umod(this.n);return this.curve._maxwellTrick?!(ye=this.g.jmulAdd(be,ne.getPublic(),ve)).isInfinity()&&ye.eqXToP(pe):!(ye=this.g.mulAdd(be,ne.getPublic(),ve)).isInfinity()&&0===ye.getX().umod(this.n).cmp(pe)},EC$3.prototype.recoverPubKey=function(G,K,ne,ue){qd((3&ne)===ne,"The recovery param is more than two bits"),K=new $d(K,ue);var pe=this.n,he=new Ei(G),ye=K.r,me=K.s,be=1&ne,ve=ne>>1;if(ye.cmp(this.curve.p.umod(this.curve.n))>=0&&ve)throw new Error("Unable to find sencond key candinate");ye=ve?this.curve.pointFromX(ye.add(this.curve.n),be):this.curve.pointFromX(ye,be);var _e=K.r.invm(pe),Te=pe.sub(he).mul(_e).umod(pe),Ee=me.mul(_e).umod(pe);return this.g.mulAdd(Te,ye,Ee)},EC$3.prototype.getKeyRecoveryParam=function(G,K,ne,ue){if(null!==(K=new $d(K,ue)).recoveryParam)return K.recoveryParam;for(var pe=0;pe<4;pe++){var he;try{he=this.recoverPubKey(G,K,pe)}catch(G){continue}if(he.eq(ne))return pe}throw new Error("Unable to find valid recovery factor")};var jd=createCommonjsModule$1((function(G,K){var ne=K;ne.version="6.5.4",ne.utils=Sd,ne.rand=function(){throw new Error("unsupported")},ne.curve=Md,ne.curves=Bd,ne.ec=Gd,ne.eddsa=null})),Hd=jd.ec;const Wd=new oi("signing-key/5.7.0");let zd=null;function getCurve(){return zd||(zd=new Hd("secp256k1")),zd}let Vd=class SigningKey{constructor(G){defineReadOnly$1(this,"curve","secp256k1"),defineReadOnly$1(this,"privateKey",hexlify$2(G)),32!==hexDataLength$1(this.privateKey)&&Wd.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const K=getCurve().keyFromPrivate(arrayify$1(this.privateKey));defineReadOnly$1(this,"publicKey","0x"+K.getPublic(!1,"hex")),defineReadOnly$1(this,"compressedPublicKey","0x"+K.getPublic(!0,"hex")),defineReadOnly$1(this,"_isSigningKey",!0)}_addPoint(G){const K=getCurve().keyFromPublic(arrayify$1(this.publicKey)),ne=getCurve().keyFromPublic(arrayify$1(G));return"0x"+K.pub.add(ne.pub).encodeCompressed("hex")}signDigest(G){const K=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),ne=arrayify$1(G);32!==ne.length&&Wd.throwArgumentError("bad digest length","digest",G);const ue=K.sign(ne,{canonical:!0});return splitSignature({recoveryParam:ue.recoveryParam,r:hexZeroPad$1("0x"+ue.r.toString(16),32),s:hexZeroPad$1("0x"+ue.s.toString(16),32)})}computeSharedSecret(G){const K=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),ne=getCurve().keyFromPublic(arrayify$1(computePublicKey(G)));return hexZeroPad$1("0x"+K.derive(ne.getPublic()).toString(16),32)}static isSigningKey(G){return!(!G||!G._isSigningKey)}};function recoverPublicKey(G,K){const ne=splitSignature(K),ue={r:arrayify$1(ne.r),s:arrayify$1(ne.s)};return"0x"+getCurve().recoverPubKey(arrayify$1(G),ue,ne.recoveryParam).encode("hex",!1)}function computePublicKey(G,K){const ne=arrayify$1(G);if(32===ne.length){const G=new Vd(ne);return K?"0x"+getCurve().keyFromPrivate(ne).getPublic(!0,"hex"):G.publicKey}return 33===ne.length?K?hexlify$2(ne):"0x"+getCurve().keyFromPublic(ne).getPublic(!1,"hex"):65===ne.length?K?"0x"+getCurve().keyFromPublic(ne).getPublic(!0,"hex"):hexlify$2(ne):Wd.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Kd=new oi("transactions/5.7.0");var Jd;function handleAddress$1(G){return"0x"===G?null:getAddress$2(G)}function handleNumber$1(G){return"0x"===G?$i:Oi.from(G)}!function(G){G[G.legacy=0]="legacy",G[G.eip2930=1]="eip2930",G[G.eip1559=2]="eip1559"}(Jd||(Jd={}));const Xd=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Qd={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function computeAddress$1(G){return getAddress$2(hexDataSlice$1(keccak256$3(hexDataSlice$1(computePublicKey(G),1)),12))}function recoverAddress$1(G,K){return computeAddress$1(recoverPublicKey(arrayify$1(G),K))}function formatNumber$1(G,K){const ne=stripZeros$1(Oi.from(G).toHexString());return ne.length>32&&Kd.throwArgumentError("invalid length for "+K,"transaction:"+K,G),ne}function accessSetify$2(G,K){return{address:getAddress$2(G),storageKeys:(K||[]).map(((K,ne)=>(32!==hexDataLength$1(K)&&Kd.throwArgumentError("invalid access list storageKey",`accessList[${G}:${ne}]`,K),K.toLowerCase())))}}function accessListify$2(G){if(Array.isArray(G))return G.map(((G,K)=>Array.isArray(G)?(G.length>2&&Kd.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${K}]`,G),accessSetify$2(G[0],G[1])):accessSetify$2(G.address,G.storageKeys)));const K=Object.keys(G).map((K=>{const ne=G[K].reduce(((G,K)=>(G[K]=!0,G)),{});return accessSetify$2(K,Object.keys(ne).sort())}));return K.sort(((G,K)=>G.address.localeCompare(K.address))),K}function formatAccessList$1(G){return accessListify$2(G).map((G=>[G.address,G.storageKeys]))}function _serializeEip1559$1(G,K){if(null!=G.gasPrice){const K=Oi.from(G.gasPrice),ne=Oi.from(G.maxFeePerGas||0);K.eq(ne)||Kd.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:K,maxFeePerGas:ne})}const ne=[formatNumber$1(G.chainId||0,"chainId"),formatNumber$1(G.nonce||0,"nonce"),formatNumber$1(G.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber$1(G.maxFeePerGas||0,"maxFeePerGas"),formatNumber$1(G.gasLimit||0,"gasLimit"),null!=G.to?getAddress$2(G.to):"0x",formatNumber$1(G.value||0,"value"),G.data||"0x",formatAccessList$1(G.accessList||[])];if(K){const G=splitSignature(K);ne.push(formatNumber$1(G.recoveryParam,"recoveryParam")),ne.push(stripZeros$1(G.r)),ne.push(stripZeros$1(G.s))}return hexConcat$1(["0x02",encode$6(ne)])}function _serializeEip2930$1(G,K){const ne=[formatNumber$1(G.chainId||0,"chainId"),formatNumber$1(G.nonce||0,"nonce"),formatNumber$1(G.gasPrice||0,"gasPrice"),formatNumber$1(G.gasLimit||0,"gasLimit"),null!=G.to?getAddress$2(G.to):"0x",formatNumber$1(G.value||0,"value"),G.data||"0x",formatAccessList$1(G.accessList||[])];if(K){const G=splitSignature(K);ne.push(formatNumber$1(G.recoveryParam,"recoveryParam")),ne.push(stripZeros$1(G.r)),ne.push(stripZeros$1(G.s))}return hexConcat$1(["0x01",encode$6(ne)])}function _parseEipSignature$1(G,K,ne){try{const ne=handleNumber$1(K[0]).toNumber();if(0!==ne&&1!==ne)throw new Error("bad recid");G.v=ne}catch(G){Kd.throwArgumentError("invalid v for transaction type: 1","v",K[0])}G.r=hexZeroPad$1(K[1],32),G.s=hexZeroPad$1(K[2],32);try{const K=keccak256$3(ne(G));G.from=recoverAddress$1(K,{r:G.r,s:G.s,recoveryParam:G.v})}catch(G){}}function parse$1(G){const K=arrayify$1(G);if(K[0]>127)return function _parse(G){const K=decode$3(G);9!==K.length&&6!==K.length&&Kd.throwArgumentError("invalid raw transaction","rawTransaction",G);const ne={nonce:handleNumber$1(K[0]).toNumber(),gasPrice:handleNumber$1(K[1]),gasLimit:handleNumber$1(K[2]),to:handleAddress$1(K[3]),value:handleNumber$1(K[4]),data:K[5],chainId:0};if(6===K.length)return ne;try{ne.v=Oi.from(K[6]).toNumber()}catch(G){return ne}if(ne.r=hexZeroPad$1(K[7],32),ne.s=hexZeroPad$1(K[8],32),Oi.from(ne.r).isZero()&&Oi.from(ne.s).isZero())ne.chainId=ne.v,ne.v=0;else{ne.chainId=Math.floor((ne.v-35)/2),ne.chainId<0&&(ne.chainId=0);let ue=ne.v-27;const pe=K.slice(0,6);0!==ne.chainId&&(pe.push(hexlify$2(ne.chainId)),pe.push("0x"),pe.push("0x"),ue-=2*ne.chainId+8);const he=keccak256$3(encode$6(pe));try{ne.from=recoverAddress$1(he,{r:hexlify$2(ne.r),s:hexlify$2(ne.s),recoveryParam:ue})}catch(G){}ne.hash=keccak256$3(G)}return ne.type=null,ne}(K);switch(K[0]){case 1:return function _parseEip2930$1(G){const K=decode$3(G.slice(1));8!==K.length&&11!==K.length&&Kd.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify$2(G));const ne={type:1,chainId:handleNumber$1(K[0]).toNumber(),nonce:handleNumber$1(K[1]).toNumber(),gasPrice:handleNumber$1(K[2]),gasLimit:handleNumber$1(K[3]),to:handleAddress$1(K[4]),value:handleNumber$1(K[5]),data:K[6],accessList:accessListify$2(K[7])};return 8===K.length||(ne.hash=keccak256$3(G),_parseEipSignature$1(ne,K.slice(8),_serializeEip2930$1)),ne}(K);case 2:return function _parseEip1559$1(G){const K=decode$3(G.slice(1));9!==K.length&&12!==K.length&&Kd.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify$2(G));const ne=handleNumber$1(K[2]),ue=handleNumber$1(K[3]),pe={type:2,chainId:handleNumber$1(K[0]).toNumber(),nonce:handleNumber$1(K[1]).toNumber(),maxPriorityFeePerGas:ne,maxFeePerGas:ue,gasPrice:null,gasLimit:handleNumber$1(K[4]),to:handleAddress$1(K[5]),value:handleNumber$1(K[6]),data:K[7],accessList:accessListify$2(K[8])};return 9===K.length||(pe.hash=keccak256$3(G),_parseEipSignature$1(pe,K.slice(9),_serializeEip1559$1)),pe}(K)}return Kd.throwError(`unsupported transaction type: ${K[0]}`,oi.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:K[0]})}var __awaiter$a=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Zd=new oi("contracts/5.7.0"),Yd={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function resolveName$1(G,K){return __awaiter$a(this,void 0,void 0,(function*(){const ne=yield K;"string"!=typeof ne&&Zd.throwArgumentError("invalid address or ENS name","name",ne);try{return getAddress$2(ne)}catch(G){}G||Zd.throwError("a provider or signer is needed to resolve ENS names",oi.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const ue=yield G.resolveName(ne);return null==ue&&Zd.throwArgumentError("resolver or addr is not configured for ENS name","name",ne),ue}))}function resolveAddresses$1(G,K,ne){return __awaiter$a(this,void 0,void 0,(function*(){return Array.isArray(ne)?yield Promise.all(ne.map(((ne,ue)=>resolveAddresses$1(G,Array.isArray(K)?K[ue]:K[ne.name],ne)))):"address"===ne.type?yield resolveName$1(G,K):"tuple"===ne.type?yield resolveAddresses$1(G,K,ne.components):"array"===ne.baseType?Array.isArray(K)?yield Promise.all(K.map((K=>resolveAddresses$1(G,K,ne.arrayChildren)))):Promise.reject(Zd.makeError("invalid value for array",oi.errors.INVALID_ARGUMENT,{argument:"value",value:K})):K}))}function populateTransaction$1(G,K,ne){return __awaiter$a(this,void 0,void 0,(function*(){let ue={};ne.length===K.inputs.length+1&&"object"==typeof ne[ne.length-1]&&(ue=shallowCopy$1(ne.pop())),Zd.checkArgumentCount(ne.length,K.inputs.length,"passed to contract"),G.signer?ue.from?ue.from=resolveProperties$2({override:resolveName$1(G.signer,ue.from),signer:G.signer.getAddress()}).then((G=>__awaiter$a(this,void 0,void 0,(function*(){return getAddress$2(G.signer)!==G.override&&Zd.throwError("Contract with a Signer cannot override from",oi.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),G.override})))):ue.from=G.signer.getAddress():ue.from&&(ue.from=resolveName$1(G.provider,ue.from));const pe=yield resolveProperties$2({args:resolveAddresses$1(G.signer||G.provider,ne,K.inputs),address:G.resolvedAddress,overrides:resolveProperties$2(ue)||{}}),he=G.interface.encodeFunctionData(K,pe.args),ye={data:he,to:pe.address},me=pe.overrides;if(null!=me.nonce&&(ye.nonce=Oi.from(me.nonce).toNumber()),null!=me.gasLimit&&(ye.gasLimit=Oi.from(me.gasLimit)),null!=me.gasPrice&&(ye.gasPrice=Oi.from(me.gasPrice)),null!=me.maxFeePerGas&&(ye.maxFeePerGas=Oi.from(me.maxFeePerGas)),null!=me.maxPriorityFeePerGas&&(ye.maxPriorityFeePerGas=Oi.from(me.maxPriorityFeePerGas)),null!=me.from&&(ye.from=me.from),null!=me.type&&(ye.type=me.type),null!=me.accessList&&(ye.accessList=accessListify$2(me.accessList)),null==ye.gasLimit&&null!=K.gas){let G=21e3;const ne=arrayify$1(he);for(let K=0;K<ne.length;K++)G+=4,ne[K]&&(G+=64);ye.gasLimit=Oi.from(K.gas).add(G)}if(me.value){const G=Oi.from(me.value);G.isZero()||K.payable||Zd.throwError("non-payable method cannot override value",oi.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:ue.value}),ye.value=G}me.customData&&(ye.customData=shallowCopy$1(me.customData)),me.ccipReadEnabled&&(ye.ccipReadEnabled=!!me.ccipReadEnabled),delete ue.nonce,delete ue.gasLimit,delete ue.gasPrice,delete ue.from,delete ue.value,delete ue.type,delete ue.accessList,delete ue.maxFeePerGas,delete ue.maxPriorityFeePerGas,delete ue.customData,delete ue.ccipReadEnabled;const be=Object.keys(ue).filter((G=>null!=ue[G]));return be.length&&Zd.throwError(`cannot override ${be.map((G=>JSON.stringify(G))).join(",")}`,oi.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:be}),ye}))}function addContractWait$1(G,K){const ne=K.wait.bind(K);K.wait=K=>ne(K).then((K=>(K.events=K.logs.map((ne=>{let ue=deepCopy$2(ne),pe=null;try{pe=G.interface.parseLog(ne)}catch(G){}return pe&&(ue.args=pe.args,ue.decode=(K,ne)=>G.interface.decodeEventLog(pe.eventFragment,K,ne),ue.event=pe.name,ue.eventSignature=pe.signature),ue.removeListener=()=>G.provider,ue.getBlock=()=>G.provider.getBlock(K.blockHash),ue.getTransaction=()=>G.provider.getTransaction(K.transactionHash),ue.getTransactionReceipt=()=>Promise.resolve(K),ue})),K)))}function buildCall$1(G,K,ne){const ue=G.signer||G.provider;return function(...pe){return __awaiter$a(this,void 0,void 0,(function*(){let he;if(pe.length===K.inputs.length+1&&"object"==typeof pe[pe.length-1]){const G=shallowCopy$1(pe.pop());null!=G.blockTag&&(he=yield G.blockTag),delete G.blockTag,pe.push(G)}null!=G.deployTransaction&&(yield G._deployed(he));const ye=yield populateTransaction$1(G,K,pe),me=yield ue.call(ye,he);try{let ue=G.interface.decodeFunctionResult(K,me);return ne&&1===K.outputs.length&&(ue=ue[0]),ue}catch(K){throw K.code===oi.errors.CALL_EXCEPTION&&(K.address=G.address,K.args=pe,K.transaction=ye),K}}))}}function buildDefault$1(G,K,ne){return K.constant?buildCall$1(G,K,ne):function buildSend$1(G,K){return function(...ne){return __awaiter$a(this,void 0,void 0,(function*(){G.signer||Zd.throwError("sending a transaction requires a signer",oi.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=G.deployTransaction&&(yield G._deployed());const ue=yield populateTransaction$1(G,K,ne),pe=yield G.signer.sendTransaction(ue);return addContractWait$1(G,pe),pe}))}}(G,K)}function getEventTag$2(G){return!G.address||null!=G.topics&&0!==G.topics.length?(G.address||"*")+"@"+(G.topics?G.topics.map((G=>Array.isArray(G)?G.join("|"):G)).join(":"):""):"*"}let eu=class RunningEvent{constructor(G,K){defineReadOnly$1(this,"tag",G),defineReadOnly$1(this,"filter",K),this._listeners=[]}addListener(G,K){this._listeners.push({listener:G,once:K})}removeListener(G){let K=!1;this._listeners=this._listeners.filter((ne=>!(!K&&ne.listener===G)||(K=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((G=>G.listener))}listenerCount(){return this._listeners.length}run(G){const K=this.listenerCount();return this._listeners=this._listeners.filter((K=>{const ne=G.slice();return setTimeout((()=>{K.listener.apply(this,ne)}),0),!K.once})),K}prepareEvent(G){}getEmit(G){return[G]}},tu=class ErrorRunningEvent extends eu{constructor(){super("error",null)}},ru=class FragmentRunningEvent extends eu{constructor(G,K,ne,ue){const pe={address:G};let he=K.getEventTopic(ne);ue?(he!==ue[0]&&Zd.throwArgumentError("topic mismatch","topics",ue),pe.topics=ue.slice()):pe.topics=[he],super(getEventTag$2(pe),pe),defineReadOnly$1(this,"address",G),defineReadOnly$1(this,"interface",K),defineReadOnly$1(this,"fragment",ne)}prepareEvent(G){super.prepareEvent(G),G.event=this.fragment.name,G.eventSignature=this.fragment.format(),G.decode=(G,K)=>this.interface.decodeEventLog(this.fragment,G,K);try{G.args=this.interface.decodeEventLog(this.fragment,G.data,G.topics)}catch(K){G.args=null,G.decodeError=K}}getEmit(G){const K=checkResultErrors$1(G.args);if(K.length)throw K[0].error;const ne=(G.args||[]).slice();return ne.push(G),ne}},nu=class WildcardRunningEvent extends eu{constructor(G,K){super("*",{address:G}),defineReadOnly$1(this,"address",G),defineReadOnly$1(this,"interface",K)}prepareEvent(G){super.prepareEvent(G);try{const K=this.interface.parseLog(G);G.event=K.name,G.eventSignature=K.signature,G.decode=(G,ne)=>this.interface.decodeEventLog(K.eventFragment,G,ne),G.args=K.args}catch(G){}}},au=class BaseContract{constructor(G,K,ne){defineReadOnly$1(this,"interface",getStatic$1(new.target,"getInterface")(K)),null==ne?(defineReadOnly$1(this,"provider",null),defineReadOnly$1(this,"signer",null)):Qo.isSigner(ne)?(defineReadOnly$1(this,"provider",ne.provider||null),defineReadOnly$1(this,"signer",ne)):Vo.isProvider(ne)?(defineReadOnly$1(this,"provider",ne),defineReadOnly$1(this,"signer",null)):Zd.throwArgumentError("invalid signer or provider","signerOrProvider",ne),defineReadOnly$1(this,"callStatic",{}),defineReadOnly$1(this,"estimateGas",{}),defineReadOnly$1(this,"functions",{}),defineReadOnly$1(this,"populateTransaction",{}),defineReadOnly$1(this,"filters",{});{const G={};Object.keys(this.interface.events).forEach((K=>{const ne=this.interface.events[K];defineReadOnly$1(this.filters,K,((...G)=>({address:this.address,topics:this.interface.encodeFilterTopics(ne,G)}))),G[ne.name]||(G[ne.name]=[]),G[ne.name].push(K)})),Object.keys(G).forEach((K=>{const ne=G[K];1===ne.length?defineReadOnly$1(this.filters,K,this.filters[ne[0]]):Zd.warn(`Duplicate definition of ${K} (${ne.join(", ")})`)}))}if(defineReadOnly$1(this,"_runningEvents",{}),defineReadOnly$1(this,"_wrappedEmits",{}),null==G&&Zd.throwArgumentError("invalid contract address or ENS name","addressOrName",G),defineReadOnly$1(this,"address",G),this.provider)defineReadOnly$1(this,"resolvedAddress",resolveName$1(this.provider,G));else try{defineReadOnly$1(this,"resolvedAddress",Promise.resolve(getAddress$2(G)))}catch(G){Zd.throwError("provider is required to use ENS name as contract address",oi.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((G=>{}));const ue={},pe={};Object.keys(this.interface.functions).forEach((G=>{const K=this.interface.functions[G];if(pe[G])Zd.warn(`Duplicate ABI entry for ${JSON.stringify(G)}`);else{pe[G]=!0;{const ne=K.name;ue[`%${ne}`]||(ue[`%${ne}`]=[]),ue[`%${ne}`].push(G)}null==this[G]&&defineReadOnly$1(this,G,buildDefault$1(this,K,!0)),null==this.functions[G]&&defineReadOnly$1(this.functions,G,buildDefault$1(this,K,!1)),null==this.callStatic[G]&&defineReadOnly$1(this.callStatic,G,buildCall$1(this,K,!0)),null==this.populateTransaction[G]&&defineReadOnly$1(this.populateTransaction,G,function buildPopulate$1(G,K){return function(...ne){return populateTransaction$1(G,K,ne)}}(this,K)),null==this.estimateGas[G]&&defineReadOnly$1(this.estimateGas,G,function buildEstimate$1(G,K){const ne=G.signer||G.provider;return function(...ue){return __awaiter$a(this,void 0,void 0,(function*(){ne||Zd.throwError("estimate require a provider or signer",oi.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const pe=yield populateTransaction$1(G,K,ue);return yield ne.estimateGas(pe)}))}}(this,K))}})),Object.keys(ue).forEach((G=>{const K=ue[G];if(K.length>1)return;G=G.substring(1);const ne=K[0];try{null==this[G]&&defineReadOnly$1(this,G,this[ne])}catch(G){}null==this.functions[G]&&defineReadOnly$1(this.functions,G,this.functions[ne]),null==this.callStatic[G]&&defineReadOnly$1(this.callStatic,G,this.callStatic[ne]),null==this.populateTransaction[G]&&defineReadOnly$1(this.populateTransaction,G,this.populateTransaction[ne]),null==this.estimateGas[G]&&defineReadOnly$1(this.estimateGas,G,this.estimateGas[ne])}))}static getContractAddress(G){return getContractAddress$1(G)}static getInterface(G){return Ho.isInterface(G)?G:new Ho(G)}deployed(){return this._deployed()}_deployed(G){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,G).then((G=>("0x"===G&&Zd.throwError("contract not deployed",oi.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(G){this.signer||Zd.throwError("sending a transactions require a signer",oi.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const K=shallowCopy$1(G||{});return["from","to"].forEach((function(G){null!=K[G]&&Zd.throwError("cannot override "+G,oi.errors.UNSUPPORTED_OPERATION,{operation:G})})),K.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(K)))}connect(G){"string"==typeof G&&(G=new Zo(G,this.provider));const K=new this.constructor(this.address,this.interface,G);return this.deployTransaction&&defineReadOnly$1(K,"deployTransaction",this.deployTransaction),K}attach(G){return new this.constructor(G,this.interface,this.signer||this.provider)}static isIndexed(G){return Go.isIndexed(G)}_normalizeRunningEvent(G){return this._runningEvents[G.tag]?this._runningEvents[G.tag]:G}_getRunningEvent(G){if("string"==typeof G){if("error"===G)return this._normalizeRunningEvent(new tu);if("event"===G)return this._normalizeRunningEvent(new eu("event",null));if("*"===G)return this._normalizeRunningEvent(new nu(this.address,this.interface));const K=this.interface.getEvent(G);return this._normalizeRunningEvent(new ru(this.address,this.interface,K))}if(G.topics&&G.topics.length>0){try{const K=G.topics[0];if("string"!=typeof K)throw new Error("invalid topic");const ne=this.interface.getEvent(K);return this._normalizeRunningEvent(new ru(this.address,this.interface,ne,G.topics))}catch(G){}const K={address:this.address,topics:G.topics};return this._normalizeRunningEvent(new eu(getEventTag$2(K),K))}return this._normalizeRunningEvent(new nu(this.address,this.interface))}_checkRunningEvents(G){if(0===G.listenerCount()){delete this._runningEvents[G.tag];const K=this._wrappedEmits[G.tag];K&&G.filter&&(this.provider.off(G.filter,K),delete this._wrappedEmits[G.tag])}}_wrapEvent(G,K,ne){const ue=deepCopy$2(K);return ue.removeListener=()=>{ne&&(G.removeListener(ne),this._checkRunningEvents(G))},ue.getBlock=()=>this.provider.getBlock(K.blockHash),ue.getTransaction=()=>this.provider.getTransaction(K.transactionHash),ue.getTransactionReceipt=()=>this.provider.getTransactionReceipt(K.transactionHash),G.prepareEvent(ue),ue}_addEventListener(G,K,ne){if(this.provider||Zd.throwError("events require a provider or a signer with a provider",oi.errors.UNSUPPORTED_OPERATION,{operation:"once"}),G.addListener(K,ne),this._runningEvents[G.tag]=G,!this._wrappedEmits[G.tag]){const wrappedEmit=ne=>{let ue=this._wrapEvent(G,ne,K);if(null==ue.decodeError)try{const K=G.getEmit(ue);this.emit(G.filter,...K)}catch(G){ue.decodeError=G.error}null!=G.filter&&this.emit("event",ue),null!=ue.decodeError&&this.emit("error",ue.decodeError,ue)};this._wrappedEmits[G.tag]=wrappedEmit,null!=G.filter&&this.provider.on(G.filter,wrappedEmit)}}queryFilter(G,K,ne){const ue=this._getRunningEvent(G),pe=shallowCopy$1(ue.filter);return"string"==typeof K&&isHexString$4(K,32)?(null!=ne&&Zd.throwArgumentError("cannot specify toBlock with blockhash","toBlock",ne),pe.blockHash=K):(pe.fromBlock=null!=K?K:0,pe.toBlock=null!=ne?ne:"latest"),this.provider.getLogs(pe).then((G=>G.map((G=>this._wrapEvent(ue,G,null)))))}on(G,K){return this._addEventListener(this._getRunningEvent(G),K,!1),this}once(G,K){return this._addEventListener(this._getRunningEvent(G),K,!0),this}emit(G,...K){if(!this.provider)return!1;const ne=this._getRunningEvent(G),ue=ne.run(K)>0;return this._checkRunningEvents(ne),ue}listenerCount(G){return this.provider?null==G?Object.keys(this._runningEvents).reduce(((G,K)=>G+this._runningEvents[K].listenerCount()),0):this._getRunningEvent(G).listenerCount():0}listeners(G){if(!this.provider)return[];if(null==G){const G=[];for(let K in this._runningEvents)this._runningEvents[K].listeners().forEach((K=>{G.push(K)}));return G}return this._getRunningEvent(G).listeners()}removeAllListeners(G){if(!this.provider)return this;if(null==G){for(const G in this._runningEvents){const K=this._runningEvents[G];K.removeAllListeners(),this._checkRunningEvents(K)}return this}const K=this._getRunningEvent(G);return K.removeAllListeners(),this._checkRunningEvents(K),this}off(G,K){if(!this.provider)return this;const ne=this._getRunningEvent(G);return ne.removeListener(K),this._checkRunningEvents(ne),this}removeListener(G,K){return this.off(G,K)}},iu=class Contract extends au{};class ContractFactory{constructor(G,K,ne){let ue=null;ue="string"==typeof K?K:isBytes$1(K)?hexlify$2(K):K&&"string"==typeof K.object?K.object:"!","0x"!==ue.substring(0,2)&&(ue="0x"+ue),(!isHexString$4(ue)||ue.length%2)&&Zd.throwArgumentError("invalid bytecode","bytecode",K),ne&&!Qo.isSigner(ne)&&Zd.throwArgumentError("invalid signer","signer",ne),defineReadOnly$1(this,"bytecode",ue),defineReadOnly$1(this,"interface",getStatic$1(new.target,"getInterface")(G)),defineReadOnly$1(this,"signer",ne||null)}getDeployTransaction(...G){let K={};if(G.length===this.interface.deploy.inputs.length+1&&"object"==typeof G[G.length-1]){K=shallowCopy$1(G.pop());for(const G in K)if(!Yd[G])throw new Error("unknown transaction override "+G)}if(["data","from","to"].forEach((G=>{null!=K[G]&&Zd.throwError("cannot override "+G,oi.errors.UNSUPPORTED_OPERATION,{operation:G})})),K.value){Oi.from(K.value).isZero()||this.interface.deploy.payable||Zd.throwError("non-payable constructor cannot override value",oi.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:K.value})}return Zd.checkArgumentCount(G.length,this.interface.deploy.inputs.length," in Contract constructor"),K.data=hexlify$2(concat$2([this.bytecode,this.interface.encodeDeploy(G)])),K}deploy(...G){return __awaiter$a(this,void 0,void 0,(function*(){let K={};G.length===this.interface.deploy.inputs.length+1&&(K=G.pop()),Zd.checkArgumentCount(G.length,this.interface.deploy.inputs.length," in Contract constructor");const ne=yield resolveAddresses$1(this.signer,G,this.interface.deploy.inputs);ne.push(K);const ue=this.getDeployTransaction(...ne),pe=yield this.signer.sendTransaction(ue),he=getStatic$1(this.constructor,"getContractAddress")(pe),ye=getStatic$1(this.constructor,"getContract")(he,this.interface,this.signer);return addContractWait$1(ye,pe),defineReadOnly$1(ye,"deployTransaction",pe),ye}))}attach(G){return this.constructor.getContract(G,this.interface,this.signer)}connect(G){return new this.constructor(this.interface,this.bytecode,G)}static fromSolidity(G,K){null==G&&Zd.throwError("missing compiler output",oi.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof G&&(G=JSON.parse(G));const ne=G.abi;let ue=null;return G.bytecode?ue=G.bytecode:G.evm&&G.evm.bytecode&&(ue=G.evm.bytecode),new this(ne,ue,K)}static getInterface(G){return iu.getInterface(G)}static getContractAddress(G){return getContractAddress$1(G)}static getContract(G,K,ne){return new iu(G,K,ne)}}class BaseX{constructor(G){defineReadOnly$1(this,"alphabet",G),defineReadOnly$1(this,"base",G.length),defineReadOnly$1(this,"_alphabetMap",{}),defineReadOnly$1(this,"_leader",G.charAt(0));for(let K=0;K<G.length;K++)this._alphabetMap[G.charAt(K)]=K}encode(G){let K=arrayify$1(G);if(0===K.length)return"";let ne=[0];for(let G=0;G<K.length;++G){let ue=K[G];for(let G=0;G<ne.length;++G)ue+=ne[G]<<8,ne[G]=ue%this.base,ue=ue/this.base|0;for(;ue>0;)ne.push(ue%this.base),ue=ue/this.base|0}let ue="";for(let G=0;0===K[G]&&G<K.length-1;++G)ue+=this._leader;for(let G=ne.length-1;G>=0;--G)ue+=this.alphabet[ne[G]];return ue}decode(G){if("string"!=typeof G)throw new TypeError("Expected String");let K=[];if(0===G.length)return new Uint8Array(K);K.push(0);for(let ne=0;ne<G.length;ne++){let ue=this._alphabetMap[G[ne]];if(void 0===ue)throw new Error("Non-base"+this.base+" character");let pe=ue;for(let G=0;G<K.length;++G)pe+=K[G]*this.base,K[G]=255&pe,pe>>=8;for(;pe>0;)K.push(255&pe),pe>>=8}for(let ne=0;G[ne]===this._leader&&ne<G.length-1;++ne)K.push(0);return arrayify$1(new Uint8Array(K.reverse()))}}new BaseX("abcdefghijklmnopqrstuvwxyz234567");const su=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var ou;!function(G){G.sha256="sha256",G.sha512="sha512"}(ou||(ou={}));const cu=new oi("sha2/5.7.0");function ripemd160$5(G){return"0x"+Ad.ripemd160().update(arrayify$1(G)).digest("hex")}function sha256$9(G){return"0x"+Ad.sha256().update(arrayify$1(G)).digest("hex")}function computeHmac(G,K,ne){return ou[G]||cu.throwError("unsupported algorithm "+G,oi.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:G}),"0x"+Ad.hmac(Ad[G],arrayify$1(K)).update(arrayify$1(ne)).digest("hex")}const du=new oi("wordlists/5.7.0");class Wordlist{constructor(G){du.checkAbstract(new.target,Wordlist),defineReadOnly$1(this,"locale",G)}split(G){return G.toLowerCase().split(/ +/g)}join(G){return G.join(" ")}static check(G){const K=[];for(let ne=0;ne<2048;ne++){const ue=G.getWord(ne);if(ne!==G.getWordIndex(ue))return"0x";K.push(ue)}return id$3(K.join("\n")+"\n")}static register(G,K){K||(K=G.locale)}}let uu=null;function loadWords(G){if(null==uu&&(uu="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Wordlist.check(G)))throw uu=null,new Error("BIP39 Wordlist for en (English) FAILED")}const fu=new class LangEn extends Wordlist{constructor(){super("en")}getWord(G){return loadWords(this),uu[G]}getWordIndex(G){return loadWords(this),uu.indexOf(G)}};Wordlist.register(fu);const lu={en:fu},pu=new oi("hdnode/5.7.0"),hu=Oi.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),yu=toUtf8Bytes$2("Bitcoin seed"),mu=2147483648;function getUpperMask(G){return(1<<G)-1<<8-G}function bytes32$1(G){return hexZeroPad$1(hexlify$2(G),32)}function base58check(G){return su.encode(concat$2([G,hexDataSlice$1(sha256$9(sha256$9(G)),0,4)]))}function getWordlist(G){if(null==G)return lu.en;if("string"==typeof G){const K=lu[G];return null==K&&pu.throwArgumentError("unknown locale","wordlist",G),K}return G}const bu={};class HDNode{constructor(G,K,ne,ue,pe,he,ye,me){if(G!==bu)throw new Error("HDNode constructor cannot be called directly");if(K){const G=new Vd(K);defineReadOnly$1(this,"privateKey",G.privateKey),defineReadOnly$1(this,"publicKey",G.compressedPublicKey)}else defineReadOnly$1(this,"privateKey",null),defineReadOnly$1(this,"publicKey",hexlify$2(ne));defineReadOnly$1(this,"parentFingerprint",ue),defineReadOnly$1(this,"fingerprint",hexDataSlice$1(ripemd160$5(sha256$9(this.publicKey)),0,4)),defineReadOnly$1(this,"address",computeAddress$1(this.publicKey)),defineReadOnly$1(this,"chainCode",pe),defineReadOnly$1(this,"index",he),defineReadOnly$1(this,"depth",ye),null==me?(defineReadOnly$1(this,"mnemonic",null),defineReadOnly$1(this,"path",null)):"string"==typeof me?(defineReadOnly$1(this,"mnemonic",null),defineReadOnly$1(this,"path",me)):(defineReadOnly$1(this,"mnemonic",me),defineReadOnly$1(this,"path",me.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return base58check(concat$2([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",hexlify$2(this.depth),this.parentFingerprint,hexZeroPad$1(hexlify$2(this.index),4),this.chainCode,null!=this.privateKey?concat$2(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new HDNode(bu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(G){if(G>4294967295)throw new Error("invalid index - "+String(G));let K=this.path;K&&(K+="/"+(2147483647&G));const ne=new Uint8Array(37);if(G&mu){if(!this.privateKey)throw new Error("cannot derive child of neutered node");ne.set(arrayify$1(this.privateKey),1),K&&(K+="'")}else ne.set(arrayify$1(this.publicKey));for(let K=24;K>=0;K-=8)ne[33+(K>>3)]=G>>24-K&255;const ue=arrayify$1(computeHmac(ou.sha512,this.chainCode,ne)),pe=ue.slice(0,32),he=ue.slice(32);let ye=null,me=null;if(this.privateKey)ye=bytes32$1(Oi.from(pe).add(this.privateKey).mod(hu));else{me=new Vd(hexlify$2(pe))._addPoint(this.publicKey)}let be=K;const ve=this.mnemonic;return ve&&(be=Object.freeze({phrase:ve.phrase,path:K,locale:ve.locale||"en"})),new HDNode(bu,ye,me,this.fingerprint,bytes32$1(he),G,this.depth+1,be)}derivePath(G){const K=G.split("/");if(0===K.length||"m"===K[0]&&0!==this.depth)throw new Error("invalid path - "+G);"m"===K[0]&&K.shift();let ne=this;for(let G=0;G<K.length;G++){const ue=K[G];if(ue.match(/^[0-9]+'$/)){const G=parseInt(ue.substring(0,ue.length-1));if(G>=mu)throw new Error("invalid path index - "+ue);ne=ne._derive(mu+G)}else{if(!ue.match(/^[0-9]+$/))throw new Error("invalid path component - "+ue);{const G=parseInt(ue);if(G>=mu)throw new Error("invalid path index - "+ue);ne=ne._derive(G)}}}return ne}static _fromSeed(G,K){const ne=arrayify$1(G);if(ne.length<16||ne.length>64)throw new Error("invalid seed");const ue=arrayify$1(computeHmac(ou.sha512,yu,ne));return new HDNode(bu,bytes32$1(ue.slice(0,32)),null,"0x00000000",bytes32$1(ue.slice(32)),0,0,K)}static fromMnemonic(G,K,ne){return G=entropyToMnemonic(mnemonicToEntropy(G,ne=getWordlist(ne)),ne),HDNode._fromSeed(mnemonicToSeed(G,K),{phrase:G,path:"m",locale:ne.locale})}static fromSeed(G){return HDNode._fromSeed(G,null)}static fromExtendedKey(G){const K=su.decode(G);82===K.length&&base58check(K.slice(0,78))===G||pu.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const ne=K[4],ue=hexlify$2(K.slice(5,9)),pe=parseInt(hexlify$2(K.slice(9,13)).substring(2),16),he=hexlify$2(K.slice(13,45)),ye=K.slice(45,78);switch(hexlify$2(K.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new HDNode(bu,null,hexlify$2(ye),ue,he,pe,ne,null);case"0x0488ade4":case"0x04358394 ":if(0!==ye[0])break;return new HDNode(bu,hexlify$2(ye.slice(1)),null,ue,he,pe,ne,null)}return pu.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function mnemonicToSeed(G,K){K||(K="");const ne=toUtf8Bytes$2("mnemonic"+K,zi.NFKD);return function pbkdf2$3(G,K,ne,ue,pe){let he;G=arrayify$1(G),K=arrayify$1(K);let ye=1;const me=new Uint8Array(ue),be=new Uint8Array(K.length+4);let ve,_e;be.set(K);for(let Te=1;Te<=ye;Te++){be[K.length]=Te>>24&255,be[K.length+1]=Te>>16&255,be[K.length+2]=Te>>8&255,be[K.length+3]=255&Te;let Ee=arrayify$1(computeHmac(pe,G,be));he||(he=Ee.length,_e=new Uint8Array(he),ye=Math.ceil(ue/he),ve=ue-(ye-1)*he),_e.set(Ee);for(let K=1;K<ne;K++){Ee=arrayify$1(computeHmac(pe,G,Ee));for(let G=0;G<he;G++)_e[G]^=Ee[G]}const Pe=(Te-1)*he,Se=Te===ye?ve:he;me.set(arrayify$1(_e).slice(0,Se),Pe)}return hexlify$2(me)}(toUtf8Bytes$2(G,zi.NFKD),ne,2048,64,"sha512")}function mnemonicToEntropy(G,K){K=getWordlist(K),pu.checkNormalize();const ne=K.split(G);if(ne.length%3!=0)throw new Error("invalid mnemonic");const ue=arrayify$1(new Uint8Array(Math.ceil(11*ne.length/8)));let pe=0;for(let G=0;G<ne.length;G++){let he=K.getWordIndex(ne[G].normalize("NFKD"));if(-1===he)throw new Error("invalid mnemonic");for(let G=0;G<11;G++)he&1<<10-G&&(ue[pe>>3]|=1<<7-pe%8),pe++}const he=32*ne.length/3,ye=getUpperMask(ne.length/3);if((arrayify$1(sha256$9(ue.slice(0,he/8)))[0]&ye)!==(ue[ue.length-1]&ye))throw new Error("invalid checksum");return hexlify$2(ue.slice(0,he/8))}function entropyToMnemonic(G,K){if(K=getWordlist(K),(G=arrayify$1(G)).length%4!=0||G.length<16||G.length>32)throw new Error("invalid entropy");const ne=[0];let ue=11;for(let K=0;K<G.length;K++)ue>8?(ne[ne.length-1]<<=8,ne[ne.length-1]|=G[K],ue-=8):(ne[ne.length-1]<<=ue,ne[ne.length-1]|=G[K]>>8-ue,ne.push(G[K]&(1<<8-ue)-1),ue+=3);const pe=G.length/4,he=arrayify$1(sha256$9(G))[0]&getUpperMask(pe);return ne[ne.length-1]<<=pe,ne[ne.length-1]|=he>>8-pe,K.join(ne.map((G=>K.getWord(G))))}const gu=new oi("random/5.7.0");const vu=function getGlobal(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let wu=vu.crypto||vu.msCrypto;wu&&wu.getRandomValues||(gu.warn("WARNING: Missing strong random number source"),wu={getRandomValues:function(G){return gu.throwError("no secure random source avaialble",oi.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var _u={exports:{}};!function(G,K){!function(K){const ne=2147483647;function SHA256(G){const K=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]);let ne=1779033703,ue=3144134277,pe=1013904242,he=2773480762,ye=1359893119,me=2600822924,be=528734635,ve=1541459225;const _e=new Uint32Array(64);function blocks(G){let Te=0,Ee=G.length;for(;Ee>=64;){let Pe,Se,Ce,ke,Oe,xe=ne,Ne=ue,Me=pe,Be=he,Fe=ye,De=me,Le=be,Ue=ve;for(Se=0;Se<16;Se++)Ce=Te+4*Se,_e[Se]=(255&G[Ce])<<24|(255&G[Ce+1])<<16|(255&G[Ce+2])<<8|255&G[Ce+3];for(Se=16;Se<64;Se++)Pe=_e[Se-2],ke=(Pe>>>17|Pe<<15)^(Pe>>>19|Pe<<13)^Pe>>>10,Pe=_e[Se-15],Oe=(Pe>>>7|Pe<<25)^(Pe>>>18|Pe<<14)^Pe>>>3,_e[Se]=(ke+_e[Se-7]|0)+(Oe+_e[Se-16]|0)|0;for(Se=0;Se<64;Se++)ke=(((Fe>>>6|Fe<<26)^(Fe>>>11|Fe<<21)^(Fe>>>25|Fe<<7))+(Fe&De^~Fe&Le)|0)+(Ue+(K[Se]+_e[Se]|0)|0)|0,Oe=((xe>>>2|xe<<30)^(xe>>>13|xe<<19)^(xe>>>22|xe<<10))+(xe&Ne^xe&Me^Ne&Me)|0,Ue=Le,Le=De,De=Fe,Fe=Be+ke|0,Be=Me,Me=Ne,Ne=xe,xe=ke+Oe|0;ne=ne+xe|0,ue=ue+Ne|0,pe=pe+Me|0,he=he+Be|0,ye=ye+Fe|0,me=me+De|0,be=be+Le|0,ve=ve+Ue|0,Te+=64,Ee-=64}}blocks(G);let Te,Ee=G.length%64,Pe=G.length/536870912|0,Se=G.length<<3,Ce=Ee<56?56:120,ke=G.slice(G.length-Ee,G.length);for(ke.push(128),Te=Ee+1;Te<Ce;Te++)ke.push(0);return ke.push(Pe>>>24&255),ke.push(Pe>>>16&255),ke.push(Pe>>>8&255),ke.push(Pe>>>0&255),ke.push(Se>>>24&255),ke.push(Se>>>16&255),ke.push(Se>>>8&255),ke.push(Se>>>0&255),blocks(ke),[ne>>>24&255,ne>>>16&255,ne>>>8&255,ne>>>0&255,ue>>>24&255,ue>>>16&255,ue>>>8&255,ue>>>0&255,pe>>>24&255,pe>>>16&255,pe>>>8&255,pe>>>0&255,he>>>24&255,he>>>16&255,he>>>8&255,he>>>0&255,ye>>>24&255,ye>>>16&255,ye>>>8&255,ye>>>0&255,me>>>24&255,me>>>16&255,me>>>8&255,me>>>0&255,be>>>24&255,be>>>16&255,be>>>8&255,be>>>0&255,ve>>>24&255,ve>>>16&255,ve>>>8&255,ve>>>0&255]}function PBKDF2_HMAC_SHA256_OneIter(G,K,ne){G=G.length<=64?G:SHA256(G);const ue=64+K.length+4,pe=new Array(ue),he=new Array(64);let ye,me=[];for(ye=0;ye<64;ye++)pe[ye]=54;for(ye=0;ye<G.length;ye++)pe[ye]^=G[ye];for(ye=0;ye<K.length;ye++)pe[64+ye]=K[ye];for(ye=ue-4;ye<ue;ye++)pe[ye]=0;for(ye=0;ye<64;ye++)he[ye]=92;for(ye=0;ye<G.length;ye++)he[ye]^=G[ye];function incrementCounter(){for(let G=ue-1;G>=ue-4;G--){if(pe[G]++,pe[G]<=255)return;pe[G]=0}}for(;ne>=32;)incrementCounter(),me=me.concat(SHA256(he.concat(SHA256(pe)))),ne-=32;return ne>0&&(incrementCounter(),me=me.concat(SHA256(he.concat(SHA256(pe))).slice(0,ne))),me}function blockmix_salsa8(G,K,ne,ue,pe){let he;for(arraycopy(G,16*(2*ne-1),pe,0,16),he=0;he<2*ne;he++)blockxor(G,16*he,pe,16),salsa20_8(pe,ue),arraycopy(pe,0,G,K+16*he,16);for(he=0;he<ne;he++)arraycopy(G,K+2*he*16,G,16*he,16);for(he=0;he<ne;he++)arraycopy(G,K+16*(2*he+1),G,16*(he+ne),16)}function R(G,K){return G<<K|G>>>32-K}function salsa20_8(G,K){arraycopy(G,0,K,0,16);for(let G=8;G>0;G-=2)K[4]^=R(K[0]+K[12],7),K[8]^=R(K[4]+K[0],9),K[12]^=R(K[8]+K[4],13),K[0]^=R(K[12]+K[8],18),K[9]^=R(K[5]+K[1],7),K[13]^=R(K[9]+K[5],9),K[1]^=R(K[13]+K[9],13),K[5]^=R(K[1]+K[13],18),K[14]^=R(K[10]+K[6],7),K[2]^=R(K[14]+K[10],9),K[6]^=R(K[2]+K[14],13),K[10]^=R(K[6]+K[2],18),K[3]^=R(K[15]+K[11],7),K[7]^=R(K[3]+K[15],9),K[11]^=R(K[7]+K[3],13),K[15]^=R(K[11]+K[7],18),K[1]^=R(K[0]+K[3],7),K[2]^=R(K[1]+K[0],9),K[3]^=R(K[2]+K[1],13),K[0]^=R(K[3]+K[2],18),K[6]^=R(K[5]+K[4],7),K[7]^=R(K[6]+K[5],9),K[4]^=R(K[7]+K[6],13),K[5]^=R(K[4]+K[7],18),K[11]^=R(K[10]+K[9],7),K[8]^=R(K[11]+K[10],9),K[9]^=R(K[8]+K[11],13),K[10]^=R(K[9]+K[8],18),K[12]^=R(K[15]+K[14],7),K[13]^=R(K[12]+K[15],9),K[14]^=R(K[13]+K[12],13),K[15]^=R(K[14]+K[13],18);for(let ne=0;ne<16;++ne)G[ne]+=K[ne]}function blockxor(G,K,ne,ue){for(let pe=0;pe<ue;pe++)ne[pe]^=G[K+pe]}function arraycopy(G,K,ne,ue,pe){for(;pe--;)ne[ue++]=G[K++]}function checkBufferish(G){if(!G||"number"!=typeof G.length)return!1;for(let K=0;K<G.length;K++){const ne=G[K];if("number"!=typeof ne||ne%1||ne<0||ne>=256)return!1}return!0}function ensureInteger(G,K){if("number"!=typeof G||G%1)throw new Error("invalid "+K);return G}function _scrypt(G,K,ue,pe,he,ye,me){if(ue=ensureInteger(ue,"N"),pe=ensureInteger(pe,"r"),he=ensureInteger(he,"p"),ye=ensureInteger(ye,"dkLen"),0===ue||0!=(ue&ue-1))throw new Error("N must be power of 2");if(ue>ne/128/pe)throw new Error("N too large");if(pe>ne/128/he)throw new Error("r too large");if(!checkBufferish(G))throw new Error("password must be an array or buffer");if(G=Array.prototype.slice.call(G),!checkBufferish(K))throw new Error("salt must be an array or buffer");K=Array.prototype.slice.call(K);let be=PBKDF2_HMAC_SHA256_OneIter(G,K,128*he*pe);const ve=new Uint32Array(32*he*pe);for(let G=0;G<ve.length;G++){const K=4*G;ve[G]=(255&be[K+3])<<24|(255&be[K+2])<<16|(255&be[K+1])<<8|(255&be[K+0])<<0}const _e=new Uint32Array(64*pe),Te=new Uint32Array(32*pe*ue),Ee=32*pe,Pe=new Uint32Array(16),Se=new Uint32Array(16),Ce=he*ue*2;let ke,Oe,xe=0,Ne=null,Me=!1,Be=0,Fe=0;const De=me?parseInt(1e3/pe):4294967295,Le="undefined"!=typeof setImmediate?setImmediate:setTimeout,incrementalSMix=function(){if(Me)return me(new Error("cancelled"),xe/Ce);let K;switch(Be){case 0:Oe=32*Fe*pe,arraycopy(ve,Oe,_e,0,Ee),Be=1,ke=0;case 1:K=ue-ke,K>De&&(K=De);for(let G=0;G<K;G++)arraycopy(_e,0,Te,(ke+G)*Ee,Ee),blockmix_salsa8(_e,Ee,pe,Pe,Se);if(ke+=K,xe+=K,me){const G=parseInt(1e3*xe/Ce);if(G!==Ne){if(Me=me(null,xe/Ce),Me)break;Ne=G}}if(ke<ue)break;ke=0,Be=2;case 2:K=ue-ke,K>De&&(K=De);for(let G=0;G<K;G++){const G=_e[16*(2*pe-1)]&ue-1;blockxor(Te,G*Ee,_e,Ee),blockmix_salsa8(_e,Ee,pe,Pe,Se)}if(ke+=K,xe+=K,me){const G=parseInt(1e3*xe/Ce);if(G!==Ne){if(Me=me(null,xe/Ce),Me)break;Ne=G}}if(ke<ue)break;if(arraycopy(_e,0,ve,Oe,Ee),Fe++,Fe<he){Be=0;break}be=[];for(let G=0;G<ve.length;G++)be.push(ve[G]>>0&255),be.push(ve[G]>>8&255),be.push(ve[G]>>16&255),be.push(ve[G]>>24&255);const ne=PBKDF2_HMAC_SHA256_OneIter(G,be,ye);return me&&me(null,1,ne),ne}me&&Le(incrementalSMix)};if(!me)for(;;){const G=incrementalSMix();if(null!=G)return G}incrementalSMix()}const ue={scrypt:function(G,K,ne,ue,pe,he,ye){return new Promise((function(me,be){let ve=0;ye&&ye(0),_scrypt(G,K,ne,ue,pe,he,(function(G,K,ne){if(G)be(G);else if(ne)ye&&1!==ve&&ye(1),me(new Uint8Array(ne));else if(ye&&K!==ve)return ve=K,ye(K)}))}))},syncScrypt:function(G,K,ne,ue,pe,he){return new Uint8Array(_scrypt(G,K,ne,ue,pe,he))}};G.exports=ue}()}(_u);var Tu=_u.exports;const Au=new oi("networks/5.7.1");function ethDefaultProvider(G){const func=function(K,ne){null==ne&&(ne={});const ue=[];if(K.InfuraProvider&&"-"!==ne.infura)try{ue.push(new K.InfuraProvider(G,ne.infura))}catch(G){}if(K.EtherscanProvider&&"-"!==ne.etherscan)try{ue.push(new K.EtherscanProvider(G,ne.etherscan))}catch(G){}if(K.AlchemyProvider&&"-"!==ne.alchemy)try{ue.push(new K.AlchemyProvider(G,ne.alchemy))}catch(G){}if(K.PocketProvider&&"-"!==ne.pocket){const pe=["goerli","ropsten","rinkeby","sepolia"];try{const he=new K.PocketProvider(G,ne.pocket);he.network&&-1===pe.indexOf(he.network.name)&&ue.push(he)}catch(G){}}if(K.CloudflareProvider&&"-"!==ne.cloudflare)try{ue.push(new K.CloudflareProvider(G))}catch(G){}if(K.AnkrProvider&&"-"!==ne.ankr)try{const pe=["ropsten"],he=new K.AnkrProvider(G,ne.ankr);he.network&&-1===pe.indexOf(he.network.name)&&ue.push(he)}catch(G){}if(0===ue.length)return null;if(K.FallbackProvider){let pe=1;return null!=ne.quorum?pe=ne.quorum:"homestead"===G&&(pe=2),new K.FallbackProvider(ue,pe)}return ue[0]};return func.renetwork=function(G){return ethDefaultProvider(G)},func}function etcDefaultProvider(G,K){const func=function(ne,ue){return ne.JsonRpcProvider?new ne.JsonRpcProvider(G,K):null};return func.renetwork=function(K){return etcDefaultProvider(G,K)},func}const Eu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},Pu={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},Su={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},Iu={unspecified:{chainId:0,name:"unspecified"},homestead:Eu,mainnet:Eu,morden:{chainId:2,name:"morden"},ropsten:Pu,testnet:Pu,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ethDefaultProvider("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Su,classicTestnet:Su,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var __awaiter$9=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};function getUrl$1(G,K){return __awaiter$9(this,void 0,void 0,(function*(){null==K&&(K={});const ne={method:K.method||"GET",headers:K.headers||{},body:K.body||void 0};if(!0!==K.skipFetchSetup&&(ne.mode="cors",ne.cache="no-cache",ne.credentials="same-origin",ne.redirect="follow",ne.referrer="client"),null!=K.fetchOptions){const G=K.fetchOptions;G.mode&&(ne.mode=G.mode),G.cache&&(ne.cache=G.cache),G.credentials&&(ne.credentials=G.credentials),G.redirect&&(ne.redirect=G.redirect),G.referrer&&(ne.referrer=G.referrer)}const ue=yield fetch(G,ne),pe=yield ue.arrayBuffer(),he={};return ue.headers.forEach?ue.headers.forEach(((G,K)=>{he[K.toLowerCase()]=G})):ue.headers.keys().forEach((G=>{he[G.toLowerCase()]=ue.headers.get(G)})),{headers:he,statusCode:ue.status,statusMessage:ue.statusText,body:arrayify$1(new Uint8Array(pe))}}))}var __awaiter$8=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Cu=new oi("web/5.7.1");function staller(G){return new Promise((K=>{setTimeout(K,G)}))}function bodyify(G,K){if(null==G)return null;if("string"==typeof G)return G;if(isBytesLike$2(G)){if(K&&("text"===K.split("/")[0]||"application/json"===K.split(";")[0].trim()))try{return toUtf8String$2(G)}catch(G){}return hexlify$2(G)}return G}function _fetchData(G,K,ne){const ue="object"==typeof G&&null!=G.throttleLimit?G.throttleLimit:12;Cu.assertArgument(ue>0&&ue%1==0,"invalid connection throttle limit","connection.throttleLimit",ue);const pe="object"==typeof G?G.throttleCallback:null,he="object"==typeof G&&"number"==typeof G.throttleSlotInterval?G.throttleSlotInterval:100;Cu.assertArgument(he>0&&he%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",he);const ye="object"==typeof G&&!!G.errorPassThrough,me={};let be=null;const ve={method:"GET"};let _e=!1,Te=12e4;if("string"==typeof G)be=G;else if("object"==typeof G){if(null!=G&&null!=G.url||Cu.throwArgumentError("missing URL","connection.url",G),be=G.url,"number"==typeof G.timeout&&G.timeout>0&&(Te=G.timeout),G.headers)for(const K in G.headers)me[K.toLowerCase()]={key:K,value:String(G.headers[K])},["if-none-match","if-modified-since"].indexOf(K.toLowerCase())>=0&&(_e=!0);if(ve.allowGzip=!!G.allowGzip,null!=G.user&&null!=G.password){"https:"!==be.substring(0,6)&&!0!==G.allowInsecureAuthentication&&Cu.throwError("basic authentication requires a secure https url",oi.errors.INVALID_ARGUMENT,{argument:"url",url:be,user:G.user,password:"[REDACTED]"});const K=G.user+":"+G.password;me.authorization={key:"Authorization",value:"Basic "+encode$5(toUtf8Bytes$2(K))}}null!=G.skipFetchSetup&&(ve.skipFetchSetup=!!G.skipFetchSetup),null!=G.fetchOptions&&(ve.fetchOptions=shallowCopy$1(G.fetchOptions))}const Ee=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Pe=be?be.match(Ee):null;if(Pe)try{const G={statusCode:200,statusMessage:"OK",headers:{"content-type":Pe[1]||"text/plain"},body:Pe[2]?decode$2(Pe[3]):(Se=Pe[3],toUtf8Bytes$2(Se.replace(/%([0-9a-f][0-9a-f])/gi,((G,K)=>String.fromCharCode(parseInt(K,16))))))};let K=G.body;return ne&&(K=ne(G.body,G)),Promise.resolve(K)}catch(G){Cu.throwError("processing response error",oi.errors.SERVER_ERROR,{body:bodyify(Pe[1],Pe[2]),error:G,requestBody:null,requestMethod:"GET",url:be})}var Se;K&&(ve.method="POST",ve.body=K,null==me["content-type"]&&(me["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==me["content-length"]&&(me["content-length"]={key:"Content-Length",value:String(K.length)}));const Ce={};Object.keys(me).forEach((G=>{const K=me[G];Ce[K.key]=K.value})),ve.headers=Ce;const ke=function(){let G=null;return{promise:new Promise((function(K,ne){Te&&(G=setTimeout((()=>{null!=G&&(G=null,ne(Cu.makeError("timeout",oi.errors.TIMEOUT,{requestBody:bodyify(ve.body,Ce["content-type"]),requestMethod:ve.method,timeout:Te,url:be})))}),Te))})),cancel:function(){null!=G&&(clearTimeout(G),G=null)}}}(),Oe=function(){return __awaiter$8(this,void 0,void 0,(function*(){for(let G=0;G<ue;G++){let K=null;try{if(K=yield getUrl$1(be,ve),G<ue)if(301===K.statusCode||302===K.statusCode){const G=K.headers.location||"";if("GET"===ve.method&&G.match(/^https:/)){be=K.headers.location;continue}}else if(429===K.statusCode){let ne=!0;if(pe&&(ne=yield pe(G,be)),ne){let ne=0;const ue=K.headers["retry-after"];ne="string"==typeof ue&&ue.match(/^[1-9][0-9]*$/)?1e3*parseInt(ue):he*parseInt(String(Math.random()*Math.pow(2,G))),yield staller(ne);continue}}}catch(G){K=G.response,null==K&&(ke.cancel(),Cu.throwError("missing response",oi.errors.SERVER_ERROR,{requestBody:bodyify(ve.body,Ce["content-type"]),requestMethod:ve.method,serverError:G,url:be}))}let me=K.body;if(_e&&304===K.statusCode?me=null:!ye&&(K.statusCode<200||K.statusCode>=300)&&(ke.cancel(),Cu.throwError("bad response",oi.errors.SERVER_ERROR,{status:K.statusCode,headers:K.headers,body:bodyify(me,K.headers?K.headers["content-type"]:null),requestBody:bodyify(ve.body,Ce["content-type"]),requestMethod:ve.method,url:be})),ne)try{const G=yield ne(me,K);return ke.cancel(),G}catch(ne){if(ne.throttleRetry&&G<ue){let K=!0;if(pe&&(K=yield pe(G,be)),K){const K=he*parseInt(String(Math.random()*Math.pow(2,G)));yield staller(K);continue}}ke.cancel(),Cu.throwError("processing response error",oi.errors.SERVER_ERROR,{body:bodyify(me,K.headers?K.headers["content-type"]:null),error:ne,requestBody:bodyify(ve.body,Ce["content-type"]),requestMethod:ve.method,url:be})}return ke.cancel(),me}return Cu.throwError("failed response",oi.errors.SERVER_ERROR,{requestBody:bodyify(ve.body,Ce["content-type"]),requestMethod:ve.method,url:be})}))}();return Promise.race([ke.promise,Oe])}function fetchJson(G,K,ne){let ue=null;if(null!=K){ue=toUtf8Bytes$2(K);const ne="string"==typeof G?{url:G}:shallowCopy$1(G);if(ne.headers){const G=0!==Object.keys(ne.headers).filter((G=>"content-type"===G.toLowerCase())).length;G||(ne.headers=shallowCopy$1(ne.headers),ne.headers["content-type"]="application/json")}else ne.headers={"content-type":"application/json"};G=ne}return _fetchData(G,ue,((G,K)=>{let ue=null;if(null!=G)try{ue=JSON.parse(toUtf8String$2(G))}catch(K){Cu.throwError("invalid JSON",oi.errors.SERVER_ERROR,{body:G,error:K})}return ne&&(ue=ne(ue,K)),ue}))}function poll(G,K){return K||(K={}),null==(K=shallowCopy$1(K)).floor&&(K.floor=0),null==K.ceiling&&(K.ceiling=1e4),null==K.interval&&(K.interval=250),new Promise((function(ne,ue){let pe=null,he=!1;const cancel=()=>!he&&(he=!0,pe&&clearTimeout(pe),!0);K.timeout&&(pe=setTimeout((()=>{cancel()&&ue(new Error("timeout"))}),K.timeout));const ye=K.retryLimit;let me=0;!function check(){return G().then((function(G){if(void 0!==G)cancel()&&ne(G);else if(K.oncePoll)K.oncePoll.once("poll",check);else if(K.onceBlock)K.onceBlock.once("block",check);else if(!he){if(me++,me>ye)return void(cancel()&&ue(new Error("retry limit reached")));let G=K.interval*parseInt(String(Math.random()*Math.pow(2,me)));G<K.floor&&(G=K.floor),G>K.ceiling&&(G=K.ceiling),setTimeout(check,G)}return null}),(function(G){cancel()&&ue(G)}))}()}))}for(var Ru="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ku={},Ou=0;Ou<32;Ou++){var xu=Ru.charAt(Ou);if(void 0!==ku[xu])throw new TypeError(xu+" is ambiguous");ku[xu]=Ou}function polymodStep(G){var K=G>>25;return(33554431&G)<<5^996825010&-(K>>0&1)^642813549&-(K>>1&1)^513874426&-(K>>2&1)^1027748829&-(K>>3&1)^705979059&-(K>>4&1)}function prefixChk(G){for(var K=1,ne=0;ne<G.length;++ne){var ue=G.charCodeAt(ne);if(ue<33||ue>126)return"Invalid prefix ("+G+")";K=polymodStep(K)^ue>>5}for(K=polymodStep(K),ne=0;ne<G.length;++ne){var pe=G.charCodeAt(ne);K=polymodStep(K)^31&pe}return K}function __decode(G,K){if(K=K||90,G.length<8)return G+" too short";if(G.length>K)return"Exceeds length limit";var ne=G.toLowerCase(),ue=G.toUpperCase();if(G!==ne&&G!==ue)return"Mixed-case string "+G;var pe=(G=ne).lastIndexOf("1");if(-1===pe)return"No separator character for "+G;if(0===pe)return"Missing prefix for "+G;var he=G.slice(0,pe),ye=G.slice(pe+1);if(ye.length<6)return"Data too short";var me=prefixChk(he);if("string"==typeof me)return me;for(var be=[],ve=0;ve<ye.length;++ve){var _e=ye.charAt(ve),Te=ku[_e];if(void 0===Te)return"Unknown character "+_e;me=polymodStep(me)^Te,ve+6>=ye.length||be.push(Te)}return 1!==me?"Invalid checksum for "+G:{prefix:he,words:be}}function convert(G,K,ne,ue){for(var pe=0,he=0,ye=(1<<ne)-1,me=[],be=0;be<G.length;++be)for(pe=pe<<K|G[be],he+=K;he>=ne;)he-=ne,me.push(pe>>he&ye);if(ue)he>0&&me.push(pe<<ne-he&ye);else{if(he>=K)return"Excess padding";if(pe<<ne-he&ye)return"Non-zero padding"}return me}var Nu={decodeUnsafe:function decodeUnsafe(){var G=__decode.apply(null,arguments);if("object"==typeof G)return G},decode:function decode$1(G){var K=__decode.apply(null,arguments);if("object"==typeof K)return K;throw new Error(K)},encode:function encode$4(G,K,ne){if(ne=ne||90,G.length+7+K.length>ne)throw new TypeError("Exceeds length limit");var ue=prefixChk(G=G.toLowerCase());if("string"==typeof ue)throw new Error(ue);for(var pe=G+"1",he=0;he<K.length;++he){var ye=K[he];if(ye>>5!=0)throw new Error("Non 5-bit word");ue=polymodStep(ue)^ye,pe+=Ru.charAt(ye)}for(he=0;he<6;++he)ue=polymodStep(ue);for(ue^=1,he=0;he<6;++he){pe+=Ru.charAt(ue>>5*(5-he)&31)}return pe},toWordsUnsafe:function toWordsUnsafe(G){var K=convert(G,8,5,!0);if(Array.isArray(K))return K},toWords:function toWords(G){var K=convert(G,8,5,!0);if(Array.isArray(K))return K;throw new Error(K)},fromWordsUnsafe:function fromWordsUnsafe(G){var K=convert(G,5,8,!1);if(Array.isArray(K))return K},fromWords:function fromWords(G){var K=convert(G,5,8,!1);if(Array.isArray(K))return K;throw new Error(K)}},Mu=getDefaultExportFromCjs$1(Nu);const Bu="providers/5.7.2",Fu=new oi(Bu);class Formatter{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const G={},K=this.address.bind(this),ne=this.bigNumber.bind(this),ue=this.blockTag.bind(this),pe=this.data.bind(this),he=this.hash.bind(this),ye=this.hex.bind(this),me=this.number.bind(this),be=this.type.bind(this);return G.transaction={hash:he,type:be,accessList:Formatter.allowNull(this.accessList.bind(this),null),blockHash:Formatter.allowNull(he,null),blockNumber:Formatter.allowNull(me,null),transactionIndex:Formatter.allowNull(me,null),confirmations:Formatter.allowNull(me,null),from:K,gasPrice:Formatter.allowNull(ne),maxPriorityFeePerGas:Formatter.allowNull(ne),maxFeePerGas:Formatter.allowNull(ne),gasLimit:ne,to:Formatter.allowNull(K,null),value:ne,nonce:me,data:pe,r:Formatter.allowNull(this.uint256),s:Formatter.allowNull(this.uint256),v:Formatter.allowNull(me),creates:Formatter.allowNull(K,null),raw:Formatter.allowNull(pe)},G.transactionRequest={from:Formatter.allowNull(K),nonce:Formatter.allowNull(me),gasLimit:Formatter.allowNull(ne),gasPrice:Formatter.allowNull(ne),maxPriorityFeePerGas:Formatter.allowNull(ne),maxFeePerGas:Formatter.allowNull(ne),to:Formatter.allowNull(K),value:Formatter.allowNull(ne),data:Formatter.allowNull((G=>this.data(G,!0))),type:Formatter.allowNull(me),accessList:Formatter.allowNull(this.accessList.bind(this),null)},G.receiptLog={transactionIndex:me,blockNumber:me,transactionHash:he,address:K,topics:Formatter.arrayOf(he),data:pe,logIndex:me,blockHash:he},G.receipt={to:Formatter.allowNull(this.address,null),from:Formatter.allowNull(this.address,null),contractAddress:Formatter.allowNull(K,null),transactionIndex:me,root:Formatter.allowNull(ye),gasUsed:ne,logsBloom:Formatter.allowNull(pe),blockHash:he,transactionHash:he,logs:Formatter.arrayOf(this.receiptLog.bind(this)),blockNumber:me,confirmations:Formatter.allowNull(me,null),cumulativeGasUsed:ne,effectiveGasPrice:Formatter.allowNull(ne),status:Formatter.allowNull(me),type:be},G.block={hash:Formatter.allowNull(he),parentHash:he,number:me,timestamp:me,nonce:Formatter.allowNull(ye),difficulty:this.difficulty.bind(this),gasLimit:ne,gasUsed:ne,miner:Formatter.allowNull(K),extraData:pe,transactions:Formatter.allowNull(Formatter.arrayOf(he)),baseFeePerGas:Formatter.allowNull(ne)},G.blockWithTransactions=shallowCopy$1(G.block),G.blockWithTransactions.transactions=Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this))),G.filter={fromBlock:Formatter.allowNull(ue,void 0),toBlock:Formatter.allowNull(ue,void 0),blockHash:Formatter.allowNull(he,void 0),address:Formatter.allowNull(K,void 0),topics:Formatter.allowNull(this.topics.bind(this),void 0)},G.filterLog={blockNumber:Formatter.allowNull(me),blockHash:Formatter.allowNull(he),transactionIndex:me,removed:Formatter.allowNull(this.boolean.bind(this)),address:K,data:Formatter.allowFalsish(pe,"0x"),topics:Formatter.arrayOf(he),transactionHash:he,logIndex:me},G}accessList(G){return accessListify$2(G||[])}number(G){return"0x"===G?0:Oi.from(G).toNumber()}type(G){return"0x"===G||null==G?0:Oi.from(G).toNumber()}bigNumber(G){return Oi.from(G)}boolean(G){if("boolean"==typeof G)return G;if("string"==typeof G){if("true"===(G=G.toLowerCase()))return!0;if("false"===G)return!1}throw new Error("invalid boolean - "+G)}hex(G,K){return"string"==typeof G&&(K||"0x"===G.substring(0,2)||(G="0x"+G),isHexString$4(G))?G.toLowerCase():Fu.throwArgumentError("invalid hash","value",G)}data(G,K){const ne=this.hex(G,K);if(ne.length%2!=0)throw new Error("invalid data; odd-length - "+G);return ne}address(G){return getAddress$2(G)}callAddress(G){if(!isHexString$4(G,32))return null;const K=getAddress$2(hexDataSlice$1(G,12));return K===ui?null:K}contractAddress(G){return getContractAddress$1(G)}blockTag(G){if(null==G)return"latest";if("earliest"===G)return"0x0";switch(G){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return G}if("number"==typeof G||isHexString$4(G))return hexValue$1(G);throw new Error("invalid blockTag")}hash(G,K){const ne=this.hex(G,K);return 32!==hexDataLength$1(ne)?Fu.throwArgumentError("invalid hash","value",G):ne}difficulty(G){if(null==G)return null;const K=Oi.from(G);try{return K.toNumber()}catch(G){}return null}uint256(G){if(!isHexString$4(G))throw new Error("invalid uint256");return hexZeroPad$1(G,32)}_block(G,K){null!=G.author&&null==G.miner&&(G.miner=G.author);const ne=null!=G._difficulty?G._difficulty:G.difficulty,ue=Formatter.check(K,G);return ue._difficulty=null==ne?null:Oi.from(ne),ue}block(G){return this._block(G,this.formats.block)}blockWithTransactions(G){return this._block(G,this.formats.blockWithTransactions)}transactionRequest(G){return Formatter.check(this.formats.transactionRequest,G)}transactionResponse(G){null!=G.gas&&null==G.gasLimit&&(G.gasLimit=G.gas),G.to&&Oi.from(G.to).isZero()&&(G.to="0x0000000000000000000000000000000000000000"),null!=G.input&&null==G.data&&(G.data=G.input),null==G.to&&null==G.creates&&(G.creates=this.contractAddress(G)),1!==G.type&&2!==G.type||null!=G.accessList||(G.accessList=[]);const K=Formatter.check(this.formats.transaction,G);if(null!=G.chainId){let ne=G.chainId;isHexString$4(ne)&&(ne=Oi.from(ne).toNumber()),K.chainId=ne}else{let ne=G.networkId;null==ne&&null==K.v&&(ne=G.chainId),isHexString$4(ne)&&(ne=Oi.from(ne).toNumber()),"number"!=typeof ne&&null!=K.v&&(ne=(K.v-35)/2,ne<0&&(ne=0),ne=parseInt(ne)),"number"!=typeof ne&&(ne=0),K.chainId=ne}return K.blockHash&&"x"===K.blockHash.replace(/0/g,"")&&(K.blockHash=null),K}transaction(G){return parse$1(G)}receiptLog(G){return Formatter.check(this.formats.receiptLog,G)}receipt(G){const K=Formatter.check(this.formats.receipt,G);if(null!=K.root)if(K.root.length<=4){const G=Oi.from(K.root).toNumber();0===G||1===G?(null!=K.status&&K.status!==G&&Fu.throwArgumentError("alt-root-status/status mismatch","value",{root:K.root,status:K.status}),K.status=G,delete K.root):Fu.throwArgumentError("invalid alt-root-status","value.root",K.root)}else 66!==K.root.length&&Fu.throwArgumentError("invalid root hash","value.root",K.root);return null!=K.status&&(K.byzantium=!0),K}topics(G){return Array.isArray(G)?G.map((G=>this.topics(G))):null!=G?this.hash(G,!0):null}filter(G){return Formatter.check(this.formats.filter,G)}filterLog(G){return Formatter.check(this.formats.filterLog,G)}static check(G,K){const ne={};for(const ue in G)try{const pe=G[ue](K[ue]);void 0!==pe&&(ne[ue]=pe)}catch(G){throw G.checkKey=ue,G.checkValue=K[ue],G}return ne}static allowNull(G,K){return function(ne){return null==ne?K:G(ne)}}static allowFalsish(G,K){return function(ne){return ne?G(ne):K}}static arrayOf(G){return function(K){if(!Array.isArray(K))throw new Error("not an array");const ne=[];return K.forEach((function(K){ne.push(G(K))})),ne}}}var __awaiter$7=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Du=new oi(Bu);function checkTopic(G){return null==G?"null":(32!==hexDataLength$1(G)&&Du.throwArgumentError("invalid topic","topic",G),G.toLowerCase())}function serializeTopics(G){for(G=G.slice();G.length>0&&null==G[G.length-1];)G.pop();return G.map((G=>{if(Array.isArray(G)){const K={};G.forEach((G=>{K[checkTopic(G)]=!0}));const ne=Object.keys(K);return ne.sort(),ne.join("|")}return checkTopic(G)})).join("&")}function getEventTag$1(G){if("string"==typeof G){if(32===hexDataLength$1(G=G.toLowerCase()))return"tx:"+G;if(-1===G.indexOf(":"))return G}else{if(Array.isArray(G))return"filter:*:"+serializeTopics(G);if(ForkEvent.isForkEvent(G))throw Du.warn("not implemented"),new Error("not implemented");if(G&&"object"==typeof G)return"filter:"+(G.address||"*")+":"+serializeTopics(G.topics||[])}throw new Error("invalid event - "+G)}function getTime$2(){return(new Date).getTime()}function stall$1(G){return new Promise((K=>{setTimeout(K,G)}))}const Lu=["block","network","pending","poll"];const Uu={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 bytes32ify(G){return hexZeroPad$1(Oi.from(G).toHexString(),32)}function base58Encode(G){return su.encode(concat$2([G,hexDataSlice$1(sha256$9(sha256$9(G)),0,4)]))}const $u=new RegExp("^(ipfs)://(.*)$","i"),qu=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),$u,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString$1(G,K){try{return toUtf8String$2(_parseBytes$1(G,K))}catch(G){}return null}function _parseBytes$1(G,K){if("0x"===G)return null;const ne=Oi.from(hexDataSlice$1(G,K,K+32)).toNumber(),ue=Oi.from(hexDataSlice$1(G,ne,ne+32)).toNumber();return hexDataSlice$1(G,ne+32,ne+32+ue)}function getIpfsLink$1(G){return G.match(/^ipfs:\/\/ipfs\//i)?G=G.substring(12):G.match(/^ipfs:\/\//i)?G=G.substring(7):Du.throwArgumentError("unsupported IPFS format","link",G),`https://gateway.ipfs.io/ipfs/${G}`}function numPad$1(G){const K=arrayify$1(G);if(K.length>32)throw new Error("internal; should not happen");const ne=new Uint8Array(32);return ne.set(K,32-K.length),ne}function bytesPad$1(G){if(G.length%32==0)return G;const K=new Uint8Array(32*Math.ceil(G.length/32));return K.set(G),K}function encodeBytes$1(G){const K=[];let ne=0;for(let ue=0;ue<G.length;ue++)K.push(null),ne+=32;for(let ue=0;ue<G.length;ue++){const pe=arrayify$1(G[ue]);K[ue]=numPad$1(ne),K.push(numPad$1(pe.length)),K.push(bytesPad$1(pe)),ne+=32+32*Math.ceil(pe.length/32)}return hexConcat$1(K)}class Resolver{constructor(G,K,ne,ue){defineReadOnly$1(this,"provider",G),defineReadOnly$1(this,"name",ne),defineReadOnly$1(this,"address",G.formatter.address(K)),defineReadOnly$1(this,"_resolvedAddress",ue)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((G=>Oi.from(G).eq(1))).catch((G=>{if(G.code===oi.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,G}))),this._supportsEip2544}_fetch(G,K){return __awaiter$7(this,void 0,void 0,(function*(){const ne={to:this.address,ccipReadEnabled:!0,data:hexConcat$1([G,namehash$2(this.name),K||"0x"])};let ue=!1;(yield this.supportsWildcard())&&(ue=!0,ne.data=hexConcat$1(["0x9061b923",encodeBytes$1([dnsEncode$1(this.name),ne.data])]));try{let G=yield this.provider.call(ne);return arrayify$1(G).length%32==4&&Du.throwError("resolver threw error",oi.errors.CALL_EXCEPTION,{transaction:ne,data:G}),ue&&(G=_parseBytes$1(G,0)),G}catch(G){if(G.code===oi.errors.CALL_EXCEPTION)return null;throw G}}))}_fetchBytes(G,K){return __awaiter$7(this,void 0,void 0,(function*(){const ne=yield this._fetch(G,K);return null!=ne?_parseBytes$1(ne,0):null}))}_getAddress(G,K){const ne=Uu[String(G)];if(null==ne&&Du.throwError(`unsupported coin type: ${G}`,oi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${G})`}),"eth"===ne.ilk)return this.provider.formatter.address(K);const ue=arrayify$1(K);if(null!=ne.p2pkh){const G=K.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(G){const K=parseInt(G[1],16);if(G[2].length===2*K&&K>=1&&K<=75)return base58Encode(concat$2([[ne.p2pkh],"0x"+G[2]]))}}if(null!=ne.p2sh){const G=K.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(G){const K=parseInt(G[1],16);if(G[2].length===2*K&&K>=1&&K<=75)return base58Encode(concat$2([[ne.p2sh],"0x"+G[2]]))}}if(null!=ne.prefix){const G=ue[1];let K=ue[0];if(0===K?20!==G&&32!==G&&(K=-1):K=-1,K>=0&&ue.length===2+G&&G>=1&&G<=75){const G=Mu.toWords(ue.slice(2));return G.unshift(K),Mu.encode(ne.prefix,G)}}return null}getAddress(G){return __awaiter$7(this,void 0,void 0,(function*(){if(null==G&&(G=60),60===G)try{const G=yield this._fetch("0x3b3b57de");return"0x"===G||G===Hi?null:this.provider.formatter.callAddress(G)}catch(G){if(G.code===oi.errors.CALL_EXCEPTION)return null;throw G}const K=yield this._fetchBytes("0xf1cb7e06",bytes32ify(G));if(null==K||"0x"===K)return null;const ne=this._getAddress(G,K);return null==ne&&Du.throwError("invalid or unsupported coin data",oi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${G})`,coinType:G,data:K}),ne}))}getAvatar(){return __awaiter$7(this,void 0,void 0,(function*(){const G=[{type:"name",content:this.name}];try{const K=yield this.getText("avatar");if(null==K)return null;for(let ne=0;ne<qu.length;ne++){const ue=K.match(qu[ne]);if(null==ue)continue;const pe=ue[1].toLowerCase();switch(pe){case"https":return G.push({type:"url",content:K}),{linkage:G,url:K};case"data":return G.push({type:"data",content:K}),{linkage:G,url:K};case"ipfs":return G.push({type:"ipfs",content:K}),{linkage:G,url:getIpfsLink$1(K)};case"erc721":case"erc1155":{const ne="erc721"===pe?"0xc87b56dd":"0x0e89341c";G.push({type:pe,content:K});const he=this._resolvedAddress||(yield this.getAddress()),ye=(ue[2]||"").split("/");if(2!==ye.length)return null;const me=yield this.provider.formatter.address(ye[0]),be=hexZeroPad$1(Oi.from(ye[1]).toHexString(),32);if("erc721"===pe){const K=this.provider.formatter.callAddress(yield this.provider.call({to:me,data:hexConcat$1(["0x6352211e",be])}));if(he!==K)return null;G.push({type:"owner",content:K})}else if("erc1155"===pe){const K=Oi.from(yield this.provider.call({to:me,data:hexConcat$1(["0x00fdd58e",hexZeroPad$1(he,32),be])}));if(K.isZero())return null;G.push({type:"balance",content:K.toString()})}const ve={to:this.provider.formatter.address(ye[0]),data:hexConcat$1([ne,be])};let _e=_parseString$1(yield this.provider.call(ve),0);if(null==_e)return null;G.push({type:"metadata-url-base",content:_e}),"erc1155"===pe&&(_e=_e.replace("{id}",be.substring(2)),G.push({type:"metadata-url-expanded",content:_e})),_e.match(/^ipfs:/i)&&(_e=getIpfsLink$1(_e)),G.push({type:"metadata-url",content:_e});const Te=yield fetchJson(_e);if(!Te)return null;G.push({type:"metadata",content:JSON.stringify(Te)});let Ee=Te.image;if("string"!=typeof Ee)return null;if(Ee.match(/^(https:\/\/|data:)/i));else{if(null==Ee.match($u))return null;G.push({type:"url-ipfs",content:Ee}),Ee=getIpfsLink$1(Ee)}return G.push({type:"url",content:Ee}),{linkage:G,url:Ee}}}}}catch(G){}return null}))}getContentHash(){return __awaiter$7(this,void 0,void 0,(function*(){const G=yield this._fetchBytes("0xbc1c58d1");if(null==G||"0x"===G)return null;const K=G.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(K){const G=parseInt(K[3],16);if(K[4].length===2*G)return"ipfs://"+su.encode("0x"+K[1])}const ne=G.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(ne){const G=parseInt(ne[3],16);if(ne[4].length===2*G)return"ipns://"+su.encode("0x"+ne[1])}const ue=G.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(ue&&64===ue[1].length)return"bzz://"+ue[1];const pe=G.match(/^0x90b2c605([0-9a-f]*)$/);if(pe&&68===pe[1].length){const G={"=":"","+":"-","/":"_"};return"sia://"+encode$5("0x"+pe[1]).replace(/[=+\/]/g,(K=>G[K]))}return Du.throwError("invalid or unsupported content hash data",oi.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:G})}))}getText(G){return __awaiter$7(this,void 0,void 0,(function*(){let K=toUtf8Bytes$2(G);K=concat$2([bytes32ify(64),bytes32ify(K.length),K]),K.length%32!=0&&(K=concat$2([K,hexZeroPad$1("0x",32-G.length%32)]));const ne=yield this._fetchBytes("0x59d1d43c",hexlify$2(K));return null==ne||"0x"===ne?null:toUtf8String$2(ne)}))}}let Gu=null,ju=1;class BaseProvider extends Vo{constructor(G){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly$1(this,"anyNetwork","any"===G),this.anyNetwork&&(G=this.detectNetwork()),G instanceof Promise)this._networkPromise=G,G.catch((G=>{})),this._ready().catch((G=>{}));else{const K=getStatic$1(new.target,"getNetwork")(G);K?(defineReadOnly$1(this,"_network",K),this.emit("network",K,null)):Du.throwArgumentError("invalid network","network",G)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$7(this,void 0,void 0,(function*(){if(null==this._network){let G=null;if(this._networkPromise)try{G=yield this._networkPromise}catch(G){}null==G&&(G=yield this.detectNetwork()),G||Du.throwError("no network detected",oi.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=G:defineReadOnly$1(this,"_network",G),this.emit("network",G,null))}return this._network}))}get ready(){return poll((()=>this._ready().then((G=>G),(G=>{if(G.code!==oi.errors.NETWORK_ERROR||"noNetwork"!==G.event)throw G}))))}static getFormatter(){return null==Gu&&(Gu=new Formatter),Gu}static getNetwork(G){return function getNetwork(G){if(null==G)return null;if("number"==typeof G){for(const K in Iu){const ne=Iu[K];if(ne.chainId===G)return{name:ne.name,chainId:ne.chainId,ensAddress:ne.ensAddress||null,_defaultProvider:ne._defaultProvider||null}}return{chainId:G,name:"unknown"}}if("string"==typeof G){const K=Iu[G];return null==K?null:{name:K.name,chainId:K.chainId,ensAddress:K.ensAddress,_defaultProvider:K._defaultProvider||null}}const K=Iu[G.name];if(!K)return"number"!=typeof G.chainId&&Au.throwArgumentError("invalid network chainId","network",G),G;0!==G.chainId&&G.chainId!==K.chainId&&Au.throwArgumentError("network chainId mismatch","network",G);let ne=G._defaultProvider||null;return null==ne&&K._defaultProvider&&(ne=function isRenetworkable(G){return G&&"function"==typeof G.renetwork}(K._defaultProvider)?K._defaultProvider.renetwork(G):K._defaultProvider),{name:G.name,chainId:K.chainId,ensAddress:G.ensAddress||K.ensAddress||null,_defaultProvider:ne}}(null==G?"homestead":G)}ccipReadFetch(G,K,ne){return __awaiter$7(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===ne.length)return null;const ue=G.to.toLowerCase(),pe=K.toLowerCase(),he=[];for(let G=0;G<ne.length;G++){const K=ne[G],ye=K.replace("{sender}",ue).replace("{data}",pe),me=K.indexOf("{data}")>=0?null:JSON.stringify({data:pe,sender:ue}),be=yield fetchJson({url:ye,errorPassThrough:!0},me,((G,K)=>(G.status=K.statusCode,G)));if(be.data)return be.data;const ve=be.message||"unknown error";if(be.status>=400&&be.status<500)return Du.throwError(`response not found during CCIP fetch: ${ve}`,oi.errors.SERVER_ERROR,{url:K,errorMessage:ve});he.push(ve)}return Du.throwError(`error encountered during CCIP fetch: ${he.map((G=>JSON.stringify(G))).join(", ")}`,oi.errors.SERVER_ERROR,{urls:ne,errorMessages:he})}))}_getInternalBlockNumber(G){return __awaiter$7(this,void 0,void 0,(function*(){if(yield this._ready(),G>0)for(;this._internalBlockNumber;){const K=this._internalBlockNumber;try{const ne=yield K;if(getTime$2()-ne.respTime<=G)return ne.blockNumber;break}catch(G){if(this._internalBlockNumber===K)break}}const K=getTime$2(),ne=resolveProperties$2({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((G=>null),(G=>G))}).then((({blockNumber:G,networkError:ue})=>{if(ue)throw this._internalBlockNumber===ne&&(this._internalBlockNumber=null),ue;const pe=getTime$2();return(G=Oi.from(G).toNumber())<this._maxInternalBlockNumber&&(G=this._maxInternalBlockNumber),this._maxInternalBlockNumber=G,this._setFastBlockNumber(G),{blockNumber:G,reqTime:K,respTime:pe}}));return this._internalBlockNumber=ne,ne.catch((G=>{this._internalBlockNumber===ne&&(this._internalBlockNumber=null)})),(yield ne).blockNumber}))}poll(){return __awaiter$7(this,void 0,void 0,(function*(){const G=ju++,K=[];let ne=null;try{ne=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(G){return void this.emit("error",G)}if(this._setFastBlockNumber(ne),this.emit("poll",G,ne),ne!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=ne-1),Math.abs(this._emitted.block-ne)>1e3)Du.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${ne})`),this.emit("error",Du.makeError("network block skew detected",oi.errors.NETWORK_ERROR,{blockNumber:ne,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",ne);else for(let G=this._emitted.block+1;G<=ne;G++)this.emit("block",G);this._emitted.block!==ne&&(this._emitted.block=ne,Object.keys(this._emitted).forEach((G=>{if("block"===G)return;const K=this._emitted[G];"pending"!==K&&ne-K>12&&delete this._emitted[G]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=ne-1),this._events.forEach((G=>{switch(G.type){case"tx":{const ne=G.hash;let ue=this.getTransactionReceipt(ne).then((G=>G&&null!=G.blockNumber?(this._emitted["t:"+ne]=G.blockNumber,this.emit(ne,G),null):null)).catch((G=>{this.emit("error",G)}));K.push(ue);break}case"filter":if(!G._inflight){G._inflight=!0,-2===G._lastBlockNumber&&(G._lastBlockNumber=ne-1);const ue=G.filter;ue.fromBlock=G._lastBlockNumber+1,ue.toBlock=ne;const pe=ue.toBlock-this._maxFilterBlockRange;pe>ue.fromBlock&&(ue.fromBlock=pe),ue.fromBlock<0&&(ue.fromBlock=0);const he=this.getLogs(ue).then((K=>{G._inflight=!1,0!==K.length&&K.forEach((K=>{K.blockNumber>G._lastBlockNumber&&(G._lastBlockNumber=K.blockNumber),this._emitted["b:"+K.blockHash]=K.blockNumber,this._emitted["t:"+K.transactionHash]=K.blockNumber,this.emit(ue,K)}))})).catch((K=>{this.emit("error",K),G._inflight=!1}));K.push(he)}}})),this._lastBlockNumber=ne,Promise.all(K).then((()=>{this.emit("didPoll",G)})).catch((G=>{this.emit("error",G)}))}else this.emit("didPoll",G)}))}resetEventsBlock(G){this._lastBlockNumber=G-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$7(this,void 0,void 0,(function*(){return Du.throwError("provider does not support network detection",oi.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return __awaiter$7(this,void 0,void 0,(function*(){const G=yield this._ready(),K=yield this.detectNetwork();if(G.chainId!==K.chainId){if(this.anyNetwork)return this._network=K,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",K,G),yield stall$1(0),this._network;const ne=Du.makeError("underlying network changed",oi.errors.NETWORK_ERROR,{event:"changed",network:G,detectedNetwork:K});throw this.emit("error",ne),ne}return G}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((G=>{this._setFastBlockNumber(G)}),(G=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(G){G&&!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))):!G&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(G){if("number"!=typeof G||G<=0||parseInt(String(G))!=G)throw new Error("invalid polling interval");this._pollingInterval=G,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const G=getTime$2();return G-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=G,this._fastBlockNumberPromise=this.getBlockNumber().then((G=>((null==this._fastBlockNumber||G>this._fastBlockNumber)&&(this._fastBlockNumber=G),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(G){null!=this._fastBlockNumber&&G<this._fastBlockNumber||(this._fastQueryDate=getTime$2(),(null==this._fastBlockNumber||G>this._fastBlockNumber)&&(this._fastBlockNumber=G,this._fastBlockNumberPromise=Promise.resolve(G)))}waitForTransaction(G,K,ne){return __awaiter$7(this,void 0,void 0,(function*(){return this._waitForTransaction(G,null==K?1:K,ne||0,null)}))}_waitForTransaction(G,K,ne,ue){return __awaiter$7(this,void 0,void 0,(function*(){const pe=yield this.getTransactionReceipt(G);return(pe?pe.confirmations:0)>=K?pe:new Promise(((pe,he)=>{const ye=[];let me=!1;const alreadyDone=function(){return!!me||(me=!0,ye.forEach((G=>{G()})),!1)},minedHandler=G=>{G.confirmations<K||alreadyDone()||pe(G)};if(this.on(G,minedHandler),ye.push((()=>{this.removeListener(G,minedHandler)})),ue){let ne=ue.startBlock,pe=null;const replaceHandler=ye=>__awaiter$7(this,void 0,void 0,(function*(){me||(yield stall$1(1e3),this.getTransactionCount(ue.from).then((be=>__awaiter$7(this,void 0,void 0,(function*(){if(!me){if(be<=ue.nonce)ne=ye;else{{const K=yield this.getTransaction(G);if(K&&null!=K.blockNumber)return}for(null==pe&&(pe=ne-3,pe<ue.startBlock&&(pe=ue.startBlock));pe<=ye;){if(me)return;const ne=yield this.getBlockWithTransactions(pe);for(let pe=0;pe<ne.transactions.length;pe++){const ye=ne.transactions[pe];if(ye.hash===G)return;if(ye.from===ue.from&&ye.nonce===ue.nonce){if(me)return;const ne=yield this.waitForTransaction(ye.hash,K);if(alreadyDone())return;let pe="replaced";return ye.data===ue.data&&ye.to===ue.to&&ye.value.eq(ue.value)?pe="repriced":"0x"===ye.data&&ye.from===ye.to&&ye.value.isZero()&&(pe="cancelled"),void he(Du.makeError("transaction was replaced",oi.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===pe||"cancelled"===pe,reason:pe,replacement:this._wrapTransaction(ye),hash:G,receipt:ne}))}}pe++}}me||this.once("block",replaceHandler)}}))),(G=>{me||this.once("block",replaceHandler)})))}));if(me)return;this.once("block",replaceHandler),ye.push((()=>{this.removeListener("block",replaceHandler)}))}if("number"==typeof ne&&ne>0){const G=setTimeout((()=>{alreadyDone()||he(Du.makeError("timeout exceeded",oi.errors.TIMEOUT,{timeout:ne}))}),ne);G.unref&&G.unref(),ye.push((()=>{clearTimeout(G)}))}}))}))}getBlockNumber(){return __awaiter$7(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const G=yield this.perform("getGasPrice",{});try{return Oi.from(G)}catch(K){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"getGasPrice",result:G,error:K})}}))}getBalance(G,K){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const ne=yield resolveProperties$2({address:this._getAddress(G),blockTag:this._getBlockTag(K)}),ue=yield this.perform("getBalance",ne);try{return Oi.from(ue)}catch(G){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"getBalance",params:ne,result:ue,error:G})}}))}getTransactionCount(G,K){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const ne=yield resolveProperties$2({address:this._getAddress(G),blockTag:this._getBlockTag(K)}),ue=yield this.perform("getTransactionCount",ne);try{return Oi.from(ue).toNumber()}catch(G){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"getTransactionCount",params:ne,result:ue,error:G})}}))}getCode(G,K){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const ne=yield resolveProperties$2({address:this._getAddress(G),blockTag:this._getBlockTag(K)}),ue=yield this.perform("getCode",ne);try{return hexlify$2(ue)}catch(G){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"getCode",params:ne,result:ue,error:G})}}))}getStorageAt(G,K,ne){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const ue=yield resolveProperties$2({address:this._getAddress(G),blockTag:this._getBlockTag(ne),position:Promise.resolve(K).then((G=>hexValue$1(G)))}),pe=yield this.perform("getStorageAt",ue);try{return hexlify$2(pe)}catch(G){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"getStorageAt",params:ue,result:pe,error:G})}}))}_wrapTransaction(G,K,ne){if(null!=K&&32!==hexDataLength$1(K))throw new Error("invalid response - sendTransaction");const ue=G;return null!=K&&G.hash!==K&&Du.throwError("Transaction hash mismatch from Provider.sendTransaction.",oi.errors.UNKNOWN_ERROR,{expectedHash:G.hash,returnedHash:K}),ue.wait=(K,ue)=>__awaiter$7(this,void 0,void 0,(function*(){let pe;null==K&&(K=1),null==ue&&(ue=0),0!==K&&null!=ne&&(pe={data:G.data,from:G.from,nonce:G.nonce,to:G.to,value:G.value,startBlock:ne});const he=yield this._waitForTransaction(G.hash,K,ue,pe);return null==he&&0===K?null:(this._emitted["t:"+G.hash]=he.blockNumber,0===he.status&&Du.throwError("transaction failed",oi.errors.CALL_EXCEPTION,{transactionHash:G.hash,transaction:G,receipt:he}),he)})),ue}sendTransaction(G){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const K=yield Promise.resolve(G).then((G=>hexlify$2(G))),ne=this.formatter.transaction(G);null==ne.confirmations&&(ne.confirmations=0);const ue=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const G=yield this.perform("sendTransaction",{signedTransaction:K});return this._wrapTransaction(ne,G,ue)}catch(G){throw G.transaction=ne,G.transactionHash=ne.hash,G}}))}_getTransactionRequest(G){return __awaiter$7(this,void 0,void 0,(function*(){const K=yield G,ne={};return["from","to"].forEach((G=>{null!=K[G]&&(ne[G]=Promise.resolve(K[G]).then((G=>G?this._getAddress(G):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((G=>{null!=K[G]&&(ne[G]=Promise.resolve(K[G]).then((G=>G?Oi.from(G):null)))})),["type"].forEach((G=>{null!=K[G]&&(ne[G]=Promise.resolve(K[G]).then((G=>null!=G?G:null)))})),K.accessList&&(ne.accessList=this.formatter.accessList(K.accessList)),["data"].forEach((G=>{null!=K[G]&&(ne[G]=Promise.resolve(K[G]).then((G=>G?hexlify$2(G):null)))})),this.formatter.transactionRequest(yield resolveProperties$2(ne))}))}_getFilter(G){return __awaiter$7(this,void 0,void 0,(function*(){G=yield G;const K={};return null!=G.address&&(K.address=this._getAddress(G.address)),["blockHash","topics"].forEach((ne=>{null!=G[ne]&&(K[ne]=G[ne])})),["fromBlock","toBlock"].forEach((ne=>{null!=G[ne]&&(K[ne]=this._getBlockTag(G[ne]))})),this.formatter.filter(yield resolveProperties$2(K))}))}_call(G,K,ne){return __awaiter$7(this,void 0,void 0,(function*(){ne>=10&&Du.throwError("CCIP read exceeded maximum redirections",oi.errors.SERVER_ERROR,{redirects:ne,transaction:G});const ue=G.to,pe=yield this.perform("call",{transaction:G,blockTag:K});if(ne>=0&&"latest"===K&&null!=ue&&"0x556f1830"===pe.substring(0,10)&&hexDataLength$1(pe)%32==4)try{const he=hexDataSlice$1(pe,4),ye=hexDataSlice$1(he,0,32);Oi.from(ye).eq(ue)||Du.throwError("CCIP Read sender did not match",oi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:G,data:pe});const me=[],be=Oi.from(hexDataSlice$1(he,32,64)).toNumber(),ve=Oi.from(hexDataSlice$1(he,be,be+32)).toNumber(),_e=hexDataSlice$1(he,be+32);for(let K=0;K<ve;K++){const ne=_parseString$1(_e,32*K);null==ne&&Du.throwError("CCIP Read contained corrupt URL string",oi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:G,data:pe}),me.push(ne)}const Te=_parseBytes$1(he,64);Oi.from(hexDataSlice$1(he,100,128)).isZero()||Du.throwError("CCIP Read callback selector included junk",oi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:G,data:pe});const Ee=hexDataSlice$1(he,96,100),Pe=_parseBytes$1(he,128),Se=yield this.ccipReadFetch(G,Te,me);null==Se&&Du.throwError("CCIP Read disabled or provided no URLs",oi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:G,data:pe});const Ce={to:ue,data:hexConcat$1([Ee,encodeBytes$1([Se,Pe])])};return this._call(Ce,K,ne+1)}catch(G){if(G.code===oi.errors.SERVER_ERROR)throw G}try{return hexlify$2(pe)}catch(ne){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"call",params:{transaction:G,blockTag:K},result:pe,error:ne})}}))}call(G,K){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const ne=yield resolveProperties$2({transaction:this._getTransactionRequest(G),blockTag:this._getBlockTag(K),ccipReadEnabled:Promise.resolve(G.ccipReadEnabled)});return this._call(ne.transaction,ne.blockTag,ne.ccipReadEnabled?0:-1)}))}estimateGas(G){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const K=yield resolveProperties$2({transaction:this._getTransactionRequest(G)}),ne=yield this.perform("estimateGas",K);try{return Oi.from(ne)}catch(G){return Du.throwError("bad result from backend",oi.errors.SERVER_ERROR,{method:"estimateGas",params:K,result:ne,error:G})}}))}_getAddress(G){return __awaiter$7(this,void 0,void 0,(function*(){"string"!=typeof(G=yield G)&&Du.throwArgumentError("invalid address or ENS name","name",G);const K=yield this.resolveName(G);return null==K&&Du.throwError("ENS name not configured",oi.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(G)})`}),K}))}_getBlock(G,K){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork(),G=yield G;let ne=-128;const ue={includeTransactions:!!K};if(isHexString$4(G,32))ue.blockHash=G;else try{ue.blockTag=yield this._getBlockTag(G),isHexString$4(ue.blockTag)&&(ne=parseInt(ue.blockTag.substring(2),16))}catch(K){Du.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",G)}return poll((()=>__awaiter$7(this,void 0,void 0,(function*(){const G=yield this.perform("getBlock",ue);if(null==G)return null!=ue.blockHash&&null==this._emitted["b:"+ue.blockHash]||null!=ue.blockTag&&ne>this._emitted.block?null:void 0;if(K){let K=null;for(let ne=0;ne<G.transactions.length;ne++){const ue=G.transactions[ne];if(null==ue.blockNumber)ue.confirmations=0;else if(null==ue.confirmations){null==K&&(K=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let G=K-ue.blockNumber+1;G<=0&&(G=1),ue.confirmations=G}}const ne=this.formatter.blockWithTransactions(G);return ne.transactions=ne.transactions.map((G=>this._wrapTransaction(G))),ne}return this.formatter.block(G)}))),{oncePoll:this})}))}getBlock(G){return this._getBlock(G,!1)}getBlockWithTransactions(G){return this._getBlock(G,!0)}getTransaction(G){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork(),G=yield G;const K={transactionHash:this.formatter.hash(G,!0)};return poll((()=>__awaiter$7(this,void 0,void 0,(function*(){const ne=yield this.perform("getTransaction",K);if(null==ne)return null==this._emitted["t:"+G]?null:void 0;const ue=this.formatter.transactionResponse(ne);if(null==ue.blockNumber)ue.confirmations=0;else if(null==ue.confirmations){let G=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-ue.blockNumber+1;G<=0&&(G=1),ue.confirmations=G}return this._wrapTransaction(ue)}))),{oncePoll:this})}))}getTransactionReceipt(G){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork(),G=yield G;const K={transactionHash:this.formatter.hash(G,!0)};return poll((()=>__awaiter$7(this,void 0,void 0,(function*(){const ne=yield this.perform("getTransactionReceipt",K);if(null==ne)return null==this._emitted["t:"+G]?null:void 0;if(null==ne.blockHash)return;const ue=this.formatter.receipt(ne);if(null==ue.blockNumber)ue.confirmations=0;else if(null==ue.confirmations){let G=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-ue.blockNumber+1;G<=0&&(G=1),ue.confirmations=G}return ue}))),{oncePoll:this})}))}getLogs(G){return __awaiter$7(this,void 0,void 0,(function*(){yield this.getNetwork();const K=yield resolveProperties$2({filter:this._getFilter(G)}),ne=yield this.perform("getLogs",K);return ne.forEach((G=>{null==G.removed&&(G.removed=!1)})),Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(ne)}))}getEtherPrice(){return __awaiter$7(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(G){return __awaiter$7(this,void 0,void 0,(function*(){if("number"==typeof(G=yield G)&&G<0){G%1&&Du.throwArgumentError("invalid BlockTag","blockTag",G);let K=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return K+=G,K<0&&(K=0),this.formatter.blockTag(K)}return this.formatter.blockTag(G)}))}getResolver(G){return __awaiter$7(this,void 0,void 0,(function*(){let K=G;for(;;){if(""===K||"."===K)return null;if("eth"!==G&&"eth"===K)return null;const ne=yield this._getResolver(K,"getResolver");if(null!=ne){const ue=new Resolver(this,ne,G);return K===G||(yield ue.supportsWildcard())?ue:null}K=K.split(".").slice(1).join(".")}}))}_getResolver(G,K){return __awaiter$7(this,void 0,void 0,(function*(){null==K&&(K="ENS");const ne=yield this.getNetwork();ne.ensAddress||Du.throwError("network does not support ENS",oi.errors.UNSUPPORTED_OPERATION,{operation:K,network:ne.name});try{const K=yield this.call({to:ne.ensAddress,data:"0x0178b8bf"+namehash$2(G).substring(2)});return this.formatter.callAddress(K)}catch(G){}return null}))}resolveName(G){return __awaiter$7(this,void 0,void 0,(function*(){G=yield G;try{return Promise.resolve(this.formatter.address(G))}catch(K){if(isHexString$4(G))throw K}"string"!=typeof G&&Du.throwArgumentError("invalid ENS name","name",G);const K=yield this.getResolver(G);return K?yield K.getAddress():null}))}lookupAddress(G){return __awaiter$7(this,void 0,void 0,(function*(){G=yield G;const K=(G=this.formatter.address(G)).substring(2).toLowerCase()+".addr.reverse",ne=yield this._getResolver(K,"lookupAddress");if(null==ne)return null;const ue=_parseString$1(yield this.call({to:ne,data:"0x691f3431"+namehash$2(K).substring(2)}),0);return(yield this.resolveName(ue))!=G?null:ue}))}getAvatar(G){return __awaiter$7(this,void 0,void 0,(function*(){let K=null;if(isHexString$4(G)){const ne=this.formatter.address(G).substring(2).toLowerCase()+".addr.reverse",ue=yield this._getResolver(ne,"getAvatar");if(!ue)return null;K=new Resolver(this,ue,ne);try{const G=yield K.getAvatar();if(G)return G.url}catch(G){if(G.code!==oi.errors.CALL_EXCEPTION)throw G}try{const G=_parseString$1(yield this.call({to:ue,data:"0x691f3431"+namehash$2(ne).substring(2)}),0);K=yield this.getResolver(G)}catch(G){if(G.code!==oi.errors.CALL_EXCEPTION)throw G;return null}}else if(K=yield this.getResolver(G),!K)return null;const ne=yield K.getAvatar();return null==ne?null:ne.url}))}perform(G,K){return Du.throwError(G+" not implemented",oi.errors.NOT_IMPLEMENTED,{operation:G})}_startEvent(G){this.polling=this._events.filter((G=>G.pollable())).length>0}_stopEvent(G){this.polling=this._events.filter((G=>G.pollable())).length>0}_addEventListener(G,K,ne){const ue=new class Event{constructor(G,K,ne){defineReadOnly$1(this,"tag",G),defineReadOnly$1(this,"listener",K),defineReadOnly$1(this,"once",ne),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 G=this.tag.split(":");return"tx"!==G[0]?null:G[1]}get filter(){const G=this.tag.split(":");if("filter"!==G[0])return null;const K=G[1],ne=function deserializeTopics(G){return""===G?[]:G.split(/&/g).map((G=>{if(""===G)return[];const K=G.split("|").map((G=>"null"===G?null:G));return 1===K.length?K[0]:K}))}(G[2]),ue={};return ne.length>0&&(ue.topics=ne),K&&"*"!==K&&(ue.address=K),ue}pollable(){return this.tag.indexOf(":")>=0||Lu.indexOf(this.tag)>=0}}(getEventTag$1(G),K,ne);return this._events.push(ue),this._startEvent(ue),this}on(G,K){return this._addEventListener(G,K,!1)}once(G,K){return this._addEventListener(G,K,!0)}emit(G,...K){let ne=!1,ue=[],pe=getEventTag$1(G);return this._events=this._events.filter((G=>G.tag!==pe||(setTimeout((()=>{G.listener.apply(this,K)}),0),ne=!0,!G.once||(ue.push(G),!1)))),ue.forEach((G=>{this._stopEvent(G)})),ne}listenerCount(G){if(!G)return this._events.length;let K=getEventTag$1(G);return this._events.filter((G=>G.tag===K)).length}listeners(G){if(null==G)return this._events.map((G=>G.listener));let K=getEventTag$1(G);return this._events.filter((G=>G.tag===K)).map((G=>G.listener))}off(G,K){if(null==K)return this.removeAllListeners(G);const ne=[];let ue=!1,pe=getEventTag$1(G);return this._events=this._events.filter((G=>G.tag!==pe||G.listener!=K||(!!ue||(ue=!0,ne.push(G),!1)))),ne.forEach((G=>{this._stopEvent(G)})),this}removeAllListeners(G){let K=[];if(null==G)K=this._events,this._events=[];else{const ne=getEventTag$1(G);this._events=this._events.filter((G=>G.tag!==ne||(K.push(G),!1)))}return K.forEach((G=>{this._stopEvent(G)})),this}}var __awaiter$6=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Hu=new oi(Bu),Wu=["call","estimateGas"];function spelunk(G,K){if(null==G)return null;if("string"==typeof G.message&&G.message.match("reverted")){const ne=isHexString$4(G.data)?G.data:null;if(!K||ne)return{message:G.message,data:ne}}if("object"==typeof G){for(const ne in G){const ue=spelunk(G[ne],K);if(ue)return ue}return null}if("string"==typeof G)try{return spelunk(JSON.parse(G),K)}catch(G){}return null}function checkError(G,K,ne){const ue=ne.transaction||ne.signedTransaction;if("call"===G){const G=spelunk(K,!0);if(G)return G.data;Hu.throwError("missing revert data in call exception; Transaction reverted without a reason string",oi.errors.CALL_EXCEPTION,{data:"0x",transaction:ue,error:K})}if("estimateGas"===G){let ne=spelunk(K.body,!1);null==ne&&(ne=spelunk(K,!1)),ne&&Hu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",oi.errors.UNPREDICTABLE_GAS_LIMIT,{reason:ne.message,method:G,transaction:ue,error:K})}let pe=K.message;throw K.code===oi.errors.SERVER_ERROR&&K.error&&"string"==typeof K.error.message?pe=K.error.message:"string"==typeof K.body?pe=K.body:"string"==typeof K.responseText&&(pe=K.responseText),pe=(pe||"").toLowerCase(),pe.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Hu.throwError("insufficient funds for intrinsic transaction cost",oi.errors.INSUFFICIENT_FUNDS,{error:K,method:G,transaction:ue}),pe.match(/nonce (is )?too low/i)&&Hu.throwError("nonce has already been used",oi.errors.NONCE_EXPIRED,{error:K,method:G,transaction:ue}),pe.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Hu.throwError("replacement fee too low",oi.errors.REPLACEMENT_UNDERPRICED,{error:K,method:G,transaction:ue}),pe.match(/only replay-protected/i)&&Hu.throwError("legacy pre-eip-155 transactions not supported",oi.errors.UNSUPPORTED_OPERATION,{error:K,method:G,transaction:ue}),Wu.indexOf(G)>=0&&pe.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Hu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",oi.errors.UNPREDICTABLE_GAS_LIMIT,{error:K,method:G,transaction:ue}),K}function timer(G){return new Promise((function(K){setTimeout(K,G)}))}function getResult(G){if(G.error){const K=new Error(G.error.message);throw K.code=G.error.code,K.data=G.error.data,K}return G.result}function getLowerCase$1(G){return G?G.toLowerCase():G}const zu={};let Vu=class JsonRpcSigner extends Qo{constructor(G,K,ne){if(super(),G!==zu)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly$1(this,"provider",K),null==ne&&(ne=0),"string"==typeof ne?(defineReadOnly$1(this,"_address",this.provider.formatter.address(ne)),defineReadOnly$1(this,"_index",null)):"number"==typeof ne?(defineReadOnly$1(this,"_index",ne),defineReadOnly$1(this,"_address",null)):Hu.throwArgumentError("invalid address or index","addressOrIndex",ne)}connect(G){return Hu.throwError("cannot alter JSON-RPC Signer connection",oi.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(zu,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((G=>(G.length<=this._index&&Hu.throwError("unknown account #"+this._index,oi.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(G[this._index]))))}sendUncheckedTransaction(G){G=shallowCopy$1(G);const K=this.getAddress().then((G=>(G&&(G=G.toLowerCase()),G)));if(null==G.gasLimit){const ne=shallowCopy$1(G);ne.from=K,G.gasLimit=this.provider.estimateGas(ne)}return null!=G.to&&(G.to=Promise.resolve(G.to).then((G=>__awaiter$6(this,void 0,void 0,(function*(){if(null==G)return null;const K=yield this.provider.resolveName(G);return null==K&&Hu.throwArgumentError("provided ENS name resolves to null","tx.to",G),K}))))),resolveProperties$2({tx:resolveProperties$2(G),sender:K}).then((({tx:K,sender:ne})=>{null!=K.from?K.from.toLowerCase()!==ne&&Hu.throwArgumentError("from address mismatch","transaction",G):K.from=ne;const ue=this.provider.constructor.hexlifyTransaction(K,{from:!0});return this.provider.send("eth_sendTransaction",[ue]).then((G=>G),(G=>("string"==typeof G.message&&G.message.match(/user denied/i)&&Hu.throwError("user rejected transaction",oi.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:K}),checkError("sendTransaction",G,ue))))}))}signTransaction(G){return Hu.throwError("signing transactions is unsupported",oi.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(G){return __awaiter$6(this,void 0,void 0,(function*(){const K=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),ne=yield this.sendUncheckedTransaction(G);try{return yield poll((()=>__awaiter$6(this,void 0,void 0,(function*(){const G=yield this.provider.getTransaction(ne);if(null!==G)return this.provider._wrapTransaction(G,ne,K)}))),{oncePoll:this.provider})}catch(G){throw G.transactionHash=ne,G}}))}signMessage(G){return __awaiter$6(this,void 0,void 0,(function*(){const K="string"==typeof G?toUtf8Bytes$2(G):G,ne=yield this.getAddress();try{return yield this.provider.send("personal_sign",[hexlify$2(K),ne.toLowerCase()])}catch(K){throw"string"==typeof K.message&&K.message.match(/user denied/i)&&Hu.throwError("user rejected signing",oi.errors.ACTION_REJECTED,{action:"signMessage",from:ne,messageData:G}),K}}))}_legacySignMessage(G){return __awaiter$6(this,void 0,void 0,(function*(){const K="string"==typeof G?toUtf8Bytes$2(G):G,ne=yield this.getAddress();try{return yield this.provider.send("eth_sign",[ne.toLowerCase(),hexlify$2(K)])}catch(K){throw"string"==typeof K.message&&K.message.match(/user denied/i)&&Hu.throwError("user rejected signing",oi.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:ne,messageData:G}),K}}))}_signTypedData(G,K,ne){return __awaiter$6(this,void 0,void 0,(function*(){const ue=yield Do.resolveNames(G,K,ne,(G=>this.provider.resolveName(G))),pe=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[pe.toLowerCase(),JSON.stringify(Do.getPayload(ue.domain,K,ue.value))])}catch(G){throw"string"==typeof G.message&&G.message.match(/user denied/i)&&Hu.throwError("user rejected signing",oi.errors.ACTION_REJECTED,{action:"_signTypedData",from:pe,messageData:{domain:ue.domain,types:K,value:ue.value}}),G}}))}unlock(G){return __awaiter$6(this,void 0,void 0,(function*(){const K=this.provider,ne=yield this.getAddress();return K.send("personal_unlockAccount",[ne.toLowerCase(),G,null])}))}};class UncheckedJsonRpcSigner extends Vu{sendTransaction(G){return this.sendUncheckedTransaction(G).then((G=>({hash:G,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:K=>this.provider.waitForTransaction(G,K)})))}}const Ku={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let Ju=class JsonRpcProvider extends BaseProvider{constructor(G,K){let ne=K;null==ne&&(ne=new Promise(((G,K)=>{setTimeout((()=>{this.detectNetwork().then((K=>{G(K)}),(G=>{K(G)}))}),0)}))),super(ne),G||(G=getStatic$1(this.constructor,"defaultUrl")()),defineReadOnly$1(this,"connection","string"==typeof G?Object.freeze({url:G}):Object.freeze(shallowCopy$1(G))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(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 __awaiter$6(this,void 0,void 0,(function*(){yield timer(0);let G=null;try{G=yield this.send("eth_chainId",[])}catch(K){try{G=yield this.send("net_version",[])}catch(G){}}if(null!=G){const K=getStatic$1(this.constructor,"getNetwork");try{return K(Oi.from(G).toNumber())}catch(K){return Hu.throwError("could not detect network",oi.errors.NETWORK_ERROR,{chainId:G,event:"invalidNetwork",serverError:K})}}return Hu.throwError("could not detect network",oi.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(G){return new Vu(zu,this,G)}getUncheckedSigner(G){return this.getSigner(G).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((G=>G.map((G=>this.formatter.address(G)))))}send(G,K){const ne={method:G,params:K,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy$2(ne),provider:this});const ue=["eth_chainId","eth_blockNumber"].indexOf(G)>=0;if(ue&&this._cache[G])return this._cache[G];const pe=fetchJson(this.connection,JSON.stringify(ne),getResult).then((G=>(this.emit("debug",{action:"response",request:ne,response:G,provider:this}),G)),(G=>{throw this.emit("debug",{action:"response",error:G,request:ne,provider:this}),G}));return ue&&(this._cache[G]=pe,setTimeout((()=>{this._cache[G]=null}),0)),pe}prepareRequest(G,K){switch(G){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase$1(K.address),K.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase$1(K.address),K.blockTag]];case"getCode":return["eth_getCode",[getLowerCase$1(K.address),K.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase$1(K.address),hexZeroPad$1(K.position,32),K.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[K.signedTransaction]];case"getBlock":return K.blockTag?["eth_getBlockByNumber",[K.blockTag,!!K.includeTransactions]]:K.blockHash?["eth_getBlockByHash",[K.blockHash,!!K.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[K.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[K.transactionHash]];case"call":return["eth_call",[getStatic$1(this.constructor,"hexlifyTransaction")(K.transaction,{from:!0}),K.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic$1(this.constructor,"hexlifyTransaction")(K.transaction,{from:!0})]];case"getLogs":return K.filter&&null!=K.filter.address&&(K.filter.address=getLowerCase$1(K.filter.address)),["eth_getLogs",[K.filter]]}return null}perform(G,K){return __awaiter$6(this,void 0,void 0,(function*(){if("call"===G||"estimateGas"===G){const G=K.transaction;if(G&&null!=G.type&&Oi.from(G.type).isZero()&&null==G.maxFeePerGas&&null==G.maxPriorityFeePerGas){const ne=yield this.getFeeData();null==ne.maxFeePerGas&&null==ne.maxPriorityFeePerGas&&((K=shallowCopy$1(K)).transaction=shallowCopy$1(G),delete K.transaction.type)}}const ne=this.prepareRequest(G,K);null==ne&&Hu.throwError(G+" not implemented",oi.errors.NOT_IMPLEMENTED,{operation:G});try{return yield this.send(ne[0],ne[1])}catch(ne){return checkError(G,ne,K)}}))}_startEvent(G){"pending"===G.tag&&this._startPending(),super._startEvent(G)}_startPending(){if(null!=this._pendingFilter)return;const G=this,K=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=K,K.then((function(ne){return function poll(){G.send("eth_getFilterChanges",[ne]).then((function(ne){if(G._pendingFilter!=K)return null;let ue=Promise.resolve();return ne.forEach((function(K){G._emitted["t:"+K.toLowerCase()]="pending",ue=ue.then((function(){return G.getTransaction(K).then((function(K){return G.emit("pending",K),null}))}))})),ue.then((function(){return timer(1e3)}))})).then((function(){if(G._pendingFilter==K)return setTimeout((function(){poll()}),0),null;G.send("eth_uninstallFilter",[ne])})).catch((G=>{}))}(),ne})).catch((G=>{}))}_stopEvent(G){"pending"===G.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(G)}static hexlifyTransaction(G,K){const ne=shallowCopy$1(Ku);if(K)for(const G in K)K[G]&&(ne[G]=!0);checkProperties(G,ne);const ue={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(K){if(null==G[K])return;const ne=hexValue$1(Oi.from(G[K]));"gasLimit"===K&&(K="gas"),ue[K]=ne})),["from","to","data"].forEach((function(K){null!=G[K]&&(ue[K]=hexlify$2(G[K]))})),G.accessList&&(ue.accessList=accessListify$2(G.accessList)),ue}};var __awaiter$5=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const Xu=new oi(Bu);class StaticJsonRpcProvider extends Ju{detectNetwork(){const G=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return __awaiter$5(this,void 0,void 0,(function*(){let K=this.network;return null==K&&(K=yield G.detectNetwork.call(this),K||Xu.throwError("no network detected",oi.errors.UNKNOWN_ERROR,{}),null==this._network&&(defineReadOnly$1(this,"_network",K),this.emit("network",K,null))),K}))}}class JsonRpcBatchProvider extends Ju{send(G,K){const ne={method:G,params:K,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const ue={request:ne,resolve:null,reject:null},pe=new Promise(((G,K)=>{ue.resolve=G,ue.reject=K}));return this._pendingBatch.push(ue),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const G=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const K=G.map((G=>G.request));return this.emit("debug",{action:"requestBatch",request:deepCopy$2(K),provider:this}),fetchJson(this.connection,JSON.stringify(K)).then((ne=>{this.emit("debug",{action:"response",request:K,response:ne,provider:this}),G.forEach(((G,K)=>{const ue=ne[K];if(ue.error){const K=new Error(ue.error.message);K.code=ue.error.code,K.data=ue.error.data,G.reject(K)}else G.resolve(ue.result)}))}),(ne=>{this.emit("debug",{action:"response",error:ne,request:K,provider:this}),G.forEach((G=>{G.reject(ne)}))}))}),10)),pe}}const Qu=new oi(Bu);let Zu=1;function buildWeb3LegacyFetcher(G,K){const ne="Web3LegacyFetcher";return function(G,ue){const pe={method:G,params:ue,id:Zu++,jsonrpc:"2.0"};return new Promise(((G,ue)=>{this.emit("debug",{action:"request",fetcher:ne,request:deepCopy$2(pe),provider:this}),K(pe,((K,he)=>{if(K)return this.emit("debug",{action:"response",fetcher:ne,error:K,request:pe,provider:this}),ue(K);if(this.emit("debug",{action:"response",fetcher:ne,request:pe,response:he,provider:this}),he.error){const G=new Error(he.error.message);return G.code=he.error.code,G.data=he.error.data,ue(G)}G(he.result)}))}))}}class Web3Provider extends Ju{constructor(G,K){null==G&&Qu.throwArgumentError("missing provider","provider",G);let ne=null,ue=null,pe=null;"function"==typeof G?(ne="unknown:",ue=G):(ne=G.host||G.path||"",!ne&&G.isMetaMask&&(ne="metamask"),pe=G,G.request?(""===ne&&(ne="eip-1193:"),ue=function buildEip1193Fetcher(G){return function(K,ne){null==ne&&(ne=[]);const ue={method:K,params:ne};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy$2(ue),provider:this}),G.request(ue).then((G=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:ue,response:G,provider:this}),G)),(G=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:ue,error:G,provider:this}),G}))}}(G)):G.sendAsync?ue=buildWeb3LegacyFetcher(0,G.sendAsync.bind(G)):G.send?ue=buildWeb3LegacyFetcher(0,G.send.bind(G)):Qu.throwArgumentError("unsupported provider","provider",G),ne||(ne="unknown:")),super(ne,K),defineReadOnly$1(this,"jsonRpcFetchFunc",ue),defineReadOnly$1(this,"provider",pe)}send(G,K){return this.jsonRpcFetchFunc(G,K)}}const Yu=new RegExp("^bytes([0-9]+)$"),ef=new RegExp("^(u?int)([0-9]*)$"),tf=new RegExp("^(.*)\\[([0-9]*)\\]$"),rf="0000000000000000000000000000000000000000000000000000000000000000",nf=new oi("solidity/5.7.0");function _pack(G,K,ne){switch(G){case"address":return ne?zeroPad$2(K,32):arrayify$1(K);case"string":return toUtf8Bytes$2(K);case"bytes":return arrayify$1(K);case"bool":return K=K?"0x01":"0x00",ne?zeroPad$2(K,32):arrayify$1(K)}let ue=G.match(ef);if(ue){let pe=parseInt(ue[2]||"256");return(ue[2]&&String(pe)!==ue[2]||pe%8!=0||0===pe||pe>256)&&nf.throwArgumentError("invalid number type","type",G),ne&&(pe=256),zeroPad$2(K=Oi.from(K).toTwos(pe),pe/8)}if(ue=G.match(Yu),ue){const pe=parseInt(ue[1]);return(String(pe)!==ue[1]||0===pe||pe>32)&&nf.throwArgumentError("invalid bytes type","type",G),arrayify$1(K).byteLength!==pe&&nf.throwArgumentError(`invalid value for ${G}`,"value",K),ne?arrayify$1((K+rf).substring(0,66)):K}if(ue=G.match(tf),ue&&Array.isArray(K)){const ne=ue[1];parseInt(ue[2]||String(K.length))!=K.length&&nf.throwArgumentError(`invalid array length for ${G}`,"value",K);const pe=[];return K.forEach((function(G){pe.push(_pack(ne,G,!0))})),concat$2(pe)}return nf.throwArgumentError("invalid type","type",G)}function pack$2(G,K){G.length!=K.length&&nf.throwArgumentError("wrong number of values; expected ${ types.length }","values",K);const ne=[];return G.forEach((function(G,ue){ne.push(_pack(G,K[ue]))})),hexlify$2(concat$2(ne))}function keccak256$2(G,K){return keccak256$3(pack$2(G,K))}function sha256$8(G,K){return sha256$9(pack$2(G,K))}var af=Object.freeze({__proto__:null,keccak256:keccak256$2,pack:pack$2,sha256:sha256$8});const sf=new oi("units/5.7.0"),of=["wei","kwei","mwei","gwei","szabo","finney","ether"];function formatUnits(G,K){if("string"==typeof K){const G=of.indexOf(K);-1!==G&&(K=3*G)}return formatFixed(G,null!=K?K:18)}function parseUnits$1(G,K){if("string"!=typeof G&&sf.throwArgumentError("value must be a string","value",G),"string"==typeof K){const G=of.indexOf(K);-1!==G&&(K=3*G)}return parseFixed(G,null!=K?K:18)}var cf=Object.freeze({__proto__:null,AbiCoder:lo,ConstructorFragment:Ds,ErrorFragment:Us,EventFragment:Fs,FormatTypes:xs,Fragment:Bs,FunctionFragment:Ls,HDNode:HDNode,Indexed:Go,Interface:Ho,LogDescription:Uo,Logger:oi,ParamType:Ms,RLP:zs,SigningKey:Vd,get SupportedAlgorithm(){return ou},TransactionDescription:$o,get TransactionTypes(){return Jd},get UnicodeNormalizationForm(){return zi},Utf8ErrorFuncs:Ki,get Utf8ErrorReason(){return Vi},_TypedDataEncoder:Do,_fetchData:_fetchData,_toEscapedUtf8String:function _toEscapedUtf8String(G,K){return'"'+getUtf8CodePoints$2(G,K).map((G=>{if(G<256){switch(G){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(G>=32&&G<127)return String.fromCharCode(G)}return G<=65535?escapeChar(G):escapeChar(55296+((G-=65536)>>10&1023))+escapeChar(56320+(1023&G))})).join("")+'"'},accessListify:accessListify$2,arrayify:arrayify$1,base58:su,base64:yo,checkProperties:checkProperties,checkResultErrors:checkResultErrors$1,commify:function commify(G){const K=String(G).split(".");(K.length>2||!K[0].match(/^-?[0-9]*$/)||K[1]&&!K[1].match(/^[0-9]*$/)||"."===G||"-."===G)&&sf.throwArgumentError("invalid value","value",G);let ne=K[0],ue="";for("-"===ne.substring(0,1)&&(ue="-",ne=ne.substring(1));"0"===ne.substring(0,1);)ne=ne.substring(1);""===ne&&(ne="0");let pe="";for(2===K.length&&(pe="."+(K[1]||"0"));pe.length>2&&"0"===pe[pe.length-1];)pe=pe.substring(0,pe.length-1);const he=[];for(;ne.length;){if(ne.length<=3){he.unshift(ne);break}{const G=ne.length-3;he.unshift(ne.substring(G)),ne=ne.substring(0,G)}}return ue+he.join(",")+pe},computeAddress:computeAddress$1,computeHmac:computeHmac,computePublicKey:computePublicKey,concat:concat$2,deepCopy:deepCopy$2,defaultAbiCoder:po,defaultPath:"m/44'/60'/0'/0/0",defineReadOnly:defineReadOnly$1,dnsEncode:dnsEncode$1,entropyToMnemonic:entropyToMnemonic,fetchJson:fetchJson,formatBytes32String:function formatBytes32String(G){const K=toUtf8Bytes$2(G);if(K.length>31)throw new Error("bytes32 string must be less than 32 bytes");return hexlify$2(concat$2([K,Hi]).slice(0,32))},formatEther:function formatEther(G){return formatUnits(G,18)},formatUnits:formatUnits,getAccountPath:function getAccountPath$1(G){return("number"!=typeof G||G<0||G>=mu||G%1)&&pu.throwArgumentError("invalid account index","index",G),`m/44'/60'/${G}'/0/0`},getAddress:getAddress$2,getContractAddress:getContractAddress$1,getCreate2Address:getCreate2Address,getIcapAddress:function getIcapAddress(G){let K=function _base16To36(G){return new Si(G,16).toString(36)}(getAddress$2(G).substring(2)).toUpperCase();for(;K.length<30;)K="0"+K;return"XE"+ibanChecksum$2("XE00"+K)+K},getJsonWalletAddress:function getJsonWalletAddress(G){if(function isCrowdsaleWallet(G){let K=null;try{K=JSON.parse(G)}catch(G){return!1}return K.encseed&&K.ethaddr}(G))try{return getAddress$2(JSON.parse(G).ethaddr)}catch(G){return null}if(function isKeystoreWallet(G){let K=null;try{K=JSON.parse(G)}catch(G){return!1}return!(!K.version||parseInt(K.version)!==K.version||3!==parseInt(K.version))}(G))try{return getAddress$2(JSON.parse(G).address)}catch(G){return null}return null},getStatic:getStatic$1,hashMessage:hashMessage,hexConcat:hexConcat$1,hexDataLength:hexDataLength$1,hexDataSlice:hexDataSlice$1,hexStripZeros:hexStripZeros$1,hexValue:hexValue$1,hexZeroPad:hexZeroPad$1,hexlify:hexlify$2,id:id$3,isAddress:function isAddress$1(G){try{return getAddress$2(G),!0}catch(G){}return!1},isBytes:isBytes$1,isBytesLike:isBytesLike$2,isHexString:isHexString$4,isValidMnemonic:function isValidMnemonic(G,K){try{return mnemonicToEntropy(G,K),!0}catch(G){}return!1},isValidName:function isValidName(G){try{return 0!==ensNameSplit$1(G).length}catch(G){}return!1},joinSignature:function joinSignature(G){return hexlify$2(concat$2([(G=splitSignature(G)).r,G.s,G.recoveryParam?"0x1c":"0x1b"]))},keccak256:keccak256$3,mnemonicToEntropy:mnemonicToEntropy,mnemonicToSeed:mnemonicToSeed,namehash:namehash$2,nameprep:function nameprep(G){if(G.match(/^[a-z0-9-]*$/i)&&G.length<=59)return G.toLowerCase();let K=toUtf8CodePoints(G);K=function flatten$1(G){return G.reduce(((G,K)=>(K.forEach((K=>{G.push(K)})),G)),[])}(K.map((G=>{if(Xi.indexOf(G)>=0)return[];if(G>=65024&&G<=65039)return[];let K=function _nameprepTableB2(G){let K=matchMap(G,Qi);if(K)return[G+K.s];let ne=Zi[G];if(ne)return ne;let ue=Yi[G];return ue?[G+ue[0]]:es[G]||null}(G);return K||[G]}))),K=toUtf8CodePoints(_toUtf8String$2(K),zi.NFKC),K.forEach((G=>{if(function _nameprepTableC(G){return!!matchMap(G,rs)}(G))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),K.forEach((G=>{if(function _nameprepTableA1(G){return!!matchMap(G,Ji)}(G))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let ne=_toUtf8String$2(K);if("-"===ne.substring(0,1)||"--"===ne.substring(2,4)||"-"===ne.substring(ne.length-1))throw new Error("invalid hyphen");return ne},parseBytes32String:function parseBytes32String(G){const K=arrayify$1(G);if(32!==K.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==K[31])throw new Error("invalid bytes32 string - no null terminator");let ne=31;for(;0===K[ne-1];)ne--;return toUtf8String$2(K.slice(0,ne))},parseEther:function parseEther(G){return parseUnits$1(G,18)},parseTransaction:parse$1,parseUnits:parseUnits$1,poll:poll,randomBytes:function randomBytes$2(G){(G<=0||G>1024||G%1||G!=G)&&gu.throwArgumentError("invalid length","length",G);const K=new Uint8Array(G);return wu.getRandomValues(K),arrayify$1(K)},recoverAddress:recoverAddress$1,recoverPublicKey:recoverPublicKey,resolveProperties:resolveProperties$2,ripemd160:ripemd160$5,serializeTransaction:function serialize$1(G,K){if(null==G.type||0===G.type)return null!=G.accessList&&Kd.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",G),function _serialize(G,K){checkProperties(G,Qd);const ne=[];Xd.forEach((function(K){let ue=G[K.name]||[];const pe={};K.numeric&&(pe.hexPad="left"),ue=arrayify$1(hexlify$2(ue,pe)),K.length&&ue.length!==K.length&&ue.length>0&&Kd.throwArgumentError("invalid length for "+K.name,"transaction:"+K.name,ue),K.maxLength&&(ue=stripZeros$1(ue),ue.length>K.maxLength&&Kd.throwArgumentError("invalid length for "+K.name,"transaction:"+K.name,ue)),ne.push(hexlify$2(ue))}));let ue=0;if(null!=G.chainId?(ue=G.chainId,"number"!=typeof ue&&Kd.throwArgumentError("invalid transaction.chainId","transaction",G)):K&&!isBytesLike$2(K)&&K.v>28&&(ue=Math.floor((K.v-35)/2)),0!==ue&&(ne.push(hexlify$2(ue)),ne.push("0x"),ne.push("0x")),!K)return encode$6(ne);const pe=splitSignature(K);let he=27+pe.recoveryParam;return 0!==ue?(ne.pop(),ne.pop(),ne.pop(),he+=2*ue+8,pe.v>28&&pe.v!==he&&Kd.throwArgumentError("transaction.chainId/signature.v mismatch","signature",K)):pe.v!==he&&Kd.throwArgumentError("transaction.chainId/signature.v mismatch","signature",K),ne.push(hexlify$2(he)),ne.push(stripZeros$1(arrayify$1(pe.r))),ne.push(stripZeros$1(arrayify$1(pe.s))),encode$6(ne)}(G,K);switch(G.type){case 1:return _serializeEip2930$1(G,K);case 2:return _serializeEip1559$1(G,K)}return Kd.throwError(`unsupported transaction type: ${G.type}`,oi.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:G.type})},sha256:sha256$9,sha512:function sha512$3(G){return"0x"+Ad.sha512().update(arrayify$1(G)).digest("hex")},shallowCopy:shallowCopy$1,shuffled:function shuffled(G){for(let K=(G=G.slice()).length-1;K>0;K--){const ne=Math.floor(Math.random()*(K+1)),ue=G[K];G[K]=G[ne],G[ne]=ue}return G},solidityKeccak256:keccak256$2,solidityPack:pack$2,soliditySha256:sha256$8,splitSignature:splitSignature,stripZeros:stripZeros$1,toUtf8Bytes:toUtf8Bytes$2,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String$2,verifyMessage:function verifyMessage(G,K){return recoverAddress$1(hashMessage(G),K)},verifyTypedData:function verifyTypedData(G,K,ne,ue){return recoverAddress$1(Do.hash(G,K,ne),ue)},zeroPad:zeroPad$2}),df={},uf="6.5.7",ff={},lf={exports:{}};!function(G){!function(G,K){function assert(G,K){if(!G)throw new Error(K||"Assertion failed")}function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G}function BN(G,K,ne){if(BN.isBN(G))return G;this.negative=0,this.words=null,this.length=0,this.red=null,null!==G&&("le"!==K&&"be"!==K||(ne=K,K=10),this._init(G||0,K||10,ne||"be"))}var ne;"object"==typeof G?G.exports=BN:K.BN=BN,BN.BN=BN,BN.wordSize=26;try{ne="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Ti.Buffer}catch(G){}function parseHex4Bits(G,K){var ne=G.charCodeAt(K);return ne>=65&&ne<=70?ne-55:ne>=97&&ne<=102?ne-87:ne-48&15}function parseHexByte(G,K,ne){var ue=parseHex4Bits(G,ne);return ne-1>=K&&(ue|=parseHex4Bits(G,ne-1)<<4),ue}function parseBase(G,K,ne,ue){for(var pe=0,he=Math.min(G.length,ne),ye=K;ye<he;ye++){var me=G.charCodeAt(ye)-48;pe*=ue,pe+=me>=49?me-49+10:me>=17?me-17+10:me}return pe}BN.isBN=function isBN(G){return G instanceof BN||null!==G&&"object"==typeof G&&G.constructor.wordSize===BN.wordSize&&Array.isArray(G.words)},BN.max=function max(G,K){return G.cmp(K)>0?G:K},BN.min=function min(G,K){return G.cmp(K)<0?G:K},BN.prototype._init=function init(G,K,ne){if("number"==typeof G)return this._initNumber(G,K,ne);if("object"==typeof G)return this._initArray(G,K,ne);"hex"===K&&(K=16),assert(K===(0|K)&&K>=2&&K<=36);var ue=0;"-"===(G=G.toString().replace(/\s+/g,""))[0]&&(ue++,this.negative=1),ue<G.length&&(16===K?this._parseHex(G,ue,ne):(this._parseBase(G,K,ue),"le"===ne&&this._initArray(this.toArray(),K,ne)))},BN.prototype._initNumber=function _initNumber(G,K,ne){G<0&&(this.negative=1,G=-G),G<67108864?(this.words=[67108863&G],this.length=1):G<4503599627370496?(this.words=[67108863&G,G/67108864&67108863],this.length=2):(assert(G<9007199254740992),this.words=[67108863&G,G/67108864&67108863,1],this.length=3),"le"===ne&&this._initArray(this.toArray(),K,ne)},BN.prototype._initArray=function _initArray(G,K,ne){if(assert("number"==typeof G.length),G.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(G.length/3),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he,ye=0;if("be"===ne)for(ue=G.length-1,pe=0;ue>=0;ue-=3)he=G[ue]|G[ue-1]<<8|G[ue-2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);else if("le"===ne)for(ue=0,pe=0;ue<G.length;ue+=3)he=G[ue]|G[ue+1]<<8|G[ue+2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);return this.strip()},BN.prototype._parseHex=function _parseHex(G,K,ne){this.length=Math.ceil((G.length-K)/6),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he=0,ye=0;if("be"===ne)for(ue=G.length-1;ue>=K;ue-=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;else for(ue=(G.length-K)%2==0?K+1:K;ue<G.length;ue+=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;this.strip()},BN.prototype._parseBase=function _parseBase(G,K,ne){this.words=[0],this.length=1;for(var ue=0,pe=1;pe<=67108863;pe*=K)ue++;ue--,pe=pe/K|0;for(var he=G.length-ne,ye=he%ue,me=Math.min(he,he-ye)+ne,be=0,ve=ne;ve<me;ve+=ue)be=parseBase(G,ve,ve+ue,K),this.imuln(pe),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be);if(0!==ye){var _e=1;for(be=parseBase(G,ve,G.length,K),ve=0;ve<ye;ve++)_e*=K;this.imuln(_e),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be)}this.strip()},BN.prototype.copy=function copy(G){G.words=new Array(this.length);for(var K=0;K<this.length;K++)G.words[K]=this.words[K];G.length=this.length,G.negative=this.negative,G.red=this.red},BN.prototype.clone=function clone(){var G=new BN(null);return this.copy(G),G},BN.prototype._expand=function _expand(G){for(;this.length<G;)this.words[this.length++]=0;return this},BN.prototype.strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var ue=["","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"],pe=[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],he=[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];function smallMulTo(G,K,ne){ne.negative=K.negative^G.negative;var ue=G.length+K.length|0;ne.length=ue,ue=ue-1|0;var pe=0|G.words[0],he=0|K.words[0],ye=pe*he,me=67108863&ye,be=ye/67108864|0;ne.words[0]=me;for(var ve=1;ve<ue;ve++){for(var _e=be>>>26,Te=67108863&be,Ee=Math.min(ve,K.length-1),Pe=Math.max(0,ve-G.length+1);Pe<=Ee;Pe++){var Se=ve-Pe|0;_e+=(ye=(pe=0|G.words[Se])*(he=0|K.words[Pe])+Te)/67108864|0,Te=67108863&ye}ne.words[ve]=0|Te,be=0|_e}return 0!==be?ne.words[ve]=0|be:ne.length--,ne.strip()}BN.prototype.toString=function toString(G,K){var ne;if(K=0|K||1,16===(G=G||10)||"hex"===G){ne="";for(var ye=0,me=0,be=0;be<this.length;be++){var ve=this.words[be],_e=(16777215&(ve<<ye|me)).toString(16);ne=0!==(me=ve>>>24-ye&16777215)||be!==this.length-1?ue[6-_e.length]+_e+ne:_e+ne,(ye+=2)>=26&&(ye-=26,be--)}for(0!==me&&(ne=me.toString(16)+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}if(G===(0|G)&&G>=2&&G<=36){var Te=pe[G],Ee=he[G];ne="";var Pe=this.clone();for(Pe.negative=0;!Pe.isZero();){var Se=Pe.modn(Ee).toString(G);ne=(Pe=Pe.idivn(Ee)).isZero()?Se+ne:ue[Te-Se.length]+Se+ne}for(this.isZero()&&(ne="0"+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var G=this.words[0];return 2===this.length?G+=67108864*this.words[1]:3===this.length&&1===this.words[2]?G+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-G:G},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(G,K){return assert(void 0!==ne),this.toArrayLike(ne,G,K)},BN.prototype.toArray=function toArray(G,K){return this.toArrayLike(Array,G,K)},BN.prototype.toArrayLike=function toArrayLike(G,K,ne){var ue=this.byteLength(),pe=ne||Math.max(1,ue);assert(ue<=pe,"byte array longer than desired length"),assert(pe>0,"Requested array length <= 0"),this.strip();var he,ye,me="le"===K,be=new G(pe),ve=this.clone();if(me){for(ye=0;!ve.isZero();ye++)he=ve.andln(255),ve.iushrn(8),be[ye]=he;for(;ye<pe;ye++)be[ye]=0}else{for(ye=0;ye<pe-ue;ye++)be[ye]=0;for(ye=0;!ve.isZero();ye++)he=ve.andln(255),ve.iushrn(8),be[pe-ye-1]=he}return be},Math.clz32?BN.prototype._countBits=function _countBits(G){return 32-Math.clz32(G)}:BN.prototype._countBits=function _countBits(G){var K=G,ne=0;return K>=4096&&(ne+=13,K>>>=13),K>=64&&(ne+=7,K>>>=7),K>=8&&(ne+=4,K>>>=4),K>=2&&(ne+=2,K>>>=2),ne+K},BN.prototype._zeroBits=function _zeroBits(G){if(0===G)return 26;var K=G,ne=0;return 0==(8191&K)&&(ne+=13,K>>>=13),0==(127&K)&&(ne+=7,K>>>=7),0==(15&K)&&(ne+=4,K>>>=4),0==(3&K)&&(ne+=2,K>>>=2),0==(1&K)&&ne++,ne},BN.prototype.bitLength=function bitLength(){var G=this.words[this.length-1],K=this._countBits(G);return 26*(this.length-1)+K},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var G=0,K=0;K<this.length;K++){var ne=this._zeroBits(this.words[K]);if(G+=ne,26!==ne)break}return G},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(G){return 0!==this.negative?this.abs().inotn(G).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(G){return this.testn(G-1)?this.notn(G).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(G){for(;this.length<G.length;)this.words[this.length++]=0;for(var K=0;K<G.length;K++)this.words[K]=this.words[K]|G.words[K];return this.strip()},BN.prototype.ior=function ior(G){return assert(0==(this.negative|G.negative)),this.iuor(G)},BN.prototype.or=function or(G){return this.length>G.length?this.clone().ior(G):G.clone().ior(this)},BN.prototype.uor=function uor(G){return this.length>G.length?this.clone().iuor(G):G.clone().iuor(this)},BN.prototype.iuand=function iuand(G){var K;K=this.length>G.length?G:this;for(var ne=0;ne<K.length;ne++)this.words[ne]=this.words[ne]&G.words[ne];return this.length=K.length,this.strip()},BN.prototype.iand=function iand(G){return assert(0==(this.negative|G.negative)),this.iuand(G)},BN.prototype.and=function and(G){return this.length>G.length?this.clone().iand(G):G.clone().iand(this)},BN.prototype.uand=function uand(G){return this.length>G.length?this.clone().iuand(G):G.clone().iuand(this)},BN.prototype.iuxor=function iuxor(G){var K,ne;this.length>G.length?(K=this,ne=G):(K=G,ne=this);for(var ue=0;ue<ne.length;ue++)this.words[ue]=K.words[ue]^ne.words[ue];if(this!==K)for(;ue<K.length;ue++)this.words[ue]=K.words[ue];return this.length=K.length,this.strip()},BN.prototype.ixor=function ixor(G){return assert(0==(this.negative|G.negative)),this.iuxor(G)},BN.prototype.xor=function xor(G){return this.length>G.length?this.clone().ixor(G):G.clone().ixor(this)},BN.prototype.uxor=function uxor(G){return this.length>G.length?this.clone().iuxor(G):G.clone().iuxor(this)},BN.prototype.inotn=function inotn(G){assert("number"==typeof G&&G>=0);var K=0|Math.ceil(G/26),ne=G%26;this._expand(K),ne>0&&K--;for(var ue=0;ue<K;ue++)this.words[ue]=67108863&~this.words[ue];return ne>0&&(this.words[ue]=~this.words[ue]&67108863>>26-ne),this.strip()},BN.prototype.notn=function notn(G){return this.clone().inotn(G)},BN.prototype.setn=function setn(G,K){assert("number"==typeof G&&G>=0);var ne=G/26|0,ue=G%26;return this._expand(ne+1),this.words[ne]=K?this.words[ne]|1<<ue:this.words[ne]&~(1<<ue),this.strip()},BN.prototype.iadd=function iadd(G){var K,ne,ue;if(0!==this.negative&&0===G.negative)return this.negative=0,K=this.isub(G),this.negative^=1,this._normSign();if(0===this.negative&&0!==G.negative)return G.negative=0,K=this.isub(G),G.negative=1,K._normSign();this.length>G.length?(ne=this,ue=G):(ne=G,ue=this);for(var pe=0,he=0;he<ue.length;he++)K=(0|ne.words[he])+(0|ue.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;for(;0!==pe&&he<ne.length;he++)K=(0|ne.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;if(this.length=ne.length,0!==pe)this.words[this.length]=pe,this.length++;else if(ne!==this)for(;he<ne.length;he++)this.words[he]=ne.words[he];return this},BN.prototype.add=function add(G){var K;return 0!==G.negative&&0===this.negative?(G.negative=0,K=this.sub(G),G.negative^=1,K):0===G.negative&&0!==this.negative?(this.negative=0,K=G.sub(this),this.negative=1,K):this.length>G.length?this.clone().iadd(G):G.clone().iadd(this)},BN.prototype.isub=function isub(G){if(0!==G.negative){G.negative=0;var K=this.iadd(G);return G.negative=1,K._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(G),this.negative=1,this._normSign();var ne,ue,pe=this.cmp(G);if(0===pe)return this.negative=0,this.length=1,this.words[0]=0,this;pe>0?(ne=this,ue=G):(ne=G,ue=this);for(var he=0,ye=0;ye<ue.length;ye++)he=(K=(0|ne.words[ye])-(0|ue.words[ye])+he)>>26,this.words[ye]=67108863&K;for(;0!==he&&ye<ne.length;ye++)he=(K=(0|ne.words[ye])+he)>>26,this.words[ye]=67108863&K;if(0===he&&ye<ne.length&&ne!==this)for(;ye<ne.length;ye++)this.words[ye]=ne.words[ye];return this.length=Math.max(this.length,ye),ne!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function sub(G){return this.clone().isub(G)};var ye=function comb10MulTo(G,K,ne){var ue,pe,he,ye=G.words,me=K.words,be=ne.words,ve=0,_e=0|ye[0],Te=8191&_e,Ee=_e>>>13,Pe=0|ye[1],Se=8191&Pe,Ce=Pe>>>13,ke=0|ye[2],Oe=8191&ke,xe=ke>>>13,Ne=0|ye[3],Me=8191&Ne,Be=Ne>>>13,Fe=0|ye[4],De=8191&Fe,Le=Fe>>>13,Ue=0|ye[5],je=8191&Ue,ze=Ue>>>13,Je=0|ye[6],Xe=8191&Je,Qe=Je>>>13,Ye=0|ye[7],et=8191&Ye,tt=Ye>>>13,rt=0|ye[8],nt=8191&rt,at=rt>>>13,it=0|ye[9],ot=8191&it,ct=it>>>13,dt=0|me[0],ut=8191&dt,ft=dt>>>13,yt=0|me[1],wt=8191&yt,At=yt>>>13,St=0|me[2],kt=8191&St,Bt=St>>>13,Lt=0|me[3],Ut=8191&Lt,$t=Lt>>>13,Ht=0|me[4],Vt=8191&Ht,er=Ht>>>13,tr=0|me[5],rr=8191&tr,cr=tr>>>13,dr=0|me[6],Rr=8191&dr,kr=dr>>>13,$r=0|me[7],qr=8191&$r,Hr=$r>>>13,Vr=0|me[8],Zr=8191&Vr,en=Vr>>>13,tn=0|me[9],an=8191&tn,sn=tn>>>13;ne.negative=G.negative^K.negative,ne.length=19;var un=(ve+(ue=Math.imul(Te,ut))|0)+((8191&(pe=(pe=Math.imul(Te,ft))+Math.imul(Ee,ut)|0))<<13)|0;ve=((he=Math.imul(Ee,ft))+(pe>>>13)|0)+(un>>>26)|0,un&=67108863,ue=Math.imul(Se,ut),pe=(pe=Math.imul(Se,ft))+Math.imul(Ce,ut)|0,he=Math.imul(Ce,ft);var fn=(ve+(ue=ue+Math.imul(Te,wt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,At)|0)+Math.imul(Ee,wt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,At)|0)+(pe>>>13)|0)+(fn>>>26)|0,fn&=67108863,ue=Math.imul(Oe,ut),pe=(pe=Math.imul(Oe,ft))+Math.imul(xe,ut)|0,he=Math.imul(xe,ft),ue=ue+Math.imul(Se,wt)|0,pe=(pe=pe+Math.imul(Se,At)|0)+Math.imul(Ce,wt)|0,he=he+Math.imul(Ce,At)|0;var pn=(ve+(ue=ue+Math.imul(Te,kt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Bt)|0)+Math.imul(Ee,kt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Bt)|0)+(pe>>>13)|0)+(pn>>>26)|0,pn&=67108863,ue=Math.imul(Me,ut),pe=(pe=Math.imul(Me,ft))+Math.imul(Be,ut)|0,he=Math.imul(Be,ft),ue=ue+Math.imul(Oe,wt)|0,pe=(pe=pe+Math.imul(Oe,At)|0)+Math.imul(xe,wt)|0,he=he+Math.imul(xe,At)|0,ue=ue+Math.imul(Se,kt)|0,pe=(pe=pe+Math.imul(Se,Bt)|0)+Math.imul(Ce,kt)|0,he=he+Math.imul(Ce,Bt)|0;var hn=(ve+(ue=ue+Math.imul(Te,Ut)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,$t)|0)+Math.imul(Ee,Ut)|0))<<13)|0;ve=((he=he+Math.imul(Ee,$t)|0)+(pe>>>13)|0)+(hn>>>26)|0,hn&=67108863,ue=Math.imul(De,ut),pe=(pe=Math.imul(De,ft))+Math.imul(Le,ut)|0,he=Math.imul(Le,ft),ue=ue+Math.imul(Me,wt)|0,pe=(pe=pe+Math.imul(Me,At)|0)+Math.imul(Be,wt)|0,he=he+Math.imul(Be,At)|0,ue=ue+Math.imul(Oe,kt)|0,pe=(pe=pe+Math.imul(Oe,Bt)|0)+Math.imul(xe,kt)|0,he=he+Math.imul(xe,Bt)|0,ue=ue+Math.imul(Se,Ut)|0,pe=(pe=pe+Math.imul(Se,$t)|0)+Math.imul(Ce,Ut)|0,he=he+Math.imul(Ce,$t)|0;var yn=(ve+(ue=ue+Math.imul(Te,Vt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,er)|0)+Math.imul(Ee,Vt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,er)|0)+(pe>>>13)|0)+(yn>>>26)|0,yn&=67108863,ue=Math.imul(je,ut),pe=(pe=Math.imul(je,ft))+Math.imul(ze,ut)|0,he=Math.imul(ze,ft),ue=ue+Math.imul(De,wt)|0,pe=(pe=pe+Math.imul(De,At)|0)+Math.imul(Le,wt)|0,he=he+Math.imul(Le,At)|0,ue=ue+Math.imul(Me,kt)|0,pe=(pe=pe+Math.imul(Me,Bt)|0)+Math.imul(Be,kt)|0,he=he+Math.imul(Be,Bt)|0,ue=ue+Math.imul(Oe,Ut)|0,pe=(pe=pe+Math.imul(Oe,$t)|0)+Math.imul(xe,Ut)|0,he=he+Math.imul(xe,$t)|0,ue=ue+Math.imul(Se,Vt)|0,pe=(pe=pe+Math.imul(Se,er)|0)+Math.imul(Ce,Vt)|0,he=he+Math.imul(Ce,er)|0;var mn=(ve+(ue=ue+Math.imul(Te,rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,cr)|0)+Math.imul(Ee,rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,cr)|0)+(pe>>>13)|0)+(mn>>>26)|0,mn&=67108863,ue=Math.imul(Xe,ut),pe=(pe=Math.imul(Xe,ft))+Math.imul(Qe,ut)|0,he=Math.imul(Qe,ft),ue=ue+Math.imul(je,wt)|0,pe=(pe=pe+Math.imul(je,At)|0)+Math.imul(ze,wt)|0,he=he+Math.imul(ze,At)|0,ue=ue+Math.imul(De,kt)|0,pe=(pe=pe+Math.imul(De,Bt)|0)+Math.imul(Le,kt)|0,he=he+Math.imul(Le,Bt)|0,ue=ue+Math.imul(Me,Ut)|0,pe=(pe=pe+Math.imul(Me,$t)|0)+Math.imul(Be,Ut)|0,he=he+Math.imul(Be,$t)|0,ue=ue+Math.imul(Oe,Vt)|0,pe=(pe=pe+Math.imul(Oe,er)|0)+Math.imul(xe,Vt)|0,he=he+Math.imul(xe,er)|0,ue=ue+Math.imul(Se,rr)|0,pe=(pe=pe+Math.imul(Se,cr)|0)+Math.imul(Ce,rr)|0,he=he+Math.imul(Ce,cr)|0;var bn=(ve+(ue=ue+Math.imul(Te,Rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,kr)|0)+Math.imul(Ee,Rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,kr)|0)+(pe>>>13)|0)+(bn>>>26)|0,bn&=67108863,ue=Math.imul(et,ut),pe=(pe=Math.imul(et,ft))+Math.imul(tt,ut)|0,he=Math.imul(tt,ft),ue=ue+Math.imul(Xe,wt)|0,pe=(pe=pe+Math.imul(Xe,At)|0)+Math.imul(Qe,wt)|0,he=he+Math.imul(Qe,At)|0,ue=ue+Math.imul(je,kt)|0,pe=(pe=pe+Math.imul(je,Bt)|0)+Math.imul(ze,kt)|0,he=he+Math.imul(ze,Bt)|0,ue=ue+Math.imul(De,Ut)|0,pe=(pe=pe+Math.imul(De,$t)|0)+Math.imul(Le,Ut)|0,he=he+Math.imul(Le,$t)|0,ue=ue+Math.imul(Me,Vt)|0,pe=(pe=pe+Math.imul(Me,er)|0)+Math.imul(Be,Vt)|0,he=he+Math.imul(Be,er)|0,ue=ue+Math.imul(Oe,rr)|0,pe=(pe=pe+Math.imul(Oe,cr)|0)+Math.imul(xe,rr)|0,he=he+Math.imul(xe,cr)|0,ue=ue+Math.imul(Se,Rr)|0,pe=(pe=pe+Math.imul(Se,kr)|0)+Math.imul(Ce,Rr)|0,he=he+Math.imul(Ce,kr)|0;var gn=(ve+(ue=ue+Math.imul(Te,qr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Hr)|0)+Math.imul(Ee,qr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Hr)|0)+(pe>>>13)|0)+(gn>>>26)|0,gn&=67108863,ue=Math.imul(nt,ut),pe=(pe=Math.imul(nt,ft))+Math.imul(at,ut)|0,he=Math.imul(at,ft),ue=ue+Math.imul(et,wt)|0,pe=(pe=pe+Math.imul(et,At)|0)+Math.imul(tt,wt)|0,he=he+Math.imul(tt,At)|0,ue=ue+Math.imul(Xe,kt)|0,pe=(pe=pe+Math.imul(Xe,Bt)|0)+Math.imul(Qe,kt)|0,he=he+Math.imul(Qe,Bt)|0,ue=ue+Math.imul(je,Ut)|0,pe=(pe=pe+Math.imul(je,$t)|0)+Math.imul(ze,Ut)|0,he=he+Math.imul(ze,$t)|0,ue=ue+Math.imul(De,Vt)|0,pe=(pe=pe+Math.imul(De,er)|0)+Math.imul(Le,Vt)|0,he=he+Math.imul(Le,er)|0,ue=ue+Math.imul(Me,rr)|0,pe=(pe=pe+Math.imul(Me,cr)|0)+Math.imul(Be,rr)|0,he=he+Math.imul(Be,cr)|0,ue=ue+Math.imul(Oe,Rr)|0,pe=(pe=pe+Math.imul(Oe,kr)|0)+Math.imul(xe,Rr)|0,he=he+Math.imul(xe,kr)|0,ue=ue+Math.imul(Se,qr)|0,pe=(pe=pe+Math.imul(Se,Hr)|0)+Math.imul(Ce,qr)|0,he=he+Math.imul(Ce,Hr)|0;var vn=(ve+(ue=ue+Math.imul(Te,Zr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,en)|0)+Math.imul(Ee,Zr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,en)|0)+(pe>>>13)|0)+(vn>>>26)|0,vn&=67108863,ue=Math.imul(ot,ut),pe=(pe=Math.imul(ot,ft))+Math.imul(ct,ut)|0,he=Math.imul(ct,ft),ue=ue+Math.imul(nt,wt)|0,pe=(pe=pe+Math.imul(nt,At)|0)+Math.imul(at,wt)|0,he=he+Math.imul(at,At)|0,ue=ue+Math.imul(et,kt)|0,pe=(pe=pe+Math.imul(et,Bt)|0)+Math.imul(tt,kt)|0,he=he+Math.imul(tt,Bt)|0,ue=ue+Math.imul(Xe,Ut)|0,pe=(pe=pe+Math.imul(Xe,$t)|0)+Math.imul(Qe,Ut)|0,he=he+Math.imul(Qe,$t)|0,ue=ue+Math.imul(je,Vt)|0,pe=(pe=pe+Math.imul(je,er)|0)+Math.imul(ze,Vt)|0,he=he+Math.imul(ze,er)|0,ue=ue+Math.imul(De,rr)|0,pe=(pe=pe+Math.imul(De,cr)|0)+Math.imul(Le,rr)|0,he=he+Math.imul(Le,cr)|0,ue=ue+Math.imul(Me,Rr)|0,pe=(pe=pe+Math.imul(Me,kr)|0)+Math.imul(Be,Rr)|0,he=he+Math.imul(Be,kr)|0,ue=ue+Math.imul(Oe,qr)|0,pe=(pe=pe+Math.imul(Oe,Hr)|0)+Math.imul(xe,qr)|0,he=he+Math.imul(xe,Hr)|0,ue=ue+Math.imul(Se,Zr)|0,pe=(pe=pe+Math.imul(Se,en)|0)+Math.imul(Ce,Zr)|0,he=he+Math.imul(Ce,en)|0;var Tn=(ve+(ue=ue+Math.imul(Te,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,sn)|0)+Math.imul(Ee,an)|0))<<13)|0;ve=((he=he+Math.imul(Ee,sn)|0)+(pe>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ue=Math.imul(ot,wt),pe=(pe=Math.imul(ot,At))+Math.imul(ct,wt)|0,he=Math.imul(ct,At),ue=ue+Math.imul(nt,kt)|0,pe=(pe=pe+Math.imul(nt,Bt)|0)+Math.imul(at,kt)|0,he=he+Math.imul(at,Bt)|0,ue=ue+Math.imul(et,Ut)|0,pe=(pe=pe+Math.imul(et,$t)|0)+Math.imul(tt,Ut)|0,he=he+Math.imul(tt,$t)|0,ue=ue+Math.imul(Xe,Vt)|0,pe=(pe=pe+Math.imul(Xe,er)|0)+Math.imul(Qe,Vt)|0,he=he+Math.imul(Qe,er)|0,ue=ue+Math.imul(je,rr)|0,pe=(pe=pe+Math.imul(je,cr)|0)+Math.imul(ze,rr)|0,he=he+Math.imul(ze,cr)|0,ue=ue+Math.imul(De,Rr)|0,pe=(pe=pe+Math.imul(De,kr)|0)+Math.imul(Le,Rr)|0,he=he+Math.imul(Le,kr)|0,ue=ue+Math.imul(Me,qr)|0,pe=(pe=pe+Math.imul(Me,Hr)|0)+Math.imul(Be,qr)|0,he=he+Math.imul(Be,Hr)|0,ue=ue+Math.imul(Oe,Zr)|0,pe=(pe=pe+Math.imul(Oe,en)|0)+Math.imul(xe,Zr)|0,he=he+Math.imul(xe,en)|0;var En=(ve+(ue=ue+Math.imul(Se,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Se,sn)|0)+Math.imul(Ce,an)|0))<<13)|0;ve=((he=he+Math.imul(Ce,sn)|0)+(pe>>>13)|0)+(En>>>26)|0,En&=67108863,ue=Math.imul(ot,kt),pe=(pe=Math.imul(ot,Bt))+Math.imul(ct,kt)|0,he=Math.imul(ct,Bt),ue=ue+Math.imul(nt,Ut)|0,pe=(pe=pe+Math.imul(nt,$t)|0)+Math.imul(at,Ut)|0,he=he+Math.imul(at,$t)|0,ue=ue+Math.imul(et,Vt)|0,pe=(pe=pe+Math.imul(et,er)|0)+Math.imul(tt,Vt)|0,he=he+Math.imul(tt,er)|0,ue=ue+Math.imul(Xe,rr)|0,pe=(pe=pe+Math.imul(Xe,cr)|0)+Math.imul(Qe,rr)|0,he=he+Math.imul(Qe,cr)|0,ue=ue+Math.imul(je,Rr)|0,pe=(pe=pe+Math.imul(je,kr)|0)+Math.imul(ze,Rr)|0,he=he+Math.imul(ze,kr)|0,ue=ue+Math.imul(De,qr)|0,pe=(pe=pe+Math.imul(De,Hr)|0)+Math.imul(Le,qr)|0,he=he+Math.imul(Le,Hr)|0,ue=ue+Math.imul(Me,Zr)|0,pe=(pe=pe+Math.imul(Me,en)|0)+Math.imul(Be,Zr)|0,he=he+Math.imul(Be,en)|0;var In=(ve+(ue=ue+Math.imul(Oe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Oe,sn)|0)+Math.imul(xe,an)|0))<<13)|0;ve=((he=he+Math.imul(xe,sn)|0)+(pe>>>13)|0)+(In>>>26)|0,In&=67108863,ue=Math.imul(ot,Ut),pe=(pe=Math.imul(ot,$t))+Math.imul(ct,Ut)|0,he=Math.imul(ct,$t),ue=ue+Math.imul(nt,Vt)|0,pe=(pe=pe+Math.imul(nt,er)|0)+Math.imul(at,Vt)|0,he=he+Math.imul(at,er)|0,ue=ue+Math.imul(et,rr)|0,pe=(pe=pe+Math.imul(et,cr)|0)+Math.imul(tt,rr)|0,he=he+Math.imul(tt,cr)|0,ue=ue+Math.imul(Xe,Rr)|0,pe=(pe=pe+Math.imul(Xe,kr)|0)+Math.imul(Qe,Rr)|0,he=he+Math.imul(Qe,kr)|0,ue=ue+Math.imul(je,qr)|0,pe=(pe=pe+Math.imul(je,Hr)|0)+Math.imul(ze,qr)|0,he=he+Math.imul(ze,Hr)|0,ue=ue+Math.imul(De,Zr)|0,pe=(pe=pe+Math.imul(De,en)|0)+Math.imul(Le,Zr)|0,he=he+Math.imul(Le,en)|0;var Rn=(ve+(ue=ue+Math.imul(Me,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Me,sn)|0)+Math.imul(Be,an)|0))<<13)|0;ve=((he=he+Math.imul(Be,sn)|0)+(pe>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,ue=Math.imul(ot,Vt),pe=(pe=Math.imul(ot,er))+Math.imul(ct,Vt)|0,he=Math.imul(ct,er),ue=ue+Math.imul(nt,rr)|0,pe=(pe=pe+Math.imul(nt,cr)|0)+Math.imul(at,rr)|0,he=he+Math.imul(at,cr)|0,ue=ue+Math.imul(et,Rr)|0,pe=(pe=pe+Math.imul(et,kr)|0)+Math.imul(tt,Rr)|0,he=he+Math.imul(tt,kr)|0,ue=ue+Math.imul(Xe,qr)|0,pe=(pe=pe+Math.imul(Xe,Hr)|0)+Math.imul(Qe,qr)|0,he=he+Math.imul(Qe,Hr)|0,ue=ue+Math.imul(je,Zr)|0,pe=(pe=pe+Math.imul(je,en)|0)+Math.imul(ze,Zr)|0,he=he+Math.imul(ze,en)|0;var Nn=(ve+(ue=ue+Math.imul(De,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(De,sn)|0)+Math.imul(Le,an)|0))<<13)|0;ve=((he=he+Math.imul(Le,sn)|0)+(pe>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,ue=Math.imul(ot,rr),pe=(pe=Math.imul(ot,cr))+Math.imul(ct,rr)|0,he=Math.imul(ct,cr),ue=ue+Math.imul(nt,Rr)|0,pe=(pe=pe+Math.imul(nt,kr)|0)+Math.imul(at,Rr)|0,he=he+Math.imul(at,kr)|0,ue=ue+Math.imul(et,qr)|0,pe=(pe=pe+Math.imul(et,Hr)|0)+Math.imul(tt,qr)|0,he=he+Math.imul(tt,Hr)|0,ue=ue+Math.imul(Xe,Zr)|0,pe=(pe=pe+Math.imul(Xe,en)|0)+Math.imul(Qe,Zr)|0,he=he+Math.imul(Qe,en)|0;var Bn=(ve+(ue=ue+Math.imul(je,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(je,sn)|0)+Math.imul(ze,an)|0))<<13)|0;ve=((he=he+Math.imul(ze,sn)|0)+(pe>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,ue=Math.imul(ot,Rr),pe=(pe=Math.imul(ot,kr))+Math.imul(ct,Rr)|0,he=Math.imul(ct,kr),ue=ue+Math.imul(nt,qr)|0,pe=(pe=pe+Math.imul(nt,Hr)|0)+Math.imul(at,qr)|0,he=he+Math.imul(at,Hr)|0,ue=ue+Math.imul(et,Zr)|0,pe=(pe=pe+Math.imul(et,en)|0)+Math.imul(tt,Zr)|0,he=he+Math.imul(tt,en)|0;var Fn=(ve+(ue=ue+Math.imul(Xe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Xe,sn)|0)+Math.imul(Qe,an)|0))<<13)|0;ve=((he=he+Math.imul(Qe,sn)|0)+(pe>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,ue=Math.imul(ot,qr),pe=(pe=Math.imul(ot,Hr))+Math.imul(ct,qr)|0,he=Math.imul(ct,Hr),ue=ue+Math.imul(nt,Zr)|0,pe=(pe=pe+Math.imul(nt,en)|0)+Math.imul(at,Zr)|0,he=he+Math.imul(at,en)|0;var Dn=(ve+(ue=ue+Math.imul(et,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(et,sn)|0)+Math.imul(tt,an)|0))<<13)|0;ve=((he=he+Math.imul(tt,sn)|0)+(pe>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,ue=Math.imul(ot,Zr),pe=(pe=Math.imul(ot,en))+Math.imul(ct,Zr)|0,he=Math.imul(ct,en);var Un=(ve+(ue=ue+Math.imul(nt,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(nt,sn)|0)+Math.imul(at,an)|0))<<13)|0;ve=((he=he+Math.imul(at,sn)|0)+(pe>>>13)|0)+(Un>>>26)|0,Un&=67108863;var $n=(ve+(ue=Math.imul(ot,an))|0)+((8191&(pe=(pe=Math.imul(ot,sn))+Math.imul(ct,an)|0))<<13)|0;return ve=((he=Math.imul(ct,sn))+(pe>>>13)|0)+($n>>>26)|0,$n&=67108863,be[0]=un,be[1]=fn,be[2]=pn,be[3]=hn,be[4]=yn,be[5]=mn,be[6]=bn,be[7]=gn,be[8]=vn,be[9]=Tn,be[10]=En,be[11]=In,be[12]=Rn,be[13]=Nn,be[14]=Bn,be[15]=Fn,be[16]=Dn,be[17]=Un,be[18]=$n,0!==ve&&(be[19]=ve,ne.length++),ne};function jumboMulTo(G,K,ne){return(new FFTM).mulp(G,K,ne)}function FFTM(G,K){this.x=G,this.y=K}Math.imul||(ye=smallMulTo),BN.prototype.mulTo=function mulTo(G,K){var ne,ue=this.length+G.length;return ne=10===this.length&&10===G.length?ye(this,G,K):ue<63?smallMulTo(this,G,K):ue<1024?function bigMulTo(G,K,ne){ne.negative=K.negative^G.negative,ne.length=G.length+K.length;for(var ue=0,pe=0,he=0;he<ne.length-1;he++){var ye=pe;pe=0;for(var me=67108863&ue,be=Math.min(he,K.length-1),ve=Math.max(0,he-G.length+1);ve<=be;ve++){var _e=he-ve,Te=(0|G.words[_e])*(0|K.words[ve]),Ee=67108863&Te;me=67108863&(Ee=Ee+me|0),pe+=(ye=(ye=ye+(Te/67108864|0)|0)+(Ee>>>26)|0)>>>26,ye&=67108863}ne.words[he]=me,ue=ye,ye=pe}return 0!==ue?ne.words[he]=ue:ne.length--,ne.strip()}(this,G,K):jumboMulTo(this,G,K),ne},FFTM.prototype.makeRBT=function makeRBT(G){for(var K=new Array(G),ne=BN.prototype._countBits(G)-1,ue=0;ue<G;ue++)K[ue]=this.revBin(ue,ne,G);return K},FFTM.prototype.revBin=function revBin(G,K,ne){if(0===G||G===ne-1)return G;for(var ue=0,pe=0;pe<K;pe++)ue|=(1&G)<<K-pe-1,G>>=1;return ue},FFTM.prototype.permute=function permute(G,K,ne,ue,pe,he){for(var ye=0;ye<he;ye++)ue[ye]=K[G[ye]],pe[ye]=ne[G[ye]]},FFTM.prototype.transform=function transform(G,K,ne,ue,pe,he){this.permute(he,G,K,ne,ue,pe);for(var ye=1;ye<pe;ye<<=1)for(var me=ye<<1,be=Math.cos(2*Math.PI/me),ve=Math.sin(2*Math.PI/me),_e=0;_e<pe;_e+=me)for(var Te=be,Ee=ve,Pe=0;Pe<ye;Pe++){var Se=ne[_e+Pe],Ce=ue[_e+Pe],ke=ne[_e+Pe+ye],Oe=ue[_e+Pe+ye],xe=Te*ke-Ee*Oe;Oe=Te*Oe+Ee*ke,ke=xe,ne[_e+Pe]=Se+ke,ue[_e+Pe]=Ce+Oe,ne[_e+Pe+ye]=Se-ke,ue[_e+Pe+ye]=Ce-Oe,Pe!==me&&(xe=be*Te-ve*Ee,Ee=be*Ee+ve*Te,Te=xe)}},FFTM.prototype.guessLen13b=function guessLen13b(G,K){var ne=1|Math.max(K,G),ue=1&ne,pe=0;for(ne=ne/2|0;ne;ne>>>=1)pe++;return 1<<pe+1+ue},FFTM.prototype.conjugate=function conjugate(G,K,ne){if(!(ne<=1))for(var ue=0;ue<ne/2;ue++){var pe=G[ue];G[ue]=G[ne-ue-1],G[ne-ue-1]=pe,pe=K[ue],K[ue]=-K[ne-ue-1],K[ne-ue-1]=-pe}},FFTM.prototype.normalize13b=function normalize13b(G,K){for(var ne=0,ue=0;ue<K/2;ue++){var pe=8192*Math.round(G[2*ue+1]/K)+Math.round(G[2*ue]/K)+ne;G[ue]=67108863&pe,ne=pe<67108864?0:pe/67108864|0}return G},FFTM.prototype.convert13b=function convert13b(G,K,ne,ue){for(var pe=0,he=0;he<K;he++)pe+=0|G[he],ne[2*he]=8191&pe,pe>>>=13,ne[2*he+1]=8191&pe,pe>>>=13;for(he=2*K;he<ue;++he)ne[he]=0;assert(0===pe),assert(0==(-8192&pe))},FFTM.prototype.stub=function stub(G){for(var K=new Array(G),ne=0;ne<G;ne++)K[ne]=0;return K},FFTM.prototype.mulp=function mulp(G,K,ne){var ue=2*this.guessLen13b(G.length,K.length),pe=this.makeRBT(ue),he=this.stub(ue),ye=new Array(ue),me=new Array(ue),be=new Array(ue),ve=new Array(ue),_e=new Array(ue),Te=new Array(ue),Ee=ne.words;Ee.length=ue,this.convert13b(G.words,G.length,ye,ue),this.convert13b(K.words,K.length,ve,ue),this.transform(ye,he,me,be,ue,pe),this.transform(ve,he,_e,Te,ue,pe);for(var Pe=0;Pe<ue;Pe++){var Se=me[Pe]*_e[Pe]-be[Pe]*Te[Pe];be[Pe]=me[Pe]*Te[Pe]+be[Pe]*_e[Pe],me[Pe]=Se}return this.conjugate(me,be,ue),this.transform(me,be,Ee,he,ue,pe),this.conjugate(Ee,he,ue),this.normalize13b(Ee,ue),ne.negative=G.negative^K.negative,ne.length=G.length+K.length,ne.strip()},BN.prototype.mul=function mul(G){var K=new BN(null);return K.words=new Array(this.length+G.length),this.mulTo(G,K)},BN.prototype.mulf=function mulf(G){var K=new BN(null);return K.words=new Array(this.length+G.length),jumboMulTo(this,G,K)},BN.prototype.imul=function imul(G){return this.clone().mulTo(G,this)},BN.prototype.imuln=function imuln(G){assert("number"==typeof G),assert(G<67108864);for(var K=0,ne=0;ne<this.length;ne++){var ue=(0|this.words[ne])*G,pe=(67108863&ue)+(67108863&K);K>>=26,K+=ue/67108864|0,K+=pe>>>26,this.words[ne]=67108863&pe}return 0!==K&&(this.words[ne]=K,this.length++),this},BN.prototype.muln=function muln(G){return this.clone().imuln(G)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(G){var K=function toBitArray(G){for(var K=new Array(G.bitLength()),ne=0;ne<K.length;ne++){var ue=ne/26|0,pe=ne%26;K[ne]=(G.words[ue]&1<<pe)>>>pe}return K}(G);if(0===K.length)return new BN(1);for(var ne=this,ue=0;ue<K.length&&0===K[ue];ue++,ne=ne.sqr());if(++ue<K.length)for(var pe=ne.sqr();ue<K.length;ue++,pe=pe.sqr())0!==K[ue]&&(ne=ne.mul(pe));return ne},BN.prototype.iushln=function iushln(G){assert("number"==typeof G&&G>=0);var K,ne=G%26,ue=(G-ne)/26,pe=67108863>>>26-ne<<26-ne;if(0!==ne){var he=0;for(K=0;K<this.length;K++){var ye=this.words[K]&pe,me=(0|this.words[K])-ye<<ne;this.words[K]=me|he,he=ye>>>26-ne}he&&(this.words[K]=he,this.length++)}if(0!==ue){for(K=this.length-1;K>=0;K--)this.words[K+ue]=this.words[K];for(K=0;K<ue;K++)this.words[K]=0;this.length+=ue}return this.strip()},BN.prototype.ishln=function ishln(G){return assert(0===this.negative),this.iushln(G)},BN.prototype.iushrn=function iushrn(G,K,ne){var ue;assert("number"==typeof G&&G>=0),ue=K?(K-K%26)/26:0;var pe=G%26,he=Math.min((G-pe)/26,this.length),ye=67108863^67108863>>>pe<<pe,me=ne;if(ue-=he,ue=Math.max(0,ue),me){for(var be=0;be<he;be++)me.words[be]=this.words[be];me.length=he}if(0===he);else if(this.length>he)for(this.length-=he,be=0;be<this.length;be++)this.words[be]=this.words[be+he];else this.words[0]=0,this.length=1;var ve=0;for(be=this.length-1;be>=0&&(0!==ve||be>=ue);be--){var _e=0|this.words[be];this.words[be]=ve<<26-pe|_e>>>pe,ve=_e&ye}return me&&0!==ve&&(me.words[me.length++]=ve),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(G,K,ne){return assert(0===this.negative),this.iushrn(G,K,ne)},BN.prototype.shln=function shln(G){return this.clone().ishln(G)},BN.prototype.ushln=function ushln(G){return this.clone().iushln(G)},BN.prototype.shrn=function shrn(G){return this.clone().ishrn(G)},BN.prototype.ushrn=function ushrn(G){return this.clone().iushrn(G)},BN.prototype.testn=function testn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26,ue=1<<K;return!(this.length<=ne)&&!!(this.words[ne]&ue)},BN.prototype.imaskn=function imaskn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=ne)return this;if(0!==K&&ne++,this.length=Math.min(ne,this.length),0!==K){var ue=67108863^67108863>>>K<<K;this.words[this.length-1]&=ue}return this.strip()},BN.prototype.maskn=function maskn(G){return this.clone().imaskn(G)},BN.prototype.iaddn=function iaddn(G){return assert("number"==typeof G),assert(G<67108864),G<0?this.isubn(-G):0!==this.negative?1===this.length&&(0|this.words[0])<G?(this.words[0]=G-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(G),this.negative=1,this):this._iaddn(G)},BN.prototype._iaddn=function _iaddn(G){this.words[0]+=G;for(var K=0;K<this.length&&this.words[K]>=67108864;K++)this.words[K]-=67108864,K===this.length-1?this.words[K+1]=1:this.words[K+1]++;return this.length=Math.max(this.length,K+1),this},BN.prototype.isubn=function isubn(G){if(assert("number"==typeof G),assert(G<67108864),G<0)return this.iaddn(-G);if(0!==this.negative)return this.negative=0,this.iaddn(G),this.negative=1,this;if(this.words[0]-=G,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var K=0;K<this.length&&this.words[K]<0;K++)this.words[K]+=67108864,this.words[K+1]-=1;return this.strip()},BN.prototype.addn=function addn(G){return this.clone().iaddn(G)},BN.prototype.subn=function subn(G){return this.clone().isubn(G)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(G,K,ne){var ue,pe,he=G.length+ne;this._expand(he);var ye=0;for(ue=0;ue<G.length;ue++){pe=(0|this.words[ue+ne])+ye;var me=(0|G.words[ue])*K;ye=((pe-=67108863&me)>>26)-(me/67108864|0),this.words[ue+ne]=67108863&pe}for(;ue<this.length-ne;ue++)ye=(pe=(0|this.words[ue+ne])+ye)>>26,this.words[ue+ne]=67108863&pe;if(0===ye)return this.strip();for(assert(-1===ye),ye=0,ue=0;ue<this.length;ue++)ye=(pe=-(0|this.words[ue])+ye)>>26,this.words[ue]=67108863&pe;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(G,K){var ne=(this.length,G.length),ue=this.clone(),pe=G,he=0|pe.words[pe.length-1];0!==(ne=26-this._countBits(he))&&(pe=pe.ushln(ne),ue.iushln(ne),he=0|pe.words[pe.length-1]);var ye,me=ue.length-pe.length;if("mod"!==K){(ye=new BN(null)).length=me+1,ye.words=new Array(ye.length);for(var be=0;be<ye.length;be++)ye.words[be]=0}var ve=ue.clone()._ishlnsubmul(pe,1,me);0===ve.negative&&(ue=ve,ye&&(ye.words[me]=1));for(var _e=me-1;_e>=0;_e--){var Te=67108864*(0|ue.words[pe.length+_e])+(0|ue.words[pe.length+_e-1]);for(Te=Math.min(Te/he|0,67108863),ue._ishlnsubmul(pe,Te,_e);0!==ue.negative;)Te--,ue.negative=0,ue._ishlnsubmul(pe,1,_e),ue.isZero()||(ue.negative^=1);ye&&(ye.words[_e]=Te)}return ye&&ye.strip(),ue.strip(),"div"!==K&&0!==ne&&ue.iushrn(ne),{div:ye||null,mod:ue}},BN.prototype.divmod=function divmod(G,K,ne){return assert(!G.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===G.negative?(he=this.neg().divmod(G,K),"mod"!==K&&(ue=he.div.neg()),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.iadd(G)),{div:ue,mod:pe}):0===this.negative&&0!==G.negative?(he=this.divmod(G.neg(),K),"mod"!==K&&(ue=he.div.neg()),{div:ue,mod:he.mod}):0!=(this.negative&G.negative)?(he=this.neg().divmod(G.neg(),K),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.isub(G)),{div:he.div,mod:pe}):G.length>this.length||this.cmp(G)<0?{div:new BN(0),mod:this}:1===G.length?"div"===K?{div:this.divn(G.words[0]),mod:null}:"mod"===K?{div:null,mod:new BN(this.modn(G.words[0]))}:{div:this.divn(G.words[0]),mod:new BN(this.modn(G.words[0]))}:this._wordDiv(G,K);var ue,pe,he},BN.prototype.div=function div(G){return this.divmod(G,"div",!1).div},BN.prototype.mod=function mod(G){return this.divmod(G,"mod",!1).mod},BN.prototype.umod=function umod(G){return this.divmod(G,"mod",!0).mod},BN.prototype.divRound=function divRound(G){var K=this.divmod(G);if(K.mod.isZero())return K.div;var ne=0!==K.div.negative?K.mod.isub(G):K.mod,ue=G.ushrn(1),pe=G.andln(1),he=ne.cmp(ue);return he<0||1===pe&&0===he?K.div:0!==K.div.negative?K.div.isubn(1):K.div.iaddn(1)},BN.prototype.modn=function modn(G){assert(G<=67108863);for(var K=(1<<26)%G,ne=0,ue=this.length-1;ue>=0;ue--)ne=(K*ne+(0|this.words[ue]))%G;return ne},BN.prototype.idivn=function idivn(G){assert(G<=67108863);for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=(0|this.words[ne])+67108864*K;this.words[ne]=ue/G|0,K=ue%G}return this.strip()},BN.prototype.divn=function divn(G){return this.clone().idivn(G)},BN.prototype.egcd=function egcd(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue=new BN(1),pe=new BN(0),he=new BN(0),ye=new BN(1),me=0;K.isEven()&&ne.isEven();)K.iushrn(1),ne.iushrn(1),++me;for(var be=ne.clone(),ve=K.clone();!K.isZero();){for(var _e=0,Te=1;0==(K.words[0]&Te)&&_e<26;++_e,Te<<=1);if(_e>0)for(K.iushrn(_e);_e-- >0;)(ue.isOdd()||pe.isOdd())&&(ue.iadd(be),pe.isub(ve)),ue.iushrn(1),pe.iushrn(1);for(var Ee=0,Pe=1;0==(ne.words[0]&Pe)&&Ee<26;++Ee,Pe<<=1);if(Ee>0)for(ne.iushrn(Ee);Ee-- >0;)(he.isOdd()||ye.isOdd())&&(he.iadd(be),ye.isub(ve)),he.iushrn(1),ye.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),ue.isub(he),pe.isub(ye)):(ne.isub(K),he.isub(ue),ye.isub(pe))}return{a:he,b:ye,gcd:ne.iushln(me)}},BN.prototype._invmp=function _invmp(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue,pe=new BN(1),he=new BN(0),ye=ne.clone();K.cmpn(1)>0&&ne.cmpn(1)>0;){for(var me=0,be=1;0==(K.words[0]&be)&&me<26;++me,be<<=1);if(me>0)for(K.iushrn(me);me-- >0;)pe.isOdd()&&pe.iadd(ye),pe.iushrn(1);for(var ve=0,_e=1;0==(ne.words[0]&_e)&&ve<26;++ve,_e<<=1);if(ve>0)for(ne.iushrn(ve);ve-- >0;)he.isOdd()&&he.iadd(ye),he.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),pe.isub(he)):(ne.isub(K),he.isub(pe))}return(ue=0===K.cmpn(1)?pe:he).cmpn(0)<0&&ue.iadd(G),ue},BN.prototype.gcd=function gcd(G){if(this.isZero())return G.abs();if(G.isZero())return this.abs();var K=this.clone(),ne=G.clone();K.negative=0,ne.negative=0;for(var ue=0;K.isEven()&&ne.isEven();ue++)K.iushrn(1),ne.iushrn(1);for(;;){for(;K.isEven();)K.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var pe=K.cmp(ne);if(pe<0){var he=K;K=ne,ne=he}else if(0===pe||0===ne.cmpn(1))break;K.isub(ne)}return ne.iushln(ue)},BN.prototype.invm=function invm(G){return this.egcd(G).a.umod(G)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(G){return this.words[0]&G},BN.prototype.bincn=function bincn(G){assert("number"==typeof G);var K=G%26,ne=(G-K)/26,ue=1<<K;if(this.length<=ne)return this._expand(ne+1),this.words[ne]|=ue,this;for(var pe=ue,he=ne;0!==pe&&he<this.length;he++){var ye=0|this.words[he];pe=(ye+=pe)>>>26,ye&=67108863,this.words[he]=ye}return 0!==pe&&(this.words[he]=pe,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(G){var K,ne=G<0;if(0!==this.negative&&!ne)return-1;if(0===this.negative&&ne)return 1;if(this.strip(),this.length>1)K=1;else{ne&&(G=-G),assert(G<=67108863,"Number is too big");var ue=0|this.words[0];K=ue===G?0:ue<G?-1:1}return 0!==this.negative?0|-K:K},BN.prototype.cmp=function cmp(G){if(0!==this.negative&&0===G.negative)return-1;if(0===this.negative&&0!==G.negative)return 1;var K=this.ucmp(G);return 0!==this.negative?0|-K:K},BN.prototype.ucmp=function ucmp(G){if(this.length>G.length)return 1;if(this.length<G.length)return-1;for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=0|this.words[ne],pe=0|G.words[ne];if(ue!==pe){ue<pe?K=-1:ue>pe&&(K=1);break}}return K},BN.prototype.gtn=function gtn(G){return 1===this.cmpn(G)},BN.prototype.gt=function gt(G){return 1===this.cmp(G)},BN.prototype.gten=function gten(G){return this.cmpn(G)>=0},BN.prototype.gte=function gte(G){return this.cmp(G)>=0},BN.prototype.ltn=function ltn(G){return-1===this.cmpn(G)},BN.prototype.lt=function lt(G){return-1===this.cmp(G)},BN.prototype.lten=function lten(G){return this.cmpn(G)<=0},BN.prototype.lte=function lte(G){return this.cmp(G)<=0},BN.prototype.eqn=function eqn(G){return 0===this.cmpn(G)},BN.prototype.eq=function eq(G){return 0===this.cmp(G)},BN.red=function red(G){return new Red(G)},BN.prototype.toRed=function toRed(G){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),G.convertTo(this)._forceRed(G)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(G){return this.red=G,this},BN.prototype.forceRed=function forceRed(G){return assert(!this.red,"Already a number in reduction context"),this._forceRed(G)},BN.prototype.redAdd=function redAdd(G){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,G)},BN.prototype.redIAdd=function redIAdd(G){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,G)},BN.prototype.redSub=function redSub(G){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,G)},BN.prototype.redISub=function redISub(G){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,G)},BN.prototype.redShl=function redShl(G){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,G)},BN.prototype.redMul=function redMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.mul(this,G)},BN.prototype.redIMul=function redIMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.imul(this,G)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(G){return assert(this.red&&!G.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,G)};var me={k256:null,p224:null,p192:null,p25519:null};function MPrime(G,K){this.name=G,this.p=new BN(K,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(G){if("string"==typeof G){var K=BN._prime(G);this.m=K.p,this.prime=K}else assert(G.gtn(1),"modulus must be greater than 1"),this.m=G,this.prime=null}function Mont(G){Red.call(this,G),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(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)}MPrime.prototype._tmp=function _tmp(){var G=new BN(null);return G.words=new Array(Math.ceil(this.n/13)),G},MPrime.prototype.ireduce=function ireduce(G){var K,ne=G;do{this.split(ne,this.tmp),K=(ne=(ne=this.imulK(ne)).iadd(this.tmp)).bitLength()}while(K>this.n);var ue=K<this.n?-1:ne.ucmp(this.p);return 0===ue?(ne.words[0]=0,ne.length=1):ue>0?ne.isub(this.p):void 0!==ne.strip?ne.strip():ne._strip(),ne},MPrime.prototype.split=function split(G,K){G.iushrn(this.n,0,K)},MPrime.prototype.imulK=function imulK(G){return G.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(G,K){for(var ne=4194303,ue=Math.min(G.length,9),pe=0;pe<ue;pe++)K.words[pe]=G.words[pe];if(K.length=ue,G.length<=9)return G.words[0]=0,void(G.length=1);var he=G.words[9];for(K.words[K.length++]=he&ne,pe=10;pe<G.length;pe++){var ye=0|G.words[pe];G.words[pe-10]=(ye&ne)<<4|he>>>22,he=ye}he>>>=22,G.words[pe-10]=he,0===he&&G.length>10?G.length-=10:G.length-=9},K256.prototype.imulK=function imulK(G){G.words[G.length]=0,G.words[G.length+1]=0,G.length+=2;for(var K=0,ne=0;ne<G.length;ne++){var ue=0|G.words[ne];K+=977*ue,G.words[ne]=67108863&K,K=64*ue+(K/67108864|0)}return 0===G.words[G.length-1]&&(G.length--,0===G.words[G.length-1]&&G.length--),G},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(G){for(var K=0,ne=0;ne<G.length;ne++){var ue=19*(0|G.words[ne])+K,pe=67108863&ue;ue>>>=26,G.words[ne]=pe,K=ue}return 0!==K&&(G.words[G.length++]=K),G},BN._prime=function prime(G){if(me[G])return me[G];var prime;if("k256"===G)prime=new K256;else if("p224"===G)prime=new P224;else if("p192"===G)prime=new P192;else{if("p25519"!==G)throw new Error("Unknown prime "+G);prime=new P25519}return me[G]=prime,prime},Red.prototype._verify1=function _verify1(G){assert(0===G.negative,"red works only with positives"),assert(G.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(G,K){assert(0==(G.negative|K.negative),"red works only with positives"),assert(G.red&&G.red===K.red,"red works only with red numbers")},Red.prototype.imod=function imod(G){return this.prime?this.prime.ireduce(G)._forceRed(this):G.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(G){return G.isZero()?G.clone():this.m.sub(G)._forceRed(this)},Red.prototype.add=function add(G,K){this._verify2(G,K);var ne=G.add(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Red.prototype.iadd=function iadd(G,K){this._verify2(G,K);var ne=G.iadd(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Red.prototype.sub=function sub(G,K){this._verify2(G,K);var ne=G.sub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Red.prototype.isub=function isub(G,K){this._verify2(G,K);var ne=G.isub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Red.prototype.shl=function shl(G,K){return this._verify1(G),this.imod(G.ushln(K))},Red.prototype.imul=function imul(G,K){return this._verify2(G,K),this.imod(G.imul(K))},Red.prototype.mul=function mul(G,K){return this._verify2(G,K),this.imod(G.mul(K))},Red.prototype.isqr=function isqr(G){return this.imul(G,G.clone())},Red.prototype.sqr=function sqr(G){return this.mul(G,G)},Red.prototype.sqrt=function sqrt(G){if(G.isZero())return G.clone();var K=this.m.andln(3);if(assert(K%2==1),3===K){var ne=this.m.add(new BN(1)).iushrn(2);return this.pow(G,ne)}for(var ue=this.m.subn(1),pe=0;!ue.isZero()&&0===ue.andln(1);)pe++,ue.iushrn(1);assert(!ue.isZero());var he=new BN(1).toRed(this),ye=he.redNeg(),me=this.m.subn(1).iushrn(1),be=this.m.bitLength();for(be=new BN(2*be*be).toRed(this);0!==this.pow(be,me).cmp(ye);)be.redIAdd(ye);for(var ve=this.pow(be,ue),_e=this.pow(G,ue.addn(1).iushrn(1)),Te=this.pow(G,ue),Ee=pe;0!==Te.cmp(he);){for(var Pe=Te,Se=0;0!==Pe.cmp(he);Se++)Pe=Pe.redSqr();assert(Se<Ee);var Ce=this.pow(ve,new BN(1).iushln(Ee-Se-1));_e=_e.redMul(Ce),ve=Ce.redSqr(),Te=Te.redMul(ve),Ee=Se}return _e},Red.prototype.invm=function invm(G){var K=G._invmp(this.m);return 0!==K.negative?(K.negative=0,this.imod(K).redNeg()):this.imod(K)},Red.prototype.pow=function pow(G,K){if(K.isZero())return new BN(1).toRed(this);if(0===K.cmpn(1))return G.clone();var ne=new Array(16);ne[0]=new BN(1).toRed(this),ne[1]=G;for(var ue=2;ue<ne.length;ue++)ne[ue]=this.mul(ne[ue-1],G);var pe=ne[0],he=0,ye=0,me=K.bitLength()%26;for(0===me&&(me=26),ue=K.length-1;ue>=0;ue--){for(var be=K.words[ue],ve=me-1;ve>=0;ve--){var _e=be>>ve&1;pe!==ne[0]&&(pe=this.sqr(pe)),0!==_e||0!==he?(he<<=1,he|=_e,(4===++ye||0===ue&&0===ve)&&(pe=this.mul(pe,ne[he]),ye=0,he=0)):ye=0}me=26}return pe},Red.prototype.convertTo=function convertTo(G){var K=G.umod(this.m);return K===G?K.clone():K},Red.prototype.convertFrom=function convertFrom(G){var K=G.clone();return K.red=null,K},BN.mont=function mont(G){return new Mont(G)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(G){return this.imod(G.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(G){var K=this.imod(G.mul(this.rinv));return K.red=null,K},Mont.prototype.imul=function imul(G,K){if(G.isZero()||K.isZero())return G.words[0]=0,G.length=1,G;var ne=G.imul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.mul=function mul(G,K){if(G.isZero()||K.isZero())return new BN(0)._forceRed(this);var ne=G.mul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.invm=function invm(G){return this.imod(G._invmp(this.m).mul(this.r2))._forceRed(this)}}(G,pn)}(lf);var pf=lf.exports,hf={};!function(G){var K=G;function zero2(G){return 1===G.length?"0"+G:G}function toHex(G){for(var K="",ne=0;ne<G.length;ne++)K+=zero2(G[ne].toString(16));return K}K.toArray=function toArray(G,K){if(Array.isArray(G))return G.slice();if(!G)return[];var ne=[];if("string"!=typeof G){for(var ue=0;ue<G.length;ue++)ne[ue]=0|G[ue];return ne}if("hex"===K){(G=G.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(G="0"+G);for(ue=0;ue<G.length;ue+=2)ne.push(parseInt(G[ue]+G[ue+1],16))}else for(ue=0;ue<G.length;ue++){var pe=G.charCodeAt(ue),he=pe>>8,ye=255&pe;he?ne.push(he,ye):ne.push(ye)}return ne},K.zero2=zero2,K.toHex=toHex,K.encode=function encode(G,K){return"hex"===K?toHex(G):G}}(hf),function(G){var K=G,ne=pf,ue=tc,pe=hf;K.assert=ue,K.toArray=pe.toArray,K.zero2=pe.zero2,K.toHex=pe.toHex,K.encode=pe.encode,K.getNAF=function getNAF(G,K,ne){var ue,pe=new Array(Math.max(G.bitLength(),ne)+1);for(ue=0;ue<pe.length;ue+=1)pe[ue]=0;var he=1<<K+1,ye=G.clone();for(ue=0;ue<pe.length;ue++){var me,be=ye.andln(he-1);ye.isOdd()?(me=be>(he>>1)-1?(he>>1)-be:be,ye.isubn(me)):me=0,pe[ue]=me,ye.iushrn(1)}return pe},K.getJSF=function getJSF(G,K){var ne=[[],[]];G=G.clone(),K=K.clone();for(var ue,pe=0,he=0;G.cmpn(-pe)>0||K.cmpn(-he)>0;){var ye,me,be=G.andln(3)+pe&3,ve=K.andln(3)+he&3;3===be&&(be=-1),3===ve&&(ve=-1),ye=0==(1&be)?0:3!==(ue=G.andln(7)+pe&7)&&5!==ue||2!==ve?be:-be,ne[0].push(ye),me=0==(1&ve)?0:3!==(ue=K.andln(7)+he&7)&&5!==ue||2!==be?ve:-ve,ne[1].push(me),2*pe===ye+1&&(pe=1-pe),2*he===me+1&&(he=1-he),G.iushrn(1),K.iushrn(1)}return ne},K.cachedProperty=function cachedProperty(G,K,ne){var ue="_"+K;G.prototype[K]=function cachedProperty(){return void 0!==this[ue]?this[ue]:this[ue]=ne.call(this)}},K.parseBytes=function parseBytes(G){return"string"==typeof G?K.toArray(G,"hex"):G},K.intFromLE=function intFromLE(G){return new ne(G,"hex","le")}}(ff);var yf,mf={exports:{}},bf=getAugmentedNamespace$1(Object.freeze({__proto__:null,default:{}}));function Rand(G){this.rand=G}if(mf.exports=function rand(G){return yf||(yf=new Rand(null)),yf.generate(G)},mf.exports.Rand=Rand,Rand.prototype.generate=function generate(G){return this._rand(G)},Rand.prototype._rand=function _rand(G){if(this.rand.getBytes)return this.rand.getBytes(G);for(var K=new Uint8Array(G),ne=0;ne<K.length;ne++)K[ne]=this.rand.getByte();return K},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function _rand(G){var K=new Uint8Array(G);return self.crypto.getRandomValues(K),K}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function _rand(G){var K=new Uint8Array(G);return self.msCrypto.getRandomValues(K),K}:"object"==typeof window&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var gf=bf;if("function"!=typeof gf.randomBytes)throw new Error("Not supported");Rand.prototype._rand=function _rand(G){return gf.randomBytes(G)}}catch(e){}var vf=mf.exports,wf={},_f=pf,Tf=ff,Af=Tf.getNAF,Ef=Tf.getJSF,Pf=Tf.assert;function BaseCurve$1(G,K){this.type=G,this.p=new _f(K.p,16),this.red=K.prime?_f.red(K.prime):_f.mont(this.p),this.zero=new _f(0).toRed(this.red),this.one=new _f(1).toRed(this.red),this.two=new _f(2).toRed(this.red),this.n=K.n&&new _f(K.n,16),this.g=K.g&&this.pointFromJSON(K.g,K.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 ne=this.n&&this.p.div(this.n);!ne||ne.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Sf=BaseCurve$1;function BasePoint$1(G,K){this.curve=G,this.type=K,this.precomputed=null}BaseCurve$1.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve$1.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve$1.prototype._fixedNafMul=function _fixedNafMul(G,K){Pf(G.precomputed);var ne=G._getDoubles(),ue=Af(K,1,this._bitLength),pe=(1<<ne.step+1)-(ne.step%2==0?2:1);pe/=3;var he,ye,me=[];for(he=0;he<ue.length;he+=ne.step){ye=0;for(var be=he+ne.step-1;be>=he;be--)ye=(ye<<1)+ue[be];me.push(ye)}for(var ve=this.jpoint(null,null,null),_e=this.jpoint(null,null,null),Te=pe;Te>0;Te--){for(he=0;he<me.length;he++)(ye=me[he])===Te?_e=_e.mixedAdd(ne.points[he]):ye===-Te&&(_e=_e.mixedAdd(ne.points[he].neg()));ve=ve.add(_e)}return ve.toP()},BaseCurve$1.prototype._wnafMul=function _wnafMul(G,K){var ne=4,ue=G._getNAFPoints(ne);ne=ue.wnd;for(var pe=ue.points,he=Af(K,ne,this._bitLength),ye=this.jpoint(null,null,null),me=he.length-1;me>=0;me--){for(var be=0;me>=0&&0===he[me];me--)be++;if(me>=0&&be++,ye=ye.dblp(be),me<0)break;var ve=he[me];Pf(0!==ve),ye="affine"===G.type?ve>0?ye.mixedAdd(pe[ve-1>>1]):ye.mixedAdd(pe[-ve-1>>1].neg()):ve>0?ye.add(pe[ve-1>>1]):ye.add(pe[-ve-1>>1].neg())}return"affine"===G.type?ye.toP():ye},BaseCurve$1.prototype._wnafMulAdd=function _wnafMulAdd(G,K,ne,ue,pe){var he,ye,me,be=this._wnafT1,ve=this._wnafT2,_e=this._wnafT3,Te=0;for(he=0;he<ue;he++){var Ee=(me=K[he])._getNAFPoints(G);be[he]=Ee.wnd,ve[he]=Ee.points}for(he=ue-1;he>=1;he-=2){var Pe=he-1,Se=he;if(1===be[Pe]&&1===be[Se]){var Ce=[K[Pe],null,null,K[Se]];0===K[Pe].y.cmp(K[Se].y)?(Ce[1]=K[Pe].add(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg())):0===K[Pe].y.cmp(K[Se].y.redNeg())?(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].add(K[Se].neg())):(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg()));var ke=[-3,-1,-5,-7,0,7,5,1,3],Oe=Ef(ne[Pe],ne[Se]);for(Te=Math.max(Oe[0].length,Te),_e[Pe]=new Array(Te),_e[Se]=new Array(Te),ye=0;ye<Te;ye++){var xe=0|Oe[0][ye],Ne=0|Oe[1][ye];_e[Pe][ye]=ke[3*(xe+1)+(Ne+1)],_e[Se][ye]=0,ve[Pe]=Ce}}else _e[Pe]=Af(ne[Pe],be[Pe],this._bitLength),_e[Se]=Af(ne[Se],be[Se],this._bitLength),Te=Math.max(_e[Pe].length,Te),Te=Math.max(_e[Se].length,Te)}var Me=this.jpoint(null,null,null),Be=this._wnafT4;for(he=Te;he>=0;he--){for(var Fe=0;he>=0;){var De=!0;for(ye=0;ye<ue;ye++)Be[ye]=0|_e[ye][he],0!==Be[ye]&&(De=!1);if(!De)break;Fe++,he--}if(he>=0&&Fe++,Me=Me.dblp(Fe),he<0)break;for(ye=0;ye<ue;ye++){var Le=Be[ye];0!==Le&&(Le>0?me=ve[ye][Le-1>>1]:Le<0&&(me=ve[ye][-Le-1>>1].neg()),Me="affine"===me.type?Me.mixedAdd(me):Me.add(me))}}for(he=0;he<ue;he++)ve[he]=null;return pe?Me:Me.toP()},BaseCurve$1.BasePoint=BasePoint$1,BasePoint$1.prototype.eq=function eq(){throw new Error("Not implemented")},BasePoint$1.prototype.validate=function validate(){return this.curve.validate(this)},BaseCurve$1.prototype.decodePoint=function decodePoint(G,K){G=Tf.toArray(G,K);var ne=this.p.byteLength();if((4===G[0]||6===G[0]||7===G[0])&&G.length-1==2*ne)return 6===G[0]?Pf(G[G.length-1]%2==0):7===G[0]&&Pf(G[G.length-1]%2==1),this.point(G.slice(1,1+ne),G.slice(1+ne,1+2*ne));if((2===G[0]||3===G[0])&&G.length-1===ne)return this.pointFromX(G.slice(1,1+ne),3===G[0]);throw new Error("Unknown point format")},BasePoint$1.prototype.encodeCompressed=function encodeCompressed(G){return this.encode(G,!0)},BasePoint$1.prototype._encode=function _encode(G){var K=this.curve.p.byteLength(),ne=this.getX().toArray("be",K);return G?[this.getY().isEven()?2:3].concat(ne):[4].concat(ne,this.getY().toArray("be",K))},BasePoint$1.prototype.encode=function encode(G,K){return Tf.encode(this._encode(K),G)},BasePoint$1.prototype.precompute=function precompute(G){if(this.precomputed)return this;var K={doubles:null,naf:null,beta:null};return K.naf=this._getNAFPoints(8),K.doubles=this._getDoubles(4,G),K.beta=this._getBeta(),this.precomputed=K,this},BasePoint$1.prototype._hasDoubles=function _hasDoubles(G){if(!this.precomputed)return!1;var K=this.precomputed.doubles;return!!K&&K.points.length>=Math.ceil((G.bitLength()+1)/K.step)},BasePoint$1.prototype._getDoubles=function _getDoubles(G,K){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ne=[this],ue=this,pe=0;pe<K;pe+=G){for(var he=0;he<G;he++)ue=ue.dbl();ne.push(ue)}return{step:G,points:ne}},BasePoint$1.prototype._getNAFPoints=function _getNAFPoints(G){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var K=[this],ne=(1<<G)-1,ue=1===ne?null:this.dbl(),pe=1;pe<ne;pe++)K[pe]=K[pe-1].add(ue);return{wnd:G,points:K}},BasePoint$1.prototype._getBeta=function _getBeta(){return null},BasePoint$1.prototype.dblp=function dblp(G){for(var K=this,ne=0;ne<G;ne++)K=K.dbl();return K};var If=pf,Cf=nc,Rf=Sf,kf=ff.assert;function ShortCurve$1(G){Rf.call(this,"short",G),this.a=new If(G.a,16).toRed(this.red),this.b=new If(G.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(G),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Cf(ShortCurve$1,Rf);var Of=ShortCurve$1;function Point$5(G,K,ne,ue){Rf.BasePoint.call(this,G,"affine"),null===K&&null===ne?(this.x=null,this.y=null,this.inf=!0):(this.x=new If(K,16),this.y=new If(ne,16),ue&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint$1(G,K,ne,ue){Rf.BasePoint.call(this,G,"jacobian"),null===K&&null===ne&&null===ue?(this.x=this.curve.one,this.y=this.curve.one,this.z=new If(0)):(this.x=new If(K,16),this.y=new If(ne,16),this.z=new If(ue,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}ShortCurve$1.prototype._getEndomorphism=function _getEndomorphism(G){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var K,ne;if(G.beta)K=new If(G.beta,16).toRed(this.red);else{var ue=this._getEndoRoots(this.p);K=(K=ue[0].cmp(ue[1])<0?ue[0]:ue[1]).toRed(this.red)}if(G.lambda)ne=new If(G.lambda,16);else{var pe=this._getEndoRoots(this.n);0===this.g.mul(pe[0]).x.cmp(this.g.x.redMul(K))?ne=pe[0]:(ne=pe[1],kf(0===this.g.mul(ne).x.cmp(this.g.x.redMul(K))))}return{beta:K,lambda:ne,basis:G.basis?G.basis.map((function(G){return{a:new If(G.a,16),b:new If(G.b,16)}})):this._getEndoBasis(ne)}}},ShortCurve$1.prototype._getEndoRoots=function _getEndoRoots(G){var K=G===this.p?this.red:If.mont(G),ne=new If(2).toRed(K).redInvm(),ue=ne.redNeg(),pe=new If(3).toRed(K).redNeg().redSqrt().redMul(ne);return[ue.redAdd(pe).fromRed(),ue.redSub(pe).fromRed()]},ShortCurve$1.prototype._getEndoBasis=function _getEndoBasis(G){for(var K,ne,ue,pe,he,ye,me,be,ve,_e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),Te=G,Ee=this.n.clone(),Pe=new If(1),Se=new If(0),Ce=new If(0),ke=new If(1),Oe=0;0!==Te.cmpn(0);){var xe=Ee.div(Te);be=Ee.sub(xe.mul(Te)),ve=Ce.sub(xe.mul(Pe));var Ne=ke.sub(xe.mul(Se));if(!ue&&be.cmp(_e)<0)K=me.neg(),ne=Pe,ue=be.neg(),pe=ve;else if(ue&&2==++Oe)break;me=be,Ee=Te,Te=be,Ce=Pe,Pe=ve,ke=Se,Se=Ne}he=be.neg(),ye=ve;var Me=ue.sqr().add(pe.sqr());return he.sqr().add(ye.sqr()).cmp(Me)>=0&&(he=K,ye=ne),ue.negative&&(ue=ue.neg(),pe=pe.neg()),he.negative&&(he=he.neg(),ye=ye.neg()),[{a:ue,b:pe},{a:he,b:ye}]},ShortCurve$1.prototype._endoSplit=function _endoSplit(G){var K=this.endo.basis,ne=K[0],ue=K[1],pe=ue.b.mul(G).divRound(this.n),he=ne.b.neg().mul(G).divRound(this.n),ye=pe.mul(ne.a),me=he.mul(ue.a),be=pe.mul(ne.b),ve=he.mul(ue.b);return{k1:G.sub(ye).sub(me),k2:be.add(ve).neg()}},ShortCurve$1.prototype.pointFromX=function pointFromX(G,K){(G=new If(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr().redMul(G).redIAdd(G.redMul(this.a)).redIAdd(this.b),ue=ne.redSqrt();if(0!==ue.redSqr().redSub(ne).cmp(this.zero))throw new Error("invalid point");var pe=ue.fromRed().isOdd();return(K&&!pe||!K&&pe)&&(ue=ue.redNeg()),this.point(G,ue)},ShortCurve$1.prototype.validate=function validate(G){if(G.inf)return!0;var K=G.x,ne=G.y,ue=this.a.redMul(K),pe=K.redSqr().redMul(K).redIAdd(ue).redIAdd(this.b);return 0===ne.redSqr().redISub(pe).cmpn(0)},ShortCurve$1.prototype._endoWnafMulAdd=function _endoWnafMulAdd(G,K,ne){for(var ue=this._endoWnafT1,pe=this._endoWnafT2,he=0;he<G.length;he++){var ye=this._endoSplit(K[he]),me=G[he],be=me._getBeta();ye.k1.negative&&(ye.k1.ineg(),me=me.neg(!0)),ye.k2.negative&&(ye.k2.ineg(),be=be.neg(!0)),ue[2*he]=me,ue[2*he+1]=be,pe[2*he]=ye.k1,pe[2*he+1]=ye.k2}for(var ve=this._wnafMulAdd(1,ue,pe,2*he,ne),_e=0;_e<2*he;_e++)ue[_e]=null,pe[_e]=null;return ve},Cf(Point$5,Rf.BasePoint),ShortCurve$1.prototype.point=function point(G,K,ne){return new Point$5(this,G,K,ne)},ShortCurve$1.prototype.pointFromJSON=function pointFromJSON(G,K){return Point$5.fromJSON(this,G,K)},Point$5.prototype._getBeta=function _getBeta(){if(this.curve.endo){var G=this.precomputed;if(G&&G.beta)return G.beta;var K=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(G){var ne=this.curve,endoMul=function(G){return ne.point(G.x.redMul(ne.endo.beta),G.y)};G.beta=K,K.precomputed={beta:null,naf:G.naf&&{wnd:G.naf.wnd,points:G.naf.points.map(endoMul)},doubles:G.doubles&&{step:G.doubles.step,points:G.doubles.points.map(endoMul)}}}return K}},Point$5.prototype.toJSON=function toJSON(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$5.fromJSON=function fromJSON(G,K,ne){"string"==typeof K&&(K=JSON.parse(K));var ue=G.point(K[0],K[1],ne);if(!K[2])return ue;function obj2point(K){return G.point(K[0],K[1],ne)}var pe=K[2];return ue.precomputed={beta:null,doubles:pe.doubles&&{step:pe.doubles.step,points:[ue].concat(pe.doubles.points.map(obj2point))},naf:pe.naf&&{wnd:pe.naf.wnd,points:[ue].concat(pe.naf.points.map(obj2point))}},ue},Point$5.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$5.prototype.isInfinity=function isInfinity(){return this.inf},Point$5.prototype.add=function add(G){if(this.inf)return G;if(G.inf)return this;if(this.eq(G))return this.dbl();if(this.neg().eq(G))return this.curve.point(null,null);if(0===this.x.cmp(G.x))return this.curve.point(null,null);var K=this.y.redSub(G.y);0!==K.cmpn(0)&&(K=K.redMul(this.x.redSub(G.x).redInvm()));var ne=K.redSqr().redISub(this.x).redISub(G.x),ue=K.redMul(this.x.redSub(ne)).redISub(this.y);return this.curve.point(ne,ue)},Point$5.prototype.dbl=function dbl(){if(this.inf)return this;var G=this.y.redAdd(this.y);if(0===G.cmpn(0))return this.curve.point(null,null);var K=this.curve.a,ne=this.x.redSqr(),ue=G.redInvm(),pe=ne.redAdd(ne).redIAdd(ne).redIAdd(K).redMul(ue),he=pe.redSqr().redISub(this.x.redAdd(this.x)),ye=pe.redMul(this.x.redSub(he)).redISub(this.y);return this.curve.point(he,ye)},Point$5.prototype.getX=function getX(){return this.x.fromRed()},Point$5.prototype.getY=function getY(){return this.y.fromRed()},Point$5.prototype.mul=function mul(G){return G=new If(G,16),this.isInfinity()?this:this._hasDoubles(G)?this.curve._fixedNafMul(this,G):this.curve.endo?this.curve._endoWnafMulAdd([this],[G]):this.curve._wnafMul(this,G)},Point$5.prototype.mulAdd=function mulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe):this.curve._wnafMulAdd(1,ue,pe,2)},Point$5.prototype.jmulAdd=function jmulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe,!0):this.curve._wnafMulAdd(1,ue,pe,2,!0)},Point$5.prototype.eq=function eq(G){return this===G||this.inf===G.inf&&(this.inf||0===this.x.cmp(G.x)&&0===this.y.cmp(G.y))},Point$5.prototype.neg=function neg(G){if(this.inf)return this;var K=this.curve.point(this.x,this.y.redNeg());if(G&&this.precomputed){var ne=this.precomputed,negate=function(G){return G.neg()};K.precomputed={naf:ne.naf&&{wnd:ne.naf.wnd,points:ne.naf.points.map(negate)},doubles:ne.doubles&&{step:ne.doubles.step,points:ne.doubles.points.map(negate)}}}return K},Point$5.prototype.toJ=function toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Cf(JPoint$1,Rf.BasePoint),ShortCurve$1.prototype.jpoint=function jpoint(G,K,ne){return new JPoint$1(this,G,K,ne)},JPoint$1.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var G=this.z.redInvm(),K=G.redSqr(),ne=this.x.redMul(K),ue=this.y.redMul(K).redMul(G);return this.curve.point(ne,ue)},JPoint$1.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint$1.prototype.add=function add(G){if(this.isInfinity())return G;if(G.isInfinity())return this;var K=G.z.redSqr(),ne=this.z.redSqr(),ue=this.x.redMul(K),pe=G.x.redMul(ne),he=this.y.redMul(K.redMul(G.z)),ye=G.y.redMul(ne.redMul(this.z)),me=ue.redSub(pe),be=he.redSub(ye);if(0===me.cmpn(0))return 0!==be.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var ve=me.redSqr(),_e=ve.redMul(me),Te=ue.redMul(ve),Ee=be.redSqr().redIAdd(_e).redISub(Te).redISub(Te),Pe=be.redMul(Te.redISub(Ee)).redISub(he.redMul(_e)),Se=this.z.redMul(G.z).redMul(me);return this.curve.jpoint(Ee,Pe,Se)},JPoint$1.prototype.mixedAdd=function mixedAdd(G){if(this.isInfinity())return G.toJ();if(G.isInfinity())return this;var K=this.z.redSqr(),ne=this.x,ue=G.x.redMul(K),pe=this.y,he=G.y.redMul(K).redMul(this.z),ye=ne.redSub(ue),me=pe.redSub(he);if(0===ye.cmpn(0))return 0!==me.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var be=ye.redSqr(),ve=be.redMul(ye),_e=ne.redMul(be),Te=me.redSqr().redIAdd(ve).redISub(_e).redISub(_e),Ee=me.redMul(_e.redISub(Te)).redISub(pe.redMul(ve)),Pe=this.z.redMul(ye);return this.curve.jpoint(Te,Ee,Pe)},JPoint$1.prototype.dblp=function dblp(G){if(0===G)return this;if(this.isInfinity())return this;if(!G)return this.dbl();var K;if(this.curve.zeroA||this.curve.threeA){var ne=this;for(K=0;K<G;K++)ne=ne.dbl();return ne}var ue=this.curve.a,pe=this.curve.tinv,he=this.x,ye=this.y,me=this.z,be=me.redSqr().redSqr(),ve=ye.redAdd(ye);for(K=0;K<G;K++){var _e=he.redSqr(),Te=ve.redSqr(),Ee=Te.redSqr(),Pe=_e.redAdd(_e).redIAdd(_e).redIAdd(ue.redMul(be)),Se=he.redMul(Te),Ce=Pe.redSqr().redISub(Se.redAdd(Se)),ke=Se.redISub(Ce),Oe=Pe.redMul(ke);Oe=Oe.redIAdd(Oe).redISub(Ee);var xe=ve.redMul(me);K+1<G&&(be=be.redMul(Ee)),he=Ce,me=xe,ve=Oe}return this.curve.jpoint(he,ve.redMul(pe),me)},JPoint$1.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint$1.prototype._zeroDbl=function _zeroDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue),be=me.redSqr().redISub(ye).redISub(ye),ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),G=be,K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.x.redSqr(),Te=this.y.redSqr(),Ee=Te.redSqr(),Pe=this.x.redAdd(Te).redSqr().redISub(_e).redISub(Ee);Pe=Pe.redIAdd(Pe);var Se=_e.redAdd(_e).redIAdd(_e),Ce=Se.redSqr(),ke=Ee.redIAdd(Ee);ke=(ke=ke.redIAdd(ke)).redIAdd(ke),G=Ce.redISub(Pe).redISub(Pe),K=Se.redMul(Pe.redISub(G)).redISub(ke),ne=(ne=this.y.redMul(this.z)).redIAdd(ne)}return this.curve.jpoint(G,K,ne)},JPoint$1.prototype._threeDbl=function _threeDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue).redIAdd(this.curve.a),be=me.redSqr().redISub(ye).redISub(ye);G=be;var ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.z.redSqr(),Te=this.y.redSqr(),Ee=this.x.redMul(Te),Pe=this.x.redSub(_e).redMul(this.x.redAdd(_e));Pe=Pe.redAdd(Pe).redIAdd(Pe);var Se=Ee.redIAdd(Ee),Ce=(Se=Se.redIAdd(Se)).redAdd(Se);G=Pe.redSqr().redISub(Ce),ne=this.y.redAdd(this.z).redSqr().redISub(Te).redISub(_e);var ke=Te.redSqr();ke=(ke=(ke=ke.redIAdd(ke)).redIAdd(ke)).redIAdd(ke),K=Pe.redMul(Se.redISub(G)).redISub(ke)}return this.curve.jpoint(G,K,ne)},JPoint$1.prototype._dbl=function _dbl(){var G=this.curve.a,K=this.x,ne=this.y,ue=this.z,pe=ue.redSqr().redSqr(),he=K.redSqr(),ye=ne.redSqr(),me=he.redAdd(he).redIAdd(he).redIAdd(G.redMul(pe)),be=K.redAdd(K),ve=(be=be.redIAdd(be)).redMul(ye),_e=me.redSqr().redISub(ve.redAdd(ve)),Te=ve.redISub(_e),Ee=ye.redSqr();Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=me.redMul(Te).redISub(Ee),Se=ne.redAdd(ne).redMul(ue);return this.curve.jpoint(_e,Pe,Se)},JPoint$1.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var G=this.x.redSqr(),K=this.y.redSqr(),ne=this.z.redSqr(),ue=K.redSqr(),pe=G.redAdd(G).redIAdd(G),he=pe.redSqr(),ye=this.x.redAdd(K).redSqr().redISub(G).redISub(ue),me=(ye=(ye=(ye=ye.redIAdd(ye)).redAdd(ye).redIAdd(ye)).redISub(he)).redSqr(),be=ue.redIAdd(ue);be=(be=(be=be.redIAdd(be)).redIAdd(be)).redIAdd(be);var ve=pe.redIAdd(ye).redSqr().redISub(he).redISub(me).redISub(be),_e=K.redMul(ve);_e=(_e=_e.redIAdd(_e)).redIAdd(_e);var Te=this.x.redMul(me).redISub(_e);Te=(Te=Te.redIAdd(Te)).redIAdd(Te);var Ee=this.y.redMul(ve.redMul(be.redISub(ve)).redISub(ye.redMul(me)));Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=this.z.redAdd(ye).redSqr().redISub(ne).redISub(me);return this.curve.jpoint(Te,Ee,Pe)},JPoint$1.prototype.mul=function mul(G,K){return G=new If(G,K),this.curve._wnafMul(this,G)},JPoint$1.prototype.eq=function eq(G){if("affine"===G.type)return this.eq(G.toJ());if(this===G)return!0;var K=this.z.redSqr(),ne=G.z.redSqr();if(0!==this.x.redMul(ne).redISub(G.x.redMul(K)).cmpn(0))return!1;var ue=K.redMul(this.z),pe=ne.redMul(G.z);return 0===this.y.redMul(pe).redISub(G.y.redMul(ue)).cmpn(0)},JPoint$1.prototype.eqXToP=function eqXToP(G){var K=this.z.redSqr(),ne=G.toRed(this.curve.red).redMul(K);if(0===this.x.cmp(ne))return!0;for(var ue=G.clone(),pe=this.curve.redN.redMul(K);;){if(ue.iadd(this.curve.n),ue.cmp(this.curve.p)>=0)return!1;if(ne.redIAdd(pe),0===this.x.cmp(ne))return!0}},JPoint$1.prototype.inspect=function inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint$1.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)};var xf=pf,Nf=nc,Mf=Sf,Bf=ff;function MontCurve$1(G){Mf.call(this,"mont",G),this.a=new xf(G.a,16).toRed(this.red),this.b=new xf(G.b,16).toRed(this.red),this.i4=new xf(4).toRed(this.red).redInvm(),this.two=new xf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Nf(MontCurve$1,Mf);var Ff=MontCurve$1;function Point$4(G,K,ne){Mf.BasePoint.call(this,G,"projective"),null===K&&null===ne?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new xf(K,16),this.z=new xf(ne,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}MontCurve$1.prototype.validate=function validate(G){var K=G.normalize().x,ne=K.redSqr(),ue=ne.redMul(K).redAdd(ne.redMul(this.a)).redAdd(K);return 0===ue.redSqrt().redSqr().cmp(ue)},Nf(Point$4,Mf.BasePoint),MontCurve$1.prototype.decodePoint=function decodePoint(G,K){return this.point(Bf.toArray(G,K),1)},MontCurve$1.prototype.point=function point(G,K){return new Point$4(this,G,K)},MontCurve$1.prototype.pointFromJSON=function pointFromJSON(G){return Point$4.fromJSON(this,G)},Point$4.prototype.precompute=function precompute(){},Point$4.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$4.fromJSON=function fromJSON(G,K){return new Point$4(G,K[0],K[1]||G.one)},Point$4.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$4.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)},Point$4.prototype.dbl=function dbl(){var G=this.x.redAdd(this.z).redSqr(),K=this.x.redSub(this.z).redSqr(),ne=G.redSub(K),ue=G.redMul(K),pe=ne.redMul(K.redAdd(this.curve.a24.redMul(ne)));return this.curve.point(ue,pe)},Point$4.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")},Point$4.prototype.diffAdd=function diffAdd(G,K){var ne=this.x.redAdd(this.z),ue=this.x.redSub(this.z),pe=G.x.redAdd(G.z),he=G.x.redSub(G.z).redMul(ne),ye=pe.redMul(ue),me=K.z.redMul(he.redAdd(ye).redSqr()),be=K.x.redMul(he.redISub(ye).redSqr());return this.curve.point(me,be)},Point$4.prototype.mul=function mul(G){for(var K=G.clone(),ne=this,ue=this.curve.point(null,null),pe=[];0!==K.cmpn(0);K.iushrn(1))pe.push(K.andln(1));for(var he=pe.length-1;he>=0;he--)0===pe[he]?(ne=ne.diffAdd(ue,this),ue=ue.dbl()):(ue=ne.diffAdd(ue,this),ne=ne.dbl());return ue},Point$4.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")},Point$4.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")},Point$4.prototype.eq=function eq(G){return 0===this.getX().cmp(G.getX())},Point$4.prototype.normalize=function normalize(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$4.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()};var Df=pf,Lf=nc,Uf=Sf,$f=ff.assert;function EdwardsCurve$1(G){this.twisted=1!=(0|G.a),this.mOneA=this.twisted&&-1==(0|G.a),this.extended=this.mOneA,Uf.call(this,"edwards",G),this.a=new Df(G.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Df(G.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Df(G.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),$f(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|G.c)}Lf(EdwardsCurve$1,Uf);var qf=EdwardsCurve$1;function Point$3(G,K,ne,ue,pe){Uf.BasePoint.call(this,G,"projective"),null===K&&null===ne&&null===ue?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Df(K,16),this.y=new Df(ne,16),this.z=ue?new Df(ue,16):this.curve.one,this.t=pe&&new Df(pe,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}EdwardsCurve$1.prototype._mulA=function _mulA(G){return this.mOneA?G.redNeg():this.a.redMul(G)},EdwardsCurve$1.prototype._mulC=function _mulC(G){return this.oneC?G:this.c.redMul(G)},EdwardsCurve$1.prototype.jpoint=function jpoint(G,K,ne,ue){return this.point(G,K,ne,ue)},EdwardsCurve$1.prototype.pointFromX=function pointFromX(G,K){(G=new Df(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr(),ue=this.c2.redSub(this.a.redMul(ne)),pe=this.one.redSub(this.c2.redMul(this.d).redMul(ne)),he=ue.redMul(pe.redInvm()),ye=he.redSqrt();if(0!==ye.redSqr().redSub(he).cmp(this.zero))throw new Error("invalid point");var me=ye.fromRed().isOdd();return(K&&!me||!K&&me)&&(ye=ye.redNeg()),this.point(G,ye)},EdwardsCurve$1.prototype.pointFromY=function pointFromY(G,K){(G=new Df(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr(),ue=ne.redSub(this.c2),pe=ne.redMul(this.d).redMul(this.c2).redSub(this.a),he=ue.redMul(pe.redInvm());if(0===he.cmp(this.zero)){if(K)throw new Error("invalid point");return this.point(this.zero,G)}var ye=he.redSqrt();if(0!==ye.redSqr().redSub(he).cmp(this.zero))throw new Error("invalid point");return ye.fromRed().isOdd()!==K&&(ye=ye.redNeg()),this.point(ye,G)},EdwardsCurve$1.prototype.validate=function validate(G){if(G.isInfinity())return!0;G.normalize();var K=G.x.redSqr(),ne=G.y.redSqr(),ue=K.redMul(this.a).redAdd(ne),pe=this.c2.redMul(this.one.redAdd(this.d.redMul(K).redMul(ne)));return 0===ue.cmp(pe)},Lf(Point$3,Uf.BasePoint),EdwardsCurve$1.prototype.pointFromJSON=function pointFromJSON(G){return Point$3.fromJSON(this,G)},EdwardsCurve$1.prototype.point=function point(G,K,ne,ue){return new Point$3(this,G,K,ne,ue)},Point$3.fromJSON=function fromJSON(G,K){return new Point$3(G,K[0],K[1],K[2])},Point$3.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$3.prototype.isInfinity=function isInfinity(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point$3.prototype._extDbl=function _extDbl(){var G=this.x.redSqr(),K=this.y.redSqr(),ne=this.z.redSqr();ne=ne.redIAdd(ne);var ue=this.curve._mulA(G),pe=this.x.redAdd(this.y).redSqr().redISub(G).redISub(K),he=ue.redAdd(K),ye=he.redSub(ne),me=ue.redSub(K),be=pe.redMul(ye),ve=he.redMul(me),_e=pe.redMul(me),Te=ye.redMul(he);return this.curve.point(be,ve,Te,_e)},Point$3.prototype._projDbl=function _projDbl(){var G,K,ne,ue,pe,he,ye=this.x.redAdd(this.y).redSqr(),me=this.x.redSqr(),be=this.y.redSqr();if(this.curve.twisted){var ve=(ue=this.curve._mulA(me)).redAdd(be);this.zOne?(G=ye.redSub(me).redSub(be).redMul(ve.redSub(this.curve.two)),K=ve.redMul(ue.redSub(be)),ne=ve.redSqr().redSub(ve).redSub(ve)):(pe=this.z.redSqr(),he=ve.redSub(pe).redISub(pe),G=ye.redSub(me).redISub(be).redMul(he),K=ve.redMul(ue.redSub(be)),ne=ve.redMul(he))}else ue=me.redAdd(be),pe=this.curve._mulC(this.z).redSqr(),he=ue.redSub(pe).redSub(pe),G=this.curve._mulC(ye.redISub(ue)).redMul(he),K=this.curve._mulC(ue).redMul(me.redISub(be)),ne=ue.redMul(he);return this.curve.point(G,K,ne)},Point$3.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point$3.prototype._extAdd=function _extAdd(G){var K=this.y.redSub(this.x).redMul(G.y.redSub(G.x)),ne=this.y.redAdd(this.x).redMul(G.y.redAdd(G.x)),ue=this.t.redMul(this.curve.dd).redMul(G.t),pe=this.z.redMul(G.z.redAdd(G.z)),he=ne.redSub(K),ye=pe.redSub(ue),me=pe.redAdd(ue),be=ne.redAdd(K),ve=he.redMul(ye),_e=me.redMul(be),Te=he.redMul(be),Ee=ye.redMul(me);return this.curve.point(ve,_e,Ee,Te)},Point$3.prototype._projAdd=function _projAdd(G){var K,ne,ue=this.z.redMul(G.z),pe=ue.redSqr(),he=this.x.redMul(G.x),ye=this.y.redMul(G.y),me=this.curve.d.redMul(he).redMul(ye),be=pe.redSub(me),ve=pe.redAdd(me),_e=this.x.redAdd(this.y).redMul(G.x.redAdd(G.y)).redISub(he).redISub(ye),Te=ue.redMul(be).redMul(_e);return this.curve.twisted?(K=ue.redMul(ve).redMul(ye.redSub(this.curve._mulA(he))),ne=be.redMul(ve)):(K=ue.redMul(ve).redMul(ye.redSub(he)),ne=this.curve._mulC(be).redMul(ve)),this.curve.point(Te,K,ne)},Point$3.prototype.add=function add(G){return this.isInfinity()?G:G.isInfinity()?this:this.curve.extended?this._extAdd(G):this._projAdd(G)},Point$3.prototype.mul=function mul(G){return this._hasDoubles(G)?this.curve._fixedNafMul(this,G):this.curve._wnafMul(this,G)},Point$3.prototype.mulAdd=function mulAdd(G,K,ne){return this.curve._wnafMulAdd(1,[this,K],[G,ne],2,!1)},Point$3.prototype.jmulAdd=function jmulAdd(G,K,ne){return this.curve._wnafMulAdd(1,[this,K],[G,ne],2,!0)},Point$3.prototype.normalize=function normalize(){if(this.zOne)return this;var G=this.z.redInvm();return this.x=this.x.redMul(G),this.y=this.y.redMul(G),this.t&&(this.t=this.t.redMul(G)),this.z=this.curve.one,this.zOne=!0,this},Point$3.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point$3.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()},Point$3.prototype.getY=function getY(){return this.normalize(),this.y.fromRed()},Point$3.prototype.eq=function eq(G){return this===G||0===this.getX().cmp(G.getX())&&0===this.getY().cmp(G.getY())},Point$3.prototype.eqXToP=function eqXToP(G){var K=G.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(K))return!0;for(var ne=G.clone(),ue=this.curve.redN.redMul(this.z);;){if(ne.iadd(this.curve.n),ne.cmp(this.curve.p)>=0)return!1;if(K.redIAdd(ue),0===this.x.cmp(K))return!0}},Point$3.prototype.toP=Point$3.prototype.normalize,Point$3.prototype.mixedAdd=Point$3.prototype.add,function(G){var K=G;K.base=Sf,K.short=Of,K.mont=Ff,K.edwards=qf}(wf);var Gf,jf,Hf={};!function(G){var K,ne=G,ue=Yo,pe=wf,he=ff.assert;function PresetCurve(G){"short"===G.type?this.curve=new pe.short(G):"edwards"===G.type?this.curve=new pe.edwards(G):this.curve=new pe.mont(G),this.g=this.curve.g,this.n=this.curve.n,this.hash=G.hash,he(this.g.validate(),"Invalid curve"),he(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(G,K){Object.defineProperty(ne,G,{configurable:!0,enumerable:!0,get:function(){var ue=new PresetCurve(K);return Object.defineProperty(ne,G,{configurable:!0,enumerable:!0,value:ue}),ue}})}ne.PresetCurve=PresetCurve,defineCurve("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:ue.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("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:ue.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("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:ue.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("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:ue.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"]}),defineCurve("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:ue.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"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ue.sha256,gRed:!1,g:["9"]}),defineCurve("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:ue.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{K=function requireSecp256k1$2(){return jf?Gf:(jf=1,Gf={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}()}catch(G){K=void 0}defineCurve("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:ue.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",K]})}(Hf);var Wf=Yo,zf=hf,Vf=tc;function HmacDRBG$2(G){if(!(this instanceof HmacDRBG$2))return new HmacDRBG$2(G);this.hash=G.hash,this.predResist=!!G.predResist,this.outLen=this.hash.outSize,this.minEntropy=G.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var K=zf.toArray(G.entropy,G.entropyEnc||"hex"),ne=zf.toArray(G.nonce,G.nonceEnc||"hex"),ue=zf.toArray(G.pers,G.persEnc||"hex");Vf(K.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(K,ne,ue)}var Kf=HmacDRBG$2;HmacDRBG$2.prototype._init=function init(G,K,ne){var ue=G.concat(K).concat(ne);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var pe=0;pe<this.V.length;pe++)this.K[pe]=0,this.V[pe]=1;this._update(ue),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG$2.prototype._hmac=function hmac(){return new Wf.hmac(this.hash,this.K)},HmacDRBG$2.prototype._update=function update(G){var K=this._hmac().update(this.V).update([0]);G&&(K=K.update(G)),this.K=K.digest(),this.V=this._hmac().update(this.V).digest(),G&&(this.K=this._hmac().update(this.V).update([1]).update(G).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG$2.prototype.reseed=function reseed(G,K,ne,ue){"string"!=typeof K&&(ue=ne,ne=K,K=null),G=zf.toArray(G,K),ne=zf.toArray(ne,ue),Vf(G.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(G.concat(ne||[])),this._reseed=1},HmacDRBG$2.prototype.generate=function generate(G,K,ne,ue){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof K&&(ue=ne,ne=K,K=null),ne&&(ne=zf.toArray(ne,ue||"hex"),this._update(ne));for(var pe=[];pe.length<G;)this.V=this._hmac().update(this.V).digest(),pe=pe.concat(this.V);var he=pe.slice(0,G);return this._update(ne),this._reseed++,zf.encode(he,K)};var Jf=pf,Xf=ff.assert;function KeyPair$7(G,K){this.ec=G,this.priv=null,this.pub=null,K.priv&&this._importPrivate(K.priv,K.privEnc),K.pub&&this._importPublic(K.pub,K.pubEnc)}var Qf=KeyPair$7;KeyPair$7.fromPublic=function fromPublic(G,K,ne){return K instanceof KeyPair$7?K:new KeyPair$7(G,{pub:K,pubEnc:ne})},KeyPair$7.fromPrivate=function fromPrivate(G,K,ne){return K instanceof KeyPair$7?K:new KeyPair$7(G,{priv:K,privEnc:ne})},KeyPair$7.prototype.validate=function validate(){var G=this.getPublic();return G.isInfinity()?{result:!1,reason:"Invalid public key"}:G.validate()?G.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair$7.prototype.getPublic=function getPublic(G,K){return"string"==typeof G&&(K=G,G=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),K?this.pub.encode(K,G):this.pub},KeyPair$7.prototype.getPrivate=function getPrivate(G){return"hex"===G?this.priv.toString(16,2):this.priv},KeyPair$7.prototype._importPrivate=function _importPrivate(G,K){this.priv=new Jf(G,K||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$7.prototype._importPublic=function _importPublic(G,K){if(G.x||G.y)return"mont"===this.ec.curve.type?Xf(G.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Xf(G.x&&G.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(G.x,G.y));this.pub=this.ec.curve.decodePoint(G,K)},KeyPair$7.prototype.derive=function derive(G){return G.validate()||Xf(G.validate(),"public point not validated"),G.mul(this.priv).getX()},KeyPair$7.prototype.sign=function sign(G,K,ne){return this.ec.sign(G,this,K,ne)},KeyPair$7.prototype.verify=function verify(G,K){return this.ec.verify(G,K,this)},KeyPair$7.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Zf=pf,Yf=ff,el=Yf.assert;function Signature$8(G,K){if(G instanceof Signature$8)return G;this._importDER(G,K)||(el(G.r&&G.s,"Signature without r or s"),this.r=new Zf(G.r,16),this.s=new Zf(G.s,16),void 0===G.recoveryParam?this.recoveryParam=null:this.recoveryParam=G.recoveryParam)}var tl=Signature$8;function Position$2(){this.place=0}function getLength$2(G,K){var ne=G[K.place++];if(!(128&ne))return ne;var ue=15&ne;if(0===ue||ue>4)return!1;if(0===G[K.place])return!1;for(var pe=0,he=0,ye=K.place;he<ue;he++,ye++)pe<<=8,pe|=G[ye],pe>>>=0;return!(pe<=127)&&(K.place=ye,pe)}function rmPadding$1(G){for(var K=0,ne=G.length-1;!G[K]&&!(128&G[K+1])&&K<ne;)K++;return 0===K?G:G.slice(K)}function constructLength$1(G,K){if(K<128)G.push(K);else{var ne=1+(Math.log(K)/Math.LN2>>>3);for(G.push(128|ne);--ne;)G.push(K>>>(ne<<3)&255);G.push(K)}}Signature$8.prototype._importDER=function _importDER(G,K){G=Yf.toArray(G,K);var ne=new Position$2;if(48!==G[ne.place++])return!1;var ue=getLength$2(G,ne);if(!1===ue)return!1;if(ue+ne.place!==G.length)return!1;if(2!==G[ne.place++])return!1;var pe=getLength$2(G,ne);if(!1===pe)return!1;if(0!=(128&G[ne.place]))return!1;var he=G.slice(ne.place,pe+ne.place);if(ne.place+=pe,2!==G[ne.place++])return!1;var ye=getLength$2(G,ne);if(!1===ye)return!1;if(G.length!==ye+ne.place)return!1;if(0!=(128&G[ne.place]))return!1;var me=G.slice(ne.place,ye+ne.place);if(0===he[0]){if(!(128&he[1]))return!1;he=he.slice(1)}if(0===me[0]){if(!(128&me[1]))return!1;me=me.slice(1)}return this.r=new Zf(he),this.s=new Zf(me),this.recoveryParam=null,!0},Signature$8.prototype.toDER=function toDER(G){var K=this.r.toArray(),ne=this.s.toArray();for(128&K[0]&&(K=[0].concat(K)),128&ne[0]&&(ne=[0].concat(ne)),K=rmPadding$1(K),ne=rmPadding$1(ne);!(ne[0]||128&ne[1]);)ne=ne.slice(1);var ue=[2];constructLength$1(ue,K.length),(ue=ue.concat(K)).push(2),constructLength$1(ue,ne.length);var pe=ue.concat(ne),he=[48];return constructLength$1(he,pe.length),he=he.concat(pe),Yf.encode(he,G)};var rl=pf,nl=Kf,al=Hf,il=vf,sl=ff.assert,ol=Qf,cl=tl;function EC$2(G){if(!(this instanceof EC$2))return new EC$2(G);"string"==typeof G&&(sl(Object.prototype.hasOwnProperty.call(al,G),"Unknown curve "+G),G=al[G]),G instanceof al.PresetCurve&&(G={curve:G}),this.curve=G.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=G.curve.g,this.g.precompute(G.curve.n.bitLength()+1),this.hash=G.hash||G.curve.hash}var dl=EC$2;EC$2.prototype.keyPair=function keyPair(G){return new ol(this,G)},EC$2.prototype.keyFromPrivate=function keyFromPrivate(G,K){return ol.fromPrivate(this,G,K)},EC$2.prototype.keyFromPublic=function keyFromPublic(G,K){return ol.fromPublic(this,G,K)},EC$2.prototype.genKeyPair=function genKeyPair(G){G||(G={});for(var K=new nl({hash:this.hash,pers:G.pers,persEnc:G.persEnc||"utf8",entropy:G.entropy||il(this.hash.hmacStrength),entropyEnc:G.entropy&&G.entropyEnc||"utf8",nonce:this.n.toArray()}),ne=this.n.byteLength(),ue=this.n.sub(new rl(2));;){var pe=new rl(K.generate(ne));if(!(pe.cmp(ue)>0))return pe.iaddn(1),this.keyFromPrivate(pe)}},EC$2.prototype._truncateToN=function _truncateToN(G,K){var ne=8*G.byteLength()-this.n.bitLength();return ne>0&&(G=G.ushrn(ne)),!K&&G.cmp(this.n)>=0?G.sub(this.n):G},EC$2.prototype.sign=function sign(G,K,ne,ue){"object"==typeof ne&&(ue=ne,ne=null),ue||(ue={}),K=this.keyFromPrivate(K,ne),G=this._truncateToN(new rl(G,16));for(var pe=this.n.byteLength(),he=K.getPrivate().toArray("be",pe),ye=G.toArray("be",pe),me=new nl({hash:this.hash,entropy:he,nonce:ye,pers:ue.pers,persEnc:ue.persEnc||"utf8"}),be=this.n.sub(new rl(1)),ve=0;;ve++){var _e=ue.k?ue.k(ve):new rl(me.generate(this.n.byteLength()));if(!((_e=this._truncateToN(_e,!0)).cmpn(1)<=0||_e.cmp(be)>=0)){var Te=this.g.mul(_e);if(!Te.isInfinity()){var Ee=Te.getX(),Pe=Ee.umod(this.n);if(0!==Pe.cmpn(0)){var Se=_e.invm(this.n).mul(Pe.mul(K.getPrivate()).iadd(G));if(0!==(Se=Se.umod(this.n)).cmpn(0)){var Ce=(Te.getY().isOdd()?1:0)|(0!==Ee.cmp(Pe)?2:0);return ue.canonical&&Se.cmp(this.nh)>0&&(Se=this.n.sub(Se),Ce^=1),new cl({r:Pe,s:Se,recoveryParam:Ce})}}}}}},EC$2.prototype.verify=function verify(G,K,ne,ue){G=this._truncateToN(new rl(G,16)),ne=this.keyFromPublic(ne,ue);var pe=(K=new cl(K,"hex")).r,he=K.s;if(pe.cmpn(1)<0||pe.cmp(this.n)>=0)return!1;if(he.cmpn(1)<0||he.cmp(this.n)>=0)return!1;var ye,me=he.invm(this.n),be=me.mul(G).umod(this.n),ve=me.mul(pe).umod(this.n);return this.curve._maxwellTrick?!(ye=this.g.jmulAdd(be,ne.getPublic(),ve)).isInfinity()&&ye.eqXToP(pe):!(ye=this.g.mulAdd(be,ne.getPublic(),ve)).isInfinity()&&0===ye.getX().umod(this.n).cmp(pe)},EC$2.prototype.recoverPubKey=function(G,K,ne,ue){sl((3&ne)===ne,"The recovery param is more than two bits"),K=new cl(K,ue);var pe=this.n,he=new rl(G),ye=K.r,me=K.s,be=1&ne,ve=ne>>1;if(ye.cmp(this.curve.p.umod(this.curve.n))>=0&&ve)throw new Error("Unable to find sencond key candinate");ye=ve?this.curve.pointFromX(ye.add(this.curve.n),be):this.curve.pointFromX(ye,be);var _e=K.r.invm(pe),Te=pe.sub(he).mul(_e).umod(pe),Ee=me.mul(_e).umod(pe);return this.g.mulAdd(Te,ye,Ee)},EC$2.prototype.getKeyRecoveryParam=function(G,K,ne,ue){if(null!==(K=new cl(K,ue)).recoveryParam)return K.recoveryParam;for(var pe=0;pe<4;pe++){var he;try{he=this.recoverPubKey(G,K,pe)}catch(G){continue}if(he.eq(ne))return pe}throw new Error("Unable to find valid recovery factor")};var ul=ff,fl=ul.assert,ll=ul.parseBytes,pl=ul.cachedProperty;function KeyPair$5(G,K){this.eddsa=G,this._secret=ll(K.secret),G.isPoint(K.pub)?this._pub=K.pub:this._pubBytes=ll(K.pub)}KeyPair$5.fromPublic=function fromPublic(G,K){return K instanceof KeyPair$5?K:new KeyPair$5(G,{pub:K})},KeyPair$5.fromSecret=function fromSecret(G,K){return K instanceof KeyPair$5?K:new KeyPair$5(G,{secret:K})},KeyPair$5.prototype.secret=function secret(){return this._secret},pl(KeyPair$5,"pubBytes",(function pubBytes(){return this.eddsa.encodePoint(this.pub())})),pl(KeyPair$5,"pub",(function pub(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),pl(KeyPair$5,"privBytes",(function privBytes(){var G=this.eddsa,K=this.hash(),ne=G.encodingLength-1,ue=K.slice(0,G.encodingLength);return ue[0]&=248,ue[ne]&=127,ue[ne]|=64,ue})),pl(KeyPair$5,"priv",(function priv(){return this.eddsa.decodeInt(this.privBytes())})),pl(KeyPair$5,"hash",(function hash(){return this.eddsa.hash().update(this.secret()).digest()})),pl(KeyPair$5,"messagePrefix",(function messagePrefix(){return this.hash().slice(this.eddsa.encodingLength)})),KeyPair$5.prototype.sign=function sign(G){return fl(this._secret,"KeyPair can only verify"),this.eddsa.sign(G,this)},KeyPair$5.prototype.verify=function verify(G,K){return this.eddsa.verify(G,K,this)},KeyPair$5.prototype.getSecret=function getSecret(G){return fl(this._secret,"KeyPair is public only"),ul.encode(this.secret(),G)},KeyPair$5.prototype.getPublic=function getPublic(G){return ul.encode(this.pubBytes(),G)};var hl=KeyPair$5,yl=pf,ml=ff,bl=ml.assert,gl=ml.cachedProperty,vl=ml.parseBytes;function Signature$6(G,K){this.eddsa=G,"object"!=typeof K&&(K=vl(K)),Array.isArray(K)&&(bl(K.length===2*G.encodingLength,"Signature has invalid size"),K={R:K.slice(0,G.encodingLength),S:K.slice(G.encodingLength)}),bl(K.R&&K.S,"Signature without R or S"),G.isPoint(K.R)&&(this._R=K.R),K.S instanceof yl&&(this._S=K.S),this._Rencoded=Array.isArray(K.R)?K.R:K.Rencoded,this._Sencoded=Array.isArray(K.S)?K.S:K.Sencoded}gl(Signature$6,"S",(function S(){return this.eddsa.decodeInt(this.Sencoded())})),gl(Signature$6,"R",(function R(){return this.eddsa.decodePoint(this.Rencoded())})),gl(Signature$6,"Rencoded",(function Rencoded(){return this.eddsa.encodePoint(this.R())})),gl(Signature$6,"Sencoded",(function Sencoded(){return this.eddsa.encodeInt(this.S())})),Signature$6.prototype.toBytes=function toBytes(){return this.Rencoded().concat(this.Sencoded())},Signature$6.prototype.toHex=function toHex(){return ml.encode(this.toBytes(),"hex").toUpperCase()};var wl=Signature$6,_l=Yo,Tl=Hf,Al=ff,El=Al.assert,Pl=Al.parseBytes,Sl=hl,Il=wl;function EDDSA$1(G){if(El("ed25519"===G,"only tested with ed25519 so far"),!(this instanceof EDDSA$1))return new EDDSA$1(G);G=Tl[G].curve,this.curve=G,this.g=G.g,this.g.precompute(G.n.bitLength()+1),this.pointClass=G.point().constructor,this.encodingLength=Math.ceil(G.n.bitLength()/8),this.hash=_l.sha512}var Cl=EDDSA$1;EDDSA$1.prototype.sign=function sign(G,K){G=Pl(G);var ne=this.keyFromSecret(K),ue=this.hashInt(ne.messagePrefix(),G),pe=this.g.mul(ue),he=this.encodePoint(pe),ye=this.hashInt(he,ne.pubBytes(),G).mul(ne.priv()),me=ue.add(ye).umod(this.curve.n);return this.makeSignature({R:pe,S:me,Rencoded:he})},EDDSA$1.prototype.verify=function verify(G,K,ne){if(G=Pl(G),(K=this.makeSignature(K)).S().gte(K.eddsa.curve.n)||K.S().isNeg())return!1;var ue=this.keyFromPublic(ne),pe=this.hashInt(K.Rencoded(),ue.pubBytes(),G),he=this.g.mul(K.S());return K.R().add(ue.pub().mul(pe)).eq(he)},EDDSA$1.prototype.hashInt=function hashInt(){for(var G=this.hash(),K=0;K<arguments.length;K++)G.update(arguments[K]);return Al.intFromLE(G.digest()).umod(this.curve.n)},EDDSA$1.prototype.keyFromPublic=function keyFromPublic(G){return Sl.fromPublic(this,G)},EDDSA$1.prototype.keyFromSecret=function keyFromSecret(G){return Sl.fromSecret(this,G)},EDDSA$1.prototype.makeSignature=function makeSignature(G){return G instanceof Il?G:new Il(this,G)},EDDSA$1.prototype.encodePoint=function encodePoint(G){var K=G.getY().toArray("le",this.encodingLength);return K[this.encodingLength-1]|=G.getX().isOdd()?128:0,K},EDDSA$1.prototype.decodePoint=function decodePoint(G){var K=(G=Al.parseBytes(G)).length-1,ne=G.slice(0,K).concat(-129&G[K]),ue=0!=(128&G[K]),pe=Al.intFromLE(ne);return this.curve.pointFromY(pe,ue)},EDDSA$1.prototype.encodeInt=function encodeInt(G){return G.toArray("le",this.encodingLength)},EDDSA$1.prototype.decodeInt=function decodeInt(G){return Al.intFromLE(G)},EDDSA$1.prototype.isPoint=function isPoint(G){return G instanceof this.pointClass},function(G){var K=G;K.version=uf,K.utils=ff,K.rand=vf,K.curve=wf,K.curves=Hf,K.ec=dl,K.eddsa=Cl}(df);var Rl=getDefaultExportFromCjs$1(df),kl={},Ol={},xl={},Nl={},Ml={},Bl=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.getLength=Ml.decode=Ml.encode=void 0;var Fl=Bl(Ai);function safeParseInt(G,K){if("0"===G[0]&&"0"===G[1])throw new Error("invalid RLP: extra zeros");return parseInt(G,K)}function encodeLength(G,K){if(G<56)return Buffer.from([G+K]);var ne=intToHex(G),ue=intToHex(K+55+ne.length/2);return Buffer.from(ue+ne,"hex")}function _decode$1(G){var K,ne,ue,pe,he,ye=[],me=G[0];if(me<=127)return{data:G.slice(0,1),remainder:G.slice(1)};if(me<=183){if(K=me-127,ue=128===me?Buffer.from([]):G.slice(1,K),2===K&&ue[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:ue,remainder:G.slice(K)}}if(me<=191){if(ne=me-182,G.length-1<ne)throw new Error("invalid RLP: not enough bytes for string length");if((K=safeParseInt(G.slice(1,ne).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((ue=G.slice(ne,K+ne)).length<K)throw new Error("invalid RLP: not enough bytes for string");return{data:ue,remainder:G.slice(K+ne)}}if(me<=247){for(K=me-191,pe=G.slice(1,K);pe.length;)he=_decode$1(pe),ye.push(he.data),pe=he.remainder;return{data:ye,remainder:G.slice(K)}}var be=(ne=me-246)+(K=safeParseInt(G.slice(1,ne).toString("hex"),16));if(be>G.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(pe=G.slice(ne,be)).length)throw new Error("invalid rlp, List has a invalid length");for(;pe.length;)he=_decode$1(pe),ye.push(he.data),pe=he.remainder;return{data:ye,remainder:G.slice(be)}}function isHexPrefixed$1(G){return"0x"===G.slice(0,2)}function intToHex(G){if(G<0)throw new Error("Invalid integer as argument, must be unsigned!");var K=G.toString(16);return K.length%2?"0"+K:K}function toBuffer(G){if(!Buffer.isBuffer(G)){if("string"==typeof G)return isHexPrefixed$1(G)?Buffer.from(function padToEven$1(G){return G.length%2?"0"+G:G}(function stripHexPrefix$1(G){return"string"!=typeof G?G:isHexPrefixed$1(G)?G.slice(2):G}(G)),"hex"):Buffer.from(G);if("number"==typeof G||"bigint"==typeof G)return G?function intToBuffer(G){var K=intToHex(G);return Buffer.from(K,"hex")}(G):Buffer.from([]);if(null==G)return Buffer.from([]);if(G instanceof Uint8Array)return Buffer.from(G);if(Fl.default.isBN(G))return Buffer.from(G.toArray());throw new Error("invalid type")}return G}Ml.encode=function encode$3(G){if(Array.isArray(G)){for(var K=[],ne=0;ne<G.length;ne++)K.push(encode$3(G[ne]));var ue=Buffer.concat(K);return Buffer.concat([encodeLength(ue.length,192),ue])}var pe=toBuffer(G);return 1===pe.length&&pe[0]<128?pe:Buffer.concat([encodeLength(pe.length,128),pe])},Ml.decode=function decode(G,K){if(void 0===K&&(K=!1),!G||0===G.length)return Buffer.from([]);var ne=_decode$1(toBuffer(G));if(K)return ne;if(0!==ne.remainder.length)throw new Error("invalid remainder");return ne.data},Ml.getLength=function getLength$1(G){if(!G||0===G.length)return Buffer.from([]);var K=toBuffer(G),ne=K[0];if(ne<=127)return K.length;if(ne<=183)return ne-127;if(ne<=191)return ne-182;if(ne<=247)return ne-191;var ue=ne-246;return ue+safeParseInt(K.slice(1,ue).toString("hex"),16)};var Dl=pn&&pn.__createBinding||(Object.create?function(G,K,ne,ue){void 0===ue&&(ue=ne);var pe=Object.getOwnPropertyDescriptor(K,ne);pe&&!("get"in pe?!K.__esModule:pe.writable||pe.configurable)||(pe={enumerable:!0,get:function(){return K[ne]}}),Object.defineProperty(G,ue,pe)}:function(G,K,ne,ue){void 0===ue&&(ue=ne),G[ue]=K[ne]}),Ll=pn&&pn.__setModuleDefault||(Object.create?function(G,K){Object.defineProperty(G,"default",{enumerable:!0,value:K})}:function(G,K){G.default=K}),Ul=pn&&pn.__importStar||function(G){if(G&&G.__esModule)return G;var K={};if(null!=G)for(var ne in G)"default"!==ne&&Object.prototype.hasOwnProperty.call(G,ne)&&Dl(K,G,ne);return Ll(K,G),K},$l=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.rlp=Nl.BN=void 0;var ql=$l(Ai);Nl.BN=ql.default;var Gl=Ul(Ml);Nl.rlp=Gl,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.KECCAK256_RLP=G.KECCAK256_RLP_S=G.KECCAK256_RLP_ARRAY=G.KECCAK256_RLP_ARRAY_S=G.KECCAK256_NULL=G.KECCAK256_NULL_S=G.TWO_POW256=G.MAX_INTEGER=G.MAX_UINT64=void 0;var K=Ti,ne=Nl;G.MAX_UINT64=new ne.BN("ffffffffffffffff",16),G.MAX_INTEGER=new ne.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),G.TWO_POW256=new ne.BN("10000000000000000000000000000000000000000000000000000000000000000",16),G.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",G.KECCAK256_NULL=K.Buffer.from(G.KECCAK256_NULL_S,"hex"),G.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",G.KECCAK256_RLP_ARRAY=K.Buffer.from(G.KECCAK256_RLP_ARRAY_S,"hex"),G.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",G.KECCAK256_RLP=K.Buffer.from(G.KECCAK256_RLP_S,"hex")}(xl);var jl={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var Hl=defaultSetTimout,Wl=defaultClearTimeout;function runTimeout(G){if(Hl===setTimeout)return setTimeout(G,0);if((Hl===defaultSetTimout||!Hl)&&setTimeout)return Hl=setTimeout,setTimeout(G,0);try{return Hl(G,0)}catch(K){try{return Hl.call(null,G,0)}catch(K){return Hl.call(this,G,0)}}}"function"==typeof li.setTimeout&&(Hl=setTimeout),"function"==typeof li.clearTimeout&&(Wl=clearTimeout);var zl,Vl=[],Kl=!1,Jl=-1;function cleanUpNextTick(){Kl&&zl&&(Kl=!1,zl.length?Vl=zl.concat(Vl):Jl=-1,Vl.length&&drainQueue())}function drainQueue(){if(!Kl){var G=runTimeout(cleanUpNextTick);Kl=!0;for(var K=Vl.length;K;){for(zl=Vl,Vl=[];++Jl<K;)zl&&zl[Jl].run();Jl=-1,K=Vl.length}zl=null,Kl=!1,function runClearTimeout(G){if(Wl===clearTimeout)return clearTimeout(G);if((Wl===defaultClearTimeout||!Wl)&&clearTimeout)return Wl=clearTimeout,clearTimeout(G);try{return Wl(G)}catch(K){try{return Wl.call(null,G)}catch(K){return Wl.call(this,G)}}}(G)}}function nextTick(G){var K=new Array(arguments.length-1);if(arguments.length>1)for(var ne=1;ne<arguments.length;ne++)K[ne-1]=arguments[ne];Vl.push(new Item(G,K)),1!==Vl.length||Kl||runTimeout(drainQueue)}function Item(G,K){this.fun=G,this.array=K}Item.prototype.run=function(){this.fun.apply(null,this.array)};function noop$3(){}var Xl=noop$3,Ql=noop$3,Zl=noop$3,Yl=noop$3,ep=noop$3,tp=noop$3,rp=noop$3;var np=li.performance||{},ap=np.now||np.mozNow||np.msNow||np.oNow||np.webkitNow||function(){return(new Date).getTime()};var ip=new Date;var sp,op={nextTick:nextTick,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Xl,addListener:Ql,once:Zl,off:Yl,removeListener:ep,removeAllListeners:tp,emit:rp,binding:function binding(G){throw new Error("process.binding is not supported")},cwd:function cwd(){return"/"},chdir:function chdir(G){throw new Error("process.chdir is not supported")},umask:function umask(){return 0},hrtime:function hrtime(G){var K=.001*ap.call(np),ne=Math.floor(K),ue=Math.floor(K%1*1e9);return G&&(ne-=G[0],(ue-=G[1])<0&&(ne--,ue+=1e9)),[ne,ue]},platform:"browser",release:{},config:{},uptime:function uptime(){return(new Date-ip)/1e3}};sp="function"==typeof Object.create?function inherits(G,K){G.super_=K,G.prototype=Object.create(K.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}})}:function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G};var cp=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(G){for(var K=Object.keys(G),ne={},ue=0;ue<K.length;ue++)ne[K[ue]]=Object.getOwnPropertyDescriptor(G,K[ue]);return ne},dp=/%[sdj%]/g;function format$1(G){if(!isString$2(G)){for(var K=[],ne=0;ne<arguments.length;ne++)K.push(inspect$1(arguments[ne]));return K.join(" ")}ne=1;for(var ue=arguments,pe=ue.length,he=String(G).replace(dp,(function(G){if("%%"===G)return"%";if(ne>=pe)return G;switch(G){case"%s":return String(ue[ne++]);case"%d":return Number(ue[ne++]);case"%j":try{return JSON.stringify(ue[ne++])}catch(G){return"[Circular]"}default:return G}})),ye=ue[ne];ne<pe;ye=ue[++ne])isNull(ye)||!isObject$1(ye)?he+=" "+ye:he+=" "+inspect$1(ye);return he}function deprecate(G,K){if(isUndefined$1(li.undefined))return function(){return deprecate(G,K).apply(this,arguments)};if(!0===op.noDeprecation)return G;var ne=!1;return function deprecated(){if(!ne){if(op.throwDeprecation)throw new Error(K);op.traceDeprecation?console.trace(K):console.error(K),ne=!0}return G.apply(this,arguments)}}var up,fp={};function debuglog(G){if(isUndefined$1(up)&&(up=op.env.NODE_DEBUG||""),G=G.toUpperCase(),!fp[G])if(new RegExp("\\b"+G+"\\b","i").test(up)){fp[G]=function(){var K=format$1.apply(null,arguments);console.error("%s %d: %s",G,0,K)}}else fp[G]=function(){};return fp[G]}function inspect$1(G,K){var ne={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ne.depth=arguments[2]),arguments.length>=4&&(ne.colors=arguments[3]),isBoolean$1(K)?ne.showHidden=K:K&&_extend(ne,K),isUndefined$1(ne.showHidden)&&(ne.showHidden=!1),isUndefined$1(ne.depth)&&(ne.depth=2),isUndefined$1(ne.colors)&&(ne.colors=!1),isUndefined$1(ne.customInspect)&&(ne.customInspect=!0),ne.colors&&(ne.stylize=stylizeWithColor),formatValue(ne,G,ne.depth)}function stylizeWithColor(G,K){var ne=inspect$1.styles[K];return ne?"["+inspect$1.colors[ne][0]+"m"+G+"["+inspect$1.colors[ne][1]+"m":G}function stylizeNoColor(G,K){return G}function formatValue(G,K,ne){if(G.customInspect&&K&&isFunction$1(K.inspect)&&K.inspect!==inspect$1&&(!K.constructor||K.constructor.prototype!==K)){var ue=K.inspect(ne,G);return isString$2(ue)||(ue=formatValue(G,ue,ne)),ue}var pe=function formatPrimitive(G,K){if(isUndefined$1(K))return G.stylize("undefined","undefined");if(isString$2(K)){var ne="'"+JSON.stringify(K).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(ne,"string")}if(isNumber$1(K))return G.stylize(""+K,"number");if(isBoolean$1(K))return G.stylize(""+K,"boolean");if(isNull(K))return G.stylize("null","null")}(G,K);if(pe)return pe;var he=Object.keys(K),ye=function arrayToHash(G){var K={};return G.forEach((function(G,ne){K[G]=!0})),K}(he);if(G.showHidden&&(he=Object.getOwnPropertyNames(K)),isError$1(K)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return formatError$1(K);if(0===he.length){if(isFunction$1(K)){var me=K.name?": "+K.name:"";return G.stylize("[Function"+me+"]","special")}if(isRegExp$1(K))return G.stylize(RegExp.prototype.toString.call(K),"regexp");if(isDate$1(K))return G.stylize(Date.prototype.toString.call(K),"date");if(isError$1(K))return formatError$1(K)}var be,ve="",_e=!1,Te=["{","}"];(isArray$1(K)&&(_e=!0,Te=["[","]"]),isFunction$1(K))&&(ve=" [Function"+(K.name?": "+K.name:"")+"]");return isRegExp$1(K)&&(ve=" "+RegExp.prototype.toString.call(K)),isDate$1(K)&&(ve=" "+Date.prototype.toUTCString.call(K)),isError$1(K)&&(ve=" "+formatError$1(K)),0!==he.length||_e&&0!=K.length?ne<0?isRegExp$1(K)?G.stylize(RegExp.prototype.toString.call(K),"regexp"):G.stylize("[Object]","special"):(G.seen.push(K),be=_e?function formatArray(G,K,ne,ue,pe){for(var he=[],ye=0,me=K.length;ye<me;++ye)hasOwnProperty$1(K,String(ye))?he.push(formatProperty(G,K,ne,ue,String(ye),!0)):he.push("");return pe.forEach((function(pe){pe.match(/^\d+$/)||he.push(formatProperty(G,K,ne,ue,pe,!0))})),he}(G,K,ne,ye,he):he.map((function(ue){return formatProperty(G,K,ne,ye,ue,_e)})),G.seen.pop(),function reduceToSingleString(G,K,ne){var ue=G.reduce((function(G,K){return K.indexOf("\n"),G+K.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(ue>60)return ne[0]+(""===K?"":K+"\n ")+" "+G.join(",\n  ")+" "+ne[1];return ne[0]+K+" "+G.join(", ")+" "+ne[1]}(be,ve,Te)):Te[0]+ve+Te[1]}function formatError$1(G){return"["+Error.prototype.toString.call(G)+"]"}function formatProperty(G,K,ne,ue,pe,he){var ye,me,be;if((be=Object.getOwnPropertyDescriptor(K,pe)||{value:K[pe]}).get?me=be.set?G.stylize("[Getter/Setter]","special"):G.stylize("[Getter]","special"):be.set&&(me=G.stylize("[Setter]","special")),hasOwnProperty$1(ue,pe)||(ye="["+pe+"]"),me||(G.seen.indexOf(be.value)<0?(me=isNull(ne)?formatValue(G,be.value,null):formatValue(G,be.value,ne-1)).indexOf("\n")>-1&&(me=he?me.split("\n").map((function(G){return"  "+G})).join("\n").substr(2):"\n"+me.split("\n").map((function(G){return"   "+G})).join("\n")):me=G.stylize("[Circular]","special")),isUndefined$1(ye)){if(he&&pe.match(/^\d+$/))return me;(ye=JSON.stringify(""+pe)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ye=ye.substr(1,ye.length-2),ye=G.stylize(ye,"name")):(ye=ye.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ye=G.stylize(ye,"string"))}return ye+": "+me}function isArray$1(G){return Array.isArray(G)}function isBoolean$1(G){return"boolean"==typeof G}function isNull(G){return null===G}function isNullOrUndefined(G){return null==G}function isNumber$1(G){return"number"==typeof G}function isString$2(G){return"string"==typeof G}function isSymbol(G){return"symbol"==typeof G}function isUndefined$1(G){return void 0===G}function isRegExp$1(G){return isObject$1(G)&&"[object RegExp]"===objectToString(G)}function isObject$1(G){return"object"==typeof G&&null!==G}function isDate$1(G){return isObject$1(G)&&"[object Date]"===objectToString(G)}function isError$1(G){return isObject$1(G)&&("[object Error]"===objectToString(G)||G instanceof Error)}function isFunction$1(G){return"function"==typeof G}function isPrimitive(G){return null===G||"boolean"==typeof G||"number"==typeof G||"string"==typeof G||"symbol"==typeof G||void 0===G}function isBuffer$1(G){return Buffer$h.isBuffer(G)}function objectToString(G){return Object.prototype.toString.call(G)}function pad(G){return G<10?"0"+G.toString(10):G.toString(10)}inspect$1.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect$1.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var lp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function log(){console.log("%s - %s",function timestamp(){var G=new Date,K=[pad(G.getHours()),pad(G.getMinutes()),pad(G.getSeconds())].join(":");return[G.getDate(),lp[G.getMonth()],K].join(" ")}(),format$1.apply(null,arguments))}function _extend(G,K){if(!K||!isObject$1(K))return G;for(var ne=Object.keys(K),ue=ne.length;ue--;)G[ne[ue]]=K[ne[ue]];return G}function hasOwnProperty$1(G,K){return Object.prototype.hasOwnProperty.call(G,K)}var pp="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function promisify(G){if("function"!=typeof G)throw new TypeError('The "original" argument must be of type Function');if(pp&&G[pp]){var K;if("function"!=typeof(K=G[pp]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,pp,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(){for(var K,ne,ue=new Promise((function(G,ue){K=G,ne=ue})),pe=[],he=0;he<arguments.length;he++)pe.push(arguments[he]);pe.push((function(G,ue){G?ne(G):K(ue)}));try{G.apply(this,pe)}catch(G){ne(G)}return ue}return Object.setPrototypeOf(K,Object.getPrototypeOf(G)),pp&&Object.defineProperty(K,pp,{value:K,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(K,cp(G))}function callbackifyOnRejected(G,K){if(!G){var ne=new Error("Promise was rejected with a falsy value");ne.reason=G,G=ne}return K(G)}function callbackify(G){if("function"!=typeof G)throw new TypeError('The "original" argument must be of type Function');function callbackified(){for(var K=[],ne=0;ne<arguments.length;ne++)K.push(arguments[ne]);var ue=K.pop();if("function"!=typeof ue)throw new TypeError("The last argument must be of type Function");var pe=this,cb=function(){return ue.apply(pe,arguments)};G.apply(this,K).then((function(G){op.nextTick(cb.bind(null,null,G))}),(function(G){op.nextTick(callbackifyOnRejected.bind(null,G,cb))}))}return Object.setPrototypeOf(callbackified,Object.getPrototypeOf(G)),Object.defineProperties(callbackified,cp(G)),callbackified}promisify.custom=pp;var hp={inherits:sp,_extend:_extend,log:log,isBuffer:isBuffer$1,isPrimitive:isPrimitive,isFunction:isFunction$1,isError:isError$1,isDate:isDate$1,isObject:isObject$1,isRegExp:isRegExp$1,isUndefined:isUndefined$1,isSymbol:isSymbol,isString:isString$2,isNumber:isNumber$1,isNullOrUndefined:isNullOrUndefined,isNull:isNull,isBoolean:isBoolean$1,isArray:isArray$1,inspect:inspect$1,deprecate:deprecate,format:format$1,debuglog:debuglog,promisify:promisify,callbackify:callbackify},yp=Object.freeze({__proto__:null,_extend:_extend,callbackify:callbackify,debuglog:debuglog,default:hp,deprecate:deprecate,format:format$1,inherits:sp,inspect:inspect$1,isArray:isArray$1,isBoolean:isBoolean$1,isBuffer:isBuffer$1,isDate:isDate$1,isError:isError$1,isFunction:isFunction$1,isNull:isNull,isNullOrUndefined:isNullOrUndefined,isNumber:isNumber$1,isObject:isObject$1,isPrimitive:isPrimitive,isRegExp:isRegExp$1,isString:isString$2,isSymbol:isSymbol,isUndefined:isUndefined$1,log:log,promisify:promisify});function compare(G,K){if(G===K)return 0;for(var ne=G.length,ue=K.length,pe=0,he=Math.min(ne,ue);pe<he;++pe)if(G[pe]!==K[pe]){ne=G[pe],ue=K[pe];break}return ne<ue?-1:ue<ne?1:0}var mp,bp=Object.prototype.hasOwnProperty,gp=Object.keys||function(G){var K=[];for(var ne in G)bp.call(G,ne)&&K.push(ne);return K},vp=Array.prototype.slice;function functionsHaveNames(){return void 0!==mp?mp:mp="foo"===function foo(){}.name}function pToString(G){return Object.prototype.toString.call(G)}function isView(G){return!isBuffer$3(G)&&("function"==typeof li.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(G):!!G&&(G instanceof DataView||!!(G.buffer&&G.buffer instanceof ArrayBuffer))))}function assert$c(G,K){G||fail(G,!0,K,"==",ok)}var wp=/\s*function\s+([^\(\s]*)\s*/;function getName(G){if(isFunction$1(G)){if(functionsHaveNames())return G.name;var K=G.toString().match(wp);return K&&K[1]}}function AssertionError(G){this.name="AssertionError",this.actual=G.actual,this.expected=G.expected,this.operator=G.operator,G.message?(this.message=G.message,this.generatedMessage=!1):(this.message=function getMessage(G){return truncate(inspect(G.actual),128)+" "+G.operator+" "+truncate(inspect(G.expected),128)}(this),this.generatedMessage=!0);var K=G.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,K);else{var ne=new Error;if(ne.stack){var ue=ne.stack,pe=getName(K),he=ue.indexOf("\n"+pe);if(he>=0){var ye=ue.indexOf("\n",he+1);ue=ue.substring(ye+1)}this.stack=ue}}}function truncate(G,K){return"string"==typeof G?G.length<K?G:G.slice(0,K):G}function inspect(G){if(functionsHaveNames()||!isFunction$1(G))return inspect$1(G);var K=getName(G);return"[Function"+(K?": "+K:"")+"]"}function fail(G,K,ne,ue,pe){throw new AssertionError({message:ne,actual:G,expected:K,operator:ue,stackStartFunction:pe})}function ok(G,K){G||fail(G,!0,K,"==",ok)}function equal(G,K,ne){G!=K&&fail(G,K,ne,"==",equal)}function notEqual(G,K,ne){G==K&&fail(G,K,ne,"!=",notEqual)}function deepEqual(G,K,ne){_deepEqual(G,K,!1)||fail(G,K,ne,"deepEqual",deepEqual)}function deepStrictEqual(G,K,ne){_deepEqual(G,K,!0)||fail(G,K,ne,"deepStrictEqual",deepStrictEqual)}function _deepEqual(G,K,ne,ue){if(G===K)return!0;if(isBuffer$3(G)&&isBuffer$3(K))return 0===compare(G,K);if(isDate$1(G)&&isDate$1(K))return G.getTime()===K.getTime();if(isRegExp$1(G)&&isRegExp$1(K))return G.source===K.source&&G.global===K.global&&G.multiline===K.multiline&&G.lastIndex===K.lastIndex&&G.ignoreCase===K.ignoreCase;if(null!==G&&"object"==typeof G||null!==K&&"object"==typeof K){if(isView(G)&&isView(K)&&pToString(G)===pToString(K)&&!(G instanceof Float32Array||G instanceof Float64Array))return 0===compare(new Uint8Array(G.buffer),new Uint8Array(K.buffer));if(isBuffer$3(G)!==isBuffer$3(K))return!1;var pe=(ue=ue||{actual:[],expected:[]}).actual.indexOf(G);return-1!==pe&&pe===ue.expected.indexOf(K)||(ue.actual.push(G),ue.expected.push(K),function objEquiv(G,K,ne,ue){if(null==G||null==K)return!1;if(isPrimitive(G)||isPrimitive(K))return G===K;if(ne&&Object.getPrototypeOf(G)!==Object.getPrototypeOf(K))return!1;var pe=isArguments(G),he=isArguments(K);if(pe&&!he||!pe&&he)return!1;if(pe)return _deepEqual(G=vp.call(G),K=vp.call(K),ne);var ye,me,be=gp(G),ve=gp(K);if(be.length!==ve.length)return!1;for(be.sort(),ve.sort(),me=be.length-1;me>=0;me--)if(be[me]!==ve[me])return!1;for(me=be.length-1;me>=0;me--)if(!_deepEqual(G[ye=be[me]],K[ye],ne,ue))return!1;return!0}(G,K,ne,ue))}return ne?G===K:G==K}function isArguments(G){return"[object Arguments]"==Object.prototype.toString.call(G)}function notDeepEqual(G,K,ne){_deepEqual(G,K,!1)&&fail(G,K,ne,"notDeepEqual",notDeepEqual)}function notDeepStrictEqual(G,K,ne){_deepEqual(G,K,!0)&&fail(G,K,ne,"notDeepStrictEqual",notDeepStrictEqual)}function strictEqual(G,K,ne){G!==K&&fail(G,K,ne,"===",strictEqual)}function notStrictEqual(G,K,ne){G===K&&fail(G,K,ne,"!==",notStrictEqual)}function expectedException(G,K){if(!G||!K)return!1;if("[object RegExp]"==Object.prototype.toString.call(K))return K.test(G);try{if(G instanceof K)return!0}catch(G){}return!Error.isPrototypeOf(K)&&!0===K.call({},G)}function _throws(G,K,ne,ue){var pe;if("function"!=typeof K)throw new TypeError('"block" argument must be a function');"string"==typeof ne&&(ue=ne,ne=null),pe=function _tryBlock(G){var K;try{G()}catch(G){K=G}return K}(K),ue=(ne&&ne.name?" ("+ne.name+").":".")+(ue?" "+ue:"."),G&&!pe&&fail(pe,ne,"Missing expected exception"+ue);var he="string"==typeof ue,ye=!G&&pe&&!ne;if((!G&&isError$1(pe)&&he&&expectedException(pe,ne)||ye)&&fail(pe,ne,"Got unwanted exception"+ue),G&&pe&&ne&&!expectedException(pe,ne)||!G&&pe)throw pe}function throws(G,K,ne){_throws(!0,G,K,ne)}function doesNotThrow(G,K,ne){_throws(!1,G,K,ne)}function ifError(G){if(G)throw G}assert$c.AssertionError=AssertionError,sp(AssertionError,Error),assert$c.fail=fail,assert$c.ok=ok,assert$c.equal=equal,assert$c.notEqual=notEqual,assert$c.deepEqual=deepEqual,assert$c.deepStrictEqual=deepStrictEqual,assert$c.notDeepEqual=notDeepEqual,assert$c.notDeepStrictEqual=notDeepStrictEqual,assert$c.strictEqual=strictEqual,assert$c.notStrictEqual=notStrictEqual,assert$c.throws=throws,assert$c.doesNotThrow=doesNotThrow,assert$c.ifError=ifError;var _p=getAugmentedNamespace$1(Object.freeze({__proto__:null,AssertionError:AssertionError,assert:ok,deepEqual:deepEqual,deepStrictEqual:deepStrictEqual,default:assert$c,doesNotThrow:doesNotThrow,equal:equal,fail:fail,ifError:ifError,notDeepEqual:notDeepEqual,notDeepStrictEqual:notDeepStrictEqual,notEqual:notEqual,notStrictEqual:notStrictEqual,ok:ok,strictEqual:strictEqual,throws:throws})),Tp={};const Ap="Impossible case. Please create issue.",Ep="The tweak was out of range or the resulted private key is invalid",Pp="The tweak was out of range or equal to zero",Sp="Unknow error on context randomization",Ip="Private Key is invalid",Cp="Public Key could not be parsed",Rp="Public Key serialization error",kp="The sum of the public keys is not valid",Op="Signature could not be parsed",xp="The nonce generation function failed, or the private key was invalid",Np="Public key could not be recover",Mp="Scalar was invalid (zero or overflow)";function assert$b(G,K){if(!G)throw new Error(K)}function isUint8Array(G,K,ne){if(assert$b(K instanceof Uint8Array,`Expected ${G} to be an Uint8Array`),void 0!==ne)if(Array.isArray(ne)){const ue=`Expected ${G} to be an Uint8Array with length [${ne.join(", ")}]`;assert$b(ne.includes(K.length),ue)}else{const ue=`Expected ${G} to be an Uint8Array with length ${ne}`;assert$b(K.length===ne,ue)}}function isCompressed(G){assert$b("Boolean"===toTypeString(G),"Expected compressed to be a Boolean")}function getAssertedOutput(G=(G=>new Uint8Array(G)),K){return"function"==typeof G&&(G=G(K)),isUint8Array("output",G,K),G}function toTypeString(G){return Object.prototype.toString.call(G).slice(8,-1)}var Bp={},Fp="6.5.4",Dp={},Lp={exports:{}};!function(G){!function(G,K){function assert(G,K){if(!G)throw new Error(K||"Assertion failed")}function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G}function BN(G,K,ne){if(BN.isBN(G))return G;this.negative=0,this.words=null,this.length=0,this.red=null,null!==G&&("le"!==K&&"be"!==K||(ne=K,K=10),this._init(G||0,K||10,ne||"be"))}var ne;"object"==typeof G?G.exports=BN:K.BN=BN,BN.BN=BN,BN.wordSize=26;try{ne="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Ti.Buffer}catch(G){}function parseHex4Bits(G,K){var ne=G.charCodeAt(K);return ne>=65&&ne<=70?ne-55:ne>=97&&ne<=102?ne-87:ne-48&15}function parseHexByte(G,K,ne){var ue=parseHex4Bits(G,ne);return ne-1>=K&&(ue|=parseHex4Bits(G,ne-1)<<4),ue}function parseBase(G,K,ne,ue){for(var pe=0,he=Math.min(G.length,ne),ye=K;ye<he;ye++){var me=G.charCodeAt(ye)-48;pe*=ue,pe+=me>=49?me-49+10:me>=17?me-17+10:me}return pe}BN.isBN=function isBN(G){return G instanceof BN||null!==G&&"object"==typeof G&&G.constructor.wordSize===BN.wordSize&&Array.isArray(G.words)},BN.max=function max(G,K){return G.cmp(K)>0?G:K},BN.min=function min(G,K){return G.cmp(K)<0?G:K},BN.prototype._init=function init(G,K,ne){if("number"==typeof G)return this._initNumber(G,K,ne);if("object"==typeof G)return this._initArray(G,K,ne);"hex"===K&&(K=16),assert(K===(0|K)&&K>=2&&K<=36);var ue=0;"-"===(G=G.toString().replace(/\s+/g,""))[0]&&(ue++,this.negative=1),ue<G.length&&(16===K?this._parseHex(G,ue,ne):(this._parseBase(G,K,ue),"le"===ne&&this._initArray(this.toArray(),K,ne)))},BN.prototype._initNumber=function _initNumber(G,K,ne){G<0&&(this.negative=1,G=-G),G<67108864?(this.words=[67108863&G],this.length=1):G<4503599627370496?(this.words=[67108863&G,G/67108864&67108863],this.length=2):(assert(G<9007199254740992),this.words=[67108863&G,G/67108864&67108863,1],this.length=3),"le"===ne&&this._initArray(this.toArray(),K,ne)},BN.prototype._initArray=function _initArray(G,K,ne){if(assert("number"==typeof G.length),G.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(G.length/3),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he,ye=0;if("be"===ne)for(ue=G.length-1,pe=0;ue>=0;ue-=3)he=G[ue]|G[ue-1]<<8|G[ue-2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);else if("le"===ne)for(ue=0,pe=0;ue<G.length;ue+=3)he=G[ue]|G[ue+1]<<8|G[ue+2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);return this.strip()},BN.prototype._parseHex=function _parseHex(G,K,ne){this.length=Math.ceil((G.length-K)/6),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he=0,ye=0;if("be"===ne)for(ue=G.length-1;ue>=K;ue-=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;else for(ue=(G.length-K)%2==0?K+1:K;ue<G.length;ue+=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;this.strip()},BN.prototype._parseBase=function _parseBase(G,K,ne){this.words=[0],this.length=1;for(var ue=0,pe=1;pe<=67108863;pe*=K)ue++;ue--,pe=pe/K|0;for(var he=G.length-ne,ye=he%ue,me=Math.min(he,he-ye)+ne,be=0,ve=ne;ve<me;ve+=ue)be=parseBase(G,ve,ve+ue,K),this.imuln(pe),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be);if(0!==ye){var _e=1;for(be=parseBase(G,ve,G.length,K),ve=0;ve<ye;ve++)_e*=K;this.imuln(_e),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be)}this.strip()},BN.prototype.copy=function copy(G){G.words=new Array(this.length);for(var K=0;K<this.length;K++)G.words[K]=this.words[K];G.length=this.length,G.negative=this.negative,G.red=this.red},BN.prototype.clone=function clone(){var G=new BN(null);return this.copy(G),G},BN.prototype._expand=function _expand(G){for(;this.length<G;)this.words[this.length++]=0;return this},BN.prototype.strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var ue=["","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"],pe=[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],he=[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];function smallMulTo(G,K,ne){ne.negative=K.negative^G.negative;var ue=G.length+K.length|0;ne.length=ue,ue=ue-1|0;var pe=0|G.words[0],he=0|K.words[0],ye=pe*he,me=67108863&ye,be=ye/67108864|0;ne.words[0]=me;for(var ve=1;ve<ue;ve++){for(var _e=be>>>26,Te=67108863&be,Ee=Math.min(ve,K.length-1),Pe=Math.max(0,ve-G.length+1);Pe<=Ee;Pe++){var Se=ve-Pe|0;_e+=(ye=(pe=0|G.words[Se])*(he=0|K.words[Pe])+Te)/67108864|0,Te=67108863&ye}ne.words[ve]=0|Te,be=0|_e}return 0!==be?ne.words[ve]=0|be:ne.length--,ne.strip()}BN.prototype.toString=function toString(G,K){var ne;if(K=0|K||1,16===(G=G||10)||"hex"===G){ne="";for(var ye=0,me=0,be=0;be<this.length;be++){var ve=this.words[be],_e=(16777215&(ve<<ye|me)).toString(16);ne=0!==(me=ve>>>24-ye&16777215)||be!==this.length-1?ue[6-_e.length]+_e+ne:_e+ne,(ye+=2)>=26&&(ye-=26,be--)}for(0!==me&&(ne=me.toString(16)+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}if(G===(0|G)&&G>=2&&G<=36){var Te=pe[G],Ee=he[G];ne="";var Pe=this.clone();for(Pe.negative=0;!Pe.isZero();){var Se=Pe.modn(Ee).toString(G);ne=(Pe=Pe.idivn(Ee)).isZero()?Se+ne:ue[Te-Se.length]+Se+ne}for(this.isZero()&&(ne="0"+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var G=this.words[0];return 2===this.length?G+=67108864*this.words[1]:3===this.length&&1===this.words[2]?G+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-G:G},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(G,K){return assert(void 0!==ne),this.toArrayLike(ne,G,K)},BN.prototype.toArray=function toArray(G,K){return this.toArrayLike(Array,G,K)},BN.prototype.toArrayLike=function toArrayLike(G,K,ne){var ue=this.byteLength(),pe=ne||Math.max(1,ue);assert(ue<=pe,"byte array longer than desired length"),assert(pe>0,"Requested array length <= 0"),this.strip();var he,ye,me="le"===K,be=new G(pe),ve=this.clone();if(me){for(ye=0;!ve.isZero();ye++)he=ve.andln(255),ve.iushrn(8),be[ye]=he;for(;ye<pe;ye++)be[ye]=0}else{for(ye=0;ye<pe-ue;ye++)be[ye]=0;for(ye=0;!ve.isZero();ye++)he=ve.andln(255),ve.iushrn(8),be[pe-ye-1]=he}return be},Math.clz32?BN.prototype._countBits=function _countBits(G){return 32-Math.clz32(G)}:BN.prototype._countBits=function _countBits(G){var K=G,ne=0;return K>=4096&&(ne+=13,K>>>=13),K>=64&&(ne+=7,K>>>=7),K>=8&&(ne+=4,K>>>=4),K>=2&&(ne+=2,K>>>=2),ne+K},BN.prototype._zeroBits=function _zeroBits(G){if(0===G)return 26;var K=G,ne=0;return 0==(8191&K)&&(ne+=13,K>>>=13),0==(127&K)&&(ne+=7,K>>>=7),0==(15&K)&&(ne+=4,K>>>=4),0==(3&K)&&(ne+=2,K>>>=2),0==(1&K)&&ne++,ne},BN.prototype.bitLength=function bitLength(){var G=this.words[this.length-1],K=this._countBits(G);return 26*(this.length-1)+K},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var G=0,K=0;K<this.length;K++){var ne=this._zeroBits(this.words[K]);if(G+=ne,26!==ne)break}return G},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(G){return 0!==this.negative?this.abs().inotn(G).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(G){return this.testn(G-1)?this.notn(G).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(G){for(;this.length<G.length;)this.words[this.length++]=0;for(var K=0;K<G.length;K++)this.words[K]=this.words[K]|G.words[K];return this.strip()},BN.prototype.ior=function ior(G){return assert(0==(this.negative|G.negative)),this.iuor(G)},BN.prototype.or=function or(G){return this.length>G.length?this.clone().ior(G):G.clone().ior(this)},BN.prototype.uor=function uor(G){return this.length>G.length?this.clone().iuor(G):G.clone().iuor(this)},BN.prototype.iuand=function iuand(G){var K;K=this.length>G.length?G:this;for(var ne=0;ne<K.length;ne++)this.words[ne]=this.words[ne]&G.words[ne];return this.length=K.length,this.strip()},BN.prototype.iand=function iand(G){return assert(0==(this.negative|G.negative)),this.iuand(G)},BN.prototype.and=function and(G){return this.length>G.length?this.clone().iand(G):G.clone().iand(this)},BN.prototype.uand=function uand(G){return this.length>G.length?this.clone().iuand(G):G.clone().iuand(this)},BN.prototype.iuxor=function iuxor(G){var K,ne;this.length>G.length?(K=this,ne=G):(K=G,ne=this);for(var ue=0;ue<ne.length;ue++)this.words[ue]=K.words[ue]^ne.words[ue];if(this!==K)for(;ue<K.length;ue++)this.words[ue]=K.words[ue];return this.length=K.length,this.strip()},BN.prototype.ixor=function ixor(G){return assert(0==(this.negative|G.negative)),this.iuxor(G)},BN.prototype.xor=function xor(G){return this.length>G.length?this.clone().ixor(G):G.clone().ixor(this)},BN.prototype.uxor=function uxor(G){return this.length>G.length?this.clone().iuxor(G):G.clone().iuxor(this)},BN.prototype.inotn=function inotn(G){assert("number"==typeof G&&G>=0);var K=0|Math.ceil(G/26),ne=G%26;this._expand(K),ne>0&&K--;for(var ue=0;ue<K;ue++)this.words[ue]=67108863&~this.words[ue];return ne>0&&(this.words[ue]=~this.words[ue]&67108863>>26-ne),this.strip()},BN.prototype.notn=function notn(G){return this.clone().inotn(G)},BN.prototype.setn=function setn(G,K){assert("number"==typeof G&&G>=0);var ne=G/26|0,ue=G%26;return this._expand(ne+1),this.words[ne]=K?this.words[ne]|1<<ue:this.words[ne]&~(1<<ue),this.strip()},BN.prototype.iadd=function iadd(G){var K,ne,ue;if(0!==this.negative&&0===G.negative)return this.negative=0,K=this.isub(G),this.negative^=1,this._normSign();if(0===this.negative&&0!==G.negative)return G.negative=0,K=this.isub(G),G.negative=1,K._normSign();this.length>G.length?(ne=this,ue=G):(ne=G,ue=this);for(var pe=0,he=0;he<ue.length;he++)K=(0|ne.words[he])+(0|ue.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;for(;0!==pe&&he<ne.length;he++)K=(0|ne.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;if(this.length=ne.length,0!==pe)this.words[this.length]=pe,this.length++;else if(ne!==this)for(;he<ne.length;he++)this.words[he]=ne.words[he];return this},BN.prototype.add=function add(G){var K;return 0!==G.negative&&0===this.negative?(G.negative=0,K=this.sub(G),G.negative^=1,K):0===G.negative&&0!==this.negative?(this.negative=0,K=G.sub(this),this.negative=1,K):this.length>G.length?this.clone().iadd(G):G.clone().iadd(this)},BN.prototype.isub=function isub(G){if(0!==G.negative){G.negative=0;var K=this.iadd(G);return G.negative=1,K._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(G),this.negative=1,this._normSign();var ne,ue,pe=this.cmp(G);if(0===pe)return this.negative=0,this.length=1,this.words[0]=0,this;pe>0?(ne=this,ue=G):(ne=G,ue=this);for(var he=0,ye=0;ye<ue.length;ye++)he=(K=(0|ne.words[ye])-(0|ue.words[ye])+he)>>26,this.words[ye]=67108863&K;for(;0!==he&&ye<ne.length;ye++)he=(K=(0|ne.words[ye])+he)>>26,this.words[ye]=67108863&K;if(0===he&&ye<ne.length&&ne!==this)for(;ye<ne.length;ye++)this.words[ye]=ne.words[ye];return this.length=Math.max(this.length,ye),ne!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function sub(G){return this.clone().isub(G)};var ye=function comb10MulTo(G,K,ne){var ue,pe,he,ye=G.words,me=K.words,be=ne.words,ve=0,_e=0|ye[0],Te=8191&_e,Ee=_e>>>13,Pe=0|ye[1],Se=8191&Pe,Ce=Pe>>>13,ke=0|ye[2],Oe=8191&ke,xe=ke>>>13,Ne=0|ye[3],Me=8191&Ne,Be=Ne>>>13,Fe=0|ye[4],De=8191&Fe,Le=Fe>>>13,Ue=0|ye[5],je=8191&Ue,ze=Ue>>>13,Je=0|ye[6],Xe=8191&Je,Qe=Je>>>13,Ye=0|ye[7],et=8191&Ye,tt=Ye>>>13,rt=0|ye[8],nt=8191&rt,at=rt>>>13,it=0|ye[9],ot=8191&it,ct=it>>>13,dt=0|me[0],ut=8191&dt,ft=dt>>>13,yt=0|me[1],wt=8191&yt,At=yt>>>13,St=0|me[2],kt=8191&St,Bt=St>>>13,Lt=0|me[3],Ut=8191&Lt,$t=Lt>>>13,Ht=0|me[4],Vt=8191&Ht,er=Ht>>>13,tr=0|me[5],rr=8191&tr,cr=tr>>>13,dr=0|me[6],Rr=8191&dr,kr=dr>>>13,$r=0|me[7],qr=8191&$r,Hr=$r>>>13,Vr=0|me[8],Zr=8191&Vr,en=Vr>>>13,tn=0|me[9],an=8191&tn,sn=tn>>>13;ne.negative=G.negative^K.negative,ne.length=19;var un=(ve+(ue=Math.imul(Te,ut))|0)+((8191&(pe=(pe=Math.imul(Te,ft))+Math.imul(Ee,ut)|0))<<13)|0;ve=((he=Math.imul(Ee,ft))+(pe>>>13)|0)+(un>>>26)|0,un&=67108863,ue=Math.imul(Se,ut),pe=(pe=Math.imul(Se,ft))+Math.imul(Ce,ut)|0,he=Math.imul(Ce,ft);var fn=(ve+(ue=ue+Math.imul(Te,wt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,At)|0)+Math.imul(Ee,wt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,At)|0)+(pe>>>13)|0)+(fn>>>26)|0,fn&=67108863,ue=Math.imul(Oe,ut),pe=(pe=Math.imul(Oe,ft))+Math.imul(xe,ut)|0,he=Math.imul(xe,ft),ue=ue+Math.imul(Se,wt)|0,pe=(pe=pe+Math.imul(Se,At)|0)+Math.imul(Ce,wt)|0,he=he+Math.imul(Ce,At)|0;var pn=(ve+(ue=ue+Math.imul(Te,kt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Bt)|0)+Math.imul(Ee,kt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Bt)|0)+(pe>>>13)|0)+(pn>>>26)|0,pn&=67108863,ue=Math.imul(Me,ut),pe=(pe=Math.imul(Me,ft))+Math.imul(Be,ut)|0,he=Math.imul(Be,ft),ue=ue+Math.imul(Oe,wt)|0,pe=(pe=pe+Math.imul(Oe,At)|0)+Math.imul(xe,wt)|0,he=he+Math.imul(xe,At)|0,ue=ue+Math.imul(Se,kt)|0,pe=(pe=pe+Math.imul(Se,Bt)|0)+Math.imul(Ce,kt)|0,he=he+Math.imul(Ce,Bt)|0;var hn=(ve+(ue=ue+Math.imul(Te,Ut)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,$t)|0)+Math.imul(Ee,Ut)|0))<<13)|0;ve=((he=he+Math.imul(Ee,$t)|0)+(pe>>>13)|0)+(hn>>>26)|0,hn&=67108863,ue=Math.imul(De,ut),pe=(pe=Math.imul(De,ft))+Math.imul(Le,ut)|0,he=Math.imul(Le,ft),ue=ue+Math.imul(Me,wt)|0,pe=(pe=pe+Math.imul(Me,At)|0)+Math.imul(Be,wt)|0,he=he+Math.imul(Be,At)|0,ue=ue+Math.imul(Oe,kt)|0,pe=(pe=pe+Math.imul(Oe,Bt)|0)+Math.imul(xe,kt)|0,he=he+Math.imul(xe,Bt)|0,ue=ue+Math.imul(Se,Ut)|0,pe=(pe=pe+Math.imul(Se,$t)|0)+Math.imul(Ce,Ut)|0,he=he+Math.imul(Ce,$t)|0;var yn=(ve+(ue=ue+Math.imul(Te,Vt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,er)|0)+Math.imul(Ee,Vt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,er)|0)+(pe>>>13)|0)+(yn>>>26)|0,yn&=67108863,ue=Math.imul(je,ut),pe=(pe=Math.imul(je,ft))+Math.imul(ze,ut)|0,he=Math.imul(ze,ft),ue=ue+Math.imul(De,wt)|0,pe=(pe=pe+Math.imul(De,At)|0)+Math.imul(Le,wt)|0,he=he+Math.imul(Le,At)|0,ue=ue+Math.imul(Me,kt)|0,pe=(pe=pe+Math.imul(Me,Bt)|0)+Math.imul(Be,kt)|0,he=he+Math.imul(Be,Bt)|0,ue=ue+Math.imul(Oe,Ut)|0,pe=(pe=pe+Math.imul(Oe,$t)|0)+Math.imul(xe,Ut)|0,he=he+Math.imul(xe,$t)|0,ue=ue+Math.imul(Se,Vt)|0,pe=(pe=pe+Math.imul(Se,er)|0)+Math.imul(Ce,Vt)|0,he=he+Math.imul(Ce,er)|0;var mn=(ve+(ue=ue+Math.imul(Te,rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,cr)|0)+Math.imul(Ee,rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,cr)|0)+(pe>>>13)|0)+(mn>>>26)|0,mn&=67108863,ue=Math.imul(Xe,ut),pe=(pe=Math.imul(Xe,ft))+Math.imul(Qe,ut)|0,he=Math.imul(Qe,ft),ue=ue+Math.imul(je,wt)|0,pe=(pe=pe+Math.imul(je,At)|0)+Math.imul(ze,wt)|0,he=he+Math.imul(ze,At)|0,ue=ue+Math.imul(De,kt)|0,pe=(pe=pe+Math.imul(De,Bt)|0)+Math.imul(Le,kt)|0,he=he+Math.imul(Le,Bt)|0,ue=ue+Math.imul(Me,Ut)|0,pe=(pe=pe+Math.imul(Me,$t)|0)+Math.imul(Be,Ut)|0,he=he+Math.imul(Be,$t)|0,ue=ue+Math.imul(Oe,Vt)|0,pe=(pe=pe+Math.imul(Oe,er)|0)+Math.imul(xe,Vt)|0,he=he+Math.imul(xe,er)|0,ue=ue+Math.imul(Se,rr)|0,pe=(pe=pe+Math.imul(Se,cr)|0)+Math.imul(Ce,rr)|0,he=he+Math.imul(Ce,cr)|0;var bn=(ve+(ue=ue+Math.imul(Te,Rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,kr)|0)+Math.imul(Ee,Rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,kr)|0)+(pe>>>13)|0)+(bn>>>26)|0,bn&=67108863,ue=Math.imul(et,ut),pe=(pe=Math.imul(et,ft))+Math.imul(tt,ut)|0,he=Math.imul(tt,ft),ue=ue+Math.imul(Xe,wt)|0,pe=(pe=pe+Math.imul(Xe,At)|0)+Math.imul(Qe,wt)|0,he=he+Math.imul(Qe,At)|0,ue=ue+Math.imul(je,kt)|0,pe=(pe=pe+Math.imul(je,Bt)|0)+Math.imul(ze,kt)|0,he=he+Math.imul(ze,Bt)|0,ue=ue+Math.imul(De,Ut)|0,pe=(pe=pe+Math.imul(De,$t)|0)+Math.imul(Le,Ut)|0,he=he+Math.imul(Le,$t)|0,ue=ue+Math.imul(Me,Vt)|0,pe=(pe=pe+Math.imul(Me,er)|0)+Math.imul(Be,Vt)|0,he=he+Math.imul(Be,er)|0,ue=ue+Math.imul(Oe,rr)|0,pe=(pe=pe+Math.imul(Oe,cr)|0)+Math.imul(xe,rr)|0,he=he+Math.imul(xe,cr)|0,ue=ue+Math.imul(Se,Rr)|0,pe=(pe=pe+Math.imul(Se,kr)|0)+Math.imul(Ce,Rr)|0,he=he+Math.imul(Ce,kr)|0;var gn=(ve+(ue=ue+Math.imul(Te,qr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Hr)|0)+Math.imul(Ee,qr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Hr)|0)+(pe>>>13)|0)+(gn>>>26)|0,gn&=67108863,ue=Math.imul(nt,ut),pe=(pe=Math.imul(nt,ft))+Math.imul(at,ut)|0,he=Math.imul(at,ft),ue=ue+Math.imul(et,wt)|0,pe=(pe=pe+Math.imul(et,At)|0)+Math.imul(tt,wt)|0,he=he+Math.imul(tt,At)|0,ue=ue+Math.imul(Xe,kt)|0,pe=(pe=pe+Math.imul(Xe,Bt)|0)+Math.imul(Qe,kt)|0,he=he+Math.imul(Qe,Bt)|0,ue=ue+Math.imul(je,Ut)|0,pe=(pe=pe+Math.imul(je,$t)|0)+Math.imul(ze,Ut)|0,he=he+Math.imul(ze,$t)|0,ue=ue+Math.imul(De,Vt)|0,pe=(pe=pe+Math.imul(De,er)|0)+Math.imul(Le,Vt)|0,he=he+Math.imul(Le,er)|0,ue=ue+Math.imul(Me,rr)|0,pe=(pe=pe+Math.imul(Me,cr)|0)+Math.imul(Be,rr)|0,he=he+Math.imul(Be,cr)|0,ue=ue+Math.imul(Oe,Rr)|0,pe=(pe=pe+Math.imul(Oe,kr)|0)+Math.imul(xe,Rr)|0,he=he+Math.imul(xe,kr)|0,ue=ue+Math.imul(Se,qr)|0,pe=(pe=pe+Math.imul(Se,Hr)|0)+Math.imul(Ce,qr)|0,he=he+Math.imul(Ce,Hr)|0;var vn=(ve+(ue=ue+Math.imul(Te,Zr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,en)|0)+Math.imul(Ee,Zr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,en)|0)+(pe>>>13)|0)+(vn>>>26)|0,vn&=67108863,ue=Math.imul(ot,ut),pe=(pe=Math.imul(ot,ft))+Math.imul(ct,ut)|0,he=Math.imul(ct,ft),ue=ue+Math.imul(nt,wt)|0,pe=(pe=pe+Math.imul(nt,At)|0)+Math.imul(at,wt)|0,he=he+Math.imul(at,At)|0,ue=ue+Math.imul(et,kt)|0,pe=(pe=pe+Math.imul(et,Bt)|0)+Math.imul(tt,kt)|0,he=he+Math.imul(tt,Bt)|0,ue=ue+Math.imul(Xe,Ut)|0,pe=(pe=pe+Math.imul(Xe,$t)|0)+Math.imul(Qe,Ut)|0,he=he+Math.imul(Qe,$t)|0,ue=ue+Math.imul(je,Vt)|0,pe=(pe=pe+Math.imul(je,er)|0)+Math.imul(ze,Vt)|0,he=he+Math.imul(ze,er)|0,ue=ue+Math.imul(De,rr)|0,pe=(pe=pe+Math.imul(De,cr)|0)+Math.imul(Le,rr)|0,he=he+Math.imul(Le,cr)|0,ue=ue+Math.imul(Me,Rr)|0,pe=(pe=pe+Math.imul(Me,kr)|0)+Math.imul(Be,Rr)|0,he=he+Math.imul(Be,kr)|0,ue=ue+Math.imul(Oe,qr)|0,pe=(pe=pe+Math.imul(Oe,Hr)|0)+Math.imul(xe,qr)|0,he=he+Math.imul(xe,Hr)|0,ue=ue+Math.imul(Se,Zr)|0,pe=(pe=pe+Math.imul(Se,en)|0)+Math.imul(Ce,Zr)|0,he=he+Math.imul(Ce,en)|0;var Tn=(ve+(ue=ue+Math.imul(Te,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,sn)|0)+Math.imul(Ee,an)|0))<<13)|0;ve=((he=he+Math.imul(Ee,sn)|0)+(pe>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ue=Math.imul(ot,wt),pe=(pe=Math.imul(ot,At))+Math.imul(ct,wt)|0,he=Math.imul(ct,At),ue=ue+Math.imul(nt,kt)|0,pe=(pe=pe+Math.imul(nt,Bt)|0)+Math.imul(at,kt)|0,he=he+Math.imul(at,Bt)|0,ue=ue+Math.imul(et,Ut)|0,pe=(pe=pe+Math.imul(et,$t)|0)+Math.imul(tt,Ut)|0,he=he+Math.imul(tt,$t)|0,ue=ue+Math.imul(Xe,Vt)|0,pe=(pe=pe+Math.imul(Xe,er)|0)+Math.imul(Qe,Vt)|0,he=he+Math.imul(Qe,er)|0,ue=ue+Math.imul(je,rr)|0,pe=(pe=pe+Math.imul(je,cr)|0)+Math.imul(ze,rr)|0,he=he+Math.imul(ze,cr)|0,ue=ue+Math.imul(De,Rr)|0,pe=(pe=pe+Math.imul(De,kr)|0)+Math.imul(Le,Rr)|0,he=he+Math.imul(Le,kr)|0,ue=ue+Math.imul(Me,qr)|0,pe=(pe=pe+Math.imul(Me,Hr)|0)+Math.imul(Be,qr)|0,he=he+Math.imul(Be,Hr)|0,ue=ue+Math.imul(Oe,Zr)|0,pe=(pe=pe+Math.imul(Oe,en)|0)+Math.imul(xe,Zr)|0,he=he+Math.imul(xe,en)|0;var En=(ve+(ue=ue+Math.imul(Se,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Se,sn)|0)+Math.imul(Ce,an)|0))<<13)|0;ve=((he=he+Math.imul(Ce,sn)|0)+(pe>>>13)|0)+(En>>>26)|0,En&=67108863,ue=Math.imul(ot,kt),pe=(pe=Math.imul(ot,Bt))+Math.imul(ct,kt)|0,he=Math.imul(ct,Bt),ue=ue+Math.imul(nt,Ut)|0,pe=(pe=pe+Math.imul(nt,$t)|0)+Math.imul(at,Ut)|0,he=he+Math.imul(at,$t)|0,ue=ue+Math.imul(et,Vt)|0,pe=(pe=pe+Math.imul(et,er)|0)+Math.imul(tt,Vt)|0,he=he+Math.imul(tt,er)|0,ue=ue+Math.imul(Xe,rr)|0,pe=(pe=pe+Math.imul(Xe,cr)|0)+Math.imul(Qe,rr)|0,he=he+Math.imul(Qe,cr)|0,ue=ue+Math.imul(je,Rr)|0,pe=(pe=pe+Math.imul(je,kr)|0)+Math.imul(ze,Rr)|0,he=he+Math.imul(ze,kr)|0,ue=ue+Math.imul(De,qr)|0,pe=(pe=pe+Math.imul(De,Hr)|0)+Math.imul(Le,qr)|0,he=he+Math.imul(Le,Hr)|0,ue=ue+Math.imul(Me,Zr)|0,pe=(pe=pe+Math.imul(Me,en)|0)+Math.imul(Be,Zr)|0,he=he+Math.imul(Be,en)|0;var In=(ve+(ue=ue+Math.imul(Oe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Oe,sn)|0)+Math.imul(xe,an)|0))<<13)|0;ve=((he=he+Math.imul(xe,sn)|0)+(pe>>>13)|0)+(In>>>26)|0,In&=67108863,ue=Math.imul(ot,Ut),pe=(pe=Math.imul(ot,$t))+Math.imul(ct,Ut)|0,he=Math.imul(ct,$t),ue=ue+Math.imul(nt,Vt)|0,pe=(pe=pe+Math.imul(nt,er)|0)+Math.imul(at,Vt)|0,he=he+Math.imul(at,er)|0,ue=ue+Math.imul(et,rr)|0,pe=(pe=pe+Math.imul(et,cr)|0)+Math.imul(tt,rr)|0,he=he+Math.imul(tt,cr)|0,ue=ue+Math.imul(Xe,Rr)|0,pe=(pe=pe+Math.imul(Xe,kr)|0)+Math.imul(Qe,Rr)|0,he=he+Math.imul(Qe,kr)|0,ue=ue+Math.imul(je,qr)|0,pe=(pe=pe+Math.imul(je,Hr)|0)+Math.imul(ze,qr)|0,he=he+Math.imul(ze,Hr)|0,ue=ue+Math.imul(De,Zr)|0,pe=(pe=pe+Math.imul(De,en)|0)+Math.imul(Le,Zr)|0,he=he+Math.imul(Le,en)|0;var Rn=(ve+(ue=ue+Math.imul(Me,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Me,sn)|0)+Math.imul(Be,an)|0))<<13)|0;ve=((he=he+Math.imul(Be,sn)|0)+(pe>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,ue=Math.imul(ot,Vt),pe=(pe=Math.imul(ot,er))+Math.imul(ct,Vt)|0,he=Math.imul(ct,er),ue=ue+Math.imul(nt,rr)|0,pe=(pe=pe+Math.imul(nt,cr)|0)+Math.imul(at,rr)|0,he=he+Math.imul(at,cr)|0,ue=ue+Math.imul(et,Rr)|0,pe=(pe=pe+Math.imul(et,kr)|0)+Math.imul(tt,Rr)|0,he=he+Math.imul(tt,kr)|0,ue=ue+Math.imul(Xe,qr)|0,pe=(pe=pe+Math.imul(Xe,Hr)|0)+Math.imul(Qe,qr)|0,he=he+Math.imul(Qe,Hr)|0,ue=ue+Math.imul(je,Zr)|0,pe=(pe=pe+Math.imul(je,en)|0)+Math.imul(ze,Zr)|0,he=he+Math.imul(ze,en)|0;var Nn=(ve+(ue=ue+Math.imul(De,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(De,sn)|0)+Math.imul(Le,an)|0))<<13)|0;ve=((he=he+Math.imul(Le,sn)|0)+(pe>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,ue=Math.imul(ot,rr),pe=(pe=Math.imul(ot,cr))+Math.imul(ct,rr)|0,he=Math.imul(ct,cr),ue=ue+Math.imul(nt,Rr)|0,pe=(pe=pe+Math.imul(nt,kr)|0)+Math.imul(at,Rr)|0,he=he+Math.imul(at,kr)|0,ue=ue+Math.imul(et,qr)|0,pe=(pe=pe+Math.imul(et,Hr)|0)+Math.imul(tt,qr)|0,he=he+Math.imul(tt,Hr)|0,ue=ue+Math.imul(Xe,Zr)|0,pe=(pe=pe+Math.imul(Xe,en)|0)+Math.imul(Qe,Zr)|0,he=he+Math.imul(Qe,en)|0;var Bn=(ve+(ue=ue+Math.imul(je,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(je,sn)|0)+Math.imul(ze,an)|0))<<13)|0;ve=((he=he+Math.imul(ze,sn)|0)+(pe>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,ue=Math.imul(ot,Rr),pe=(pe=Math.imul(ot,kr))+Math.imul(ct,Rr)|0,he=Math.imul(ct,kr),ue=ue+Math.imul(nt,qr)|0,pe=(pe=pe+Math.imul(nt,Hr)|0)+Math.imul(at,qr)|0,he=he+Math.imul(at,Hr)|0,ue=ue+Math.imul(et,Zr)|0,pe=(pe=pe+Math.imul(et,en)|0)+Math.imul(tt,Zr)|0,he=he+Math.imul(tt,en)|0;var Fn=(ve+(ue=ue+Math.imul(Xe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Xe,sn)|0)+Math.imul(Qe,an)|0))<<13)|0;ve=((he=he+Math.imul(Qe,sn)|0)+(pe>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,ue=Math.imul(ot,qr),pe=(pe=Math.imul(ot,Hr))+Math.imul(ct,qr)|0,he=Math.imul(ct,Hr),ue=ue+Math.imul(nt,Zr)|0,pe=(pe=pe+Math.imul(nt,en)|0)+Math.imul(at,Zr)|0,he=he+Math.imul(at,en)|0;var Dn=(ve+(ue=ue+Math.imul(et,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(et,sn)|0)+Math.imul(tt,an)|0))<<13)|0;ve=((he=he+Math.imul(tt,sn)|0)+(pe>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,ue=Math.imul(ot,Zr),pe=(pe=Math.imul(ot,en))+Math.imul(ct,Zr)|0,he=Math.imul(ct,en);var Un=(ve+(ue=ue+Math.imul(nt,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(nt,sn)|0)+Math.imul(at,an)|0))<<13)|0;ve=((he=he+Math.imul(at,sn)|0)+(pe>>>13)|0)+(Un>>>26)|0,Un&=67108863;var $n=(ve+(ue=Math.imul(ot,an))|0)+((8191&(pe=(pe=Math.imul(ot,sn))+Math.imul(ct,an)|0))<<13)|0;return ve=((he=Math.imul(ct,sn))+(pe>>>13)|0)+($n>>>26)|0,$n&=67108863,be[0]=un,be[1]=fn,be[2]=pn,be[3]=hn,be[4]=yn,be[5]=mn,be[6]=bn,be[7]=gn,be[8]=vn,be[9]=Tn,be[10]=En,be[11]=In,be[12]=Rn,be[13]=Nn,be[14]=Bn,be[15]=Fn,be[16]=Dn,be[17]=Un,be[18]=$n,0!==ve&&(be[19]=ve,ne.length++),ne};function jumboMulTo(G,K,ne){return(new FFTM).mulp(G,K,ne)}function FFTM(G,K){this.x=G,this.y=K}Math.imul||(ye=smallMulTo),BN.prototype.mulTo=function mulTo(G,K){var ne,ue=this.length+G.length;return ne=10===this.length&&10===G.length?ye(this,G,K):ue<63?smallMulTo(this,G,K):ue<1024?function bigMulTo(G,K,ne){ne.negative=K.negative^G.negative,ne.length=G.length+K.length;for(var ue=0,pe=0,he=0;he<ne.length-1;he++){var ye=pe;pe=0;for(var me=67108863&ue,be=Math.min(he,K.length-1),ve=Math.max(0,he-G.length+1);ve<=be;ve++){var _e=he-ve,Te=(0|G.words[_e])*(0|K.words[ve]),Ee=67108863&Te;me=67108863&(Ee=Ee+me|0),pe+=(ye=(ye=ye+(Te/67108864|0)|0)+(Ee>>>26)|0)>>>26,ye&=67108863}ne.words[he]=me,ue=ye,ye=pe}return 0!==ue?ne.words[he]=ue:ne.length--,ne.strip()}(this,G,K):jumboMulTo(this,G,K),ne},FFTM.prototype.makeRBT=function makeRBT(G){for(var K=new Array(G),ne=BN.prototype._countBits(G)-1,ue=0;ue<G;ue++)K[ue]=this.revBin(ue,ne,G);return K},FFTM.prototype.revBin=function revBin(G,K,ne){if(0===G||G===ne-1)return G;for(var ue=0,pe=0;pe<K;pe++)ue|=(1&G)<<K-pe-1,G>>=1;return ue},FFTM.prototype.permute=function permute(G,K,ne,ue,pe,he){for(var ye=0;ye<he;ye++)ue[ye]=K[G[ye]],pe[ye]=ne[G[ye]]},FFTM.prototype.transform=function transform(G,K,ne,ue,pe,he){this.permute(he,G,K,ne,ue,pe);for(var ye=1;ye<pe;ye<<=1)for(var me=ye<<1,be=Math.cos(2*Math.PI/me),ve=Math.sin(2*Math.PI/me),_e=0;_e<pe;_e+=me)for(var Te=be,Ee=ve,Pe=0;Pe<ye;Pe++){var Se=ne[_e+Pe],Ce=ue[_e+Pe],ke=ne[_e+Pe+ye],Oe=ue[_e+Pe+ye],xe=Te*ke-Ee*Oe;Oe=Te*Oe+Ee*ke,ke=xe,ne[_e+Pe]=Se+ke,ue[_e+Pe]=Ce+Oe,ne[_e+Pe+ye]=Se-ke,ue[_e+Pe+ye]=Ce-Oe,Pe!==me&&(xe=be*Te-ve*Ee,Ee=be*Ee+ve*Te,Te=xe)}},FFTM.prototype.guessLen13b=function guessLen13b(G,K){var ne=1|Math.max(K,G),ue=1&ne,pe=0;for(ne=ne/2|0;ne;ne>>>=1)pe++;return 1<<pe+1+ue},FFTM.prototype.conjugate=function conjugate(G,K,ne){if(!(ne<=1))for(var ue=0;ue<ne/2;ue++){var pe=G[ue];G[ue]=G[ne-ue-1],G[ne-ue-1]=pe,pe=K[ue],K[ue]=-K[ne-ue-1],K[ne-ue-1]=-pe}},FFTM.prototype.normalize13b=function normalize13b(G,K){for(var ne=0,ue=0;ue<K/2;ue++){var pe=8192*Math.round(G[2*ue+1]/K)+Math.round(G[2*ue]/K)+ne;G[ue]=67108863&pe,ne=pe<67108864?0:pe/67108864|0}return G},FFTM.prototype.convert13b=function convert13b(G,K,ne,ue){for(var pe=0,he=0;he<K;he++)pe+=0|G[he],ne[2*he]=8191&pe,pe>>>=13,ne[2*he+1]=8191&pe,pe>>>=13;for(he=2*K;he<ue;++he)ne[he]=0;assert(0===pe),assert(0==(-8192&pe))},FFTM.prototype.stub=function stub(G){for(var K=new Array(G),ne=0;ne<G;ne++)K[ne]=0;return K},FFTM.prototype.mulp=function mulp(G,K,ne){var ue=2*this.guessLen13b(G.length,K.length),pe=this.makeRBT(ue),he=this.stub(ue),ye=new Array(ue),me=new Array(ue),be=new Array(ue),ve=new Array(ue),_e=new Array(ue),Te=new Array(ue),Ee=ne.words;Ee.length=ue,this.convert13b(G.words,G.length,ye,ue),this.convert13b(K.words,K.length,ve,ue),this.transform(ye,he,me,be,ue,pe),this.transform(ve,he,_e,Te,ue,pe);for(var Pe=0;Pe<ue;Pe++){var Se=me[Pe]*_e[Pe]-be[Pe]*Te[Pe];be[Pe]=me[Pe]*Te[Pe]+be[Pe]*_e[Pe],me[Pe]=Se}return this.conjugate(me,be,ue),this.transform(me,be,Ee,he,ue,pe),this.conjugate(Ee,he,ue),this.normalize13b(Ee,ue),ne.negative=G.negative^K.negative,ne.length=G.length+K.length,ne.strip()},BN.prototype.mul=function mul(G){var K=new BN(null);return K.words=new Array(this.length+G.length),this.mulTo(G,K)},BN.prototype.mulf=function mulf(G){var K=new BN(null);return K.words=new Array(this.length+G.length),jumboMulTo(this,G,K)},BN.prototype.imul=function imul(G){return this.clone().mulTo(G,this)},BN.prototype.imuln=function imuln(G){assert("number"==typeof G),assert(G<67108864);for(var K=0,ne=0;ne<this.length;ne++){var ue=(0|this.words[ne])*G,pe=(67108863&ue)+(67108863&K);K>>=26,K+=ue/67108864|0,K+=pe>>>26,this.words[ne]=67108863&pe}return 0!==K&&(this.words[ne]=K,this.length++),this},BN.prototype.muln=function muln(G){return this.clone().imuln(G)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(G){var K=function toBitArray(G){for(var K=new Array(G.bitLength()),ne=0;ne<K.length;ne++){var ue=ne/26|0,pe=ne%26;K[ne]=(G.words[ue]&1<<pe)>>>pe}return K}(G);if(0===K.length)return new BN(1);for(var ne=this,ue=0;ue<K.length&&0===K[ue];ue++,ne=ne.sqr());if(++ue<K.length)for(var pe=ne.sqr();ue<K.length;ue++,pe=pe.sqr())0!==K[ue]&&(ne=ne.mul(pe));return ne},BN.prototype.iushln=function iushln(G){assert("number"==typeof G&&G>=0);var K,ne=G%26,ue=(G-ne)/26,pe=67108863>>>26-ne<<26-ne;if(0!==ne){var he=0;for(K=0;K<this.length;K++){var ye=this.words[K]&pe,me=(0|this.words[K])-ye<<ne;this.words[K]=me|he,he=ye>>>26-ne}he&&(this.words[K]=he,this.length++)}if(0!==ue){for(K=this.length-1;K>=0;K--)this.words[K+ue]=this.words[K];for(K=0;K<ue;K++)this.words[K]=0;this.length+=ue}return this.strip()},BN.prototype.ishln=function ishln(G){return assert(0===this.negative),this.iushln(G)},BN.prototype.iushrn=function iushrn(G,K,ne){var ue;assert("number"==typeof G&&G>=0),ue=K?(K-K%26)/26:0;var pe=G%26,he=Math.min((G-pe)/26,this.length),ye=67108863^67108863>>>pe<<pe,me=ne;if(ue-=he,ue=Math.max(0,ue),me){for(var be=0;be<he;be++)me.words[be]=this.words[be];me.length=he}if(0===he);else if(this.length>he)for(this.length-=he,be=0;be<this.length;be++)this.words[be]=this.words[be+he];else this.words[0]=0,this.length=1;var ve=0;for(be=this.length-1;be>=0&&(0!==ve||be>=ue);be--){var _e=0|this.words[be];this.words[be]=ve<<26-pe|_e>>>pe,ve=_e&ye}return me&&0!==ve&&(me.words[me.length++]=ve),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(G,K,ne){return assert(0===this.negative),this.iushrn(G,K,ne)},BN.prototype.shln=function shln(G){return this.clone().ishln(G)},BN.prototype.ushln=function ushln(G){return this.clone().iushln(G)},BN.prototype.shrn=function shrn(G){return this.clone().ishrn(G)},BN.prototype.ushrn=function ushrn(G){return this.clone().iushrn(G)},BN.prototype.testn=function testn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26,ue=1<<K;return!(this.length<=ne)&&!!(this.words[ne]&ue)},BN.prototype.imaskn=function imaskn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=ne)return this;if(0!==K&&ne++,this.length=Math.min(ne,this.length),0!==K){var ue=67108863^67108863>>>K<<K;this.words[this.length-1]&=ue}return this.strip()},BN.prototype.maskn=function maskn(G){return this.clone().imaskn(G)},BN.prototype.iaddn=function iaddn(G){return assert("number"==typeof G),assert(G<67108864),G<0?this.isubn(-G):0!==this.negative?1===this.length&&(0|this.words[0])<G?(this.words[0]=G-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(G),this.negative=1,this):this._iaddn(G)},BN.prototype._iaddn=function _iaddn(G){this.words[0]+=G;for(var K=0;K<this.length&&this.words[K]>=67108864;K++)this.words[K]-=67108864,K===this.length-1?this.words[K+1]=1:this.words[K+1]++;return this.length=Math.max(this.length,K+1),this},BN.prototype.isubn=function isubn(G){if(assert("number"==typeof G),assert(G<67108864),G<0)return this.iaddn(-G);if(0!==this.negative)return this.negative=0,this.iaddn(G),this.negative=1,this;if(this.words[0]-=G,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var K=0;K<this.length&&this.words[K]<0;K++)this.words[K]+=67108864,this.words[K+1]-=1;return this.strip()},BN.prototype.addn=function addn(G){return this.clone().iaddn(G)},BN.prototype.subn=function subn(G){return this.clone().isubn(G)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(G,K,ne){var ue,pe,he=G.length+ne;this._expand(he);var ye=0;for(ue=0;ue<G.length;ue++){pe=(0|this.words[ue+ne])+ye;var me=(0|G.words[ue])*K;ye=((pe-=67108863&me)>>26)-(me/67108864|0),this.words[ue+ne]=67108863&pe}for(;ue<this.length-ne;ue++)ye=(pe=(0|this.words[ue+ne])+ye)>>26,this.words[ue+ne]=67108863&pe;if(0===ye)return this.strip();for(assert(-1===ye),ye=0,ue=0;ue<this.length;ue++)ye=(pe=-(0|this.words[ue])+ye)>>26,this.words[ue]=67108863&pe;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(G,K){var ne=(this.length,G.length),ue=this.clone(),pe=G,he=0|pe.words[pe.length-1];0!==(ne=26-this._countBits(he))&&(pe=pe.ushln(ne),ue.iushln(ne),he=0|pe.words[pe.length-1]);var ye,me=ue.length-pe.length;if("mod"!==K){(ye=new BN(null)).length=me+1,ye.words=new Array(ye.length);for(var be=0;be<ye.length;be++)ye.words[be]=0}var ve=ue.clone()._ishlnsubmul(pe,1,me);0===ve.negative&&(ue=ve,ye&&(ye.words[me]=1));for(var _e=me-1;_e>=0;_e--){var Te=67108864*(0|ue.words[pe.length+_e])+(0|ue.words[pe.length+_e-1]);for(Te=Math.min(Te/he|0,67108863),ue._ishlnsubmul(pe,Te,_e);0!==ue.negative;)Te--,ue.negative=0,ue._ishlnsubmul(pe,1,_e),ue.isZero()||(ue.negative^=1);ye&&(ye.words[_e]=Te)}return ye&&ye.strip(),ue.strip(),"div"!==K&&0!==ne&&ue.iushrn(ne),{div:ye||null,mod:ue}},BN.prototype.divmod=function divmod(G,K,ne){return assert(!G.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===G.negative?(he=this.neg().divmod(G,K),"mod"!==K&&(ue=he.div.neg()),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.iadd(G)),{div:ue,mod:pe}):0===this.negative&&0!==G.negative?(he=this.divmod(G.neg(),K),"mod"!==K&&(ue=he.div.neg()),{div:ue,mod:he.mod}):0!=(this.negative&G.negative)?(he=this.neg().divmod(G.neg(),K),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.isub(G)),{div:he.div,mod:pe}):G.length>this.length||this.cmp(G)<0?{div:new BN(0),mod:this}:1===G.length?"div"===K?{div:this.divn(G.words[0]),mod:null}:"mod"===K?{div:null,mod:new BN(this.modn(G.words[0]))}:{div:this.divn(G.words[0]),mod:new BN(this.modn(G.words[0]))}:this._wordDiv(G,K);var ue,pe,he},BN.prototype.div=function div(G){return this.divmod(G,"div",!1).div},BN.prototype.mod=function mod(G){return this.divmod(G,"mod",!1).mod},BN.prototype.umod=function umod(G){return this.divmod(G,"mod",!0).mod},BN.prototype.divRound=function divRound(G){var K=this.divmod(G);if(K.mod.isZero())return K.div;var ne=0!==K.div.negative?K.mod.isub(G):K.mod,ue=G.ushrn(1),pe=G.andln(1),he=ne.cmp(ue);return he<0||1===pe&&0===he?K.div:0!==K.div.negative?K.div.isubn(1):K.div.iaddn(1)},BN.prototype.modn=function modn(G){assert(G<=67108863);for(var K=(1<<26)%G,ne=0,ue=this.length-1;ue>=0;ue--)ne=(K*ne+(0|this.words[ue]))%G;return ne},BN.prototype.idivn=function idivn(G){assert(G<=67108863);for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=(0|this.words[ne])+67108864*K;this.words[ne]=ue/G|0,K=ue%G}return this.strip()},BN.prototype.divn=function divn(G){return this.clone().idivn(G)},BN.prototype.egcd=function egcd(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue=new BN(1),pe=new BN(0),he=new BN(0),ye=new BN(1),me=0;K.isEven()&&ne.isEven();)K.iushrn(1),ne.iushrn(1),++me;for(var be=ne.clone(),ve=K.clone();!K.isZero();){for(var _e=0,Te=1;0==(K.words[0]&Te)&&_e<26;++_e,Te<<=1);if(_e>0)for(K.iushrn(_e);_e-- >0;)(ue.isOdd()||pe.isOdd())&&(ue.iadd(be),pe.isub(ve)),ue.iushrn(1),pe.iushrn(1);for(var Ee=0,Pe=1;0==(ne.words[0]&Pe)&&Ee<26;++Ee,Pe<<=1);if(Ee>0)for(ne.iushrn(Ee);Ee-- >0;)(he.isOdd()||ye.isOdd())&&(he.iadd(be),ye.isub(ve)),he.iushrn(1),ye.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),ue.isub(he),pe.isub(ye)):(ne.isub(K),he.isub(ue),ye.isub(pe))}return{a:he,b:ye,gcd:ne.iushln(me)}},BN.prototype._invmp=function _invmp(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue,pe=new BN(1),he=new BN(0),ye=ne.clone();K.cmpn(1)>0&&ne.cmpn(1)>0;){for(var me=0,be=1;0==(K.words[0]&be)&&me<26;++me,be<<=1);if(me>0)for(K.iushrn(me);me-- >0;)pe.isOdd()&&pe.iadd(ye),pe.iushrn(1);for(var ve=0,_e=1;0==(ne.words[0]&_e)&&ve<26;++ve,_e<<=1);if(ve>0)for(ne.iushrn(ve);ve-- >0;)he.isOdd()&&he.iadd(ye),he.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),pe.isub(he)):(ne.isub(K),he.isub(pe))}return(ue=0===K.cmpn(1)?pe:he).cmpn(0)<0&&ue.iadd(G),ue},BN.prototype.gcd=function gcd(G){if(this.isZero())return G.abs();if(G.isZero())return this.abs();var K=this.clone(),ne=G.clone();K.negative=0,ne.negative=0;for(var ue=0;K.isEven()&&ne.isEven();ue++)K.iushrn(1),ne.iushrn(1);for(;;){for(;K.isEven();)K.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var pe=K.cmp(ne);if(pe<0){var he=K;K=ne,ne=he}else if(0===pe||0===ne.cmpn(1))break;K.isub(ne)}return ne.iushln(ue)},BN.prototype.invm=function invm(G){return this.egcd(G).a.umod(G)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(G){return this.words[0]&G},BN.prototype.bincn=function bincn(G){assert("number"==typeof G);var K=G%26,ne=(G-K)/26,ue=1<<K;if(this.length<=ne)return this._expand(ne+1),this.words[ne]|=ue,this;for(var pe=ue,he=ne;0!==pe&&he<this.length;he++){var ye=0|this.words[he];pe=(ye+=pe)>>>26,ye&=67108863,this.words[he]=ye}return 0!==pe&&(this.words[he]=pe,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(G){var K,ne=G<0;if(0!==this.negative&&!ne)return-1;if(0===this.negative&&ne)return 1;if(this.strip(),this.length>1)K=1;else{ne&&(G=-G),assert(G<=67108863,"Number is too big");var ue=0|this.words[0];K=ue===G?0:ue<G?-1:1}return 0!==this.negative?0|-K:K},BN.prototype.cmp=function cmp(G){if(0!==this.negative&&0===G.negative)return-1;if(0===this.negative&&0!==G.negative)return 1;var K=this.ucmp(G);return 0!==this.negative?0|-K:K},BN.prototype.ucmp=function ucmp(G){if(this.length>G.length)return 1;if(this.length<G.length)return-1;for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=0|this.words[ne],pe=0|G.words[ne];if(ue!==pe){ue<pe?K=-1:ue>pe&&(K=1);break}}return K},BN.prototype.gtn=function gtn(G){return 1===this.cmpn(G)},BN.prototype.gt=function gt(G){return 1===this.cmp(G)},BN.prototype.gten=function gten(G){return this.cmpn(G)>=0},BN.prototype.gte=function gte(G){return this.cmp(G)>=0},BN.prototype.ltn=function ltn(G){return-1===this.cmpn(G)},BN.prototype.lt=function lt(G){return-1===this.cmp(G)},BN.prototype.lten=function lten(G){return this.cmpn(G)<=0},BN.prototype.lte=function lte(G){return this.cmp(G)<=0},BN.prototype.eqn=function eqn(G){return 0===this.cmpn(G)},BN.prototype.eq=function eq(G){return 0===this.cmp(G)},BN.red=function red(G){return new Red(G)},BN.prototype.toRed=function toRed(G){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),G.convertTo(this)._forceRed(G)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(G){return this.red=G,this},BN.prototype.forceRed=function forceRed(G){return assert(!this.red,"Already a number in reduction context"),this._forceRed(G)},BN.prototype.redAdd=function redAdd(G){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,G)},BN.prototype.redIAdd=function redIAdd(G){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,G)},BN.prototype.redSub=function redSub(G){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,G)},BN.prototype.redISub=function redISub(G){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,G)},BN.prototype.redShl=function redShl(G){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,G)},BN.prototype.redMul=function redMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.mul(this,G)},BN.prototype.redIMul=function redIMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.imul(this,G)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(G){return assert(this.red&&!G.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,G)};var me={k256:null,p224:null,p192:null,p25519:null};function MPrime(G,K){this.name=G,this.p=new BN(K,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(G){if("string"==typeof G){var K=BN._prime(G);this.m=K.p,this.prime=K}else assert(G.gtn(1),"modulus must be greater than 1"),this.m=G,this.prime=null}function Mont(G){Red.call(this,G),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(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)}MPrime.prototype._tmp=function _tmp(){var G=new BN(null);return G.words=new Array(Math.ceil(this.n/13)),G},MPrime.prototype.ireduce=function ireduce(G){var K,ne=G;do{this.split(ne,this.tmp),K=(ne=(ne=this.imulK(ne)).iadd(this.tmp)).bitLength()}while(K>this.n);var ue=K<this.n?-1:ne.ucmp(this.p);return 0===ue?(ne.words[0]=0,ne.length=1):ue>0?ne.isub(this.p):void 0!==ne.strip?ne.strip():ne._strip(),ne},MPrime.prototype.split=function split(G,K){G.iushrn(this.n,0,K)},MPrime.prototype.imulK=function imulK(G){return G.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(G,K){for(var ne=4194303,ue=Math.min(G.length,9),pe=0;pe<ue;pe++)K.words[pe]=G.words[pe];if(K.length=ue,G.length<=9)return G.words[0]=0,void(G.length=1);var he=G.words[9];for(K.words[K.length++]=he&ne,pe=10;pe<G.length;pe++){var ye=0|G.words[pe];G.words[pe-10]=(ye&ne)<<4|he>>>22,he=ye}he>>>=22,G.words[pe-10]=he,0===he&&G.length>10?G.length-=10:G.length-=9},K256.prototype.imulK=function imulK(G){G.words[G.length]=0,G.words[G.length+1]=0,G.length+=2;for(var K=0,ne=0;ne<G.length;ne++){var ue=0|G.words[ne];K+=977*ue,G.words[ne]=67108863&K,K=64*ue+(K/67108864|0)}return 0===G.words[G.length-1]&&(G.length--,0===G.words[G.length-1]&&G.length--),G},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(G){for(var K=0,ne=0;ne<G.length;ne++){var ue=19*(0|G.words[ne])+K,pe=67108863&ue;ue>>>=26,G.words[ne]=pe,K=ue}return 0!==K&&(G.words[G.length++]=K),G},BN._prime=function prime(G){if(me[G])return me[G];var prime;if("k256"===G)prime=new K256;else if("p224"===G)prime=new P224;else if("p192"===G)prime=new P192;else{if("p25519"!==G)throw new Error("Unknown prime "+G);prime=new P25519}return me[G]=prime,prime},Red.prototype._verify1=function _verify1(G){assert(0===G.negative,"red works only with positives"),assert(G.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(G,K){assert(0==(G.negative|K.negative),"red works only with positives"),assert(G.red&&G.red===K.red,"red works only with red numbers")},Red.prototype.imod=function imod(G){return this.prime?this.prime.ireduce(G)._forceRed(this):G.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(G){return G.isZero()?G.clone():this.m.sub(G)._forceRed(this)},Red.prototype.add=function add(G,K){this._verify2(G,K);var ne=G.add(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Red.prototype.iadd=function iadd(G,K){this._verify2(G,K);var ne=G.iadd(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Red.prototype.sub=function sub(G,K){this._verify2(G,K);var ne=G.sub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Red.prototype.isub=function isub(G,K){this._verify2(G,K);var ne=G.isub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Red.prototype.shl=function shl(G,K){return this._verify1(G),this.imod(G.ushln(K))},Red.prototype.imul=function imul(G,K){return this._verify2(G,K),this.imod(G.imul(K))},Red.prototype.mul=function mul(G,K){return this._verify2(G,K),this.imod(G.mul(K))},Red.prototype.isqr=function isqr(G){return this.imul(G,G.clone())},Red.prototype.sqr=function sqr(G){return this.mul(G,G)},Red.prototype.sqrt=function sqrt(G){if(G.isZero())return G.clone();var K=this.m.andln(3);if(assert(K%2==1),3===K){var ne=this.m.add(new BN(1)).iushrn(2);return this.pow(G,ne)}for(var ue=this.m.subn(1),pe=0;!ue.isZero()&&0===ue.andln(1);)pe++,ue.iushrn(1);assert(!ue.isZero());var he=new BN(1).toRed(this),ye=he.redNeg(),me=this.m.subn(1).iushrn(1),be=this.m.bitLength();for(be=new BN(2*be*be).toRed(this);0!==this.pow(be,me).cmp(ye);)be.redIAdd(ye);for(var ve=this.pow(be,ue),_e=this.pow(G,ue.addn(1).iushrn(1)),Te=this.pow(G,ue),Ee=pe;0!==Te.cmp(he);){for(var Pe=Te,Se=0;0!==Pe.cmp(he);Se++)Pe=Pe.redSqr();assert(Se<Ee);var Ce=this.pow(ve,new BN(1).iushln(Ee-Se-1));_e=_e.redMul(Ce),ve=Ce.redSqr(),Te=Te.redMul(ve),Ee=Se}return _e},Red.prototype.invm=function invm(G){var K=G._invmp(this.m);return 0!==K.negative?(K.negative=0,this.imod(K).redNeg()):this.imod(K)},Red.prototype.pow=function pow(G,K){if(K.isZero())return new BN(1).toRed(this);if(0===K.cmpn(1))return G.clone();var ne=new Array(16);ne[0]=new BN(1).toRed(this),ne[1]=G;for(var ue=2;ue<ne.length;ue++)ne[ue]=this.mul(ne[ue-1],G);var pe=ne[0],he=0,ye=0,me=K.bitLength()%26;for(0===me&&(me=26),ue=K.length-1;ue>=0;ue--){for(var be=K.words[ue],ve=me-1;ve>=0;ve--){var _e=be>>ve&1;pe!==ne[0]&&(pe=this.sqr(pe)),0!==_e||0!==he?(he<<=1,he|=_e,(4===++ye||0===ue&&0===ve)&&(pe=this.mul(pe,ne[he]),ye=0,he=0)):ye=0}me=26}return pe},Red.prototype.convertTo=function convertTo(G){var K=G.umod(this.m);return K===G?K.clone():K},Red.prototype.convertFrom=function convertFrom(G){var K=G.clone();return K.red=null,K},BN.mont=function mont(G){return new Mont(G)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(G){return this.imod(G.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(G){var K=this.imod(G.mul(this.rinv));return K.red=null,K},Mont.prototype.imul=function imul(G,K){if(G.isZero()||K.isZero())return G.words[0]=0,G.length=1,G;var ne=G.imul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.mul=function mul(G,K){if(G.isZero()||K.isZero())return new BN(0)._forceRed(this);var ne=G.mul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.invm=function invm(G){return this.imod(G._invmp(this.m).mul(this.r2))._forceRed(this)}}(G,pn)}(Lp);var Up=Lp.exports;!function(G){var K=G,ne=Up,ue=tc,pe=hf;K.assert=ue,K.toArray=pe.toArray,K.zero2=pe.zero2,K.toHex=pe.toHex,K.encode=pe.encode,K.getNAF=function getNAF(G,K,ne){var ue=new Array(Math.max(G.bitLength(),ne)+1);ue.fill(0);for(var pe=1<<K+1,he=G.clone(),ye=0;ye<ue.length;ye++){var me,be=he.andln(pe-1);he.isOdd()?(me=be>(pe>>1)-1?(pe>>1)-be:be,he.isubn(me)):me=0,ue[ye]=me,he.iushrn(1)}return ue},K.getJSF=function getJSF(G,K){var ne=[[],[]];G=G.clone(),K=K.clone();for(var ue,pe=0,he=0;G.cmpn(-pe)>0||K.cmpn(-he)>0;){var ye,me,be=G.andln(3)+pe&3,ve=K.andln(3)+he&3;3===be&&(be=-1),3===ve&&(ve=-1),ye=0==(1&be)?0:3!==(ue=G.andln(7)+pe&7)&&5!==ue||2!==ve?be:-be,ne[0].push(ye),me=0==(1&ve)?0:3!==(ue=K.andln(7)+he&7)&&5!==ue||2!==be?ve:-ve,ne[1].push(me),2*pe===ye+1&&(pe=1-pe),2*he===me+1&&(he=1-he),G.iushrn(1),K.iushrn(1)}return ne},K.cachedProperty=function cachedProperty(G,K,ne){var ue="_"+K;G.prototype[K]=function cachedProperty(){return void 0!==this[ue]?this[ue]:this[ue]=ne.call(this)}},K.parseBytes=function parseBytes(G){return"string"==typeof G?K.toArray(G,"hex"):G},K.intFromLE=function intFromLE(G){return new ne(G,"hex","le")}}(Dp);var $p={},qp=Up,Gp=Dp,jp=Gp.getNAF,Hp=Gp.getJSF,Wp=Gp.assert;function BaseCurve(G,K){this.type=G,this.p=new qp(K.p,16),this.red=K.prime?qp.red(K.prime):qp.mont(this.p),this.zero=new qp(0).toRed(this.red),this.one=new qp(1).toRed(this.red),this.two=new qp(2).toRed(this.red),this.n=K.n&&new qp(K.n,16),this.g=K.g&&this.pointFromJSON(K.g,K.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 ne=this.n&&this.p.div(this.n);!ne||ne.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zp=BaseCurve;function BasePoint(G,K){this.curve=G,this.type=K,this.precomputed=null}BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(G,K){Wp(G.precomputed);var ne=G._getDoubles(),ue=jp(K,1,this._bitLength),pe=(1<<ne.step+1)-(ne.step%2==0?2:1);pe/=3;var he,ye,me=[];for(he=0;he<ue.length;he+=ne.step){ye=0;for(var be=he+ne.step-1;be>=he;be--)ye=(ye<<1)+ue[be];me.push(ye)}for(var ve=this.jpoint(null,null,null),_e=this.jpoint(null,null,null),Te=pe;Te>0;Te--){for(he=0;he<me.length;he++)(ye=me[he])===Te?_e=_e.mixedAdd(ne.points[he]):ye===-Te&&(_e=_e.mixedAdd(ne.points[he].neg()));ve=ve.add(_e)}return ve.toP()},BaseCurve.prototype._wnafMul=function _wnafMul(G,K){var ne=4,ue=G._getNAFPoints(ne);ne=ue.wnd;for(var pe=ue.points,he=jp(K,ne,this._bitLength),ye=this.jpoint(null,null,null),me=he.length-1;me>=0;me--){for(var be=0;me>=0&&0===he[me];me--)be++;if(me>=0&&be++,ye=ye.dblp(be),me<0)break;var ve=he[me];Wp(0!==ve),ye="affine"===G.type?ve>0?ye.mixedAdd(pe[ve-1>>1]):ye.mixedAdd(pe[-ve-1>>1].neg()):ve>0?ye.add(pe[ve-1>>1]):ye.add(pe[-ve-1>>1].neg())}return"affine"===G.type?ye.toP():ye},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(G,K,ne,ue,pe){var he,ye,me,be=this._wnafT1,ve=this._wnafT2,_e=this._wnafT3,Te=0;for(he=0;he<ue;he++){var Ee=(me=K[he])._getNAFPoints(G);be[he]=Ee.wnd,ve[he]=Ee.points}for(he=ue-1;he>=1;he-=2){var Pe=he-1,Se=he;if(1===be[Pe]&&1===be[Se]){var Ce=[K[Pe],null,null,K[Se]];0===K[Pe].y.cmp(K[Se].y)?(Ce[1]=K[Pe].add(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg())):0===K[Pe].y.cmp(K[Se].y.redNeg())?(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].add(K[Se].neg())):(Ce[1]=K[Pe].toJ().mixedAdd(K[Se]),Ce[2]=K[Pe].toJ().mixedAdd(K[Se].neg()));var ke=[-3,-1,-5,-7,0,7,5,1,3],Oe=Hp(ne[Pe],ne[Se]);for(Te=Math.max(Oe[0].length,Te),_e[Pe]=new Array(Te),_e[Se]=new Array(Te),ye=0;ye<Te;ye++){var xe=0|Oe[0][ye],Ne=0|Oe[1][ye];_e[Pe][ye]=ke[3*(xe+1)+(Ne+1)],_e[Se][ye]=0,ve[Pe]=Ce}}else _e[Pe]=jp(ne[Pe],be[Pe],this._bitLength),_e[Se]=jp(ne[Se],be[Se],this._bitLength),Te=Math.max(_e[Pe].length,Te),Te=Math.max(_e[Se].length,Te)}var Me=this.jpoint(null,null,null),Be=this._wnafT4;for(he=Te;he>=0;he--){for(var Fe=0;he>=0;){var De=!0;for(ye=0;ye<ue;ye++)Be[ye]=0|_e[ye][he],0!==Be[ye]&&(De=!1);if(!De)break;Fe++,he--}if(he>=0&&Fe++,Me=Me.dblp(Fe),he<0)break;for(ye=0;ye<ue;ye++){var Le=Be[ye];0!==Le&&(Le>0?me=ve[ye][Le-1>>1]:Le<0&&(me=ve[ye][-Le-1>>1].neg()),Me="affine"===me.type?Me.mixedAdd(me):Me.add(me))}}for(he=0;he<ue;he++)ve[he]=null;return pe?Me:Me.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function eq(){throw new Error("Not implemented")},BasePoint.prototype.validate=function validate(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function decodePoint(G,K){G=Gp.toArray(G,K);var ne=this.p.byteLength();if((4===G[0]||6===G[0]||7===G[0])&&G.length-1==2*ne)return 6===G[0]?Wp(G[G.length-1]%2==0):7===G[0]&&Wp(G[G.length-1]%2==1),this.point(G.slice(1,1+ne),G.slice(1+ne,1+2*ne));if((2===G[0]||3===G[0])&&G.length-1===ne)return this.pointFromX(G.slice(1,1+ne),3===G[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function encodeCompressed(G){return this.encode(G,!0)},BasePoint.prototype._encode=function _encode(G){var K=this.curve.p.byteLength(),ne=this.getX().toArray("be",K);return G?[this.getY().isEven()?2:3].concat(ne):[4].concat(ne,this.getY().toArray("be",K))},BasePoint.prototype.encode=function encode(G,K){return Gp.encode(this._encode(K),G)},BasePoint.prototype.precompute=function precompute(G){if(this.precomputed)return this;var K={doubles:null,naf:null,beta:null};return K.naf=this._getNAFPoints(8),K.doubles=this._getDoubles(4,G),K.beta=this._getBeta(),this.precomputed=K,this},BasePoint.prototype._hasDoubles=function _hasDoubles(G){if(!this.precomputed)return!1;var K=this.precomputed.doubles;return!!K&&K.points.length>=Math.ceil((G.bitLength()+1)/K.step)},BasePoint.prototype._getDoubles=function _getDoubles(G,K){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ne=[this],ue=this,pe=0;pe<K;pe+=G){for(var he=0;he<G;he++)ue=ue.dbl();ne.push(ue)}return{step:G,points:ne}},BasePoint.prototype._getNAFPoints=function _getNAFPoints(G){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var K=[this],ne=(1<<G)-1,ue=1===ne?null:this.dbl(),pe=1;pe<ne;pe++)K[pe]=K[pe-1].add(ue);return{wnd:G,points:K}},BasePoint.prototype._getBeta=function _getBeta(){return null},BasePoint.prototype.dblp=function dblp(G){for(var K=this,ne=0;ne<G;ne++)K=K.dbl();return K};var Vp=Up,Kp=nc,Jp=zp,Xp=Dp.assert;function ShortCurve(G){Jp.call(this,"short",G),this.a=new Vp(G.a,16).toRed(this.red),this.b=new Vp(G.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(G),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Kp(ShortCurve,Jp);var Qp=ShortCurve;function Point$2(G,K,ne,ue){Jp.BasePoint.call(this,G,"affine"),null===K&&null===ne?(this.x=null,this.y=null,this.inf=!0):(this.x=new Vp(K,16),this.y=new Vp(ne,16),ue&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(G,K,ne,ue){Jp.BasePoint.call(this,G,"jacobian"),null===K&&null===ne&&null===ue?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Vp(0)):(this.x=new Vp(K,16),this.y=new Vp(ne,16),this.z=new Vp(ue,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}ShortCurve.prototype._getEndomorphism=function _getEndomorphism(G){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var K,ne;if(G.beta)K=new Vp(G.beta,16).toRed(this.red);else{var ue=this._getEndoRoots(this.p);K=(K=ue[0].cmp(ue[1])<0?ue[0]:ue[1]).toRed(this.red)}if(G.lambda)ne=new Vp(G.lambda,16);else{var pe=this._getEndoRoots(this.n);0===this.g.mul(pe[0]).x.cmp(this.g.x.redMul(K))?ne=pe[0]:(ne=pe[1],Xp(0===this.g.mul(ne).x.cmp(this.g.x.redMul(K))))}return{beta:K,lambda:ne,basis:G.basis?G.basis.map((function(G){return{a:new Vp(G.a,16),b:new Vp(G.b,16)}})):this._getEndoBasis(ne)}}},ShortCurve.prototype._getEndoRoots=function _getEndoRoots(G){var K=G===this.p?this.red:Vp.mont(G),ne=new Vp(2).toRed(K).redInvm(),ue=ne.redNeg(),pe=new Vp(3).toRed(K).redNeg().redSqrt().redMul(ne);return[ue.redAdd(pe).fromRed(),ue.redSub(pe).fromRed()]},ShortCurve.prototype._getEndoBasis=function _getEndoBasis(G){for(var K,ne,ue,pe,he,ye,me,be,ve,_e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),Te=G,Ee=this.n.clone(),Pe=new Vp(1),Se=new Vp(0),Ce=new Vp(0),ke=new Vp(1),Oe=0;0!==Te.cmpn(0);){var xe=Ee.div(Te);be=Ee.sub(xe.mul(Te)),ve=Ce.sub(xe.mul(Pe));var Ne=ke.sub(xe.mul(Se));if(!ue&&be.cmp(_e)<0)K=me.neg(),ne=Pe,ue=be.neg(),pe=ve;else if(ue&&2==++Oe)break;me=be,Ee=Te,Te=be,Ce=Pe,Pe=ve,ke=Se,Se=Ne}he=be.neg(),ye=ve;var Me=ue.sqr().add(pe.sqr());return he.sqr().add(ye.sqr()).cmp(Me)>=0&&(he=K,ye=ne),ue.negative&&(ue=ue.neg(),pe=pe.neg()),he.negative&&(he=he.neg(),ye=ye.neg()),[{a:ue,b:pe},{a:he,b:ye}]},ShortCurve.prototype._endoSplit=function _endoSplit(G){var K=this.endo.basis,ne=K[0],ue=K[1],pe=ue.b.mul(G).divRound(this.n),he=ne.b.neg().mul(G).divRound(this.n),ye=pe.mul(ne.a),me=he.mul(ue.a),be=pe.mul(ne.b),ve=he.mul(ue.b);return{k1:G.sub(ye).sub(me),k2:be.add(ve).neg()}},ShortCurve.prototype.pointFromX=function pointFromX(G,K){(G=new Vp(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr().redMul(G).redIAdd(G.redMul(this.a)).redIAdd(this.b),ue=ne.redSqrt();if(0!==ue.redSqr().redSub(ne).cmp(this.zero))throw new Error("invalid point");var pe=ue.fromRed().isOdd();return(K&&!pe||!K&&pe)&&(ue=ue.redNeg()),this.point(G,ue)},ShortCurve.prototype.validate=function validate(G){if(G.inf)return!0;var K=G.x,ne=G.y,ue=this.a.redMul(K),pe=K.redSqr().redMul(K).redIAdd(ue).redIAdd(this.b);return 0===ne.redSqr().redISub(pe).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(G,K,ne){for(var ue=this._endoWnafT1,pe=this._endoWnafT2,he=0;he<G.length;he++){var ye=this._endoSplit(K[he]),me=G[he],be=me._getBeta();ye.k1.negative&&(ye.k1.ineg(),me=me.neg(!0)),ye.k2.negative&&(ye.k2.ineg(),be=be.neg(!0)),ue[2*he]=me,ue[2*he+1]=be,pe[2*he]=ye.k1,pe[2*he+1]=ye.k2}for(var ve=this._wnafMulAdd(1,ue,pe,2*he,ne),_e=0;_e<2*he;_e++)ue[_e]=null,pe[_e]=null;return ve},Kp(Point$2,Jp.BasePoint),ShortCurve.prototype.point=function point(G,K,ne){return new Point$2(this,G,K,ne)},ShortCurve.prototype.pointFromJSON=function pointFromJSON(G,K){return Point$2.fromJSON(this,G,K)},Point$2.prototype._getBeta=function _getBeta(){if(this.curve.endo){var G=this.precomputed;if(G&&G.beta)return G.beta;var K=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(G){var ne=this.curve,endoMul=function(G){return ne.point(G.x.redMul(ne.endo.beta),G.y)};G.beta=K,K.precomputed={beta:null,naf:G.naf&&{wnd:G.naf.wnd,points:G.naf.points.map(endoMul)},doubles:G.doubles&&{step:G.doubles.step,points:G.doubles.points.map(endoMul)}}}return K}},Point$2.prototype.toJSON=function toJSON(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$2.fromJSON=function fromJSON(G,K,ne){"string"==typeof K&&(K=JSON.parse(K));var ue=G.point(K[0],K[1],ne);if(!K[2])return ue;function obj2point(K){return G.point(K[0],K[1],ne)}var pe=K[2];return ue.precomputed={beta:null,doubles:pe.doubles&&{step:pe.doubles.step,points:[ue].concat(pe.doubles.points.map(obj2point))},naf:pe.naf&&{wnd:pe.naf.wnd,points:[ue].concat(pe.naf.points.map(obj2point))}},ue},Point$2.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$2.prototype.isInfinity=function isInfinity(){return this.inf},Point$2.prototype.add=function add(G){if(this.inf)return G;if(G.inf)return this;if(this.eq(G))return this.dbl();if(this.neg().eq(G))return this.curve.point(null,null);if(0===this.x.cmp(G.x))return this.curve.point(null,null);var K=this.y.redSub(G.y);0!==K.cmpn(0)&&(K=K.redMul(this.x.redSub(G.x).redInvm()));var ne=K.redSqr().redISub(this.x).redISub(G.x),ue=K.redMul(this.x.redSub(ne)).redISub(this.y);return this.curve.point(ne,ue)},Point$2.prototype.dbl=function dbl(){if(this.inf)return this;var G=this.y.redAdd(this.y);if(0===G.cmpn(0))return this.curve.point(null,null);var K=this.curve.a,ne=this.x.redSqr(),ue=G.redInvm(),pe=ne.redAdd(ne).redIAdd(ne).redIAdd(K).redMul(ue),he=pe.redSqr().redISub(this.x.redAdd(this.x)),ye=pe.redMul(this.x.redSub(he)).redISub(this.y);return this.curve.point(he,ye)},Point$2.prototype.getX=function getX(){return this.x.fromRed()},Point$2.prototype.getY=function getY(){return this.y.fromRed()},Point$2.prototype.mul=function mul(G){return G=new Vp(G,16),this.isInfinity()?this:this._hasDoubles(G)?this.curve._fixedNafMul(this,G):this.curve.endo?this.curve._endoWnafMulAdd([this],[G]):this.curve._wnafMul(this,G)},Point$2.prototype.mulAdd=function mulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe):this.curve._wnafMulAdd(1,ue,pe,2)},Point$2.prototype.jmulAdd=function jmulAdd(G,K,ne){var ue=[this,K],pe=[G,ne];return this.curve.endo?this.curve._endoWnafMulAdd(ue,pe,!0):this.curve._wnafMulAdd(1,ue,pe,2,!0)},Point$2.prototype.eq=function eq(G){return this===G||this.inf===G.inf&&(this.inf||0===this.x.cmp(G.x)&&0===this.y.cmp(G.y))},Point$2.prototype.neg=function neg(G){if(this.inf)return this;var K=this.curve.point(this.x,this.y.redNeg());if(G&&this.precomputed){var ne=this.precomputed,negate=function(G){return G.neg()};K.precomputed={naf:ne.naf&&{wnd:ne.naf.wnd,points:ne.naf.points.map(negate)},doubles:ne.doubles&&{step:ne.doubles.step,points:ne.doubles.points.map(negate)}}}return K},Point$2.prototype.toJ=function toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Kp(JPoint,Jp.BasePoint),ShortCurve.prototype.jpoint=function jpoint(G,K,ne){return new JPoint(this,G,K,ne)},JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var G=this.z.redInvm(),K=G.redSqr(),ne=this.x.redMul(K),ue=this.y.redMul(K).redMul(G);return this.curve.point(ne,ue)},JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function add(G){if(this.isInfinity())return G;if(G.isInfinity())return this;var K=G.z.redSqr(),ne=this.z.redSqr(),ue=this.x.redMul(K),pe=G.x.redMul(ne),he=this.y.redMul(K.redMul(G.z)),ye=G.y.redMul(ne.redMul(this.z)),me=ue.redSub(pe),be=he.redSub(ye);if(0===me.cmpn(0))return 0!==be.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var ve=me.redSqr(),_e=ve.redMul(me),Te=ue.redMul(ve),Ee=be.redSqr().redIAdd(_e).redISub(Te).redISub(Te),Pe=be.redMul(Te.redISub(Ee)).redISub(he.redMul(_e)),Se=this.z.redMul(G.z).redMul(me);return this.curve.jpoint(Ee,Pe,Se)},JPoint.prototype.mixedAdd=function mixedAdd(G){if(this.isInfinity())return G.toJ();if(G.isInfinity())return this;var K=this.z.redSqr(),ne=this.x,ue=G.x.redMul(K),pe=this.y,he=G.y.redMul(K).redMul(this.z),ye=ne.redSub(ue),me=pe.redSub(he);if(0===ye.cmpn(0))return 0!==me.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var be=ye.redSqr(),ve=be.redMul(ye),_e=ne.redMul(be),Te=me.redSqr().redIAdd(ve).redISub(_e).redISub(_e),Ee=me.redMul(_e.redISub(Te)).redISub(pe.redMul(ve)),Pe=this.z.redMul(ye);return this.curve.jpoint(Te,Ee,Pe)},JPoint.prototype.dblp=function dblp(G){if(0===G)return this;if(this.isInfinity())return this;if(!G)return this.dbl();var K;if(this.curve.zeroA||this.curve.threeA){var ne=this;for(K=0;K<G;K++)ne=ne.dbl();return ne}var ue=this.curve.a,pe=this.curve.tinv,he=this.x,ye=this.y,me=this.z,be=me.redSqr().redSqr(),ve=ye.redAdd(ye);for(K=0;K<G;K++){var _e=he.redSqr(),Te=ve.redSqr(),Ee=Te.redSqr(),Pe=_e.redAdd(_e).redIAdd(_e).redIAdd(ue.redMul(be)),Se=he.redMul(Te),Ce=Pe.redSqr().redISub(Se.redAdd(Se)),ke=Se.redISub(Ce),Oe=Pe.redMul(ke);Oe=Oe.redIAdd(Oe).redISub(Ee);var xe=ve.redMul(me);K+1<G&&(be=be.redMul(Ee)),he=Ce,me=xe,ve=Oe}return this.curve.jpoint(he,ve.redMul(pe),me)},JPoint.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function _zeroDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue),be=me.redSqr().redISub(ye).redISub(ye),ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),G=be,K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.x.redSqr(),Te=this.y.redSqr(),Ee=Te.redSqr(),Pe=this.x.redAdd(Te).redSqr().redISub(_e).redISub(Ee);Pe=Pe.redIAdd(Pe);var Se=_e.redAdd(_e).redIAdd(_e),Ce=Se.redSqr(),ke=Ee.redIAdd(Ee);ke=(ke=ke.redIAdd(ke)).redIAdd(ke),G=Ce.redISub(Pe).redISub(Pe),K=Se.redMul(Pe.redISub(G)).redISub(ke),ne=(ne=this.y.redMul(this.z)).redIAdd(ne)}return this.curve.jpoint(G,K,ne)},JPoint.prototype._threeDbl=function _threeDbl(){var G,K,ne;if(this.zOne){var ue=this.x.redSqr(),pe=this.y.redSqr(),he=pe.redSqr(),ye=this.x.redAdd(pe).redSqr().redISub(ue).redISub(he);ye=ye.redIAdd(ye);var me=ue.redAdd(ue).redIAdd(ue).redIAdd(this.curve.a),be=me.redSqr().redISub(ye).redISub(ye);G=be;var ve=he.redIAdd(he);ve=(ve=ve.redIAdd(ve)).redIAdd(ve),K=me.redMul(ye.redISub(be)).redISub(ve),ne=this.y.redAdd(this.y)}else{var _e=this.z.redSqr(),Te=this.y.redSqr(),Ee=this.x.redMul(Te),Pe=this.x.redSub(_e).redMul(this.x.redAdd(_e));Pe=Pe.redAdd(Pe).redIAdd(Pe);var Se=Ee.redIAdd(Ee),Ce=(Se=Se.redIAdd(Se)).redAdd(Se);G=Pe.redSqr().redISub(Ce),ne=this.y.redAdd(this.z).redSqr().redISub(Te).redISub(_e);var ke=Te.redSqr();ke=(ke=(ke=ke.redIAdd(ke)).redIAdd(ke)).redIAdd(ke),K=Pe.redMul(Se.redISub(G)).redISub(ke)}return this.curve.jpoint(G,K,ne)},JPoint.prototype._dbl=function _dbl(){var G=this.curve.a,K=this.x,ne=this.y,ue=this.z,pe=ue.redSqr().redSqr(),he=K.redSqr(),ye=ne.redSqr(),me=he.redAdd(he).redIAdd(he).redIAdd(G.redMul(pe)),be=K.redAdd(K),ve=(be=be.redIAdd(be)).redMul(ye),_e=me.redSqr().redISub(ve.redAdd(ve)),Te=ve.redISub(_e),Ee=ye.redSqr();Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=me.redMul(Te).redISub(Ee),Se=ne.redAdd(ne).redMul(ue);return this.curve.jpoint(_e,Pe,Se)},JPoint.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var G=this.x.redSqr(),K=this.y.redSqr(),ne=this.z.redSqr(),ue=K.redSqr(),pe=G.redAdd(G).redIAdd(G),he=pe.redSqr(),ye=this.x.redAdd(K).redSqr().redISub(G).redISub(ue),me=(ye=(ye=(ye=ye.redIAdd(ye)).redAdd(ye).redIAdd(ye)).redISub(he)).redSqr(),be=ue.redIAdd(ue);be=(be=(be=be.redIAdd(be)).redIAdd(be)).redIAdd(be);var ve=pe.redIAdd(ye).redSqr().redISub(he).redISub(me).redISub(be),_e=K.redMul(ve);_e=(_e=_e.redIAdd(_e)).redIAdd(_e);var Te=this.x.redMul(me).redISub(_e);Te=(Te=Te.redIAdd(Te)).redIAdd(Te);var Ee=this.y.redMul(ve.redMul(be.redISub(ve)).redISub(ye.redMul(me)));Ee=(Ee=(Ee=Ee.redIAdd(Ee)).redIAdd(Ee)).redIAdd(Ee);var Pe=this.z.redAdd(ye).redSqr().redISub(ne).redISub(me);return this.curve.jpoint(Te,Ee,Pe)},JPoint.prototype.mul=function mul(G,K){return G=new Vp(G,K),this.curve._wnafMul(this,G)},JPoint.prototype.eq=function eq(G){if("affine"===G.type)return this.eq(G.toJ());if(this===G)return!0;var K=this.z.redSqr(),ne=G.z.redSqr();if(0!==this.x.redMul(ne).redISub(G.x.redMul(K)).cmpn(0))return!1;var ue=K.redMul(this.z),pe=ne.redMul(G.z);return 0===this.y.redMul(pe).redISub(G.y.redMul(ue)).cmpn(0)},JPoint.prototype.eqXToP=function eqXToP(G){var K=this.z.redSqr(),ne=G.toRed(this.curve.red).redMul(K);if(0===this.x.cmp(ne))return!0;for(var ue=G.clone(),pe=this.curve.redN.redMul(K);;){if(ue.iadd(this.curve.n),ue.cmp(this.curve.p)>=0)return!1;if(ne.redIAdd(pe),0===this.x.cmp(ne))return!0}},JPoint.prototype.inspect=function inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)};var Zp=Up,Yp=nc,eh=zp,th=Dp;function MontCurve(G){eh.call(this,"mont",G),this.a=new Zp(G.a,16).toRed(this.red),this.b=new Zp(G.b,16).toRed(this.red),this.i4=new Zp(4).toRed(this.red).redInvm(),this.two=new Zp(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Yp(MontCurve,eh);var rh=MontCurve;function Point$1(G,K,ne){eh.BasePoint.call(this,G,"projective"),null===K&&null===ne?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zp(K,16),this.z=new Zp(ne,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}MontCurve.prototype.validate=function validate(G){var K=G.normalize().x,ne=K.redSqr(),ue=ne.redMul(K).redAdd(ne.redMul(this.a)).redAdd(K);return 0===ue.redSqrt().redSqr().cmp(ue)},Yp(Point$1,eh.BasePoint),MontCurve.prototype.decodePoint=function decodePoint(G,K){return this.point(th.toArray(G,K),1)},MontCurve.prototype.point=function point(G,K){return new Point$1(this,G,K)},MontCurve.prototype.pointFromJSON=function pointFromJSON(G){return Point$1.fromJSON(this,G)},Point$1.prototype.precompute=function precompute(){},Point$1.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$1.fromJSON=function fromJSON(G,K){return new Point$1(G,K[0],K[1]||G.one)},Point$1.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$1.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)},Point$1.prototype.dbl=function dbl(){var G=this.x.redAdd(this.z).redSqr(),K=this.x.redSub(this.z).redSqr(),ne=G.redSub(K),ue=G.redMul(K),pe=ne.redMul(K.redAdd(this.curve.a24.redMul(ne)));return this.curve.point(ue,pe)},Point$1.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.diffAdd=function diffAdd(G,K){var ne=this.x.redAdd(this.z),ue=this.x.redSub(this.z),pe=G.x.redAdd(G.z),he=G.x.redSub(G.z).redMul(ne),ye=pe.redMul(ue),me=K.z.redMul(he.redAdd(ye).redSqr()),be=K.x.redMul(he.redISub(ye).redSqr());return this.curve.point(me,be)},Point$1.prototype.mul=function mul(G){for(var K=G.clone(),ne=this,ue=this.curve.point(null,null),pe=[];0!==K.cmpn(0);K.iushrn(1))pe.push(K.andln(1));for(var he=pe.length-1;he>=0;he--)0===pe[he]?(ne=ne.diffAdd(ue,this),ue=ue.dbl()):(ue=ne.diffAdd(ue,this),ne=ne.dbl());return ue},Point$1.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.eq=function eq(G){return 0===this.getX().cmp(G.getX())},Point$1.prototype.normalize=function normalize(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$1.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()};var nh=Up,ah=nc,ih=zp,sh=Dp.assert;function EdwardsCurve(G){this.twisted=1!=(0|G.a),this.mOneA=this.twisted&&-1==(0|G.a),this.extended=this.mOneA,ih.call(this,"edwards",G),this.a=new nh(G.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nh(G.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nh(G.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),sh(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|G.c)}ah(EdwardsCurve,ih);var oh=EdwardsCurve;function Point(G,K,ne,ue,pe){ih.BasePoint.call(this,G,"projective"),null===K&&null===ne&&null===ue?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new nh(K,16),this.y=new nh(ne,16),this.z=ue?new nh(ue,16):this.curve.one,this.t=pe&&new nh(pe,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}EdwardsCurve.prototype._mulA=function _mulA(G){return this.mOneA?G.redNeg():this.a.redMul(G)},EdwardsCurve.prototype._mulC=function _mulC(G){return this.oneC?G:this.c.redMul(G)},EdwardsCurve.prototype.jpoint=function jpoint(G,K,ne,ue){return this.point(G,K,ne,ue)},EdwardsCurve.prototype.pointFromX=function pointFromX(G,K){(G=new nh(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr(),ue=this.c2.redSub(this.a.redMul(ne)),pe=this.one.redSub(this.c2.redMul(this.d).redMul(ne)),he=ue.redMul(pe.redInvm()),ye=he.redSqrt();if(0!==ye.redSqr().redSub(he).cmp(this.zero))throw new Error("invalid point");var me=ye.fromRed().isOdd();return(K&&!me||!K&&me)&&(ye=ye.redNeg()),this.point(G,ye)},EdwardsCurve.prototype.pointFromY=function pointFromY(G,K){(G=new nh(G,16)).red||(G=G.toRed(this.red));var ne=G.redSqr(),ue=ne.redSub(this.c2),pe=ne.redMul(this.d).redMul(this.c2).redSub(this.a),he=ue.redMul(pe.redInvm());if(0===he.cmp(this.zero)){if(K)throw new Error("invalid point");return this.point(this.zero,G)}var ye=he.redSqrt();if(0!==ye.redSqr().redSub(he).cmp(this.zero))throw new Error("invalid point");return ye.fromRed().isOdd()!==K&&(ye=ye.redNeg()),this.point(ye,G)},EdwardsCurve.prototype.validate=function validate(G){if(G.isInfinity())return!0;G.normalize();var K=G.x.redSqr(),ne=G.y.redSqr(),ue=K.redMul(this.a).redAdd(ne),pe=this.c2.redMul(this.one.redAdd(this.d.redMul(K).redMul(ne)));return 0===ue.cmp(pe)},ah(Point,ih.BasePoint),EdwardsCurve.prototype.pointFromJSON=function pointFromJSON(G){return Point.fromJSON(this,G)},EdwardsCurve.prototype.point=function point(G,K,ne,ue){return new Point(this,G,K,ne,ue)},Point.fromJSON=function fromJSON(G,K){return new Point(G,K[0],K[1],K[2])},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function _extDbl(){var G=this.x.redSqr(),K=this.y.redSqr(),ne=this.z.redSqr();ne=ne.redIAdd(ne);var ue=this.curve._mulA(G),pe=this.x.redAdd(this.y).redSqr().redISub(G).redISub(K),he=ue.redAdd(K),ye=he.redSub(ne),me=ue.redSub(K),be=pe.redMul(ye),ve=he.redMul(me),_e=pe.redMul(me),Te=ye.redMul(he);return this.curve.point(be,ve,Te,_e)},Point.prototype._projDbl=function _projDbl(){var G,K,ne,ue,pe,he,ye=this.x.redAdd(this.y).redSqr(),me=this.x.redSqr(),be=this.y.redSqr();if(this.curve.twisted){var ve=(ue=this.curve._mulA(me)).redAdd(be);this.zOne?(G=ye.redSub(me).redSub(be).redMul(ve.redSub(this.curve.two)),K=ve.redMul(ue.redSub(be)),ne=ve.redSqr().redSub(ve).redSub(ve)):(pe=this.z.redSqr(),he=ve.redSub(pe).redISub(pe),G=ye.redSub(me).redISub(be).redMul(he),K=ve.redMul(ue.redSub(be)),ne=ve.redMul(he))}else ue=me.redAdd(be),pe=this.curve._mulC(this.z).redSqr(),he=ue.redSub(pe).redSub(pe),G=this.curve._mulC(ye.redISub(ue)).redMul(he),K=this.curve._mulC(ue).redMul(me.redISub(be)),ne=ue.redMul(he);return this.curve.point(G,K,ne)},Point.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function _extAdd(G){var K=this.y.redSub(this.x).redMul(G.y.redSub(G.x)),ne=this.y.redAdd(this.x).redMul(G.y.redAdd(G.x)),ue=this.t.redMul(this.curve.dd).redMul(G.t),pe=this.z.redMul(G.z.redAdd(G.z)),he=ne.redSub(K),ye=pe.redSub(ue),me=pe.redAdd(ue),be=ne.redAdd(K),ve=he.redMul(ye),_e=me.redMul(be),Te=he.redMul(be),Ee=ye.redMul(me);return this.curve.point(ve,_e,Ee,Te)},Point.prototype._projAdd=function _projAdd(G){var K,ne,ue=this.z.redMul(G.z),pe=ue.redSqr(),he=this.x.redMul(G.x),ye=this.y.redMul(G.y),me=this.curve.d.redMul(he).redMul(ye),be=pe.redSub(me),ve=pe.redAdd(me),_e=this.x.redAdd(this.y).redMul(G.x.redAdd(G.y)).redISub(he).redISub(ye),Te=ue.redMul(be).redMul(_e);return this.curve.twisted?(K=ue.redMul(ve).redMul(ye.redSub(this.curve._mulA(he))),ne=be.redMul(ve)):(K=ue.redMul(ve).redMul(ye.redSub(he)),ne=this.curve._mulC(be).redMul(ve)),this.curve.point(Te,K,ne)},Point.prototype.add=function add(G){return this.isInfinity()?G:G.isInfinity()?this:this.curve.extended?this._extAdd(G):this._projAdd(G)},Point.prototype.mul=function mul(G){return this._hasDoubles(G)?this.curve._fixedNafMul(this,G):this.curve._wnafMul(this,G)},Point.prototype.mulAdd=function mulAdd(G,K,ne){return this.curve._wnafMulAdd(1,[this,K],[G,ne],2,!1)},Point.prototype.jmulAdd=function jmulAdd(G,K,ne){return this.curve._wnafMulAdd(1,[this,K],[G,ne],2,!0)},Point.prototype.normalize=function normalize(){if(this.zOne)return this;var G=this.z.redInvm();return this.x=this.x.redMul(G),this.y=this.y.redMul(G),this.t&&(this.t=this.t.redMul(G)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function getY(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function eq(G){return this===G||0===this.getX().cmp(G.getX())&&0===this.getY().cmp(G.getY())},Point.prototype.eqXToP=function eqXToP(G){var K=G.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(K))return!0;for(var ne=G.clone(),ue=this.curve.redN.redMul(this.z);;){if(ne.iadd(this.curve.n),ne.cmp(this.curve.p)>=0)return!1;if(K.redIAdd(ue),0===this.x.cmp(K))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add,function(G){var K=G;K.base=zp,K.short=Qp,K.mont=rh,K.edwards=oh}($p);var dh,uh,fh={};!function(G){var K,ne=G,ue=Yo,pe=$p,he=Dp.assert;function PresetCurve(G){"short"===G.type?this.curve=new pe.short(G):"edwards"===G.type?this.curve=new pe.edwards(G):this.curve=new pe.mont(G),this.g=this.curve.g,this.n=this.curve.n,this.hash=G.hash,he(this.g.validate(),"Invalid curve"),he(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(G,K){Object.defineProperty(ne,G,{configurable:!0,enumerable:!0,get:function(){var ue=new PresetCurve(K);return Object.defineProperty(ne,G,{configurable:!0,enumerable:!0,value:ue}),ue}})}ne.PresetCurve=PresetCurve,defineCurve("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:ue.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("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:ue.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("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:ue.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("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:ue.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"]}),defineCurve("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:ue.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"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ue.sha256,gRed:!1,g:["9"]}),defineCurve("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:ue.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{K=function requireSecp256k1$1(){return uh?dh:(uh=1,dh={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}()}catch(G){K=void 0}defineCurve("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:ue.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",K]})}(fh);var lh=Up,ph=Dp.assert;function KeyPair$3(G,K){this.ec=G,this.priv=null,this.pub=null,K.priv&&this._importPrivate(K.priv,K.privEnc),K.pub&&this._importPublic(K.pub,K.pubEnc)}var hh=KeyPair$3;KeyPair$3.fromPublic=function fromPublic(G,K,ne){return K instanceof KeyPair$3?K:new KeyPair$3(G,{pub:K,pubEnc:ne})},KeyPair$3.fromPrivate=function fromPrivate(G,K,ne){return K instanceof KeyPair$3?K:new KeyPair$3(G,{priv:K,privEnc:ne})},KeyPair$3.prototype.validate=function validate(){var G=this.getPublic();return G.isInfinity()?{result:!1,reason:"Invalid public key"}:G.validate()?G.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair$3.prototype.getPublic=function getPublic(G,K){return"string"==typeof G&&(K=G,G=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),K?this.pub.encode(K,G):this.pub},KeyPair$3.prototype.getPrivate=function getPrivate(G){return"hex"===G?this.priv.toString(16,2):this.priv},KeyPair$3.prototype._importPrivate=function _importPrivate(G,K){this.priv=new lh(G,K||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$3.prototype._importPublic=function _importPublic(G,K){if(G.x||G.y)return"mont"===this.ec.curve.type?ph(G.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||ph(G.x&&G.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(G.x,G.y));this.pub=this.ec.curve.decodePoint(G,K)},KeyPair$3.prototype.derive=function derive(G){return G.validate()||ph(G.validate(),"public point not validated"),G.mul(this.priv).getX()},KeyPair$3.prototype.sign=function sign(G,K,ne){return this.ec.sign(G,this,K,ne)},KeyPair$3.prototype.verify=function verify(G,K){return this.ec.verify(G,K,this)},KeyPair$3.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var yh=Up,mh=Dp,bh=mh.assert;function Signature$4(G,K){if(G instanceof Signature$4)return G;this._importDER(G,K)||(bh(G.r&&G.s,"Signature without r or s"),this.r=new yh(G.r,16),this.s=new yh(G.s,16),void 0===G.recoveryParam?this.recoveryParam=null:this.recoveryParam=G.recoveryParam)}var gh=Signature$4;function Position$1(){this.place=0}function getLength(G,K){var ne=G[K.place++];if(!(128&ne))return ne;var ue=15&ne;if(0===ue||ue>4)return!1;for(var pe=0,he=0,ye=K.place;he<ue;he++,ye++)pe<<=8,pe|=G[ye],pe>>>=0;return!(pe<=127)&&(K.place=ye,pe)}function rmPadding(G){for(var K=0,ne=G.length-1;!G[K]&&!(128&G[K+1])&&K<ne;)K++;return 0===K?G:G.slice(K)}function constructLength(G,K){if(K<128)G.push(K);else{var ne=1+(Math.log(K)/Math.LN2>>>3);for(G.push(128|ne);--ne;)G.push(K>>>(ne<<3)&255);G.push(K)}}Signature$4.prototype._importDER=function _importDER(G,K){G=mh.toArray(G,K);var ne=new Position$1;if(48!==G[ne.place++])return!1;var ue=getLength(G,ne);if(!1===ue)return!1;if(ue+ne.place!==G.length)return!1;if(2!==G[ne.place++])return!1;var pe=getLength(G,ne);if(!1===pe)return!1;var he=G.slice(ne.place,pe+ne.place);if(ne.place+=pe,2!==G[ne.place++])return!1;var ye=getLength(G,ne);if(!1===ye)return!1;if(G.length!==ye+ne.place)return!1;var me=G.slice(ne.place,ye+ne.place);if(0===he[0]){if(!(128&he[1]))return!1;he=he.slice(1)}if(0===me[0]){if(!(128&me[1]))return!1;me=me.slice(1)}return this.r=new yh(he),this.s=new yh(me),this.recoveryParam=null,!0},Signature$4.prototype.toDER=function toDER(G){var K=this.r.toArray(),ne=this.s.toArray();for(128&K[0]&&(K=[0].concat(K)),128&ne[0]&&(ne=[0].concat(ne)),K=rmPadding(K),ne=rmPadding(ne);!(ne[0]||128&ne[1]);)ne=ne.slice(1);var ue=[2];constructLength(ue,K.length),(ue=ue.concat(K)).push(2),constructLength(ue,ne.length);var pe=ue.concat(ne),he=[48];return constructLength(he,pe.length),he=he.concat(pe),mh.encode(he,G)};var vh=Up,wh=Kf,_h=fh,Th=vf,Ah=Dp.assert,Eh=hh,Ph=gh;function EC$1(G){if(!(this instanceof EC$1))return new EC$1(G);"string"==typeof G&&(Ah(Object.prototype.hasOwnProperty.call(_h,G),"Unknown curve "+G),G=_h[G]),G instanceof _h.PresetCurve&&(G={curve:G}),this.curve=G.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=G.curve.g,this.g.precompute(G.curve.n.bitLength()+1),this.hash=G.hash||G.curve.hash}var Sh=EC$1;EC$1.prototype.keyPair=function keyPair(G){return new Eh(this,G)},EC$1.prototype.keyFromPrivate=function keyFromPrivate(G,K){return Eh.fromPrivate(this,G,K)},EC$1.prototype.keyFromPublic=function keyFromPublic(G,K){return Eh.fromPublic(this,G,K)},EC$1.prototype.genKeyPair=function genKeyPair(G){G||(G={});for(var K=new wh({hash:this.hash,pers:G.pers,persEnc:G.persEnc||"utf8",entropy:G.entropy||Th(this.hash.hmacStrength),entropyEnc:G.entropy&&G.entropyEnc||"utf8",nonce:this.n.toArray()}),ne=this.n.byteLength(),ue=this.n.sub(new vh(2));;){var pe=new vh(K.generate(ne));if(!(pe.cmp(ue)>0))return pe.iaddn(1),this.keyFromPrivate(pe)}},EC$1.prototype._truncateToN=function _truncateToN(G,K){var ne=8*G.byteLength()-this.n.bitLength();return ne>0&&(G=G.ushrn(ne)),!K&&G.cmp(this.n)>=0?G.sub(this.n):G},EC$1.prototype.sign=function sign(G,K,ne,ue){"object"==typeof ne&&(ue=ne,ne=null),ue||(ue={}),K=this.keyFromPrivate(K,ne),G=this._truncateToN(new vh(G,16));for(var pe=this.n.byteLength(),he=K.getPrivate().toArray("be",pe),ye=G.toArray("be",pe),me=new wh({hash:this.hash,entropy:he,nonce:ye,pers:ue.pers,persEnc:ue.persEnc||"utf8"}),be=this.n.sub(new vh(1)),ve=0;;ve++){var _e=ue.k?ue.k(ve):new vh(me.generate(this.n.byteLength()));if(!((_e=this._truncateToN(_e,!0)).cmpn(1)<=0||_e.cmp(be)>=0)){var Te=this.g.mul(_e);if(!Te.isInfinity()){var Ee=Te.getX(),Pe=Ee.umod(this.n);if(0!==Pe.cmpn(0)){var Se=_e.invm(this.n).mul(Pe.mul(K.getPrivate()).iadd(G));if(0!==(Se=Se.umod(this.n)).cmpn(0)){var Ce=(Te.getY().isOdd()?1:0)|(0!==Ee.cmp(Pe)?2:0);return ue.canonical&&Se.cmp(this.nh)>0&&(Se=this.n.sub(Se),Ce^=1),new Ph({r:Pe,s:Se,recoveryParam:Ce})}}}}}},EC$1.prototype.verify=function verify(G,K,ne,ue){G=this._truncateToN(new vh(G,16)),ne=this.keyFromPublic(ne,ue);var pe=(K=new Ph(K,"hex")).r,he=K.s;if(pe.cmpn(1)<0||pe.cmp(this.n)>=0)return!1;if(he.cmpn(1)<0||he.cmp(this.n)>=0)return!1;var ye,me=he.invm(this.n),be=me.mul(G).umod(this.n),ve=me.mul(pe).umod(this.n);return this.curve._maxwellTrick?!(ye=this.g.jmulAdd(be,ne.getPublic(),ve)).isInfinity()&&ye.eqXToP(pe):!(ye=this.g.mulAdd(be,ne.getPublic(),ve)).isInfinity()&&0===ye.getX().umod(this.n).cmp(pe)},EC$1.prototype.recoverPubKey=function(G,K,ne,ue){Ah((3&ne)===ne,"The recovery param is more than two bits"),K=new Ph(K,ue);var pe=this.n,he=new vh(G),ye=K.r,me=K.s,be=1&ne,ve=ne>>1;if(ye.cmp(this.curve.p.umod(this.curve.n))>=0&&ve)throw new Error("Unable to find sencond key candinate");ye=ve?this.curve.pointFromX(ye.add(this.curve.n),be):this.curve.pointFromX(ye,be);var _e=K.r.invm(pe),Te=pe.sub(he).mul(_e).umod(pe),Ee=me.mul(_e).umod(pe);return this.g.mulAdd(Te,ye,Ee)},EC$1.prototype.getKeyRecoveryParam=function(G,K,ne,ue){if(null!==(K=new Ph(K,ue)).recoveryParam)return K.recoveryParam;for(var pe=0;pe<4;pe++){var he;try{he=this.recoverPubKey(G,K,pe)}catch(G){continue}if(he.eq(ne))return pe}throw new Error("Unable to find valid recovery factor")};var Ih=Dp,Rh=Ih.assert,kh=Ih.parseBytes,Oh=Ih.cachedProperty;function KeyPair$1(G,K){this.eddsa=G,this._secret=kh(K.secret),G.isPoint(K.pub)?this._pub=K.pub:this._pubBytes=kh(K.pub)}KeyPair$1.fromPublic=function fromPublic(G,K){return K instanceof KeyPair$1?K:new KeyPair$1(G,{pub:K})},KeyPair$1.fromSecret=function fromSecret(G,K){return K instanceof KeyPair$1?K:new KeyPair$1(G,{secret:K})},KeyPair$1.prototype.secret=function secret(){return this._secret},Oh(KeyPair$1,"pubBytes",(function pubBytes(){return this.eddsa.encodePoint(this.pub())})),Oh(KeyPair$1,"pub",(function pub(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Oh(KeyPair$1,"privBytes",(function privBytes(){var G=this.eddsa,K=this.hash(),ne=G.encodingLength-1,ue=K.slice(0,G.encodingLength);return ue[0]&=248,ue[ne]&=127,ue[ne]|=64,ue})),Oh(KeyPair$1,"priv",(function priv(){return this.eddsa.decodeInt(this.privBytes())})),Oh(KeyPair$1,"hash",(function hash(){return this.eddsa.hash().update(this.secret()).digest()})),Oh(KeyPair$1,"messagePrefix",(function messagePrefix(){return this.hash().slice(this.eddsa.encodingLength)})),KeyPair$1.prototype.sign=function sign(G){return Rh(this._secret,"KeyPair can only verify"),this.eddsa.sign(G,this)},KeyPair$1.prototype.verify=function verify(G,K){return this.eddsa.verify(G,K,this)},KeyPair$1.prototype.getSecret=function getSecret(G){return Rh(this._secret,"KeyPair is public only"),Ih.encode(this.secret(),G)},KeyPair$1.prototype.getPublic=function getPublic(G){return Ih.encode(this.pubBytes(),G)};var xh=KeyPair$1,Nh=Up,Mh=Dp,Bh=Mh.assert,Fh=Mh.cachedProperty,Dh=Mh.parseBytes;function Signature$2(G,K){this.eddsa=G,"object"!=typeof K&&(K=Dh(K)),Array.isArray(K)&&(K={R:K.slice(0,G.encodingLength),S:K.slice(G.encodingLength)}),Bh(K.R&&K.S,"Signature without R or S"),G.isPoint(K.R)&&(this._R=K.R),K.S instanceof Nh&&(this._S=K.S),this._Rencoded=Array.isArray(K.R)?K.R:K.Rencoded,this._Sencoded=Array.isArray(K.S)?K.S:K.Sencoded}Fh(Signature$2,"S",(function S(){return this.eddsa.decodeInt(this.Sencoded())})),Fh(Signature$2,"R",(function R(){return this.eddsa.decodePoint(this.Rencoded())})),Fh(Signature$2,"Rencoded",(function Rencoded(){return this.eddsa.encodePoint(this.R())})),Fh(Signature$2,"Sencoded",(function Sencoded(){return this.eddsa.encodeInt(this.S())})),Signature$2.prototype.toBytes=function toBytes(){return this.Rencoded().concat(this.Sencoded())},Signature$2.prototype.toHex=function toHex(){return Mh.encode(this.toBytes(),"hex").toUpperCase()};var Lh=Signature$2,Uh=Yo,$h=fh,qh=Dp,Gh=qh.assert,jh=qh.parseBytes,Hh=xh,Wh=Lh;function EDDSA(G){if(Gh("ed25519"===G,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(G);G=$h[G].curve,this.curve=G,this.g=G.g,this.g.precompute(G.n.bitLength()+1),this.pointClass=G.point().constructor,this.encodingLength=Math.ceil(G.n.bitLength()/8),this.hash=Uh.sha512}var zh=EDDSA;EDDSA.prototype.sign=function sign(G,K){G=jh(G);var ne=this.keyFromSecret(K),ue=this.hashInt(ne.messagePrefix(),G),pe=this.g.mul(ue),he=this.encodePoint(pe),ye=this.hashInt(he,ne.pubBytes(),G).mul(ne.priv()),me=ue.add(ye).umod(this.curve.n);return this.makeSignature({R:pe,S:me,Rencoded:he})},EDDSA.prototype.verify=function verify(G,K,ne){G=jh(G),K=this.makeSignature(K);var ue=this.keyFromPublic(ne),pe=this.hashInt(K.Rencoded(),ue.pubBytes(),G),he=this.g.mul(K.S());return K.R().add(ue.pub().mul(pe)).eq(he)},EDDSA.prototype.hashInt=function hashInt(){for(var G=this.hash(),K=0;K<arguments.length;K++)G.update(arguments[K]);return qh.intFromLE(G.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function keyFromPublic(G){return Hh.fromPublic(this,G)},EDDSA.prototype.keyFromSecret=function keyFromSecret(G){return Hh.fromSecret(this,G)},EDDSA.prototype.makeSignature=function makeSignature(G){return G instanceof Wh?G:new Wh(this,G)},EDDSA.prototype.encodePoint=function encodePoint(G){var K=G.getY().toArray("le",this.encodingLength);return K[this.encodingLength-1]|=G.getX().isOdd()?128:0,K},EDDSA.prototype.decodePoint=function decodePoint(G){var K=(G=qh.parseBytes(G)).length-1,ne=G.slice(0,K).concat(-129&G[K]),ue=0!=(128&G[K]),pe=qh.intFromLE(ne);return this.curve.pointFromY(pe,ue)},EDDSA.prototype.encodeInt=function encodeInt(G){return G.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function decodeInt(G){return qh.intFromLE(G)},EDDSA.prototype.isPoint=function isPoint(G){return G instanceof this.pointClass},function(G){var K=G;K.version=Fp,K.utils=Dp,K.rand=vf,K.curve=$p,K.curves=fh,K.ec=Sh,K.eddsa=zh}(Bp);const Vh=new(0,Bp.ec)("secp256k1"),Jh=Vh.curve,Xh=Jh.n.constructor;function loadPublicKey(G){const K=G[0];switch(K){case 2:case 3:return 33!==G.length?null:function loadCompressedPublicKey(G,K){let ne=new Xh(K);if(ne.cmp(Jh.p)>=0)return null;ne=ne.toRed(Jh.red);let ue=ne.redSqr().redIMul(ne).redIAdd(Jh.b).redSqrt();return 3===G!==ue.isOdd()&&(ue=ue.redNeg()),Vh.keyPair({pub:{x:ne,y:ue}})}(K,G.subarray(1,33));case 4:case 6:case 7:return 65!==G.length?null:function loadUncompressedPublicKey(G,K,ne){let ue=new Xh(K),pe=new Xh(ne);if(ue.cmp(Jh.p)>=0||pe.cmp(Jh.p)>=0)return null;if(ue=ue.toRed(Jh.red),pe=pe.toRed(Jh.red),(6===G||7===G)&&pe.isOdd()!==(7===G))return null;const he=ue.redSqr().redIMul(ue);return pe.redSqr().redISub(he.redIAdd(Jh.b)).isZero()?Vh.keyPair({pub:{x:ue,y:pe}}):null}(K,G.subarray(1,33),G.subarray(33,65));default:return null}}function savePublicKey(G,K){const ne=K.encode(null,33===G.length);for(let K=0;K<G.length;++K)G[K]=ne[K]}var Qh={contextRandomize:()=>0,privateKeyVerify(G){const K=new Xh(G);return K.cmp(Jh.n)<0&&!K.isZero()?0:1},privateKeyNegate(G){const K=new Xh(G),ne=Jh.n.sub(K).umod(Jh.n).toArrayLike(Uint8Array,"be",32);return G.set(ne),0},privateKeyTweakAdd(G,K){const ne=new Xh(K);if(ne.cmp(Jh.n)>=0)return 1;if(ne.iadd(new Xh(G)),ne.cmp(Jh.n)>=0&&ne.isub(Jh.n),ne.isZero())return 1;const ue=ne.toArrayLike(Uint8Array,"be",32);return G.set(ue),0},privateKeyTweakMul(G,K){let ne=new Xh(K);if(ne.cmp(Jh.n)>=0||ne.isZero())return 1;ne.imul(new Xh(G)),ne.cmp(Jh.n)>=0&&(ne=ne.umod(Jh.n));const ue=ne.toArrayLike(Uint8Array,"be",32);return G.set(ue),0},publicKeyVerify:G=>null===loadPublicKey(G)?1:0,publicKeyCreate(G,K){const ne=new Xh(K);if(ne.cmp(Jh.n)>=0||ne.isZero())return 1;return savePublicKey(G,Vh.keyFromPrivate(K).getPublic()),0},publicKeyConvert(G,K){const ne=loadPublicKey(K);if(null===ne)return 1;return savePublicKey(G,ne.getPublic()),0},publicKeyNegate(G,K){const ne=loadPublicKey(K);if(null===ne)return 1;const ue=ne.getPublic();return ue.y=ue.y.redNeg(),savePublicKey(G,ue),0},publicKeyCombine(G,K){const ne=new Array(K.length);for(let G=0;G<K.length;++G)if(ne[G]=loadPublicKey(K[G]),null===ne[G])return 1;let ue=ne[0].getPublic();for(let G=1;G<ne.length;++G)ue=ue.add(ne[G].pub);return ue.isInfinity()?2:(savePublicKey(G,ue),0)},publicKeyTweakAdd(G,K,ne){const ue=loadPublicKey(K);if(null===ue)return 1;if((ne=new Xh(ne)).cmp(Jh.n)>=0)return 2;const pe=ue.getPublic().add(Jh.g.mul(ne));return pe.isInfinity()?2:(savePublicKey(G,pe),0)},publicKeyTweakMul(G,K,ne){const ue=loadPublicKey(K);if(null===ue)return 1;if((ne=new Xh(ne)).cmp(Jh.n)>=0||ne.isZero())return 2;return savePublicKey(G,ue.getPublic().mul(ne)),0},signatureNormalize(G){const K=new Xh(G.subarray(0,32)),ne=new Xh(G.subarray(32,64));return K.cmp(Jh.n)>=0||ne.cmp(Jh.n)>=0?1:(1===ne.cmp(Vh.nh)&&G.set(Jh.n.sub(ne).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(G,K){const ne=K.subarray(0,32),ue=K.subarray(32,64);if(new Xh(ne).cmp(Jh.n)>=0)return 1;if(new Xh(ue).cmp(Jh.n)>=0)return 1;const{output:pe}=G;let he=pe.subarray(4,37);he[0]=0,he.set(ne,1);let ye=33,me=0;for(;ye>1&&0===he[me]&&!(128&he[me+1]);--ye,++me);if(he=he.subarray(me),128&he[0])return 1;if(ye>1&&0===he[0]&&!(128&he[1]))return 1;let be=pe.subarray(39,72);be[0]=0,be.set(ue,1);let ve=33,_e=0;for(;ve>1&&0===be[_e]&&!(128&be[_e+1]);--ve,++_e);return be=be.subarray(_e),128&be[0]||ve>1&&0===be[0]&&!(128&be[1])?1:(G.outputlen=6+ye+ve,pe[0]=48,pe[1]=G.outputlen-2,pe[2]=2,pe[3]=he.length,pe.set(he,4),pe[4+ye]=2,pe[5+ye]=be.length,pe.set(be,6+ye),0)},signatureImport(G,K){if(K.length<8)return 1;if(K.length>72)return 1;if(48!==K[0])return 1;if(K[1]!==K.length-2)return 1;if(2!==K[2])return 1;const ne=K[3];if(0===ne)return 1;if(5+ne>=K.length)return 1;if(2!==K[4+ne])return 1;const ue=K[5+ne];if(0===ue)return 1;if(6+ne+ue!==K.length)return 1;if(128&K[4])return 1;if(ne>1&&0===K[4]&&!(128&K[5]))return 1;if(128&K[ne+6])return 1;if(ue>1&&0===K[ne+6]&&!(128&K[ne+7]))return 1;let pe=K.subarray(4,4+ne);if(33===pe.length&&0===pe[0]&&(pe=pe.subarray(1)),pe.length>32)return 1;let he=K.subarray(6+ne);if(33===he.length&&0===he[0]&&(he=he.slice(1)),he.length>32)throw new Error("S length is too long");let ye=new Xh(pe);ye.cmp(Jh.n)>=0&&(ye=new Xh(0));let me=new Xh(K.subarray(6+ne));return me.cmp(Jh.n)>=0&&(me=new Xh(0)),G.set(ye.toArrayLike(Uint8Array,"be",32),0),G.set(me.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(G,K,ne,ue,pe){if(pe){const G=pe;pe=pe=>{const he=G(K,ne,null,ue,pe);if(!(he instanceof Uint8Array&&32===he.length))throw new Error("This is the way");return new Xh(he)}}const he=new Xh(ne);if(he.cmp(Jh.n)>=0||he.isZero())return 1;let ye;try{ye=Vh.sign(K,ne,{canonical:!0,k:pe,pers:ue})}catch(G){return 1}return G.signature.set(ye.r.toArrayLike(Uint8Array,"be",32),0),G.signature.set(ye.s.toArrayLike(Uint8Array,"be",32),32),G.recid=ye.recoveryParam,0},ecdsaVerify(G,K,ne){const ue={r:G.subarray(0,32),s:G.subarray(32,64)},pe=new Xh(ue.r),he=new Xh(ue.s);if(pe.cmp(Jh.n)>=0||he.cmp(Jh.n)>=0)return 1;if(1===he.cmp(Vh.nh)||pe.isZero()||he.isZero())return 3;const ye=loadPublicKey(ne);if(null===ye)return 2;const me=ye.getPublic();return Vh.verify(K,ue,me)?0:3},ecdsaRecover(G,K,ne,ue){const pe={r:K.slice(0,32),s:K.slice(32,64)},he=new Xh(pe.r),ye=new Xh(pe.s);if(he.cmp(Jh.n)>=0||ye.cmp(Jh.n)>=0)return 1;if(he.isZero()||ye.isZero())return 2;let me;try{me=Vh.recoverPubKey(ue,pe,ne)}catch(G){return 2}return savePublicKey(G,me),0},ecdh(G,K,ne,ue,pe,he,ye){const me=loadPublicKey(K);if(null===me)return 1;const be=new Xh(ne);if(be.cmp(Jh.n)>=0||be.isZero())return 2;const ve=me.getPublic().mul(be);if(void 0===pe){const K=ve.encode(null,!0),ne=Vh.hash().update(K).digest();for(let K=0;K<32;++K)G[K]=ne[K]}else{he||(he=new Uint8Array(32));const K=ve.getX().toArray("be",32);for(let G=0;G<32;++G)he[G]=K[G];ye||(ye=new Uint8Array(32));const ne=ve.getY().toArray("be",32);for(let G=0;G<32;++G)ye[G]=ne[G];const me=pe(he,ye,ue);if(!(me instanceof Uint8Array&&me.length===G.length))return 2;G.set(me)}return 0}},Zh=(G=>({contextRandomize(K){if(assert$b(null===K||K instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==K&&isUint8Array("seed",K,32),1===G.contextRandomize(K))throw new Error(Sp)},privateKeyVerify:K=>(isUint8Array("private key",K,32),0===G.privateKeyVerify(K)),privateKeyNegate(K){switch(isUint8Array("private key",K,32),G.privateKeyNegate(K)){case 0:return K;case 1:throw new Error(Ap)}},privateKeyTweakAdd(K,ne){switch(isUint8Array("private key",K,32),isUint8Array("tweak",ne,32),G.privateKeyTweakAdd(K,ne)){case 0:return K;case 1:throw new Error(Ep)}},privateKeyTweakMul(K,ne){switch(isUint8Array("private key",K,32),isUint8Array("tweak",ne,32),G.privateKeyTweakMul(K,ne)){case 0:return K;case 1:throw new Error(Pp)}},publicKeyVerify:K=>(isUint8Array("public key",K,[33,65]),0===G.publicKeyVerify(K)),publicKeyCreate(K,ne=!0,ue){switch(isUint8Array("private key",K,32),isCompressed(ne),ue=getAssertedOutput(ue,ne?33:65),G.publicKeyCreate(ue,K)){case 0:return ue;case 1:throw new Error(Ip);case 2:throw new Error(Rp)}},publicKeyConvert(K,ne=!0,ue){switch(isUint8Array("public key",K,[33,65]),isCompressed(ne),ue=getAssertedOutput(ue,ne?33:65),G.publicKeyConvert(ue,K)){case 0:return ue;case 1:throw new Error(Cp);case 2:throw new Error(Rp)}},publicKeyNegate(K,ne=!0,ue){switch(isUint8Array("public key",K,[33,65]),isCompressed(ne),ue=getAssertedOutput(ue,ne?33:65),G.publicKeyNegate(ue,K)){case 0:return ue;case 1:throw new Error(Cp);case 2:throw new Error(Ap);case 3:throw new Error(Rp)}},publicKeyCombine(K,ne=!0,ue){assert$b(Array.isArray(K),"Expected public keys to be an Array"),assert$b(K.length>0,"Expected public keys array will have more than zero items");for(const G of K)isUint8Array("public key",G,[33,65]);switch(isCompressed(ne),ue=getAssertedOutput(ue,ne?33:65),G.publicKeyCombine(ue,K)){case 0:return ue;case 1:throw new Error(Cp);case 2:throw new Error(kp);case 3:throw new Error(Rp)}},publicKeyTweakAdd(K,ne,ue=!0,pe){switch(isUint8Array("public key",K,[33,65]),isUint8Array("tweak",ne,32),isCompressed(ue),pe=getAssertedOutput(pe,ue?33:65),G.publicKeyTweakAdd(pe,K,ne)){case 0:return pe;case 1:throw new Error(Cp);case 2:throw new Error(Ep)}},publicKeyTweakMul(K,ne,ue=!0,pe){switch(isUint8Array("public key",K,[33,65]),isUint8Array("tweak",ne,32),isCompressed(ue),pe=getAssertedOutput(pe,ue?33:65),G.publicKeyTweakMul(pe,K,ne)){case 0:return pe;case 1:throw new Error(Cp);case 2:throw new Error(Pp)}},signatureNormalize(K){switch(isUint8Array("signature",K,64),G.signatureNormalize(K)){case 0:return K;case 1:throw new Error(Op)}},signatureExport(K,ne){isUint8Array("signature",K,64);const ue={output:ne=getAssertedOutput(ne,72),outputlen:72};switch(G.signatureExport(ue,K)){case 0:return ne.slice(0,ue.outputlen);case 1:throw new Error(Op);case 2:throw new Error(Ap)}},signatureImport(K,ne){switch(isUint8Array("signature",K),ne=getAssertedOutput(ne,64),G.signatureImport(ne,K)){case 0:return ne;case 1:throw new Error(Op);case 2:throw new Error(Ap)}},ecdsaSign(K,ne,ue={},pe){isUint8Array("message",K,32),isUint8Array("private key",ne,32),assert$b("Object"===toTypeString(ue),"Expected options to be an Object"),void 0!==ue.data&&isUint8Array("options.data",ue.data),void 0!==ue.noncefn&&assert$b("Function"===toTypeString(ue.noncefn),"Expected options.noncefn to be a Function");const he={signature:pe=getAssertedOutput(pe,64),recid:null};switch(G.ecdsaSign(he,K,ne,ue.data,ue.noncefn)){case 0:return he;case 1:throw new Error(xp);case 2:throw new Error(Ap)}},ecdsaVerify(K,ne,ue){switch(isUint8Array("signature",K,64),isUint8Array("message",ne,32),isUint8Array("public key",ue,[33,65]),G.ecdsaVerify(K,ne,ue)){case 0:return!0;case 3:return!1;case 1:throw new Error(Op);case 2:throw new Error(Cp)}},ecdsaRecover(K,ne,ue,pe=!0,he){switch(isUint8Array("signature",K,64),assert$b("Number"===toTypeString(ne)&&ne>=0&&ne<=3,"Expected recovery id to be a Number within interval [0, 3]"),isUint8Array("message",ue,32),isCompressed(pe),he=getAssertedOutput(he,pe?33:65),G.ecdsaRecover(he,K,ne,ue)){case 0:return he;case 1:throw new Error(Op);case 2:throw new Error(Np);case 3:throw new Error(Ap)}},ecdh(K,ne,ue={},pe){switch(isUint8Array("public key",K,[33,65]),isUint8Array("private key",ne,32),assert$b("Object"===toTypeString(ue),"Expected options to be an Object"),void 0!==ue.data&&isUint8Array("options.data",ue.data),void 0!==ue.hashfn?(assert$b("Function"===toTypeString(ue.hashfn),"Expected options.hashfn to be a Function"),void 0!==ue.xbuf&&isUint8Array("options.xbuf",ue.xbuf,32),void 0!==ue.ybuf&&isUint8Array("options.ybuf",ue.ybuf,32),isUint8Array("output",pe)):pe=getAssertedOutput(pe,32),G.ecdh(pe,K,ne,ue.data,ue.hashfn,ue.xbuf,ue.ybuf)){case 0:return pe;case 1:throw new Error(Cp);case 2:throw new Error(Mp)}}}))(Qh),Yh={},ey={exports:{}},ty={exports:{}};
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
!function(G,K){var ne=Ti,ue=ne.Buffer;function copyProps(G,K){for(var ne in G)K[ne]=G[ne]}function SafeBuffer(G,K,ne){return ue(G,K,ne)}ue.from&&ue.alloc&&ue.allocUnsafe&&ue.allocUnsafeSlow?G.exports=ne:(copyProps(ne,K),K.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(ue.prototype),copyProps(ue,SafeBuffer),SafeBuffer.from=function(G,K,ne){if("number"==typeof G)throw new TypeError("Argument must not be a number");return ue(G,K,ne)},SafeBuffer.alloc=function(G,K,ne){if("number"!=typeof G)throw new TypeError("Argument must be a number");var pe=ue(G);return void 0!==K?"string"==typeof ne?pe.fill(K,ne):pe.fill(K):pe.fill(0),pe},SafeBuffer.allocUnsafe=function(G){if("number"!=typeof G)throw new TypeError("Argument must be a number");return ue(G)},SafeBuffer.allocUnsafeSlow=function(G){if("number"!=typeof G)throw new TypeError("Argument must be a number");return ne.SlowBuffer(G)}}(ty,ty.exports);var ry=ty.exports,ny=65536,ay=4294967295;var iy=ry.Buffer,sy=pn.crypto||pn.msCrypto;sy&&sy.getRandomValues?ey.exports=function randomBytes$1(G,K){if(G>ay)throw new RangeError("requested too many random bytes");var ne=iy.allocUnsafe(G);if(G>0)if(G>ny)for(var ue=0;ue<G;ue+=ny)sy.getRandomValues(ne.slice(ue,ue+ny));else sy.getRandomValues(ne);if("function"==typeof K)return process.nextTick((function(){K(null,ne)}));return ne}:ey.exports=function oldBrowser(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")};var oy=ey.exports;Object.defineProperty(Yh,"__esModule",{value:!0});var cy=oy;Yh.getRandomBytes=function getRandomBytes(G){return new Promise((function(K,ne){cy(G,(function(G,ue){G?ne(G):K(ue)}))}))},Yh.getRandomBytesSync=function getRandomBytesSync(G){return cy(G)},function(G){var K=pn&&pn.__awaiter||function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))},ne=pn&&pn.__generator||function(G,K){var ne,ue,pe,he,ye={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return he={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(he[Symbol.iterator]=function(){return this}),he;function verb(he){return function(me){return function step(he){if(ne)throw new TypeError("Generator is already executing.");for(;ye;)try{if(ne=1,ue&&(pe=2&he[0]?ue.return:he[0]?ue.throw||((pe=ue.return)&&pe.call(ue),0):ue.next)&&!(pe=pe.call(ue,he[1])).done)return pe;switch(ue=0,pe&&(he=[2&he[0],pe.value]),he[0]){case 0:case 1:pe=he;break;case 4:return ye.label++,{value:he[1],done:!1};case 5:ye.label++,ue=he[1],he=[0];continue;case 7:he=ye.ops.pop(),ye.trys.pop();continue;default:if(!(pe=ye.trys,(pe=pe.length>0&&pe[pe.length-1])||6!==he[0]&&2!==he[0])){ye=0;continue}if(3===he[0]&&(!pe||he[1]>pe[0]&&he[1]<pe[3])){ye.label=he[1];break}if(6===he[0]&&ye.label<pe[1]){ye.label=pe[1],pe=he;break}if(pe&&ye.label<pe[2]){ye.label=pe[2],ye.ops.push(he);break}pe[2]&&ye.ops.pop(),ye.trys.pop();continue}he=K.call(G,ye)}catch(G){he=[6,G],ue=0}finally{ne=pe=0}if(5&he[0])throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}([he,me])}}};Object.defineProperty(G,"__esModule",{value:!0});var ue=Zh,pe=Yh;G.createPrivateKey=function createPrivateKey(){return K(this,void 0,void 0,(function(){var G;return ne(this,(function(K){switch(K.label){case 0:return[4,pe.getRandomBytes(32)];case 1:return G=K.sent(),ue.privateKeyVerify(G)?[2,G]:[3,0];case 2:return[2]}}))}))},G.createPrivateKeySync=function createPrivateKeySync(){for(;;){var G=pe.getRandomBytesSync(32);if(ue.privateKeyVerify(G))return G}},function __export(K){for(var ne in K)G.hasOwnProperty(ne)||(G[ne]=K[ne])}(Zh)}(Tp);var dy={};function isHexPrefixed(G){if("string"!=typeof G)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof G));return"0"===G[0]&&"x"===G[1]}Object.defineProperty(dy,"__esModule",{value:!0}),dy.isHexString=dy.getKeys=dy.fromAscii=dy.fromUtf8=dy.toAscii=dy.arrayContainsArray=dy.getBinarySize=dy.padToEven=dy.stripHexPrefix=dy.isHexPrefixed=void 0,dy.isHexPrefixed=isHexPrefixed;function padToEven(G){var K=G;if("string"!=typeof K)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof K));return K.length%2&&(K="0".concat(K)),K}dy.stripHexPrefix=function(G){if("string"!=typeof G)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof G));return isHexPrefixed(G)?G.slice(2):G},dy.padToEven=padToEven,dy.getBinarySize=function getBinarySize(G){if("string"!=typeof G)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof G));return Buffer.byteLength(G,"utf8")},dy.arrayContainsArray=function arrayContainsArray(G,K,ne){if(!0!==Array.isArray(G))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof G,"'"));if(!0!==Array.isArray(K))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof K,"'"));return K[ne?"some":"every"]((function(K){return G.indexOf(K)>=0}))},dy.toAscii=function toAscii(G){var K="",ne=0,ue=G.length;for("0x"===G.substring(0,2)&&(ne=2);ne<ue;ne+=2){var pe=parseInt(G.substr(ne,2),16);K+=String.fromCharCode(pe)}return K},dy.fromUtf8=function fromUtf8(G){var K=Buffer.from(G,"utf8");return"0x".concat(padToEven(K.toString("hex")).replace(/^0+|0+$/g,""))},dy.fromAscii=function fromAscii(G){for(var K="",ne=0;ne<G.length;ne++){var ue=G.charCodeAt(ne).toString(16);K+=ue.length<2?"0".concat(ue):ue}return"0x".concat(K)},dy.getKeys=function getKeys(G,K,ne){if(!Array.isArray(G))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof G));if("string"!=typeof K)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof G));for(var ue=[],pe=0;pe<G.length;pe++){var he=G[pe][K];if(ne&&!he)he="";else if("string"!=typeof he)throw new Error("invalid abi - expected type 'string', received ".concat(typeof he));ue.push(he)}return ue},dy.isHexString=function isHexString$2(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(!K||G.length===2+2*K)};var uy={},fy={};Object.defineProperty(fy,"__esModule",{value:!0}),fy.assertIsString=fy.assertIsArray=fy.assertIsBuffer=fy.assertIsHexString=void 0;var ly=dy;fy.assertIsHexString=function(G){if(!(0,ly.isHexString)(G)){var K="This method only supports 0x-prefixed hex strings but input was: ".concat(G);throw new Error(K)}};fy.assertIsBuffer=function(G){if(!Buffer.isBuffer(G)){var K="This method only supports Buffer but input was: ".concat(G);throw new Error(K)}};fy.assertIsArray=function(G){if(!Array.isArray(G)){var K="This method only supports number arrays but input was: ".concat(G);throw new Error(K)}};fy.assertIsString=function(G){if("string"!=typeof G){var K="This method only supports strings but input was: ".concat(G);throw new Error(K)}},function(G){var K=pn&&pn.__values||function(G){var K="function"==typeof Symbol&&Symbol.iterator,ne=K&&G[K],ue=0;if(ne)return ne.call(G);if(G&&"number"==typeof G.length)return{next:function(){return G&&ue>=G.length&&(G=void 0),{value:G&&G[ue++],done:!G}}};throw new TypeError(K?"Object is not iterable.":"Symbol.iterator is not defined.")},ne=pn&&pn.__read||function(G,K){var ne="function"==typeof Symbol&&G[Symbol.iterator];if(!ne)return G;var ue,pe,he=ne.call(G),ye=[];try{for(;(void 0===K||K-- >0)&&!(ue=he.next()).done;)ye.push(ue.value)}catch(G){pe={error:G}}finally{try{ue&&!ue.done&&(ne=he.return)&&ne.call(he)}finally{if(pe)throw pe.error}}return ye};Object.defineProperty(G,"__esModule",{value:!0}),G.bufArrToArr=G.arrToBufArr=G.validateNoLeadingZeroes=G.baToJSON=G.toUtf8=G.addHexPrefix=G.toUnsigned=G.fromSigned=G.bufferToHex=G.bufferToInt=G.toBuffer=G.unpadHexString=G.unpadArray=G.unpadBuffer=G.setLengthRight=G.setLengthLeft=G.zeros=G.intToBuffer=G.intToHex=void 0;var ue=Nl,pe=dy,he=fy;G.intToHex=function(G){if(!Number.isSafeInteger(G)||G<0)throw new Error("Received an invalid integer type: ".concat(G));return"0x".concat(G.toString(16))};G.intToBuffer=function(K){var ne=(0,G.intToHex)(K);return Buffer.from((0,pe.padToEven)(ne.slice(2)),"hex")};G.zeros=function(G){return Buffer.allocUnsafe(G).fill(0)};var setLength=function(K,ne,ue){var pe=(0,G.zeros)(ne);return ue?K.length<ne?(K.copy(pe),pe):K.slice(0,ne):K.length<ne?(K.copy(pe,ne-K.length),pe):K.slice(-ne)};G.setLengthLeft=function(G,K){return(0,he.assertIsBuffer)(G),setLength(G,K,!1)};G.setLengthRight=function(G,K){return(0,he.assertIsBuffer)(G),setLength(G,K,!0)};var stripZeros=function(G){for(var K=G[0];G.length>0&&"0"===K.toString();)K=(G=G.slice(1))[0];return G};G.unpadBuffer=function(G){return(0,he.assertIsBuffer)(G),stripZeros(G)};G.unpadArray=function(G){return(0,he.assertIsArray)(G),stripZeros(G)};G.unpadHexString=function(G){return(0,he.assertIsHexString)(G),G=(0,pe.stripHexPrefix)(G),stripZeros(G)};G.toBuffer=function(K){if(null==K)return Buffer.allocUnsafe(0);if(Buffer.isBuffer(K))return Buffer.from(K);if(Array.isArray(K)||K instanceof Uint8Array)return Buffer.from(K);if("string"==typeof K){if(!(0,pe.isHexString)(K))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(K));return Buffer.from((0,pe.padToEven)((0,pe.stripHexPrefix)(K)),"hex")}if("number"==typeof K)return(0,G.intToBuffer)(K);if(ue.BN.isBN(K)){if(K.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(K));return K.toArrayLike(Buffer)}if(K.toArray)return Buffer.from(K.toArray());if(K.toBuffer)return Buffer.from(K.toBuffer());throw new Error("invalid type")};G.bufferToInt=function(K){return new ue.BN((0,G.toBuffer)(K)).toNumber()};G.bufferToHex=function(K){return"0x"+(K=(0,G.toBuffer)(K)).toString("hex")};G.fromSigned=function(G){return new ue.BN(G).fromTwos(256)};G.toUnsigned=function(G){return Buffer.from(G.toTwos(256).toArray())};G.addHexPrefix=function(G){return"string"!=typeof G||(0,pe.isHexPrefixed)(G)?G:"0x"+G};G.toUtf8=function(G){if((G=(0,pe.stripHexPrefix)(G)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return Buffer.from(G.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};G.baToJSON=function(K){if(Buffer.isBuffer(K))return"0x".concat(K.toString("hex"));if(K instanceof Array){for(var ne=[],ue=0;ue<K.length;ue++)ne.push((0,G.baToJSON)(K[ue]));return ne}};G.validateNoLeadingZeroes=function(G){var ue,pe;try{for(var he=K(Object.entries(G)),ye=he.next();!ye.done;ye=he.next()){var me=ne(ye.value,2),be=me[0],ve=me[1];if(void 0!==ve&&ve.length>0&&0===ve[0])throw new Error("".concat(be," cannot have leading zeroes, received: ").concat(ve.toString("hex")))}}catch(G){ue={error:G}}finally{try{ye&&!ye.done&&(pe=he.return)&&pe.call(he)}finally{if(ue)throw ue.error}}},G.arrToBufArr=function arrToBufArr(G){return Array.isArray(G)?G.map((function(G){return arrToBufArr(G)})):Buffer.from(G)},G.bufArrToArr=function bufArrToArr(G){return Array.isArray(G)?G.map((function(G){return bufArrToArr(G)})):Uint8Array.from(null!=G?G:[])}}(uy);var py={},hy={},yy={};Object.defineProperty(yy,"__esModule",{value:!0}),yy.createHashFunction=function createHashFunction(G){return function(K){var ne=G();return ne.update(K),Buffer.from(ne.digest())}};var my={exports:{}};function EventHandlers(){}function EventEmitter(){EventEmitter.init.call(this)}function $getMaxListeners(G){return void 0===G._maxListeners?EventEmitter.defaultMaxListeners:G._maxListeners}function _addListener(G,K,ne,ue){var pe,he,ye;if("function"!=typeof ne)throw new TypeError('"listener" argument must be a function');if((he=G._events)?(he.newListener&&(G.emit("newListener",K,ne.listener?ne.listener:ne),he=G._events),ye=he[K]):(he=G._events=new EventHandlers,G._eventsCount=0),ye){if("function"==typeof ye?ye=he[K]=ue?[ne,ye]:[ye,ne]:ue?ye.unshift(ne):ye.push(ne),!ye.warned&&(pe=$getMaxListeners(G))&&pe>0&&ye.length>pe){ye.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+ye.length+" "+K+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=G,me.type=K,me.count=ye.length,function emitWarning(G){"function"==typeof console.warn?console.warn(G):console.log(G)}(me)}}else ye=he[K]=ne,++G._eventsCount;return G}function _onceWrap(G,K,ne){var ue=!1;function g(){G.removeListener(K,g),ue||(ue=!0,ne.apply(G,arguments))}return g.listener=ne,g}function listenerCount$1(G){var K=this._events;if(K){var ne=K[G];if("function"==typeof ne)return 1;if(ne)return ne.length}return 0}function arrayClone(G,K){for(var ne=new Array(K);K--;)ne[K]=G[K];return ne}EventHandlers.prototype=Object.create(null),EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(G){if("number"!=typeof G||G<0||isNaN(G))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=G,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return $getMaxListeners(this)},EventEmitter.prototype.emit=function emit(G){var K,ne,ue,pe,he,ye,me,be="error"===G;if(ye=this._events)be=be&&null==ye.error;else if(!be)return!1;if(me=this.domain,be){if(K=arguments[1],!me){if(K instanceof Error)throw K;var ve=new Error('Uncaught, unspecified "error" event. ('+K+")");throw ve.context=K,ve}return K||(K=new Error('Uncaught, unspecified "error" event')),K.domainEmitter=this,K.domain=me,K.domainThrown=!1,me.emit("error",K),!1}if(!(ne=ye[G]))return!1;var _e="function"==typeof ne;switch(ue=arguments.length){case 1:!function emitNone(G,K,ne){if(K)G.call(ne);else for(var ue=G.length,pe=arrayClone(G,ue),he=0;he<ue;++he)pe[he].call(ne)}(ne,_e,this);break;case 2:!function emitOne(G,K,ne,ue){if(K)G.call(ne,ue);else for(var pe=G.length,he=arrayClone(G,pe),ye=0;ye<pe;++ye)he[ye].call(ne,ue)}(ne,_e,this,arguments[1]);break;case 3:!function emitTwo(G,K,ne,ue,pe){if(K)G.call(ne,ue,pe);else for(var he=G.length,ye=arrayClone(G,he),me=0;me<he;++me)ye[me].call(ne,ue,pe)}(ne,_e,this,arguments[1],arguments[2]);break;case 4:!function emitThree(G,K,ne,ue,pe,he){if(K)G.call(ne,ue,pe,he);else for(var ye=G.length,me=arrayClone(G,ye),be=0;be<ye;++be)me[be].call(ne,ue,pe,he)}(ne,_e,this,arguments[1],arguments[2],arguments[3]);break;default:for(pe=new Array(ue-1),he=1;he<ue;he++)pe[he-1]=arguments[he];!function emitMany(G,K,ne,ue){if(K)G.apply(ne,ue);else for(var pe=G.length,he=arrayClone(G,pe),ye=0;ye<pe;++ye)he[ye].apply(ne,ue)}(ne,_e,this,pe)}return!0},EventEmitter.prototype.addListener=function addListener(G,K){return _addListener(this,G,K,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(G,K){return _addListener(this,G,K,!0)},EventEmitter.prototype.once=function once(G,K){if("function"!=typeof K)throw new TypeError('"listener" argument must be a function');return this.on(G,_onceWrap(this,G,K)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(G,K){if("function"!=typeof K)throw new TypeError('"listener" argument must be a function');return this.prependListener(G,_onceWrap(this,G,K)),this},EventEmitter.prototype.removeListener=function removeListener(G,K){var ne,ue,pe,he,ye;if("function"!=typeof K)throw new TypeError('"listener" argument must be a function');if(!(ue=this._events))return this;if(!(ne=ue[G]))return this;if(ne===K||ne.listener&&ne.listener===K)0==--this._eventsCount?this._events=new EventHandlers:(delete ue[G],ue.removeListener&&this.emit("removeListener",G,ne.listener||K));else if("function"!=typeof ne){for(pe=-1,he=ne.length;he-- >0;)if(ne[he]===K||ne[he].listener&&ne[he].listener===K){ye=ne[he].listener,pe=he;break}if(pe<0)return this;if(1===ne.length){if(ne[0]=void 0,0==--this._eventsCount)return this._events=new EventHandlers,this;delete ue[G]}else!function spliceOne(G,K){for(var ne=K,ue=ne+1,pe=G.length;ue<pe;ne+=1,ue+=1)G[ne]=G[ue];G.pop()}(ne,pe);ue.removeListener&&this.emit("removeListener",G,ye||K)}return this},EventEmitter.prototype.off=function(G,K){return this.removeListener(G,K)},EventEmitter.prototype.removeAllListeners=function removeAllListeners(G){var K,ne;if(!(ne=this._events))return this;if(!ne.removeListener)return 0===arguments.length?(this._events=new EventHandlers,this._eventsCount=0):ne[G]&&(0==--this._eventsCount?this._events=new EventHandlers:delete ne[G]),this;if(0===arguments.length){for(var ue,pe=Object.keys(ne),he=0;he<pe.length;++he)"removeListener"!==(ue=pe[he])&&this.removeAllListeners(ue);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if("function"==typeof(K=ne[G]))this.removeListener(G,K);else if(K)do{this.removeListener(G,K[K.length-1])}while(K[0]);return this},EventEmitter.prototype.listeners=function listeners(G){var K,ne,ue=this._events;return ne=ue&&(K=ue[G])?"function"==typeof K?[K.listener||K]:function unwrapListeners(G){for(var K=new Array(G.length),ne=0;ne<K.length;++ne)K[ne]=G[ne].listener||G[ne];return K}(K):[],ne},EventEmitter.listenerCount=function(G,K){return"function"==typeof G.listenerCount?G.listenerCount(K):listenerCount$1.call(G,K)},EventEmitter.prototype.listenerCount=listenerCount$1,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var by,gy,vy=getAugmentedNamespace$1(Object.freeze({__proto__:null,EventEmitter:EventEmitter,default:EventEmitter}));function requireStreamBrowser(){return gy?by:(gy=1,by=vy.EventEmitter)}var wy,_y,Ty,Ay,Ey=getAugmentedNamespace$1(yp);function requireBuffer_list(){if(_y)return wy;function ownKeys(G,K){var ne=Object.keys(G);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(G);K&&(ue=ue.filter((function(K){return Object.getOwnPropertyDescriptor(G,K).enumerable}))),ne.push.apply(ne,ue)}return ne}function _objectSpread(G){for(var K=1;K<arguments.length;K++){var ne=null!=arguments[K]?arguments[K]:{};K%2?ownKeys(Object(ne),!0).forEach((function(K){_defineProperty(G,K,ne[K])})):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(ne)):ownKeys(Object(ne)).forEach((function(K){Object.defineProperty(G,K,Object.getOwnPropertyDescriptor(ne,K))}))}return G}function _defineProperty(G,K,ne){return(K=_toPropertyKey(K))in G?Object.defineProperty(G,K,{value:ne,enumerable:!0,configurable:!0,writable:!0}):G[K]=ne,G}function _createClass(G,K,ne){return K&&function _defineProperties(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,_toPropertyKey(ue.key),ue)}}(G.prototype,K),Object.defineProperty(G,"prototype",{writable:!1}),G}function _toPropertyKey(G){var K=function _toPrimitive(G,K){if("object"!=typeof G||null===G)return G;var ne=G[Symbol.toPrimitive];if(void 0!==ne){var ue=ne.call(G,K||"default");if("object"!=typeof ue)return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===K?String:Number)(G)}(G,"string");return"symbol"==typeof K?K:String(K)}_y=1;var G=Ti.Buffer,K=Ey.inspect,ne=K&&K.custom||"inspect";function copyBuffer(K,ne,ue){G.prototype.copy.call(K,ne,ue)}return wy=function(){function BufferList(){!function _classCallCheck(G,K){if(!(G instanceof K))throw new TypeError("Cannot call a class as a function")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return _createClass(BufferList,[{key:"push",value:function push(G){var K={data:G,next:null};this.length>0?this.tail.next=K:this.head=K,this.tail=K,++this.length}},{key:"unshift",value:function unshift(G){var K={data:G,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length}},{key:"shift",value:function shift(){if(0!==this.length){var G=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,G}}},{key:"clear",value:function clear(){this.head=this.tail=null,this.length=0}},{key:"join",value:function join(G){if(0===this.length)return"";for(var K=this.head,ne=""+K.data;K=K.next;)ne+=G+K.data;return ne}},{key:"concat",value:function concat(K){if(0===this.length)return G.alloc(0);for(var ne=G.allocUnsafe(K>>>0),ue=this.head,pe=0;ue;)copyBuffer(ue.data,ne,pe),pe+=ue.data.length,ue=ue.next;return ne}},{key:"consume",value:function consume(G,K){var ne;return G<this.head.data.length?(ne=this.head.data.slice(0,G),this.head.data=this.head.data.slice(G)):ne=G===this.head.data.length?this.shift():K?this._getString(G):this._getBuffer(G),ne}},{key:"first",value:function first(){return this.head.data}},{key:"_getString",value:function _getString(G){var K=this.head,ne=1,ue=K.data;for(G-=ue.length;K=K.next;){var pe=K.data,he=G>pe.length?pe.length:G;if(he===pe.length?ue+=pe:ue+=pe.slice(0,G),0===(G-=he)){he===pe.length?(++ne,K.next?this.head=K.next:this.head=this.tail=null):(this.head=K,K.data=pe.slice(he));break}++ne}return this.length-=ne,ue}},{key:"_getBuffer",value:function _getBuffer(K){var ne=G.allocUnsafe(K),ue=this.head,pe=1;for(ue.data.copy(ne),K-=ue.data.length;ue=ue.next;){var he=ue.data,ye=K>he.length?he.length:K;if(he.copy(ne,ne.length-K,0,ye),0===(K-=ye)){ye===he.length?(++pe,ue.next?this.head=ue.next:this.head=this.tail=null):(this.head=ue,ue.data=he.slice(ye));break}++pe}return this.length-=pe,ne}},{key:ne,value:function value(G,ne){return K(this,_objectSpread(_objectSpread({},ne),{},{depth:0,customInspect:!1}))}}]),BufferList}(),wy}function requireDestroy(){if(Ay)return Ty;function emitErrorAndCloseNT(G,K){emitErrorNT(G,K),emitCloseNT(G)}function emitCloseNT(G){G._writableState&&!G._writableState.emitClose||G._readableState&&!G._readableState.emitClose||G.emit("close")}function emitErrorNT(G,K){G.emit("error",K)}return Ay=1,Ty={destroy:function destroy(G,K){var ne=this,ue=this._readableState&&this._readableState.destroyed,pe=this._writableState&&this._writableState.destroyed;return ue||pe?(K?K(G):G&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,G)):process.nextTick(emitErrorNT,this,G)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(G||null,(function(G){!K&&G?ne._writableState?ne._writableState.errorEmitted?process.nextTick(emitCloseNT,ne):(ne._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,ne,G)):process.nextTick(emitErrorAndCloseNT,ne,G):K?(process.nextTick(emitCloseNT,ne),K(G)):process.nextTick(emitCloseNT,ne)})),this)},undestroy:function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function errorOrDestroy(G,K){var ne=G._readableState,ue=G._writableState;ne&&ne.autoDestroy||ue&&ue.autoDestroy?G.destroy(K):G.emit("error",K)}}}var Py={};var Sy,Iy,Cy,Ry,ky,Oy,xy,Ny,My={};function createErrorType(G,K,ne){ne||(ne=Error);var ue=function(G){function NodeError(ne,ue,pe){return G.call(this,function getMessage(G,ne,ue){return"string"==typeof K?K:K(G,ne,ue)}(ne,ue,pe))||this}return function _inheritsLoose$5(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}(NodeError,G),NodeError}(ne);ue.prototype.name=ne.name,ue.prototype.code=G,My[G]=ue}function oneOf(G,K){if(Array.isArray(G)){var ne=G.length;return G=G.map((function(G){return String(G)})),ne>2?"one of ".concat(K," ").concat(G.slice(0,ne-1).join(", "),", or ")+G[ne-1]:2===ne?"one of ".concat(K," ").concat(G[0]," or ").concat(G[1]):"of ".concat(K," ").concat(G[0])}return"of ".concat(K," ").concat(String(G))}function requireState(){if(Iy)return Sy;Iy=1;var G=Py.codes.ERR_INVALID_OPT_VALUE;return Sy={getHighWaterMark:function getHighWaterMark(K,ne,ue,pe){var he=function highWaterMarkFrom(G,K,ne){return null!=G.highWaterMark?G.highWaterMark:K?G[ne]:null}(ne,pe,ue);if(null!=he){if(!isFinite(he)||Math.floor(he)!==he||he<0)throw new G(pe?ue:"highWaterMark",he);return Math.floor(he)}return K.objectMode?16:16384}}}function requireBrowser(){if(Ry)return Cy;function config(G){try{if(!pn.localStorage)return!1}catch(G){return!1}var K=pn.localStorage[G];return null!=K&&"true"===String(K).toLowerCase()}return Ry=1,Cy=function deprecate(G,K){if(config("noDeprecation"))return G;var ne=!1;return function deprecated(){if(!ne){if(config("throwDeprecation"))throw new Error(K);config("traceDeprecation")?console.trace(K):console.warn(K),ne=!0}return G.apply(this,arguments)}},Cy}function require_stream_writable(){if(Oy)return ky;function CorkedRequest(G){var K=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(G,K,ne){var ue=G.entry;G.entry=null;for(;ue;){var pe=ue.callback;K.pendingcb--,pe(ne),ue=ue.next}K.corkedRequestsFree.next=G}(K,G)}}var G;Oy=1,ky=Writable,Writable.WritableState=WritableState;var K={deprecate:requireBrowser()},ne=requireStreamBrowser(),ue=Ti.Buffer,pe=(void 0!==pn?pn:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var he,ye=requireDestroy(),me=requireState().getHighWaterMark,be=Py.codes,ve=be.ERR_INVALID_ARG_TYPE,_e=be.ERR_METHOD_NOT_IMPLEMENTED,Te=be.ERR_MULTIPLE_CALLBACK,Ee=be.ERR_STREAM_CANNOT_PIPE,Pe=be.ERR_STREAM_DESTROYED,Se=be.ERR_STREAM_NULL_VALUES,Ce=be.ERR_STREAM_WRITE_AFTER_END,ke=be.ERR_UNKNOWN_ENCODING,Oe=ye.errorOrDestroy;function nop(){}function WritableState(K,ne,ue){G=G||require_stream_duplex(),K=K||{},"boolean"!=typeof ue&&(ue=ne instanceof G),this.objectMode=!!K.objectMode,ue&&(this.objectMode=this.objectMode||!!K.writableObjectMode),this.highWaterMark=me(this,K,"writableHighWaterMark",ue),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pe=!1===K.decodeStrings;this.decodeStrings=!pe,this.defaultEncoding=K.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){!function onwrite(G,K){var ne=G._writableState,ue=ne.sync,pe=ne.writecb;if("function"!=typeof pe)throw new Te;if(function onwriteStateUpdate(G){G.writing=!1,G.writecb=null,G.length-=G.writelen,G.writelen=0}(ne),K)!function onwriteError(G,K,ne,ue,pe){--K.pendingcb,ne?(process.nextTick(pe,ue),process.nextTick(finishMaybe,G,K),G._writableState.errorEmitted=!0,Oe(G,ue)):(pe(ue),G._writableState.errorEmitted=!0,Oe(G,ue),finishMaybe(G,K))}(G,ne,ue,K,pe);else{var he=needFinish(ne)||G.destroyed;he||ne.corked||ne.bufferProcessing||!ne.bufferedRequest||clearBuffer(G,ne),ue?process.nextTick(afterWrite,G,ne,he,pe):afterWrite(G,ne,he,pe)}}(ne,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==K.emitClose,this.autoDestroy=!!K.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(K){var ue=this instanceof(G=G||require_stream_duplex());if(!ue&&!he.call(Writable,this))return new Writable(K);this._writableState=new WritableState(K,this,ue),this.writable=!0,K&&("function"==typeof K.write&&(this._write=K.write),"function"==typeof K.writev&&(this._writev=K.writev),"function"==typeof K.destroy&&(this._destroy=K.destroy),"function"==typeof K.final&&(this._final=K.final)),ne.call(this)}function doWrite(G,K,ne,ue,pe,he,ye){K.writelen=ue,K.writecb=ye,K.writing=!0,K.sync=!0,K.destroyed?K.onwrite(new Pe("write")):ne?G._writev(pe,K.onwrite):G._write(pe,he,K.onwrite),K.sync=!1}function afterWrite(G,K,ne,ue){ne||function onwriteDrain(G,K){0===K.length&&K.needDrain&&(K.needDrain=!1,G.emit("drain"))}(G,K),K.pendingcb--,ue(),finishMaybe(G,K)}function clearBuffer(G,K){K.bufferProcessing=!0;var ne=K.bufferedRequest;if(G._writev&&ne&&ne.next){var ue=K.bufferedRequestCount,pe=new Array(ue),he=K.corkedRequestsFree;he.entry=ne;for(var ye=0,me=!0;ne;)pe[ye]=ne,ne.isBuf||(me=!1),ne=ne.next,ye+=1;pe.allBuffers=me,doWrite(G,K,!0,K.length,pe,"",he.finish),K.pendingcb++,K.lastBufferedRequest=null,he.next?(K.corkedRequestsFree=he.next,he.next=null):K.corkedRequestsFree=new CorkedRequest(K),K.bufferedRequestCount=0}else{for(;ne;){var be=ne.chunk,ve=ne.encoding,_e=ne.callback;if(doWrite(G,K,!1,K.objectMode?1:be.length,be,ve,_e),ne=ne.next,K.bufferedRequestCount--,K.writing)break}null===ne&&(K.lastBufferedRequest=null)}K.bufferedRequest=ne,K.bufferProcessing=!1}function needFinish(G){return G.ending&&0===G.length&&null===G.bufferedRequest&&!G.finished&&!G.writing}function callFinal(G,K){G._final((function(ne){K.pendingcb--,ne&&Oe(G,ne),K.prefinished=!0,G.emit("prefinish"),finishMaybe(G,K)}))}function finishMaybe(G,K){var ne=needFinish(K);if(ne&&(function prefinish(G,K){K.prefinished||K.finalCalled||("function"!=typeof G._final||K.destroyed?(K.prefinished=!0,G.emit("prefinish")):(K.pendingcb++,K.finalCalled=!0,process.nextTick(callFinal,G,K)))}(G,K),0===K.pendingcb&&(K.finished=!0,G.emit("finish"),K.autoDestroy))){var ue=G._readableState;(!ue||ue.autoDestroy&&ue.endEmitted)&&G.destroy()}return ne}return nc(Writable,ne),WritableState.prototype.getBuffer=function getBuffer(){for(var G=this.bufferedRequest,K=[];G;)K.push(G),G=G.next;return K},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:K.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(G){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(he=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(G){return!!he.call(this,G)||this===Writable&&(G&&G._writableState instanceof WritableState)}})):he=function realHasInstance(G){return G instanceof this},Writable.prototype.pipe=function(){Oe(this,new Ee)},Writable.prototype.write=function(G,K,ne){var he=this._writableState,ye=!1,me=!he.objectMode&&function _isUint8Array(G){return ue.isBuffer(G)||G instanceof pe}(G);return me&&!ue.isBuffer(G)&&(G=function _uint8ArrayToBuffer(G){return ue.from(G)}(G)),"function"==typeof K&&(ne=K,K=null),me?K="buffer":K||(K=he.defaultEncoding),"function"!=typeof ne&&(ne=nop),he.ending?function writeAfterEnd(G,K){var ne=new Ce;Oe(G,ne),process.nextTick(K,ne)}(this,ne):(me||function validChunk(G,K,ne,ue){var pe;return null===ne?pe=new Se:"string"==typeof ne||K.objectMode||(pe=new ve("chunk",["string","Buffer"],ne)),!pe||(Oe(G,pe),process.nextTick(ue,pe),!1)}(this,he,G,ne))&&(he.pendingcb++,ye=function writeOrBuffer(G,K,ne,pe,he,ye){if(!ne){var me=function decodeChunk(G,K,ne){G.objectMode||!1===G.decodeStrings||"string"!=typeof K||(K=ue.from(K,ne));return K}(K,pe,he);pe!==me&&(ne=!0,he="buffer",pe=me)}var be=K.objectMode?1:pe.length;K.length+=be;var ve=K.length<K.highWaterMark;ve||(K.needDrain=!0);if(K.writing||K.corked){var _e=K.lastBufferedRequest;K.lastBufferedRequest={chunk:pe,encoding:he,isBuf:ne,callback:ye,next:null},_e?_e.next=K.lastBufferedRequest:K.bufferedRequest=K.lastBufferedRequest,K.bufferedRequestCount+=1}else doWrite(G,K,!1,be,pe,he,ye);return ve}(this,he,me,G,K,ne)),ye},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,G.writing||G.corked||G.bufferProcessing||!G.bufferedRequest||clearBuffer(this,G))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(G){if("string"==typeof G&&(G=G.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((G+"").toLowerCase())>-1))throw new ke(G);return this._writableState.defaultEncoding=G,this},Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(G,K,ne){ne(new _e("_write()"))},Writable.prototype._writev=null,Writable.prototype.end=function(G,K,ne){var ue=this._writableState;return"function"==typeof G?(ne=G,G=null,K=null):"function"==typeof K&&(ne=K,K=null),null!=G&&this.write(G,K),ue.corked&&(ue.corked=1,this.uncork()),ue.ending||function endWritable(G,K,ne){K.ending=!0,finishMaybe(G,K),ne&&(K.finished?process.nextTick(ne):G.once("finish",ne));K.ended=!0,G.writable=!1}(this,ue,ne),this},Object.defineProperty(Writable.prototype,"writableLength",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(G){this._writableState&&(this._writableState.destroyed=G)}}),Writable.prototype.destroy=ye.destroy,Writable.prototype._undestroy=ye.undestroy,Writable.prototype._destroy=function(G,K){K(G)},ky}function require_stream_duplex(){if(Ny)return xy;Ny=1;var G=Object.keys||function(G){var K=[];for(var ne in G)K.push(ne);return K};xy=Duplex;var K=require_stream_readable(),ne=require_stream_writable();nc(Duplex,K);for(var ue=G(ne.prototype),pe=0;pe<ue.length;pe++){var he=ue[pe];Duplex.prototype[he]||(Duplex.prototype[he]=ne.prototype[he])}function Duplex(G){if(!(this instanceof Duplex))return new Duplex(G);K.call(this,G),ne.call(this,G),this.allowHalfOpen=!0,G&&(!1===G.readable&&(this.readable=!1),!1===G.writable&&(this.writable=!1),!1===G.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",onend)))}function onend(){this._writableState.ended||process.nextTick(onEndNT,this)}function onEndNT(G){G.end()}return Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"writableBuffer",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Duplex.prototype,"writableLength",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Duplex.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function set(G){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=G,this._writableState.destroyed=G)}}),xy}createErrorType("ERR_INVALID_OPT_VALUE",(function(G,K){return'The value "'+K+'" is invalid for option "'+G+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(G,K,ne){var ue,pe;if("string"==typeof K&&function startsWith(G,K,ne){return G.substr(0,K.length)===K}(K,"not ")?(ue="must not be",K=K.replace(/^not /,"")):ue="must be",function endsWith$1(G,K,ne){return(void 0===ne||ne>G.length)&&(ne=G.length),G.substring(ne-K.length,ne)===K}(G," argument"))pe="The ".concat(G," ").concat(ue," ").concat(oneOf(K,"type"));else{var he=function includes(G,K,ne){return"number"!=typeof ne&&(ne=0),!(ne+K.length>G.length)&&-1!==G.indexOf(K,ne)}(G,".")?"property":"argument";pe='The "'.concat(G,'" ').concat(he," ").concat(ue," ").concat(oneOf(K,"type"))}return pe+=". Received type ".concat(typeof ne)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(G){return"The "+G+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(G){return"Cannot call "+G+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(G){return"Unknown encoding: "+G}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Py.codes=My;var By=Buffer$h.isEncoding||function(G){switch(G&&G.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder$1(G){switch(this.encoding=(G||"utf8").toLowerCase().replace(/[-_]/,""),function assertEncoding(G){if(G&&!By(G))throw new Error("Unknown encoding: "+G)}(G),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer$h(6),this.charReceived=0,this.charLength=0}function passThroughWrite(G){return G.toString(this.encoding)}function utf16DetectIncompleteChar(G){this.charReceived=G.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(G){this.charReceived=G.length%3,this.charLength=this.charReceived?3:0}StringDecoder$1.prototype.write=function(G){for(var K="";this.charLength;){var ne=G.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:G.length;if(G.copy(this.charBuffer,this.charReceived,0,ne),this.charReceived+=ne,this.charReceived<this.charLength)return"";if(G=G.slice(ne,G.length),!((pe=(K=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(K.length-1))>=55296&&pe<=56319)){if(this.charReceived=this.charLength=0,0===G.length)return K;break}this.charLength+=this.surrogateSize,K=""}this.detectIncompleteChar(G);var ue=G.length;this.charLength&&(G.copy(this.charBuffer,0,G.length-this.charReceived,ue),ue-=this.charReceived);var pe;ue=(K+=G.toString(this.encoding,0,ue)).length-1;if((pe=K.charCodeAt(ue))>=55296&&pe<=56319){var he=this.surrogateSize;return this.charLength+=he,this.charReceived+=he,this.charBuffer.copy(this.charBuffer,he,0,he),G.copy(this.charBuffer,0,0,he),K.substring(0,ue)}return K},StringDecoder$1.prototype.detectIncompleteChar=function(G){for(var K=G.length>=3?3:G.length;K>0;K--){var ne=G[G.length-K];if(1==K&&ne>>5==6){this.charLength=2;break}if(K<=2&&ne>>4==14){this.charLength=3;break}if(K<=3&&ne>>3==30){this.charLength=4;break}}this.charReceived=K},StringDecoder$1.prototype.end=function(G){var K="";if(G&&G.length&&(K=this.write(G)),this.charReceived){var ne=this.charReceived,ue=this.charBuffer,pe=this.encoding;K+=ue.slice(0,ne).toString(pe)}return K};var Fy=getAugmentedNamespace$1(Object.freeze({__proto__:null,StringDecoder:StringDecoder$1})),Dy=Py.codes.ERR_STREAM_PREMATURE_CLOSE;function noop$2(){}var Ly,Uy,$y,qy,Gy,jy,Hy=function eos$1(G,K,ne){if("function"==typeof K)return eos$1(G,null,K);K||(K={}),ne=function once$1(G){var K=!1;return function(){if(!K){K=!0;for(var ne=arguments.length,ue=new Array(ne),pe=0;pe<ne;pe++)ue[pe]=arguments[pe];G.apply(this,ue)}}}(ne||noop$2);var ue=K.readable||!1!==K.readable&&G.readable,pe=K.writable||!1!==K.writable&&G.writable,he=function onlegacyfinish(){G.writable||me()},ye=G._writableState&&G._writableState.finished,me=function onfinish(){pe=!1,ye=!0,ue||ne.call(G)},be=G._readableState&&G._readableState.endEmitted,ve=function onend(){ue=!1,be=!0,pe||ne.call(G)},_e=function onerror(K){ne.call(G,K)},Te=function onclose(){var K;return ue&&!be?(G._readableState&&G._readableState.ended||(K=new Dy),ne.call(G,K)):pe&&!ye?(G._writableState&&G._writableState.ended||(K=new Dy),ne.call(G,K)):void 0},Ee=function onrequest(){G.req.on("finish",me)};return!function isRequest$1(G){return G.setHeader&&"function"==typeof G.abort}(G)?pe&&!G._writableState&&(G.on("end",he),G.on("close",he)):(G.on("complete",me),G.on("abort",Te),G.req?Ee():G.on("request",Ee)),G.on("end",ve),G.on("finish",me),!1!==K.error&&G.on("error",_e),G.on("close",Te),function(){G.removeListener("complete",me),G.removeListener("abort",Te),G.removeListener("request",Ee),G.req&&G.req.removeListener("finish",me),G.removeListener("end",he),G.removeListener("close",he),G.removeListener("finish",me),G.removeListener("end",ve),G.removeListener("error",_e),G.removeListener("close",Te)}};function requireAsync_iterator(){if(Uy)return Ly;var G;function _defineProperty(G,K,ne){return(K=function _toPropertyKey(G){var K=function _toPrimitive(G,K){if("object"!=typeof G||null===G)return G;var ne=G[Symbol.toPrimitive];if(void 0!==ne){var ue=ne.call(G,K||"default");if("object"!=typeof ue)return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===K?String:Number)(G)}(G,"string");return"symbol"==typeof K?K:String(K)}(K))in G?Object.defineProperty(G,K,{value:ne,enumerable:!0,configurable:!0,writable:!0}):G[K]=ne,G}Uy=1;var K=Hy,ne=Symbol("lastResolve"),ue=Symbol("lastReject"),pe=Symbol("error"),he=Symbol("ended"),ye=Symbol("lastPromise"),me=Symbol("handlePromise"),be=Symbol("stream");function createIterResult(G,K){return{value:G,done:K}}function readAndResolve(G){var K=G[ne];if(null!==K){var pe=G[be].read();null!==pe&&(G[ye]=null,G[ne]=null,G[ue]=null,K(createIterResult(pe,!1)))}}function onReadable(G){process.nextTick(readAndResolve,G)}var ve=Object.getPrototypeOf((function(){})),_e=Object.setPrototypeOf((G={get stream(){return this[be]},next:function next(){var G=this,K=this[pe];if(null!==K)return Promise.reject(K);if(this[he])return Promise.resolve(createIterResult(void 0,!0));if(this[be].destroyed)return new Promise((function(K,ne){process.nextTick((function(){G[pe]?ne(G[pe]):K(createIterResult(void 0,!0))}))}));var ne,ue=this[ye];if(ue)ne=new Promise(function wrapForNext(G,K){return function(ne,ue){G.then((function(){K[he]?ne(createIterResult(void 0,!0)):K[me](ne,ue)}),ue)}}(ue,this));else{var ve=this[be].read();if(null!==ve)return Promise.resolve(createIterResult(ve,!1));ne=new Promise(this[me])}return this[ye]=ne,ne}},_defineProperty(G,Symbol.asyncIterator,(function(){return this})),_defineProperty(G,"return",(function _return(){var G=this;return new Promise((function(K,ne){G[be].destroy(null,(function(G){G?ne(G):K(createIterResult(void 0,!0))}))}))})),G),ve);return Ly=function createReadableStreamAsyncIterator(G){var ve,Te=Object.create(_e,(_defineProperty(ve={},be,{value:G,writable:!0}),_defineProperty(ve,ne,{value:null,writable:!0}),_defineProperty(ve,ue,{value:null,writable:!0}),_defineProperty(ve,pe,{value:null,writable:!0}),_defineProperty(ve,he,{value:G._readableState.endEmitted,writable:!0}),_defineProperty(ve,me,{value:function value(G,K){var pe=Te[be].read();pe?(Te[ye]=null,Te[ne]=null,Te[ue]=null,G(createIterResult(pe,!1))):(Te[ne]=G,Te[ue]=K)},writable:!0}),ve));return Te[ye]=null,K(G,(function(G){if(G&&"ERR_STREAM_PREMATURE_CLOSE"!==G.code){var K=Te[ue];return null!==K&&(Te[ye]=null,Te[ne]=null,Te[ue]=null,K(G)),void(Te[pe]=G)}var me=Te[ne];null!==me&&(Te[ye]=null,Te[ne]=null,Te[ue]=null,me(createIterResult(void 0,!0))),Te[he]=!0})),G.on("readable",onReadable.bind(null,Te)),Te},Ly}function require_stream_readable(){if(jy)return Gy;var G;jy=1,Gy=Readable,Readable.ReadableState=ReadableState,vy.EventEmitter;var K=function EElistenerCount(G,K){return G.listeners(K).length},ne=requireStreamBrowser(),ue=Ti.Buffer,pe=(void 0!==pn?pn:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var he,ye=Ey;he=ye&&ye.debuglog?ye.debuglog("stream"):function debug(){};var me,be,ve,_e=requireBuffer_list(),Te=requireDestroy(),Ee=requireState().getHighWaterMark,Pe=Py.codes,Se=Pe.ERR_INVALID_ARG_TYPE,Ce=Pe.ERR_STREAM_PUSH_AFTER_EOF,ke=Pe.ERR_METHOD_NOT_IMPLEMENTED,Oe=Pe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;nc(Readable,ne);var xe=Te.errorOrDestroy,Ne=["error","close","destroy","pause","resume"];function ReadableState(K,ne,ue){G=G||require_stream_duplex(),K=K||{},"boolean"!=typeof ue&&(ue=ne instanceof G),this.objectMode=!!K.objectMode,ue&&(this.objectMode=this.objectMode||!!K.readableObjectMode),this.highWaterMark=Ee(this,K,"readableHighWaterMark",ue),this.buffer=new _e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==K.emitClose,this.autoDestroy=!!K.autoDestroy,this.destroyed=!1,this.defaultEncoding=K.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,K.encoding&&(me||(me=Fy.StringDecoder),this.decoder=new me(K.encoding),this.encoding=K.encoding)}function Readable(K){if(G=G||require_stream_duplex(),!(this instanceof Readable))return new Readable(K);var ue=this instanceof G;this._readableState=new ReadableState(K,this,ue),this.readable=!0,K&&("function"==typeof K.read&&(this._read=K.read),"function"==typeof K.destroy&&(this._destroy=K.destroy)),ne.call(this)}function readableAddChunk(G,K,ne,ye,me){he("readableAddChunk",K);var be,ve=G._readableState;if(null===K)ve.reading=!1,function onEofChunk(G,K){if(he("onEofChunk"),K.ended)return;if(K.decoder){var ne=K.decoder.end();ne&&ne.length&&(K.buffer.push(ne),K.length+=K.objectMode?1:ne.length)}K.ended=!0,K.sync?emitReadable(G):(K.needReadable=!1,K.emittedReadable||(K.emittedReadable=!0,emitReadable_(G)))}(G,ve);else if(me||(be=function chunkInvalid(G,K){var ne;(function _isUint8Array(G){return ue.isBuffer(G)||G instanceof pe})(K)||"string"==typeof K||void 0===K||G.objectMode||(ne=new Se("chunk",["string","Buffer","Uint8Array"],K));return ne}(ve,K)),be)xe(G,be);else if(ve.objectMode||K&&K.length>0)if("string"==typeof K||ve.objectMode||Object.getPrototypeOf(K)===ue.prototype||(K=function _uint8ArrayToBuffer(G){return ue.from(G)}(K)),ye)ve.endEmitted?xe(G,new Oe):addChunk(G,ve,K,!0);else if(ve.ended)xe(G,new Ce);else{if(ve.destroyed)return!1;ve.reading=!1,ve.decoder&&!ne?(K=ve.decoder.write(K),ve.objectMode||0!==K.length?addChunk(G,ve,K,!1):maybeReadMore(G,ve)):addChunk(G,ve,K,!1)}else ye||(ve.reading=!1,maybeReadMore(G,ve));return!ve.ended&&(ve.length<ve.highWaterMark||0===ve.length)}function addChunk(G,K,ne,ue){K.flowing&&0===K.length&&!K.sync?(K.awaitDrain=0,G.emit("data",ne)):(K.length+=K.objectMode?1:ne.length,ue?K.buffer.unshift(ne):K.buffer.push(ne),K.needReadable&&emitReadable(G)),maybeReadMore(G,K)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._readableState&&this._readableState.destroyed},set:function set(G){this._readableState&&(this._readableState.destroyed=G)}}),Readable.prototype.destroy=Te.destroy,Readable.prototype._undestroy=Te.undestroy,Readable.prototype._destroy=function(G,K){K(G)},Readable.prototype.push=function(G,K){var ne,pe=this._readableState;return pe.objectMode?ne=!0:"string"==typeof G&&((K=K||pe.defaultEncoding)!==pe.encoding&&(G=ue.from(G,K),K=""),ne=!0),readableAddChunk(this,G,K,!1,ne)},Readable.prototype.unshift=function(G){return readableAddChunk(this,G,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(G){me||(me=Fy.StringDecoder);var K=new me(G);this._readableState.decoder=K,this._readableState.encoding=this._readableState.decoder.encoding;for(var ne=this._readableState.buffer.head,ue="";null!==ne;)ue+=K.write(ne.data),ne=ne.next;return this._readableState.buffer.clear(),""!==ue&&this._readableState.buffer.push(ue),this._readableState.length=ue.length,this};var Me=1073741824;function howMuchToRead(G,K){return G<=0||0===K.length&&K.ended?0:K.objectMode?1:G!=G?K.flowing&&K.length?K.buffer.head.data.length:K.length:(G>K.highWaterMark&&(K.highWaterMark=function computeNewHighWaterMark(G){return G>=Me?G=Me:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}(G)),G<=K.length?G:K.ended?K.length:(K.needReadable=!0,0))}function emitReadable(G){var K=G._readableState;he("emitReadable",K.needReadable,K.emittedReadable),K.needReadable=!1,K.emittedReadable||(he("emitReadable",K.flowing),K.emittedReadable=!0,process.nextTick(emitReadable_,G))}function emitReadable_(G){var K=G._readableState;he("emitReadable_",K.destroyed,K.length,K.ended),K.destroyed||!K.length&&!K.ended||(G.emit("readable"),K.emittedReadable=!1),K.needReadable=!K.flowing&&!K.ended&&K.length<=K.highWaterMark,flow(G)}function maybeReadMore(G,K){K.readingMore||(K.readingMore=!0,process.nextTick(maybeReadMore_,G,K))}function maybeReadMore_(G,K){for(;!K.reading&&!K.ended&&(K.length<K.highWaterMark||K.flowing&&0===K.length);){var ne=K.length;if(he("maybeReadMore read 0"),G.read(0),ne===K.length)break}K.readingMore=!1}function updateReadableListening(G){var K=G._readableState;K.readableListening=G.listenerCount("readable")>0,K.resumeScheduled&&!K.paused?K.flowing=!0:G.listenerCount("data")>0&&G.resume()}function nReadingNextTick(G){he("readable nexttick read 0"),G.read(0)}function resume_(G,K){he("resume",K.reading),K.reading||G.read(0),K.resumeScheduled=!1,G.emit("resume"),flow(G),K.flowing&&!K.reading&&G.read(0)}function flow(G){var K=G._readableState;for(he("flow",K.flowing);K.flowing&&null!==G.read(););}function fromList(G,K){return 0===K.length?null:(K.objectMode?ne=K.buffer.shift():!G||G>=K.length?(ne=K.decoder?K.buffer.join(""):1===K.buffer.length?K.buffer.first():K.buffer.concat(K.length),K.buffer.clear()):ne=K.buffer.consume(G,K.decoder),ne);var ne}function endReadable(G){var K=G._readableState;he("endReadable",K.endEmitted),K.endEmitted||(K.ended=!0,process.nextTick(endReadableNT,K,G))}function endReadableNT(G,K){if(he("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&0===G.length&&(G.endEmitted=!0,K.readable=!1,K.emit("end"),G.autoDestroy)){var ne=K._writableState;(!ne||ne.autoDestroy&&ne.finished)&&K.destroy()}}function indexOf(G,K){for(var ne=0,ue=G.length;ne<ue;ne++)if(G[ne]===K)return ne;return-1}return Readable.prototype.read=function(G){he("read",G),G=parseInt(G,10);var K=this._readableState,ne=G;if(0!==G&&(K.emittedReadable=!1),0===G&&K.needReadable&&((0!==K.highWaterMark?K.length>=K.highWaterMark:K.length>0)||K.ended))return he("read: emitReadable",K.length,K.ended),0===K.length&&K.ended?endReadable(this):emitReadable(this),null;if(0===(G=howMuchToRead(G,K))&&K.ended)return 0===K.length&&endReadable(this),null;var ue,pe=K.needReadable;return he("need readable",pe),(0===K.length||K.length-G<K.highWaterMark)&&he("length less than watermark",pe=!0),K.ended||K.reading?he("reading or ended",pe=!1):pe&&(he("do read"),K.reading=!0,K.sync=!0,0===K.length&&(K.needReadable=!0),this._read(K.highWaterMark),K.sync=!1,K.reading||(G=howMuchToRead(ne,K))),null===(ue=G>0?fromList(G,K):null)?(K.needReadable=K.length<=K.highWaterMark,G=0):(K.length-=G,K.awaitDrain=0),0===K.length&&(K.ended||(K.needReadable=!0),ne!==G&&K.ended&&endReadable(this)),null!==ue&&this.emit("data",ue),ue},Readable.prototype._read=function(G){xe(this,new ke("_read()"))},Readable.prototype.pipe=function(G,ne){var ue=this,pe=this._readableState;switch(pe.pipesCount){case 0:pe.pipes=G;break;case 1:pe.pipes=[pe.pipes,G];break;default:pe.pipes.push(G)}pe.pipesCount+=1,he("pipe count=%d opts=%j",pe.pipesCount,ne);var ye=(!ne||!1!==ne.end)&&G!==process.stdout&&G!==process.stderr?onend:unpipe;function onunpipe(K,ne){he("onunpipe"),K===ue&&ne&&!1===ne.hasUnpiped&&(ne.hasUnpiped=!0,function cleanup(){he("cleanup"),G.removeListener("close",onclose),G.removeListener("finish",onfinish),G.removeListener("drain",me),G.removeListener("error",onerror),G.removeListener("unpipe",onunpipe),ue.removeListener("end",onend),ue.removeListener("end",unpipe),ue.removeListener("data",ondata),be=!0,!pe.awaitDrain||G._writableState&&!G._writableState.needDrain||me()}())}function onend(){he("onend"),G.end()}pe.endEmitted?process.nextTick(ye):ue.once("end",ye),G.on("unpipe",onunpipe);var me=function pipeOnDrain(G){return function pipeOnDrainFunctionResult(){var ne=G._readableState;he("pipeOnDrain",ne.awaitDrain),ne.awaitDrain&&ne.awaitDrain--,0===ne.awaitDrain&&K(G,"data")&&(ne.flowing=!0,flow(G))}}(ue);G.on("drain",me);var be=!1;function ondata(K){he("ondata");var ne=G.write(K);he("dest.write",ne),!1===ne&&((1===pe.pipesCount&&pe.pipes===G||pe.pipesCount>1&&-1!==indexOf(pe.pipes,G))&&!be&&(he("false write response, pause",pe.awaitDrain),pe.awaitDrain++),ue.pause())}function onerror(ne){he("onerror",ne),unpipe(),G.removeListener("error",onerror),0===K(G,"error")&&xe(G,ne)}function onclose(){G.removeListener("finish",onfinish),unpipe()}function onfinish(){he("onfinish"),G.removeListener("close",onclose),unpipe()}function unpipe(){he("unpipe"),ue.unpipe(G)}return ue.on("data",ondata),function prependListener(G,K,ne){if("function"==typeof G.prependListener)return G.prependListener(K,ne);G._events&&G._events[K]?Array.isArray(G._events[K])?G._events[K].unshift(ne):G._events[K]=[ne,G._events[K]]:G.on(K,ne)}(G,"error",onerror),G.once("close",onclose),G.once("finish",onfinish),G.emit("pipe",ue),pe.flowing||(he("pipe resume"),ue.resume()),G},Readable.prototype.unpipe=function(G){var K=this._readableState,ne={hasUnpiped:!1};if(0===K.pipesCount)return this;if(1===K.pipesCount)return G&&G!==K.pipes||(G||(G=K.pipes),K.pipes=null,K.pipesCount=0,K.flowing=!1,G&&G.emit("unpipe",this,ne)),this;if(!G){var ue=K.pipes,pe=K.pipesCount;K.pipes=null,K.pipesCount=0,K.flowing=!1;for(var he=0;he<pe;he++)ue[he].emit("unpipe",this,{hasUnpiped:!1});return this}var ye=indexOf(K.pipes,G);return-1===ye||(K.pipes.splice(ye,1),K.pipesCount-=1,1===K.pipesCount&&(K.pipes=K.pipes[0]),G.emit("unpipe",this,ne)),this},Readable.prototype.on=function(G,K){var ue=ne.prototype.on.call(this,G,K),pe=this._readableState;return"data"===G?(pe.readableListening=this.listenerCount("readable")>0,!1!==pe.flowing&&this.resume()):"readable"===G&&(pe.endEmitted||pe.readableListening||(pe.readableListening=pe.needReadable=!0,pe.flowing=!1,pe.emittedReadable=!1,he("on readable",pe.length,pe.reading),pe.length?emitReadable(this):pe.reading||process.nextTick(nReadingNextTick,this))),ue},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(G,K){var ue=ne.prototype.removeListener.call(this,G,K);return"readable"===G&&process.nextTick(updateReadableListening,this),ue},Readable.prototype.removeAllListeners=function(G){var K=ne.prototype.removeAllListeners.apply(this,arguments);return"readable"!==G&&void 0!==G||process.nextTick(updateReadableListening,this),K},Readable.prototype.resume=function(){var G=this._readableState;return G.flowing||(he("resume"),G.flowing=!G.readableListening,function resume(G,K){K.resumeScheduled||(K.resumeScheduled=!0,process.nextTick(resume_,G,K))}(this,G)),G.paused=!1,this},Readable.prototype.pause=function(){return he("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(he("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(G){var K=this,ne=this._readableState,ue=!1;for(var pe in G.on("end",(function(){if(he("wrapped end"),ne.decoder&&!ne.ended){var G=ne.decoder.end();G&&G.length&&K.push(G)}K.push(null)})),G.on("data",(function(pe){(he("wrapped data"),ne.decoder&&(pe=ne.decoder.write(pe)),ne.objectMode&&null==pe)||(ne.objectMode||pe&&pe.length)&&(K.push(pe)||(ue=!0,G.pause()))})),G)void 0===this[pe]&&"function"==typeof G[pe]&&(this[pe]=function methodWrap(K){return function methodWrapReturnFunction(){return G[K].apply(G,arguments)}}(pe));for(var ye=0;ye<Ne.length;ye++)G.on(Ne[ye],this.emit.bind(this,Ne[ye]));return this._read=function(K){he("wrapped _read",K),ue&&(ue=!1,G.resume())},this},"function"==typeof Symbol&&(Readable.prototype[Symbol.asyncIterator]=function(){return void 0===be&&(be=requireAsync_iterator()),be(this)}),Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function get(){return this._readableState.highWaterMark}}),Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:!1,get:function get(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:!1,get:function get(){return this._readableState.flowing},set:function set(G){this._readableState&&(this._readableState.flowing=G)}}),Readable._fromList=fromList,Object.defineProperty(Readable.prototype,"readableLength",{enumerable:!1,get:function get(){return this._readableState.length}}),"function"==typeof Symbol&&(Readable.from=function(G,K){return void 0===ve&&(ve=function requireFromBrowser(){return qy?$y:(qy=1,$y=function(){throw new Error("Readable.from is not available in the browser")})}()),ve(Readable,G,K)}),Gy}var Wy=Transform$6,zy=Py.codes,Vy=zy.ERR_METHOD_NOT_IMPLEMENTED,Ky=zy.ERR_MULTIPLE_CALLBACK,Jy=zy.ERR_TRANSFORM_ALREADY_TRANSFORMING,Xy=zy.ERR_TRANSFORM_WITH_LENGTH_0,Qy=require_stream_duplex();function afterTransform$1(G,K){var ne=this._transformState;ne.transforming=!1;var ue=ne.writecb;if(null===ue)return this.emit("error",new Ky);ne.writechunk=null,ne.writecb=null,null!=K&&this.push(K),ue(G);var pe=this._readableState;pe.reading=!1,(pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.highWaterMark)}function Transform$6(G){if(!(this instanceof Transform$6))return new Transform$6(G);Qy.call(this,G),this._transformState={afterTransform:afterTransform$1.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,G&&("function"==typeof G.transform&&(this._transform=G.transform),"function"==typeof G.flush&&(this._flush=G.flush)),this.on("prefinish",prefinish$1)}function prefinish$1(){var G=this;"function"!=typeof this._flush||this._readableState.destroyed?done$1(this,null,null):this._flush((function(K,ne){done$1(G,K,ne)}))}function done$1(G,K,ne){if(K)return G.emit("error",K);if(null!=ne&&G.push(ne),G._writableState.length)throw new Xy;if(G._transformState.transforming)throw new Jy;return G.push(null)}nc(Transform$6,Qy),Transform$6.prototype.push=function(G,K){return this._transformState.needTransform=!1,Qy.prototype.push.call(this,G,K)},Transform$6.prototype._transform=function(G,K,ne){ne(new Vy("_transform()"))},Transform$6.prototype._write=function(G,K,ne){var ue=this._transformState;if(ue.writecb=ne,ue.writechunk=G,ue.writeencoding=K,!ue.transforming){var pe=this._readableState;(ue.needTransform||pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.highWaterMark)}},Transform$6.prototype._read=function(G){var K=this._transformState;null===K.writechunk||K.transforming?K.needTransform=!0:(K.transforming=!0,this._transform(K.writechunk,K.writeencoding,K.afterTransform))},Transform$6.prototype._destroy=function(G,K){Qy.prototype._destroy.call(this,G,(function(G){K(G)}))};var Zy,Yy=PassThrough$1,em=Wy;function PassThrough$1(G){if(!(this instanceof PassThrough$1))return new PassThrough$1(G);em.call(this,G)}nc(PassThrough$1,em),PassThrough$1.prototype._transform=function(G,K,ne){ne(null,G)};var tm=Py.codes,rm=tm.ERR_MISSING_ARGS,nm=tm.ERR_STREAM_DESTROYED;function noop$1(G){if(G)throw G}function call(G){G()}function pipe(G,K){return G.pipe(K)}var am=function pipeline(){for(var G=arguments.length,K=new Array(G),ne=0;ne<G;ne++)K[ne]=arguments[ne];var ue,pe=function popCallback(G){return G.length?"function"!=typeof G[G.length-1]?noop$1:G.pop():noop$1}(K);if(Array.isArray(K[0])&&(K=K[0]),K.length<2)throw new rm("streams");var he=K.map((function(G,ne){var ye=ne<K.length-1;return function destroyer(G,K,ne,ue){ue=function once(G){var K=!1;return function(){K||(K=!0,G.apply(void 0,arguments))}}(ue);var pe=!1;G.on("close",(function(){pe=!0})),void 0===Zy&&(Zy=Hy),Zy(G,{readable:K,writable:ne},(function(G){if(G)return ue(G);pe=!0,ue()}));var he=!1;return function(K){if(!pe&&!he)return he=!0,function isRequest(G){return G.setHeader&&"function"==typeof G.abort}(G)?G.abort():"function"==typeof G.destroy?G.destroy():void ue(K||new nm("pipe"))}}(G,ye,ne>0,(function(G){ue||(ue=G),G&&he.forEach(call),ye||(he.forEach(call),pe(ue))}))}));return K.reduce(pipe)};!function(G,K){(K=G.exports=require_stream_readable()).Stream=K,K.Readable=K,K.Writable=require_stream_writable(),K.Duplex=require_stream_duplex(),K.Transform=Wy,K.PassThrough=Yy,K.finished=Hy,K.pipeline=am}(my,my.exports);var im=my.exports;const{Transform:sm}=im;const{Transform:om}=im;const createKeccak=G=>class Keccak extends sm{constructor(K,ne,ue,pe,he){super(he),this._rate=K,this._capacity=ne,this._delimitedSuffix=ue,this._hashBitLength=pe,this._options=he,this._state=new G,this._state.initialize(K,ne),this._finalized=!1}_transform(G,K,ne){let ue=null;try{this.update(G,K)}catch(G){ue=G}ne(ue)}_flush(G){let K=null;try{this.push(this.digest())}catch(G){K=G}G(K)}update(G,K){if(!Buffer.isBuffer(G)&&"string"!=typeof G)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(G)||(G=Buffer.from(G,K)),this._state.absorb(G),this}digest(G){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let K=this._state.squeeze(this._hashBitLength/8);return void 0!==G&&(K=K.toString(G)),this._resetState(),K}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const G=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(G._state),G._finalized=this._finalized,G}},createShake=G=>class Shake extends om{constructor(K,ne,ue,pe){super(pe),this._rate=K,this._capacity=ne,this._delimitedSuffix=ue,this._options=pe,this._state=new G,this._state.initialize(K,ne),this._finalized=!1}_transform(G,K,ne){let ue=null;try{this.update(G,K)}catch(G){ue=G}ne(ue)}_flush(){}_read(G){this.push(this.squeeze(G))}update(G,K){if(!Buffer.isBuffer(G)&&"string"!=typeof G)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(G)||(G=Buffer.from(G,K)),this._state.absorb(G),this}squeeze(G,K){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let ne=this._state.squeeze(G);return void 0!==K&&(ne=ne.toString(K)),ne}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const G=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(G._state),G._finalized=this._finalized,G}};var cm={};const dm=[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];cm.p1600=function(G){for(let K=0;K<24;++K){const ne=G[0]^G[10]^G[20]^G[30]^G[40],ue=G[1]^G[11]^G[21]^G[31]^G[41],pe=G[2]^G[12]^G[22]^G[32]^G[42],he=G[3]^G[13]^G[23]^G[33]^G[43],ye=G[4]^G[14]^G[24]^G[34]^G[44],me=G[5]^G[15]^G[25]^G[35]^G[45],be=G[6]^G[16]^G[26]^G[36]^G[46],ve=G[7]^G[17]^G[27]^G[37]^G[47],_e=G[8]^G[18]^G[28]^G[38]^G[48],Te=G[9]^G[19]^G[29]^G[39]^G[49];let Ee=_e^(pe<<1|he>>>31),Pe=Te^(he<<1|pe>>>31);const Se=G[0]^Ee,Ce=G[1]^Pe,ke=G[10]^Ee,Oe=G[11]^Pe,xe=G[20]^Ee,Ne=G[21]^Pe,Me=G[30]^Ee,Be=G[31]^Pe,Fe=G[40]^Ee,De=G[41]^Pe;Ee=ne^(ye<<1|me>>>31),Pe=ue^(me<<1|ye>>>31);const Le=G[2]^Ee,Ue=G[3]^Pe,je=G[12]^Ee,ze=G[13]^Pe,Je=G[22]^Ee,Xe=G[23]^Pe,Qe=G[32]^Ee,Ye=G[33]^Pe,et=G[42]^Ee,tt=G[43]^Pe;Ee=pe^(be<<1|ve>>>31),Pe=he^(ve<<1|be>>>31);const rt=G[4]^Ee,nt=G[5]^Pe,at=G[14]^Ee,it=G[15]^Pe,ot=G[24]^Ee,ct=G[25]^Pe,dt=G[34]^Ee,ut=G[35]^Pe,ft=G[44]^Ee,yt=G[45]^Pe;Ee=ye^(_e<<1|Te>>>31),Pe=me^(Te<<1|_e>>>31);const wt=G[6]^Ee,At=G[7]^Pe,St=G[16]^Ee,kt=G[17]^Pe,Bt=G[26]^Ee,Lt=G[27]^Pe,Ut=G[36]^Ee,$t=G[37]^Pe,Ht=G[46]^Ee,Vt=G[47]^Pe;Ee=be^(ne<<1|ue>>>31),Pe=ve^(ue<<1|ne>>>31);const er=G[8]^Ee,tr=G[9]^Pe,rr=G[18]^Ee,cr=G[19]^Pe,dr=G[28]^Ee,Rr=G[29]^Pe,kr=G[38]^Ee,$r=G[39]^Pe,qr=G[48]^Ee,Hr=G[49]^Pe,Vr=Se,Zr=Ce,en=Oe<<4|ke>>>28,tn=ke<<4|Oe>>>28,an=xe<<3|Ne>>>29,sn=Ne<<3|xe>>>29,un=Be<<9|Me>>>23,fn=Me<<9|Be>>>23,pn=Fe<<18|De>>>14,hn=De<<18|Fe>>>14,yn=Le<<1|Ue>>>31,mn=Ue<<1|Le>>>31,bn=ze<<12|je>>>20,gn=je<<12|ze>>>20,vn=Je<<10|Xe>>>22,Tn=Xe<<10|Je>>>22,En=Ye<<13|Qe>>>19,In=Qe<<13|Ye>>>19,Rn=et<<2|tt>>>30,Nn=tt<<2|et>>>30,Bn=nt<<30|rt>>>2,Fn=rt<<30|nt>>>2,Dn=at<<6|it>>>26,Un=it<<6|at>>>26,$n=ct<<11|ot>>>21,qn=ot<<11|ct>>>21,Gn=dt<<15|ut>>>17,jn=ut<<15|dt>>>17,Hn=yt<<29|ft>>>3,Wn=ft<<29|yt>>>3,zn=wt<<28|At>>>4,Vn=At<<28|wt>>>4,Kn=kt<<23|St>>>9,Jn=St<<23|kt>>>9,Xn=Bt<<25|Lt>>>7,Qn=Lt<<25|Bt>>>7,Zn=Ut<<21|$t>>>11,Yn=$t<<21|Ut>>>11,ea=Vt<<24|Ht>>>8,ta=Ht<<24|Vt>>>8,ra=er<<27|tr>>>5,na=tr<<27|er>>>5,aa=rr<<20|cr>>>12,ia=cr<<20|rr>>>12,sa=Rr<<7|dr>>>25,oa=dr<<7|Rr>>>25,ca=kr<<8|$r>>>24,da=$r<<8|kr>>>24,ua=qr<<14|Hr>>>18,fa=Hr<<14|qr>>>18;G[0]=Vr^~bn&$n,G[1]=Zr^~gn&qn,G[10]=zn^~aa&an,G[11]=Vn^~ia&sn,G[20]=yn^~Dn&Xn,G[21]=mn^~Un&Qn,G[30]=ra^~en&vn,G[31]=na^~tn&Tn,G[40]=Bn^~Kn&sa,G[41]=Fn^~Jn&oa,G[2]=bn^~$n&Zn,G[3]=gn^~qn&Yn,G[12]=aa^~an&En,G[13]=ia^~sn&In,G[22]=Dn^~Xn&ca,G[23]=Un^~Qn&da,G[32]=en^~vn&Gn,G[33]=tn^~Tn&jn,G[42]=Kn^~sa&un,G[43]=Jn^~oa&fn,G[4]=$n^~Zn&ua,G[5]=qn^~Yn&fa,G[14]=an^~En&Hn,G[15]=sn^~In&Wn,G[24]=Xn^~ca&pn,G[25]=Qn^~da&hn,G[34]=vn^~Gn&ea,G[35]=Tn^~jn&ta,G[44]=sa^~un&Rn,G[45]=oa^~fn&Nn,G[6]=Zn^~ua&Vr,G[7]=Yn^~fa&Zr,G[16]=En^~Hn&zn,G[17]=In^~Wn&Vn,G[26]=ca^~pn&yn,G[27]=da^~hn&mn,G[36]=Gn^~ea&ra,G[37]=jn^~ta&na,G[46]=un^~Rn&Bn,G[47]=fn^~Nn&Fn,G[8]=ua^~Vr&bn,G[9]=fa^~Zr&gn,G[18]=Hn^~zn&aa,G[19]=Wn^~Vn&ia,G[28]=pn^~yn&Dn,G[29]=hn^~mn&Un,G[38]=ea^~ra&en,G[39]=ta^~na&tn,G[48]=Rn^~Bn&Kn,G[49]=Nn^~Fn&Jn,G[0]^=dm[2*K],G[1]^=dm[2*K+1]}};const um=cm;function Keccak$1(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Keccak$1.prototype.initialize=function(G,K){for(let G=0;G<50;++G)this.state[G]=0;this.blockSize=G/8,this.count=0,this.squeezing=!1},Keccak$1.prototype.absorb=function(G){for(let K=0;K<G.length;++K)this.state[~~(this.count/4)]^=G[K]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(um.p1600(this.state),this.count=0)},Keccak$1.prototype.absorbLastFewBits=function(G){this.state[~~(this.count/4)]^=G<<this.count%4*8,0!=(128&G)&&this.count===this.blockSize-1&&um.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,um.p1600(this.state),this.count=0,this.squeezing=!0},Keccak$1.prototype.squeeze=function(G){this.squeezing||this.absorbLastFewBits(1);const K=Buffer.alloc(G);for(let ne=0;ne<G;++ne)K[ne]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(um.p1600(this.state),this.count=0);return K},Keccak$1.prototype.copy=function(G){for(let K=0;K<50;++K)G.state[K]=this.state[K];G.blockSize=this.blockSize,G.count=this.count,G.squeezing=this.squeezing};var fm=function(G){const K=createKeccak(G),ne=createShake(G);return function(G,ue){switch("string"==typeof G?G.toLowerCase():G){case"keccak224":return new K(1152,448,null,224,ue);case"keccak256":return new K(1088,512,null,256,ue);case"keccak384":return new K(832,768,null,384,ue);case"keccak512":return new K(576,1024,null,512,ue);case"sha3-224":return new K(1152,448,6,224,ue);case"sha3-256":return new K(1088,512,6,256,ue);case"sha3-384":return new K(832,768,6,384,ue);case"sha3-512":return new K(576,1024,6,512,ue);case"shake128":return new ne(1344,256,31,ue);case"shake256":return new ne(1088,512,31,ue);default:throw new Error("Invald algorithm: "+G)}}}(Keccak$1);Object.defineProperty(hy,"__esModule",{value:!0});var lm=yy,pm=fm;hy.keccak224=lm.createHashFunction((function(){return pm("keccak224")})),hy.keccak256=lm.createHashFunction((function(){return pm("keccak256")})),hy.keccak384=lm.createHashFunction((function(){return pm("keccak384")})),hy.keccak512=lm.createHashFunction((function(){return pm("keccak512")}));var hm=ry.Buffer,ym=im.Transform;function HashBase$2(G){ym.call(this),this._block=hm.allocUnsafe(G),this._blockSize=G,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}nc(HashBase$2,ym),HashBase$2.prototype._transform=function(G,K,ne){var ue=null;try{this.update(G,K)}catch(G){ue=G}ne(ue)},HashBase$2.prototype._flush=function(G){var K=null;try{this.push(this.digest())}catch(G){K=G}G(K)},HashBase$2.prototype.update=function(G,K){if(function throwIfNotStringOrBuffer(G,K){if(!hm.isBuffer(G)&&"string"!=typeof G)throw new TypeError(K+" must be a string or a buffer")}(G,"Data"),this._finalized)throw new Error("Digest already called");hm.isBuffer(G)||(G=hm.from(G,K));for(var ne=this._block,ue=0;this._blockOffset+G.length-ue>=this._blockSize;){for(var pe=this._blockOffset;pe<this._blockSize;)ne[pe++]=G[ue++];this._update(),this._blockOffset=0}for(;ue<G.length;)ne[this._blockOffset++]=G[ue++];for(var he=0,ye=8*G.length;ye>0;++he)this._length[he]+=ye,(ye=this._length[he]/4294967296|0)>0&&(this._length[he]-=4294967296*ye);return this},HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")},HashBase$2.prototype.digest=function(G){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var K=this._digest();void 0!==G&&(K=K.toString(G)),this._block.fill(0),this._blockOffset=0;for(var ne=0;ne<4;++ne)this._length[ne]=0;return K},HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var mm=HashBase$2,bm=nc,gm=mm,vm=ry.Buffer,wm=new Array(16);function MD5$2(){gm.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl$1(G,K){return G<<K|G>>>32-K}function fnF(G,K,ne,ue,pe,he,ye){return rotl$1(G+(K&ne|~K&ue)+pe+he|0,ye)+K|0}function fnG(G,K,ne,ue,pe,he,ye){return rotl$1(G+(K&ue|ne&~ue)+pe+he|0,ye)+K|0}function fnH(G,K,ne,ue,pe,he,ye){return rotl$1(G+(K^ne^ue)+pe+he|0,ye)+K|0}function fnI(G,K,ne,ue,pe,he,ye){return rotl$1(G+(ne^(K|~ue))+pe+he|0,ye)+K|0}bm(MD5$2,gm),MD5$2.prototype._update=function(){for(var G=wm,K=0;K<16;++K)G[K]=this._block.readInt32LE(4*K);var ne=this._a,ue=this._b,pe=this._c,he=this._d;ne=fnF(ne,ue,pe,he,G[0],3614090360,7),he=fnF(he,ne,ue,pe,G[1],3905402710,12),pe=fnF(pe,he,ne,ue,G[2],606105819,17),ue=fnF(ue,pe,he,ne,G[3],3250441966,22),ne=fnF(ne,ue,pe,he,G[4],4118548399,7),he=fnF(he,ne,ue,pe,G[5],1200080426,12),pe=fnF(pe,he,ne,ue,G[6],2821735955,17),ue=fnF(ue,pe,he,ne,G[7],4249261313,22),ne=fnF(ne,ue,pe,he,G[8],1770035416,7),he=fnF(he,ne,ue,pe,G[9],2336552879,12),pe=fnF(pe,he,ne,ue,G[10],4294925233,17),ue=fnF(ue,pe,he,ne,G[11],2304563134,22),ne=fnF(ne,ue,pe,he,G[12],1804603682,7),he=fnF(he,ne,ue,pe,G[13],4254626195,12),pe=fnF(pe,he,ne,ue,G[14],2792965006,17),ne=fnG(ne,ue=fnF(ue,pe,he,ne,G[15],1236535329,22),pe,he,G[1],4129170786,5),he=fnG(he,ne,ue,pe,G[6],3225465664,9),pe=fnG(pe,he,ne,ue,G[11],643717713,14),ue=fnG(ue,pe,he,ne,G[0],3921069994,20),ne=fnG(ne,ue,pe,he,G[5],3593408605,5),he=fnG(he,ne,ue,pe,G[10],38016083,9),pe=fnG(pe,he,ne,ue,G[15],3634488961,14),ue=fnG(ue,pe,he,ne,G[4],3889429448,20),ne=fnG(ne,ue,pe,he,G[9],568446438,5),he=fnG(he,ne,ue,pe,G[14],3275163606,9),pe=fnG(pe,he,ne,ue,G[3],4107603335,14),ue=fnG(ue,pe,he,ne,G[8],1163531501,20),ne=fnG(ne,ue,pe,he,G[13],2850285829,5),he=fnG(he,ne,ue,pe,G[2],4243563512,9),pe=fnG(pe,he,ne,ue,G[7],1735328473,14),ne=fnH(ne,ue=fnG(ue,pe,he,ne,G[12],2368359562,20),pe,he,G[5],4294588738,4),he=fnH(he,ne,ue,pe,G[8],2272392833,11),pe=fnH(pe,he,ne,ue,G[11],1839030562,16),ue=fnH(ue,pe,he,ne,G[14],4259657740,23),ne=fnH(ne,ue,pe,he,G[1],2763975236,4),he=fnH(he,ne,ue,pe,G[4],1272893353,11),pe=fnH(pe,he,ne,ue,G[7],4139469664,16),ue=fnH(ue,pe,he,ne,G[10],3200236656,23),ne=fnH(ne,ue,pe,he,G[13],681279174,4),he=fnH(he,ne,ue,pe,G[0],3936430074,11),pe=fnH(pe,he,ne,ue,G[3],3572445317,16),ue=fnH(ue,pe,he,ne,G[6],76029189,23),ne=fnH(ne,ue,pe,he,G[9],3654602809,4),he=fnH(he,ne,ue,pe,G[12],3873151461,11),pe=fnH(pe,he,ne,ue,G[15],530742520,16),ne=fnI(ne,ue=fnH(ue,pe,he,ne,G[2],3299628645,23),pe,he,G[0],4096336452,6),he=fnI(he,ne,ue,pe,G[7],1126891415,10),pe=fnI(pe,he,ne,ue,G[14],2878612391,15),ue=fnI(ue,pe,he,ne,G[5],4237533241,21),ne=fnI(ne,ue,pe,he,G[12],1700485571,6),he=fnI(he,ne,ue,pe,G[3],2399980690,10),pe=fnI(pe,he,ne,ue,G[10],4293915773,15),ue=fnI(ue,pe,he,ne,G[1],2240044497,21),ne=fnI(ne,ue,pe,he,G[8],1873313359,6),he=fnI(he,ne,ue,pe,G[15],4264355552,10),pe=fnI(pe,he,ne,ue,G[6],2734768916,15),ue=fnI(ue,pe,he,ne,G[13],1309151649,21),ne=fnI(ne,ue,pe,he,G[4],4149444226,6),he=fnI(he,ne,ue,pe,G[11],3174756917,10),pe=fnI(pe,he,ne,ue,G[2],718787259,15),ue=fnI(ue,pe,he,ne,G[9],3951481745,21),this._a=this._a+ne|0,this._b=this._b+ue|0,this._c=this._c+pe|0,this._d=this._d+he|0},MD5$2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var G=vm.allocUnsafe(16);return G.writeInt32LE(this._a,0),G.writeInt32LE(this._b,4),G.writeInt32LE(this._c,8),G.writeInt32LE(this._d,12),G};var _m=MD5$2,Tm=Ti.Buffer,Am=nc,Em=mm,Pm=new Array(16),Sm=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Im=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Cm=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Rm=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],km=[0,1518500249,1859775393,2400959708,2840853838],Om=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$2(){Em.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function rotl(G,K){return G<<K|G>>>32-K}function fn1(G,K,ne,ue,pe,he,ye,me){return rotl(G+(K^ne^ue)+he+ye|0,me)+pe|0}function fn2(G,K,ne,ue,pe,he,ye,me){return rotl(G+(K&ne|~K&ue)+he+ye|0,me)+pe|0}function fn3(G,K,ne,ue,pe,he,ye,me){return rotl(G+((K|~ne)^ue)+he+ye|0,me)+pe|0}function fn4(G,K,ne,ue,pe,he,ye,me){return rotl(G+(K&ue|ne&~ue)+he+ye|0,me)+pe|0}function fn5(G,K,ne,ue,pe,he,ye,me){return rotl(G+(K^(ne|~ue))+he+ye|0,me)+pe|0}Am(RIPEMD160$2,Em),RIPEMD160$2.prototype._update=function(){for(var G=Pm,K=0;K<16;++K)G[K]=this._block.readInt32LE(4*K);for(var ne=0|this._a,ue=0|this._b,pe=0|this._c,he=0|this._d,ye=0|this._e,me=0|this._a,be=0|this._b,ve=0|this._c,_e=0|this._d,Te=0|this._e,Ee=0;Ee<80;Ee+=1){var Pe,Se;Ee<16?(Pe=fn1(ne,ue,pe,he,ye,G[Sm[Ee]],km[0],Cm[Ee]),Se=fn5(me,be,ve,_e,Te,G[Im[Ee]],Om[0],Rm[Ee])):Ee<32?(Pe=fn2(ne,ue,pe,he,ye,G[Sm[Ee]],km[1],Cm[Ee]),Se=fn4(me,be,ve,_e,Te,G[Im[Ee]],Om[1],Rm[Ee])):Ee<48?(Pe=fn3(ne,ue,pe,he,ye,G[Sm[Ee]],km[2],Cm[Ee]),Se=fn3(me,be,ve,_e,Te,G[Im[Ee]],Om[2],Rm[Ee])):Ee<64?(Pe=fn4(ne,ue,pe,he,ye,G[Sm[Ee]],km[3],Cm[Ee]),Se=fn2(me,be,ve,_e,Te,G[Im[Ee]],Om[3],Rm[Ee])):(Pe=fn5(ne,ue,pe,he,ye,G[Sm[Ee]],km[4],Cm[Ee]),Se=fn1(me,be,ve,_e,Te,G[Im[Ee]],Om[4],Rm[Ee])),ne=ye,ye=he,he=rotl(pe,10),pe=ue,ue=Pe,me=Te,Te=_e,_e=rotl(ve,10),ve=be,be=Se}var Ce=this._b+pe+_e|0;this._b=this._c+he+Te|0,this._c=this._d+ye+me|0,this._d=this._e+ne+be|0,this._e=this._a+ue+ve|0,this._a=Ce},RIPEMD160$2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var G=Tm.alloc?Tm.alloc(20):new Tm(20);return G.writeInt32LE(this._a,0),G.writeInt32LE(this._b,4),G.writeInt32LE(this._c,8),G.writeInt32LE(this._d,12),G.writeInt32LE(this._e,16),G};var xm=RIPEMD160$2,Nm={exports:{}},Mm=ry.Buffer;function Hash$a(G,K){this._block=Mm.alloc(G),this._finalSize=K,this._blockSize=G,this._len=0}Hash$a.prototype.update=function(G,K){"string"==typeof G&&(K=K||"utf8",G=Mm.from(G,K));for(var ne=this._block,ue=this._blockSize,pe=G.length,he=this._len,ye=0;ye<pe;){for(var me=he%ue,be=Math.min(pe-ye,ue-me),ve=0;ve<be;ve++)ne[me+ve]=G[ye+ve];ye+=be,(he+=be)%ue==0&&this._update(ne)}return this._len+=pe,this},Hash$a.prototype.digest=function(G){var K=this._len%this._blockSize;this._block[K]=128,this._block.fill(0,K+1),K>=this._finalSize&&(this._update(this._block),this._block.fill(0));var ne=8*this._len;if(ne<=4294967295)this._block.writeUInt32BE(ne,this._blockSize-4);else{var ue=(4294967295&ne)>>>0,pe=(ne-ue)/4294967296;this._block.writeUInt32BE(pe,this._blockSize-8),this._block.writeUInt32BE(ue,this._blockSize-4)}this._update(this._block);var he=this._hash();return G?he.toString(G):he},Hash$a.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Bm=Hash$a,Fm=nc,Dm=Bm,Lm=ry.Buffer,Um=[1518500249,1859775393,-1894007588,-899497514],$m=new Array(80);function Sha(){this.init(),this._w=$m,Dm.call(this,64,56)}function rotl30$1(G){return G<<30|G>>>2}function ft$3(G,K,ne,ue){return 0===G?K&ne|~K&ue:2===G?K&ne|K&ue|ne&ue:K^ne^ue}Fm(Sha,Dm),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(G){for(var K,ne=this._w,ue=0|this._a,pe=0|this._b,he=0|this._c,ye=0|this._d,me=0|this._e,be=0;be<16;++be)ne[be]=G.readInt32BE(4*be);for(;be<80;++be)ne[be]=ne[be-3]^ne[be-8]^ne[be-14]^ne[be-16];for(var ve=0;ve<80;++ve){var _e=~~(ve/20),Te=0|((K=ue)<<5|K>>>27)+ft$3(_e,pe,he,ye)+me+ne[ve]+Um[_e];me=ye,ye=he,he=rotl30$1(pe),pe=ue,ue=Te}this._a=ue+this._a|0,this._b=pe+this._b|0,this._c=he+this._c|0,this._d=ye+this._d|0,this._e=me+this._e|0},Sha.prototype._hash=function(){var G=Lm.allocUnsafe(20);return G.writeInt32BE(0|this._a,0),G.writeInt32BE(0|this._b,4),G.writeInt32BE(0|this._c,8),G.writeInt32BE(0|this._d,12),G.writeInt32BE(0|this._e,16),G};var qm=Sha,Gm=nc,jm=Bm,Hm=ry.Buffer,Wm=[1518500249,1859775393,-1894007588,-899497514],zm=new Array(80);function Sha1(){this.init(),this._w=zm,jm.call(this,64,56)}function rotl5(G){return G<<5|G>>>27}function rotl30(G){return G<<30|G>>>2}function ft$2(G,K,ne,ue){return 0===G?K&ne|~K&ue:2===G?K&ne|K&ue|ne&ue:K^ne^ue}Gm(Sha1,jm),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(G){for(var K,ne=this._w,ue=0|this._a,pe=0|this._b,he=0|this._c,ye=0|this._d,me=0|this._e,be=0;be<16;++be)ne[be]=G.readInt32BE(4*be);for(;be<80;++be)ne[be]=(K=ne[be-3]^ne[be-8]^ne[be-14]^ne[be-16])<<1|K>>>31;for(var ve=0;ve<80;++ve){var _e=~~(ve/20),Te=rotl5(ue)+ft$2(_e,pe,he,ye)+me+ne[ve]+Wm[_e]|0;me=ye,ye=he,he=rotl30(pe),pe=ue,ue=Te}this._a=ue+this._a|0,this._b=pe+this._b|0,this._c=he+this._c|0,this._d=ye+this._d|0,this._e=me+this._e|0},Sha1.prototype._hash=function(){var G=Hm.allocUnsafe(20);return G.writeInt32BE(0|this._a,0),G.writeInt32BE(0|this._b,4),G.writeInt32BE(0|this._c,8),G.writeInt32BE(0|this._d,12),G.writeInt32BE(0|this._e,16),G};var Vm=Sha1,Km=nc,Jm=Bm,Xm=ry.Buffer,Qm=[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],Zm=new Array(64);function Sha256$1(){this.init(),this._w=Zm,Jm.call(this,64,56)}function ch(G,K,ne){return ne^G&(K^ne)}function maj$1(G,K,ne){return G&K|ne&(G|K)}function sigma0$1(G){return(G>>>2|G<<30)^(G>>>13|G<<19)^(G>>>22|G<<10)}function sigma1$1(G){return(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7)}function gamma0(G){return(G>>>7|G<<25)^(G>>>18|G<<14)^G>>>3}function gamma1(G){return(G>>>17|G<<15)^(G>>>19|G<<13)^G>>>10}Km(Sha256$1,Jm),Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256$1.prototype._update=function(G){for(var K=this._w,ne=0|this._a,ue=0|this._b,pe=0|this._c,he=0|this._d,ye=0|this._e,me=0|this._f,be=0|this._g,ve=0|this._h,_e=0;_e<16;++_e)K[_e]=G.readInt32BE(4*_e);for(;_e<64;++_e)K[_e]=gamma1(K[_e-2])+K[_e-7]+gamma0(K[_e-15])+K[_e-16]|0;for(var Te=0;Te<64;++Te){var Ee=ve+sigma1$1(ye)+ch(ye,me,be)+Qm[Te]+K[Te]|0,Pe=sigma0$1(ne)+maj$1(ne,ue,pe)|0;ve=be,be=me,me=ye,ye=he+Ee|0,he=pe,pe=ue,ue=ne,ne=Ee+Pe|0}this._a=ne+this._a|0,this._b=ue+this._b|0,this._c=pe+this._c|0,this._d=he+this._d|0,this._e=ye+this._e|0,this._f=me+this._f|0,this._g=be+this._g|0,this._h=ve+this._h|0},Sha256$1.prototype._hash=function(){var G=Xm.allocUnsafe(32);return G.writeInt32BE(this._a,0),G.writeInt32BE(this._b,4),G.writeInt32BE(this._c,8),G.writeInt32BE(this._d,12),G.writeInt32BE(this._e,16),G.writeInt32BE(this._f,20),G.writeInt32BE(this._g,24),G.writeInt32BE(this._h,28),G};var Ym=Sha256$1,eb=nc,tb=Ym,rb=Bm,nb=ry.Buffer,ab=new Array(64);function Sha224(){this.init(),this._w=ab,rb.call(this,64,56)}eb(Sha224,tb),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var G=nb.allocUnsafe(28);return G.writeInt32BE(this._a,0),G.writeInt32BE(this._b,4),G.writeInt32BE(this._c,8),G.writeInt32BE(this._d,12),G.writeInt32BE(this._e,16),G.writeInt32BE(this._f,20),G.writeInt32BE(this._g,24),G};var ib=Sha224,sb=nc,ob=Bm,db=ry.Buffer,ub=[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],fb=new Array(160);function Sha512(){this.init(),this._w=fb,ob.call(this,128,112)}function Ch(G,K,ne){return ne^G&(K^ne)}function maj(G,K,ne){return G&K|ne&(G|K)}function sigma0(G,K){return(G>>>28|K<<4)^(K>>>2|G<<30)^(K>>>7|G<<25)}function sigma1(G,K){return(G>>>14|K<<18)^(G>>>18|K<<14)^(K>>>9|G<<23)}function Gamma0(G,K){return(G>>>1|K<<31)^(G>>>8|K<<24)^G>>>7}function Gamma0l(G,K){return(G>>>1|K<<31)^(G>>>8|K<<24)^(G>>>7|K<<25)}function Gamma1(G,K){return(G>>>19|K<<13)^(K>>>29|G<<3)^G>>>6}function Gamma1l(G,K){return(G>>>19|K<<13)^(K>>>29|G<<3)^(G>>>6|K<<26)}function getCarry(G,K){return G>>>0<K>>>0?1:0}sb(Sha512,ob),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(G){for(var K=this._w,ne=0|this._ah,ue=0|this._bh,pe=0|this._ch,he=0|this._dh,ye=0|this._eh,me=0|this._fh,be=0|this._gh,ve=0|this._hh,_e=0|this._al,Te=0|this._bl,Ee=0|this._cl,Pe=0|this._dl,Se=0|this._el,Ce=0|this._fl,ke=0|this._gl,Oe=0|this._hl,xe=0;xe<32;xe+=2)K[xe]=G.readInt32BE(4*xe),K[xe+1]=G.readInt32BE(4*xe+4);for(;xe<160;xe+=2){var Ne=K[xe-30],Me=K[xe-30+1],Be=Gamma0(Ne,Me),Fe=Gamma0l(Me,Ne),De=Gamma1(Ne=K[xe-4],Me=K[xe-4+1]),Le=Gamma1l(Me,Ne),Ue=K[xe-14],je=K[xe-14+1],ze=K[xe-32],Je=K[xe-32+1],Xe=Fe+je|0,Qe=Be+Ue+getCarry(Xe,Fe)|0;Qe=(Qe=Qe+De+getCarry(Xe=Xe+Le|0,Le)|0)+ze+getCarry(Xe=Xe+Je|0,Je)|0,K[xe]=Qe,K[xe+1]=Xe}for(var Ye=0;Ye<160;Ye+=2){Qe=K[Ye],Xe=K[Ye+1];var et=maj(ne,ue,pe),tt=maj(_e,Te,Ee),rt=sigma0(ne,_e),nt=sigma0(_e,ne),at=sigma1(ye,Se),it=sigma1(Se,ye),ot=ub[Ye],ct=ub[Ye+1],dt=Ch(ye,me,be),ut=Ch(Se,Ce,ke),ft=Oe+it|0,yt=ve+at+getCarry(ft,Oe)|0;yt=(yt=(yt=yt+dt+getCarry(ft=ft+ut|0,ut)|0)+ot+getCarry(ft=ft+ct|0,ct)|0)+Qe+getCarry(ft=ft+Xe|0,Xe)|0;var wt=nt+tt|0,At=rt+et+getCarry(wt,nt)|0;ve=be,Oe=ke,be=me,ke=Ce,me=ye,Ce=Se,ye=he+yt+getCarry(Se=Pe+ft|0,Pe)|0,he=pe,Pe=Ee,pe=ue,Ee=Te,ue=ne,Te=_e,ne=yt+At+getCarry(_e=ft+wt|0,ft)|0}this._al=this._al+_e|0,this._bl=this._bl+Te|0,this._cl=this._cl+Ee|0,this._dl=this._dl+Pe|0,this._el=this._el+Se|0,this._fl=this._fl+Ce|0,this._gl=this._gl+ke|0,this._hl=this._hl+Oe|0,this._ah=this._ah+ne+getCarry(this._al,_e)|0,this._bh=this._bh+ue+getCarry(this._bl,Te)|0,this._ch=this._ch+pe+getCarry(this._cl,Ee)|0,this._dh=this._dh+he+getCarry(this._dl,Pe)|0,this._eh=this._eh+ye+getCarry(this._el,Se)|0,this._fh=this._fh+me+getCarry(this._fl,Ce)|0,this._gh=this._gh+be+getCarry(this._gl,ke)|0,this._hh=this._hh+ve+getCarry(this._hl,Oe)|0},Sha512.prototype._hash=function(){var G=db.allocUnsafe(64);function writeInt64BE(K,ne,ue){G.writeInt32BE(K,ue),G.writeInt32BE(ne,ue+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),G};var lb=Sha512,pb=nc,hb=lb,yb=Bm,mb=ry.Buffer,bb=new Array(160);function Sha384(){this.init(),this._w=bb,yb.call(this,128,112)}pb(Sha384,hb),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var G=mb.allocUnsafe(48);function writeInt64BE(K,ne,ue){G.writeInt32BE(K,ue),G.writeInt32BE(ne,ue+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),G};var gb=Sha384,vb=Nm.exports=function SHA(G){G=G.toLowerCase();var K=vb[G];if(!K)throw new Error(G+" is not supported (we accept pull requests)");return new K};vb.sha=qm,vb.sha1=Vm,vb.sha224=ib,vb.sha256=Ym,vb.sha384=gb,vb.sha512=lb;var wb=Nm.exports;function BufferList(){this.head=null,this.tail=null,this.length=0}BufferList.prototype.push=function(G){var K={data:G,next:null};this.length>0?this.tail.next=K:this.head=K,this.tail=K,++this.length},BufferList.prototype.unshift=function(G){var K={data:G,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var G=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,G}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(G){if(0===this.length)return"";for(var K=this.head,ne=""+K.data;K=K.next;)ne+=G+K.data;return ne},BufferList.prototype.concat=function(G){if(0===this.length)return Buffer$h.alloc(0);if(1===this.length)return this.head.data;for(var K=Buffer$h.allocUnsafe(G>>>0),ne=this.head,ue=0;ne;)ne.data.copy(K,ue),ue+=ne.data.length,ne=ne.next;return K},Readable.ReadableState=ReadableState;var _b=debuglog("stream");function ReadableState(G,K){G=G||{},this.objectMode=!!G.objectMode,K instanceof Duplex&&(this.objectMode=this.objectMode||!!G.readableObjectMode);var ne=G.highWaterMark,ue=this.objectMode?16:16384;this.highWaterMark=ne||0===ne?ne:ue,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=G.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,G.encoding&&(this.decoder=new StringDecoder$1(G.encoding),this.encoding=G.encoding)}function Readable(G){if(!(this instanceof Readable))return new Readable(G);this._readableState=new ReadableState(G,this),this.readable=!0,G&&"function"==typeof G.read&&(this._read=G.read),EventEmitter.call(this)}function readableAddChunk(G,K,ne,ue,pe){var he=function chunkInvalid(G,K){var ne=null;Buffer$h.isBuffer(K)||"string"==typeof K||null==K||G.objectMode||(ne=new TypeError("Invalid non-string/buffer chunk"));return ne}(K,ne);if(he)G.emit("error",he);else if(null===ne)K.reading=!1,function onEofChunk(G,K){if(K.ended)return;if(K.decoder){var ne=K.decoder.end();ne&&ne.length&&(K.buffer.push(ne),K.length+=K.objectMode?1:ne.length)}K.ended=!0,emitReadable(G)}(G,K);else if(K.objectMode||ne&&ne.length>0)if(K.ended&&!pe){var ye=new Error("stream.push() after EOF");G.emit("error",ye)}else if(K.endEmitted&&pe){var me=new Error("stream.unshift() after end event");G.emit("error",me)}else{var be;!K.decoder||pe||ue||(ne=K.decoder.write(ne),be=!K.objectMode&&0===ne.length),pe||(K.reading=!1),be||(K.flowing&&0===K.length&&!K.sync?(G.emit("data",ne),G.read(0)):(K.length+=K.objectMode?1:ne.length,pe?K.buffer.unshift(ne):K.buffer.push(ne),K.needReadable&&emitReadable(G))),function maybeReadMore(G,K){K.readingMore||(K.readingMore=!0,nextTick(maybeReadMore_,G,K))}(G,K)}else pe||(K.reading=!1);return function needMoreData(G){return!G.ended&&(G.needReadable||G.length<G.highWaterMark||0===G.length)}(K)}sp(Readable,EventEmitter),Readable.prototype.push=function(G,K){var ne=this._readableState;return ne.objectMode||"string"!=typeof G||(K=K||ne.defaultEncoding)!==ne.encoding&&(G=Buffer$h.from(G,K),K=""),readableAddChunk(this,ne,G,K,!1)},Readable.prototype.unshift=function(G){return readableAddChunk(this,this._readableState,G,"",!0)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(G){return this._readableState.decoder=new StringDecoder$1(G),this._readableState.encoding=G,this};var Tb=8388608;function howMuchToRead(G,K){return G<=0||0===K.length&&K.ended?0:K.objectMode?1:G!=G?K.flowing&&K.length?K.buffer.head.data.length:K.length:(G>K.highWaterMark&&(K.highWaterMark=function computeNewHighWaterMark(G){return G>=Tb?G=Tb:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}(G)),G<=K.length?G:K.ended?K.length:(K.needReadable=!0,0))}function emitReadable(G){var K=G._readableState;K.needReadable=!1,K.emittedReadable||(_b("emitReadable",K.flowing),K.emittedReadable=!0,K.sync?nextTick(emitReadable_,G):emitReadable_(G))}function emitReadable_(G){_b("emit readable"),G.emit("readable"),flow(G)}function maybeReadMore_(G,K){for(var ne=K.length;!K.reading&&!K.flowing&&!K.ended&&K.length<K.highWaterMark&&(_b("maybeReadMore read 0"),G.read(0),ne!==K.length);)ne=K.length;K.readingMore=!1}function nReadingNextTick(G){_b("readable nexttick read 0"),G.read(0)}function resume_(G,K){K.reading||(_b("resume read 0"),G.read(0)),K.resumeScheduled=!1,K.awaitDrain=0,G.emit("resume"),flow(G),K.flowing&&!K.reading&&G.read(0)}function flow(G){var K=G._readableState;for(_b("flow",K.flowing);K.flowing&&null!==G.read(););}function fromList(G,K){return 0===K.length?null:(K.objectMode?ne=K.buffer.shift():!G||G>=K.length?(ne=K.decoder?K.buffer.join(""):1===K.buffer.length?K.buffer.head.data:K.buffer.concat(K.length),K.buffer.clear()):ne=function fromListPartial(G,K,ne){var ue;G<K.head.data.length?(ue=K.head.data.slice(0,G),K.head.data=K.head.data.slice(G)):ue=G===K.head.data.length?K.shift():ne?function copyFromBufferString(G,K){var ne=K.head,ue=1,pe=ne.data;G-=pe.length;for(;ne=ne.next;){var he=ne.data,ye=G>he.length?he.length:G;if(ye===he.length?pe+=he:pe+=he.slice(0,G),0===(G-=ye)){ye===he.length?(++ue,ne.next?K.head=ne.next:K.head=K.tail=null):(K.head=ne,ne.data=he.slice(ye));break}++ue}return K.length-=ue,pe}(G,K):function copyFromBuffer(G,K){var ne=Buffer$h.allocUnsafe(G),ue=K.head,pe=1;ue.data.copy(ne),G-=ue.data.length;for(;ue=ue.next;){var he=ue.data,ye=G>he.length?he.length:G;if(he.copy(ne,ne.length-G,0,ye),0===(G-=ye)){ye===he.length?(++pe,ue.next?K.head=ue.next:K.head=K.tail=null):(K.head=ue,ue.data=he.slice(ye));break}++pe}return K.length-=pe,ne}(G,K);return ue}(G,K.buffer,K.decoder),ne);var ne}function endReadable(G){var K=G._readableState;if(K.length>0)throw new Error('"endReadable()" called on non-empty stream');K.endEmitted||(K.ended=!0,nextTick(endReadableNT,K,G))}function endReadableNT(G,K){G.endEmitted||0!==G.length||(G.endEmitted=!0,K.readable=!1,K.emit("end"))}function indexOf(G,K){for(var ne=0,ue=G.length;ne<ue;ne++)if(G[ne]===K)return ne;return-1}function nop(){}function WriteReq(G,K,ne){this.chunk=G,this.encoding=K,this.callback=ne,this.next=null}function WritableState(G,K){Object.defineProperty(this,"buffer",{get:deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),G=G||{},this.objectMode=!!G.objectMode,K instanceof Duplex&&(this.objectMode=this.objectMode||!!G.writableObjectMode);var ne=G.highWaterMark,ue=this.objectMode?16:16384;this.highWaterMark=ne||0===ne?ne:ue,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var pe=!1===G.decodeStrings;this.decodeStrings=!pe,this.defaultEncoding=G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){!function onwrite(G,K){var ne=G._writableState,ue=ne.sync,pe=ne.writecb;if(function onwriteStateUpdate(G){G.writing=!1,G.writecb=null,G.length-=G.writelen,G.writelen=0}(ne),K)!function onwriteError(G,K,ne,ue,pe){--K.pendingcb,ne?nextTick(pe,ue):pe(ue);G._writableState.errorEmitted=!0,G.emit("error",ue)}(G,ne,ue,K,pe);else{var he=needFinish(ne);he||ne.corked||ne.bufferProcessing||!ne.bufferedRequest||clearBuffer(G,ne),ue?nextTick(afterWrite,G,ne,he,pe):afterWrite(G,ne,he,pe)}}(K,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(G){if(!(this instanceof Writable||this instanceof Duplex))return new Writable(G);this._writableState=new WritableState(G,this),this.writable=!0,G&&("function"==typeof G.write&&(this._write=G.write),"function"==typeof G.writev&&(this._writev=G.writev)),EventEmitter.call(this)}function doWrite(G,K,ne,ue,pe,he,ye){K.writelen=ue,K.writecb=ye,K.writing=!0,K.sync=!0,ne?G._writev(pe,K.onwrite):G._write(pe,he,K.onwrite),K.sync=!1}function afterWrite(G,K,ne,ue){ne||function onwriteDrain(G,K){0===K.length&&K.needDrain&&(K.needDrain=!1,G.emit("drain"))}(G,K),K.pendingcb--,ue(),finishMaybe(G,K)}function clearBuffer(G,K){K.bufferProcessing=!0;var ne=K.bufferedRequest;if(G._writev&&ne&&ne.next){var ue=K.bufferedRequestCount,pe=new Array(ue),he=K.corkedRequestsFree;he.entry=ne;for(var ye=0;ne;)pe[ye]=ne,ne=ne.next,ye+=1;doWrite(G,K,!0,K.length,pe,"",he.finish),K.pendingcb++,K.lastBufferedRequest=null,he.next?(K.corkedRequestsFree=he.next,he.next=null):K.corkedRequestsFree=new CorkedRequest(K)}else{for(;ne;){var me=ne.chunk,be=ne.encoding,ve=ne.callback;if(doWrite(G,K,!1,K.objectMode?1:me.length,me,be,ve),ne=ne.next,K.writing)break}null===ne&&(K.lastBufferedRequest=null)}K.bufferedRequestCount=0,K.bufferedRequest=ne,K.bufferProcessing=!1}function needFinish(G){return G.ending&&0===G.length&&null===G.bufferedRequest&&!G.finished&&!G.writing}function prefinish(G,K){K.prefinished||(K.prefinished=!0,G.emit("prefinish"))}function finishMaybe(G,K){var ne=needFinish(K);return ne&&(0===K.pendingcb?(prefinish(G,K),K.finished=!0,G.emit("finish")):prefinish(G,K)),ne}function CorkedRequest(G){var K=this;this.next=null,this.entry=null,this.finish=function(ne){var ue=K.entry;for(K.entry=null;ue;){var pe=ue.callback;G.pendingcb--,pe(ne),ue=ue.next}G.corkedRequestsFree?G.corkedRequestsFree.next=K:G.corkedRequestsFree=K}}Readable.prototype.read=function(G){_b("read",G),G=parseInt(G,10);var K=this._readableState,ne=G;if(0!==G&&(K.emittedReadable=!1),0===G&&K.needReadable&&(K.length>=K.highWaterMark||K.ended))return _b("read: emitReadable",K.length,K.ended),0===K.length&&K.ended?endReadable(this):emitReadable(this),null;if(0===(G=howMuchToRead(G,K))&&K.ended)return 0===K.length&&endReadable(this),null;var ue,pe=K.needReadable;return _b("need readable",pe),(0===K.length||K.length-G<K.highWaterMark)&&_b("length less than watermark",pe=!0),K.ended||K.reading?_b("reading or ended",pe=!1):pe&&(_b("do read"),K.reading=!0,K.sync=!0,0===K.length&&(K.needReadable=!0),this._read(K.highWaterMark),K.sync=!1,K.reading||(G=howMuchToRead(ne,K))),null===(ue=G>0?fromList(G,K):null)?(K.needReadable=!0,G=0):K.length-=G,0===K.length&&(K.ended||(K.needReadable=!0),ne!==G&&K.ended&&endReadable(this)),null!==ue&&this.emit("data",ue),ue},Readable.prototype._read=function(G){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(G,K){var ne=this,ue=this._readableState;switch(ue.pipesCount){case 0:ue.pipes=G;break;case 1:ue.pipes=[ue.pipes,G];break;default:ue.pipes.push(G)}ue.pipesCount+=1,_b("pipe count=%d opts=%j",ue.pipesCount,K);var pe=!K||!1!==K.end?onend:cleanup;function onunpipe(G){_b("onunpipe"),G===ne&&cleanup()}function onend(){_b("onend"),G.end()}ue.endEmitted?nextTick(pe):ne.once("end",pe),G.on("unpipe",onunpipe);var he=function pipeOnDrain(G){return function(){var K=G._readableState;_b("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,0===K.awaitDrain&&G.listeners("data").length&&(K.flowing=!0,flow(G))}}(ne);G.on("drain",he);var ye=!1;function cleanup(){_b("cleanup"),G.removeListener("close",onclose),G.removeListener("finish",onfinish),G.removeListener("drain",he),G.removeListener("error",onerror),G.removeListener("unpipe",onunpipe),ne.removeListener("end",onend),ne.removeListener("end",cleanup),ne.removeListener("data",ondata),ye=!0,!ue.awaitDrain||G._writableState&&!G._writableState.needDrain||he()}var me=!1;function ondata(K){_b("ondata"),me=!1,!1!==G.write(K)||me||((1===ue.pipesCount&&ue.pipes===G||ue.pipesCount>1&&-1!==indexOf(ue.pipes,G))&&!ye&&(_b("false write response, pause",ne._readableState.awaitDrain),ne._readableState.awaitDrain++,me=!0),ne.pause())}function onerror(K){_b("onerror",K),unpipe(),G.removeListener("error",onerror),0===function listenerCount(G,K){return G.listeners(K).length}(G,"error")&&G.emit("error",K)}function onclose(){G.removeListener("finish",onfinish),unpipe()}function onfinish(){_b("onfinish"),G.removeListener("close",onclose),unpipe()}function unpipe(){_b("unpipe"),ne.unpipe(G)}return ne.on("data",ondata),function prependListener(G,K,ne){if("function"==typeof G.prependListener)return G.prependListener(K,ne);G._events&&G._events[K]?Array.isArray(G._events[K])?G._events[K].unshift(ne):G._events[K]=[ne,G._events[K]]:G.on(K,ne)}(G,"error",onerror),G.once("close",onclose),G.once("finish",onfinish),G.emit("pipe",ne),ue.flowing||(_b("pipe resume"),ne.resume()),G},Readable.prototype.unpipe=function(G){var K=this._readableState;if(0===K.pipesCount)return this;if(1===K.pipesCount)return G&&G!==K.pipes||(G||(G=K.pipes),K.pipes=null,K.pipesCount=0,K.flowing=!1,G&&G.emit("unpipe",this)),this;if(!G){var ne=K.pipes,ue=K.pipesCount;K.pipes=null,K.pipesCount=0,K.flowing=!1;for(var pe=0;pe<ue;pe++)ne[pe].emit("unpipe",this);return this}var he=indexOf(K.pipes,G);return-1===he||(K.pipes.splice(he,1),K.pipesCount-=1,1===K.pipesCount&&(K.pipes=K.pipes[0]),G.emit("unpipe",this)),this},Readable.prototype.on=function(G,K){var ne=EventEmitter.prototype.on.call(this,G,K);if("data"===G)!1!==this._readableState.flowing&&this.resume();else if("readable"===G){var ue=this._readableState;ue.endEmitted||ue.readableListening||(ue.readableListening=ue.needReadable=!0,ue.emittedReadable=!1,ue.reading?ue.length&&emitReadable(this):nextTick(nReadingNextTick,this))}return ne},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var G=this._readableState;return G.flowing||(_b("resume"),G.flowing=!0,function resume(G,K){K.resumeScheduled||(K.resumeScheduled=!0,nextTick(resume_,G,K))}(this,G)),this},Readable.prototype.pause=function(){return _b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(_b("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(G){var K=this._readableState,ne=!1,ue=this;for(var pe in G.on("end",(function(){if(_b("wrapped end"),K.decoder&&!K.ended){var G=K.decoder.end();G&&G.length&&ue.push(G)}ue.push(null)})),G.on("data",(function(pe){(_b("wrapped data"),K.decoder&&(pe=K.decoder.write(pe)),K.objectMode&&null==pe)||(K.objectMode||pe&&pe.length)&&(ue.push(pe)||(ne=!0,G.pause()))})),G)void 0===this[pe]&&"function"==typeof G[pe]&&(this[pe]=function(K){return function(){return G[K].apply(G,arguments)}}(pe));return function forEach$1(G,K){for(var ne=0,ue=G.length;ne<ue;ne++)K(G[ne],ne)}(["error","close","destroy","pause","resume"],(function(K){G.on(K,ue.emit.bind(ue,K))})),ue._read=function(K){_b("wrapped _read",K),ne&&(ne=!1,G.resume())},ue},Readable._fromList=fromList,Writable.WritableState=WritableState,sp(Writable,EventEmitter),WritableState.prototype.getBuffer=function writableStateGetBuffer(){for(var G=this.bufferedRequest,K=[];G;)K.push(G),G=G.next;return K},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(G,K,ne){var ue=this._writableState,pe=!1;return"function"==typeof K&&(ne=K,K=null),Buffer$h.isBuffer(G)?K="buffer":K||(K=ue.defaultEncoding),"function"!=typeof ne&&(ne=nop),ue.ended?function writeAfterEnd(G,K){var ne=new Error("write after end");G.emit("error",ne),nextTick(K,ne)}(this,ne):function validChunk(G,K,ne,ue){var pe=!0,he=!1;return null===ne?he=new TypeError("May not write null values to stream"):Buffer$h.isBuffer(ne)||"string"==typeof ne||void 0===ne||K.objectMode||(he=new TypeError("Invalid non-string/buffer chunk")),he&&(G.emit("error",he),nextTick(ue,he),pe=!1),pe}(this,ue,G,ne)&&(ue.pendingcb++,pe=function writeOrBuffer(G,K,ne,ue,pe){ne=function decodeChunk(G,K,ne){G.objectMode||!1===G.decodeStrings||"string"!=typeof K||(K=Buffer$h.from(K,ne));return K}(K,ne,ue),Buffer$h.isBuffer(ne)&&(ue="buffer");var he=K.objectMode?1:ne.length;K.length+=he;var ye=K.length<K.highWaterMark;ye||(K.needDrain=!0);if(K.writing||K.corked){var me=K.lastBufferedRequest;K.lastBufferedRequest=new WriteReq(ne,ue,pe),me?me.next=K.lastBufferedRequest:K.bufferedRequest=K.lastBufferedRequest,K.bufferedRequestCount+=1}else doWrite(G,K,!1,he,ne,ue,pe);return ye}(this,ue,G,K,ne)),pe},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,G.writing||G.corked||G.finished||G.bufferProcessing||!G.bufferedRequest||clearBuffer(this,G))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(G){if("string"==typeof G&&(G=G.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((G+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+G);return this._writableState.defaultEncoding=G,this},Writable.prototype._write=function(G,K,ne){ne(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(G,K,ne){var ue=this._writableState;"function"==typeof G?(ne=G,G=null,K=null):"function"==typeof K&&(ne=K,K=null),null!=G&&this.write(G,K),ue.corked&&(ue.corked=1,this.uncork()),ue.ending||ue.finished||function endWritable(G,K,ne){K.ending=!0,finishMaybe(G,K),ne&&(K.finished?nextTick(ne):G.once("finish",ne));K.ended=!0,G.writable=!1}(this,ue,ne)},sp(Duplex,Readable);for(var Ab=Object.keys(Writable.prototype),Eb=0;Eb<Ab.length;Eb++){var Pb=Ab[Eb];Duplex.prototype[Pb]||(Duplex.prototype[Pb]=Writable.prototype[Pb])}function Duplex(G){if(!(this instanceof Duplex))return new Duplex(G);Readable.call(this,G),Writable.call(this,G),G&&!1===G.readable&&(this.readable=!1),G&&!1===G.writable&&(this.writable=!1),this.allowHalfOpen=!0,G&&!1===G.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||nextTick(onEndNT,this)}function onEndNT(G){G.end()}function TransformState(G){this.afterTransform=function(K,ne){return function afterTransform(G,K,ne){var ue=G._transformState;ue.transforming=!1;var pe=ue.writecb;if(!pe)return G.emit("error",new Error("no writecb in Transform class"));ue.writechunk=null,ue.writecb=null,null!=ne&&G.push(ne);pe(K);var he=G._readableState;he.reading=!1,(he.needReadable||he.length<he.highWaterMark)&&G._read(he.highWaterMark)}(G,K,ne)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Transform$1(G){if(!(this instanceof Transform$1))return new Transform$1(G);Duplex.call(this,G),this._transformState=new TransformState(this);var K=this;this._readableState.needReadable=!0,this._readableState.sync=!1,G&&("function"==typeof G.transform&&(this._transform=G.transform),"function"==typeof G.flush&&(this._flush=G.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(G){done(K,G)})):done(K)}))}function done(G,K){if(K)return G.emit("error",K);var ne=G._writableState,ue=G._transformState;if(ne.length)throw new Error("Calling transform done when ws.length != 0");if(ue.transforming)throw new Error("Calling transform done when still transforming");return G.push(null)}function PassThrough(G){if(!(this instanceof PassThrough))return new PassThrough(G);Transform$1.call(this,G)}function Stream(){EventEmitter.call(this)}sp(Transform$1,Duplex),Transform$1.prototype.push=function(G,K){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,G,K)},Transform$1.prototype._transform=function(G,K,ne){throw new Error("Not implemented")},Transform$1.prototype._write=function(G,K,ne){var ue=this._transformState;if(ue.writecb=ne,ue.writechunk=G,ue.writeencoding=K,!ue.transforming){var pe=this._readableState;(ue.needTransform||pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.highWaterMark)}},Transform$1.prototype._read=function(G){var K=this._transformState;null!==K.writechunk&&K.writecb&&!K.transforming?(K.transforming=!0,this._transform(K.writechunk,K.writeencoding,K.afterTransform)):K.needTransform=!0},sp(PassThrough,Transform$1),PassThrough.prototype._transform=function(G,K,ne){ne(null,G)},sp(Stream,EventEmitter),Stream.Readable=Readable,Stream.Writable=Writable,Stream.Duplex=Duplex,Stream.Transform=Transform$1,Stream.PassThrough=PassThrough,Stream.Stream=Stream,Stream.prototype.pipe=function(G,K){var ne=this;function ondata(K){G.writable&&!1===G.write(K)&&ne.pause&&ne.pause()}function ondrain(){ne.readable&&ne.resume&&ne.resume()}ne.on("data",ondata),G.on("drain",ondrain),G._isStdio||K&&!1===K.end||(ne.on("end",onend),ne.on("close",onclose));var ue=!1;function onend(){ue||(ue=!0,G.end())}function onclose(){ue||(ue=!0,"function"==typeof G.destroy&&G.destroy())}function onerror(G){if(cleanup(),0===EventEmitter.listenerCount(this,"error"))throw G}function cleanup(){ne.removeListener("data",ondata),G.removeListener("drain",ondrain),ne.removeListener("end",onend),ne.removeListener("close",onclose),ne.removeListener("error",onerror),G.removeListener("error",onerror),ne.removeListener("end",cleanup),ne.removeListener("close",cleanup),G.removeListener("close",cleanup)}return ne.on("error",onerror),G.on("error",onerror),ne.on("end",cleanup),ne.on("close",cleanup),G.on("close",cleanup),G.emit("pipe",ne),G};var Sb=getAugmentedNamespace$1(Object.freeze({__proto__:null,Duplex:Duplex,PassThrough:PassThrough,Readable:Readable,Stream:Stream,Transform:Transform$1,Writable:Writable,default:Stream})),Ib=ry.Buffer,Cb=Sb.Transform,Rb=Fy.StringDecoder;function CipherBase(G){Cb.call(this),this.hashMode="string"==typeof G,this.hashMode?this[G]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}nc(CipherBase,Cb),CipherBase.prototype.update=function(G,K,ne){"string"==typeof G&&(G=Ib.from(G,K));var ue=this._update(G);return this.hashMode?this:(ne&&(ue=this._toString(ue,ne)),ue)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(G,K,ne){var ue;try{this.hashMode?this._update(G):this.push(this._update(G))}catch(G){ue=G}finally{ne(ue)}},CipherBase.prototype._flush=function(G){var K;try{this.push(this.__final())}catch(G){K=G}G(K)},CipherBase.prototype._finalOrDigest=function(G){var K=this.__final()||Ib.alloc(0);return G&&(K=this._toString(K,G,!0)),K},CipherBase.prototype._toString=function(G,K,ne){if(this._decoder||(this._decoder=new Rb(K),this._encoding=K),this._encoding!==K)throw new Error("can't switch encodings");var ue=this._decoder.write(G);return ne&&(ue+=this._decoder.end()),ue};var kb=CipherBase,Ob=_m,xb=xm,Nb=wb,Mb=kb;function Hash$3(G){Mb.call(this,"digest"),this._hash=G}nc(Hash$3,Mb),Hash$3.prototype._update=function(G){this._hash.update(G)},Hash$3.prototype._final=function(){return this._hash.digest()};var Bb=function createHash(G){return"md5"===(G=G.toLowerCase())?new Ob:"rmd160"===G||"ripemd160"===G?new xb:new Hash$3(Nb(G))};!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.rlphash=G.ripemd160FromArray=G.ripemd160FromString=G.ripemd160=G.sha256FromArray=G.sha256FromString=G.sha256=G.keccakFromArray=G.keccakFromHexString=G.keccakFromString=G.keccak256=G.keccak=void 0;var K=hy,ne=Bb,ue=Nl,pe=uy,he=fy;G.keccak=function(G,ne){switch(void 0===ne&&(ne=256),(0,he.assertIsBuffer)(G),ne){case 224:return(0,K.keccak224)(G);case 256:return(0,K.keccak256)(G);case 384:return(0,K.keccak384)(G);case 512:return(0,K.keccak512)(G);default:throw new Error("Invald algorithm: keccak".concat(ne))}};G.keccak256=function(K){return(0,G.keccak)(K)};G.keccakFromString=function(K,ne){void 0===ne&&(ne=256),(0,he.assertIsString)(K);var ue=Buffer.from(K,"utf8");return(0,G.keccak)(ue,ne)};G.keccakFromHexString=function(K,ne){return void 0===ne&&(ne=256),(0,he.assertIsHexString)(K),(0,G.keccak)((0,pe.toBuffer)(K),ne)};G.keccakFromArray=function(K,ne){return void 0===ne&&(ne=256),(0,he.assertIsArray)(K),(0,G.keccak)((0,pe.toBuffer)(K),ne)};var _sha256=function(G){return G=(0,pe.toBuffer)(G),ne("sha256").update(G).digest()};G.sha256=function(G){return(0,he.assertIsBuffer)(G),_sha256(G)};G.sha256FromString=function(G){return(0,he.assertIsString)(G),_sha256(G)};G.sha256FromArray=function(G){return(0,he.assertIsArray)(G),_sha256(G)};var _ripemd160=function(G,K){G=(0,pe.toBuffer)(G);var ue=ne("rmd160").update(G).digest();return!0===K?(0,pe.setLengthLeft)(ue,32):ue};G.ripemd160=function(G,K){return(0,he.assertIsBuffer)(G),_ripemd160(G,K)};G.ripemd160FromString=function(G,K){return(0,he.assertIsString)(G),_ripemd160(G,K)};G.ripemd160FromArray=function(G,K){return(0,he.assertIsArray)(G),_ripemd160(G,K)};G.rlphash=function(K){return(0,G.keccak)(ue.rlp.encode(K))}}(py);var Fb={};!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.toType=G.TypeOutput=G.bnToRlp=G.bnToUnpaddedBuffer=G.bnToHex=void 0;var K,ne=Nl,ue=dy,pe=uy;function bnToUnpaddedBuffer(G){return(0,pe.unpadBuffer)(G.toArrayLike(Buffer))}G.bnToHex=function bnToHex(G){return"0x".concat(G.toString(16))},G.bnToUnpaddedBuffer=bnToUnpaddedBuffer,G.bnToRlp=function bnToRlp(G){return bnToUnpaddedBuffer(G)},function(G){G[G.Number=0]="Number",G[G.BN=1]="BN",G[G.Buffer=2]="Buffer",G[G.PrefixedHexString=3]="PrefixedHexString"}(K=G.TypeOutput||(G.TypeOutput={})),G.toType=function toType(G,he){if(null===G)return null;if(void 0!==G){if("string"==typeof G&&!(0,ue.isHexString)(G))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(G));if("number"==typeof G&&!Number.isSafeInteger(G))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var ye=(0,pe.toBuffer)(G);if(he===K.Buffer)return ye;if(he===K.BN)return new ne.BN(ye);if(he===K.Number){var me=new ne.BN(ye),be=new ne.BN(Number.MAX_SAFE_INTEGER.toString());if(me.gt(be))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return me.toNumber()}return"0x".concat(ye.toString("hex"))}}}(Fb),function(G){var K=pn&&pn.__read||function(G,K){var ne="function"==typeof Symbol&&G[Symbol.iterator];if(!ne)return G;var ue,pe,he=ne.call(G),ye=[];try{for(;(void 0===K||K-- >0)&&!(ue=he.next()).done;)ye.push(ue.value)}catch(G){pe={error:G}}finally{try{ue&&!ue.done&&(ne=he.return)&&ne.call(he)}finally{if(pe)throw pe.error}}return ye},ne=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(G,"__esModule",{value:!0}),G.isZeroAddress=G.zeroAddress=G.importPublic=G.privateToAddress=G.privateToPublic=G.publicToAddress=G.pubToAddress=G.isValidPublic=G.isValidPrivate=G.generateAddress2=G.generateAddress=G.isValidChecksumAddress=G.toChecksumAddress=G.isValidAddress=G.Account=void 0;var ue=ne(_p),pe=Nl,he=Tp,ye=dy,me=xl,be=uy,ve=py,_e=fy,Te=Fb,Ee=function(){function Account(G,K,ne,ue){void 0===G&&(G=new pe.BN(0)),void 0===K&&(K=new pe.BN(0)),void 0===ne&&(ne=me.KECCAK256_RLP),void 0===ue&&(ue=me.KECCAK256_NULL),this.nonce=G,this.balance=K,this.stateRoot=ne,this.codeHash=ue,this._validate()}return Account.fromAccountData=function(G){var K=G.nonce,ne=G.balance,ue=G.stateRoot,he=G.codeHash;return new Account(K?new pe.BN((0,be.toBuffer)(K)):void 0,ne?new pe.BN((0,be.toBuffer)(ne)):void 0,ue?(0,be.toBuffer)(ue):void 0,he?(0,be.toBuffer)(he):void 0)},Account.fromRlpSerializedAccount=function(G){var K=pe.rlp.decode(G);if(!Array.isArray(K))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(K)},Account.fromValuesArray=function(G){var ne=K(G,4),ue=ne[0],he=ne[1],ye=ne[2],me=ne[3];return new Account(new pe.BN(ue),new pe.BN(he),ye,me)},Account.prototype._validate=function(){if(this.nonce.lt(new pe.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new pe.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},Account.prototype.raw=function(){return[(0,Te.bnToUnpaddedBuffer)(this.nonce),(0,Te.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},Account.prototype.serialize=function(){return pe.rlp.encode(this.raw())},Account.prototype.isContract=function(){return!this.codeHash.equals(me.KECCAK256_NULL)},Account.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(me.KECCAK256_NULL)},Account}();G.Account=Ee;G.isValidAddress=function(G){try{(0,_e.assertIsString)(G)}catch(G){return!1}return/^0x[0-9a-fA-F]{40}$/.test(G)};G.toChecksumAddress=function(G,K){(0,_e.assertIsHexString)(G);var ne=(0,ye.stripHexPrefix)(G).toLowerCase(),ue="";K&&(ue=(0,Te.toType)(K,Te.TypeOutput.BN).toString()+"0x");for(var pe=(0,ve.keccakFromString)(ue+ne).toString("hex"),he="0x",me=0;me<ne.length;me++)parseInt(pe[me],16)>=8?he+=ne[me].toUpperCase():he+=ne[me];return he};G.isValidChecksumAddress=function(K,ne){return(0,G.isValidAddress)(K)&&(0,G.toChecksumAddress)(K,ne)===K};G.generateAddress=function(G,K){(0,_e.assertIsBuffer)(G),(0,_e.assertIsBuffer)(K);var ne=new pe.BN(K);return ne.isZero()?(0,ve.rlphash)([G,null]).slice(-20):(0,ve.rlphash)([G,Buffer.from(ne.toArray())]).slice(-20)};G.generateAddress2=function(G,K,ne){return(0,_e.assertIsBuffer)(G),(0,_e.assertIsBuffer)(K),(0,_e.assertIsBuffer)(ne),(0,ue.default)(20===G.length),(0,ue.default)(32===K.length),(0,ve.keccak256)(Buffer.concat([Buffer.from("ff","hex"),G,K,(0,ve.keccak256)(ne)])).slice(-20)};G.isValidPrivate=function(G){return(0,he.privateKeyVerify)(G)};G.isValidPublic=function(G,K){return void 0===K&&(K=!1),(0,_e.assertIsBuffer)(G),64===G.length?(0,he.publicKeyVerify)(Buffer.concat([Buffer.from([4]),G])):!!K&&(0,he.publicKeyVerify)(G)};G.pubToAddress=function(G,K){return void 0===K&&(K=!1),(0,_e.assertIsBuffer)(G),K&&64!==G.length&&(G=Buffer.from((0,he.publicKeyConvert)(G,!1).slice(1))),(0,ue.default)(64===G.length),(0,ve.keccak)(G).slice(-20)},G.publicToAddress=G.pubToAddress;G.privateToPublic=function(G){return(0,_e.assertIsBuffer)(G),Buffer.from((0,he.publicKeyCreate)(G,!1)).slice(1)};G.privateToAddress=function(K){return(0,G.publicToAddress)((0,G.privateToPublic)(K))};G.importPublic=function(G){return(0,_e.assertIsBuffer)(G),64!==G.length&&(G=Buffer.from((0,he.publicKeyConvert)(G,!1).slice(1))),G};G.zeroAddress=function(){var G=(0,be.zeros)(20);return(0,be.bufferToHex)(G)};G.isZeroAddress=function(K){try{(0,_e.assertIsString)(K)}catch(G){return!1}return(0,G.zeroAddress)()===K}}(jl);var Db={},Lb=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(Db,"__esModule",{value:!0}),Db.Address=void 0;var Ub=Lb(_p),$b=Nl,qb=uy,Gb=jl,jb=function(){function Address(G){(0,Ub.default)(20===G.length,"Invalid address length"),this.buf=G}return Address.zero=function(){return new Address((0,qb.zeros)(20))},Address.fromString=function(G){return(0,Ub.default)((0,Gb.isValidAddress)(G),"Invalid address"),new Address((0,qb.toBuffer)(G))},Address.fromPublicKey=function(G){return(0,Ub.default)(Buffer.isBuffer(G),"Public key should be Buffer"),new Address((0,Gb.pubToAddress)(G))},Address.fromPrivateKey=function(G){return(0,Ub.default)(Buffer.isBuffer(G),"Private key should be Buffer"),new Address((0,Gb.privateToAddress)(G))},Address.generate=function(G,K){return(0,Ub.default)($b.BN.isBN(K)),new Address((0,Gb.generateAddress)(G.buf,K.toArrayLike(Buffer)))},Address.generate2=function(G,K,ne){return(0,Ub.default)(Buffer.isBuffer(K)),(0,Ub.default)(Buffer.isBuffer(ne)),new Address((0,Gb.generateAddress2)(G.buf,K,ne))},Address.prototype.equals=function(G){return this.buf.equals(G.buf)},Address.prototype.isZero=function(){return this.equals(Address.zero())},Address.prototype.isPrecompileOrSystemAddress=function(){var G=new $b.BN(this.buf),K=new $b.BN(0),ne=new $b.BN("ffff","hex");return G.gte(K)&&G.lte(ne)},Address.prototype.toString=function(){return"0x"+this.buf.toString("hex")},Address.prototype.toBuffer=function(){return Buffer.from(this.buf)},Address}();Db.Address=jb;var Hb={};Object.defineProperty(Hb,"__esModule",{value:!0}),Hb.hashPersonalMessage=Hb.isValidSignature=Hb.fromRpcSig=Hb.toCompactSig=Hb.toRpcSig=Hb.ecrecover=Hb.ecsign=void 0;var Wb=Tp,zb=Nl,Vb=uy,Kb=py,Jb=fy,Xb=Fb;function calculateSigRecovery(G,K){var ne=(0,Xb.toType)(G,Xb.TypeOutput.BN);if(ne.eqn(0)||ne.eqn(1))return(0,Xb.toType)(G,Xb.TypeOutput.BN);if(!K)return ne.subn(27);var ue=(0,Xb.toType)(K,Xb.TypeOutput.BN);return ne.sub(ue.muln(2).addn(35))}function isValidSigRecovery(G){var K=new zb.BN(G);return K.eqn(0)||K.eqn(1)}Hb.ecsign=function ecsign(G,K,ne){var ue=(0,Wb.ecdsaSign)(G,K),pe=ue.signature,he=ue.recid,ye=Buffer.from(pe.slice(0,32)),me=Buffer.from(pe.slice(32,64));if(!ne||"number"==typeof ne){if(ne&&!Number.isSafeInteger(ne))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:ye,s:me,v:ne?he+(2*ne+35):he+27}}return{r:ye,s:me,v:(0,Xb.toType)(ne,Xb.TypeOutput.BN).muln(2).addn(35).addn(he).toArrayLike(Buffer)}};Hb.ecrecover=function(G,K,ne,ue,pe){var he=Buffer.concat([(0,Vb.setLengthLeft)(ne,32),(0,Vb.setLengthLeft)(ue,32)],64),ye=calculateSigRecovery(K,pe);if(!isValidSigRecovery(ye))throw new Error("Invalid signature v value");var me=(0,Wb.ecdsaRecover)(he,ye.toNumber(),G);return Buffer.from((0,Wb.publicKeyConvert)(me,!1).slice(1))};Hb.toRpcSig=function(G,K,ne,ue){if(!isValidSigRecovery(calculateSigRecovery(G,ue)))throw new Error("Invalid signature v value");return(0,Vb.bufferToHex)(Buffer.concat([(0,Vb.setLengthLeft)(K,32),(0,Vb.setLengthLeft)(ne,32),(0,Vb.toBuffer)(G)]))};Hb.toCompactSig=function(G,K,ne,ue){if(!isValidSigRecovery(calculateSigRecovery(G,ue)))throw new Error("Invalid signature v value");var pe=(0,Xb.toType)(G,Xb.TypeOutput.Number),he=ne;return(pe>28&&pe%2==1||1===pe||28===pe)&&((he=Buffer.from(ne))[0]|=128),(0,Vb.bufferToHex)(Buffer.concat([(0,Vb.setLengthLeft)(K,32),(0,Vb.setLengthLeft)(he,32)]))};Hb.fromRpcSig=function(G){var K,ne,ue,pe=(0,Vb.toBuffer)(G);if(pe.length>=65)K=pe.slice(0,32),ne=pe.slice(32,64),ue=(0,Vb.bufferToInt)(pe.slice(64));else{if(64!==pe.length)throw new Error("Invalid signature length");K=pe.slice(0,32),ne=pe.slice(32,64),ue=(0,Vb.bufferToInt)(pe.slice(32,33))>>7,ne[0]&=127}return ue<27&&(ue+=27),{v:ue,r:K,s:ne}};Hb.isValidSignature=function(G,K,ne,ue,pe){void 0===ue&&(ue=!0);var he=new zb.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),ye=new zb.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==K.length||32!==ne.length)return!1;if(!isValidSigRecovery(calculateSigRecovery(G,pe)))return!1;var me=new zb.BN(K),be=new zb.BN(ne);return!(me.isZero()||me.gt(ye)||be.isZero()||be.gt(ye))&&(!ue||1!==be.cmp(he))};Hb.hashPersonalMessage=function(G){(0,Jb.assertIsBuffer)(G);var K=Buffer.from("Ethereum Signed Message:\n".concat(G.length),"utf-8");return(0,Kb.keccak)(Buffer.concat([K,G]))};var Qb={},Zb=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.defineProperties=void 0;var Yb=Zb(_p),eg=dy,tg=Nl,rg=uy;Qb.defineProperties=function(G,K,ne){if(G.raw=[],G._fields=[],G.toJSON=function(K){if(void 0===K&&(K=!1),K){var ne={};return G._fields.forEach((function(K){ne[K]="0x".concat(G[K].toString("hex"))})),ne}return(0,rg.baToJSON)(G.raw)},G.serialize=function serialize(){return tg.rlp.encode(G.raw)},K.forEach((function(K,ne){function getter(){return G.raw[ne]}function setter(ue){"00"!==(ue=(0,rg.toBuffer)(ue)).toString("hex")||K.allowZero||(ue=Buffer.allocUnsafe(0)),K.allowLess&&K.length?(ue=(0,rg.unpadBuffer)(ue),(0,Yb.default)(K.length>=ue.length,"The field ".concat(K.name," must not have more ").concat(K.length," bytes"))):K.allowZero&&0===ue.length||!K.length||(0,Yb.default)(K.length===ue.length,"The field ".concat(K.name," must have byte length of ").concat(K.length)),G.raw[ne]=ue}G._fields.push(K.name),Object.defineProperty(G,K.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),K.default&&(G[K.name]=K.default),K.alias&&Object.defineProperty(G,K.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})})),ne)if("string"==typeof ne&&(ne=Buffer.from((0,eg.stripHexPrefix)(ne),"hex")),Buffer.isBuffer(ne)&&(ne=tg.rlp.decode(ne)),Array.isArray(ne)){if(ne.length>G._fields.length)throw new Error("wrong number of fields in data");ne.forEach((function(K,ne){G[G._fields[ne]]=(0,rg.toBuffer)(K)}))}else{if("object"!=typeof ne)throw new Error("invalid data");var ue=Object.keys(ne);K.forEach((function(K){-1!==ue.indexOf(K.name)&&(G[K.name]=ne[K.name]),-1!==ue.indexOf(K.alias)&&(G[K.alias]=ne[K.alias])}))}},function(G){var K=pn&&pn.__createBinding||(Object.create?function(G,K,ne,ue){void 0===ue&&(ue=ne);var pe=Object.getOwnPropertyDescriptor(K,ne);pe&&!("get"in pe?!K.__esModule:pe.writable||pe.configurable)||(pe={enumerable:!0,get:function(){return K[ne]}}),Object.defineProperty(G,ue,pe)}:function(G,K,ne,ue){void 0===ue&&(ue=ne),G[ue]=K[ne]}),ne=pn&&pn.__exportStar||function(G,ne){for(var ue in G)"default"===ue||Object.prototype.hasOwnProperty.call(ne,ue)||K(ne,G,ue)};Object.defineProperty(G,"__esModule",{value:!0}),G.isHexString=G.getKeys=G.fromAscii=G.fromUtf8=G.toAscii=G.arrayContainsArray=G.getBinarySize=G.padToEven=G.stripHexPrefix=G.isHexPrefixed=void 0,ne(xl,G),ne(jl,G),ne(Db,G),ne(py,G),ne(Hb,G),ne(uy,G),ne(Qb,G),ne(Nl,G),ne(Fb,G);var ue=dy;Object.defineProperty(G,"isHexPrefixed",{enumerable:!0,get:function(){return ue.isHexPrefixed}}),Object.defineProperty(G,"stripHexPrefix",{enumerable:!0,get:function(){return ue.stripHexPrefix}}),Object.defineProperty(G,"padToEven",{enumerable:!0,get:function(){return ue.padToEven}}),Object.defineProperty(G,"getBinarySize",{enumerable:!0,get:function(){return ue.getBinarySize}}),Object.defineProperty(G,"arrayContainsArray",{enumerable:!0,get:function(){return ue.arrayContainsArray}}),Object.defineProperty(G,"toAscii",{enumerable:!0,get:function(){return ue.toAscii}}),Object.defineProperty(G,"fromUtf8",{enumerable:!0,get:function(){return ue.fromUtf8}}),Object.defineProperty(G,"fromAscii",{enumerable:!0,get:function(){return ue.fromAscii}}),Object.defineProperty(G,"getKeys",{enumerable:!0,get:function(){return ue.getKeys}}),Object.defineProperty(G,"isHexString",{enumerable:!0,get:function(){return ue.isHexString}})}(Ol);var ng={},ag={},ig=ry.Buffer;var sg=function base$1(G){if(G.length>=255)throw new TypeError("Alphabet too long");for(var K=new Uint8Array(256),ne=0;ne<K.length;ne++)K[ne]=255;for(var ue=0;ue<G.length;ue++){var pe=G.charAt(ue),he=pe.charCodeAt(0);if(255!==K[he])throw new TypeError(pe+" is ambiguous");K[he]=ue}var ye=G.length,me=G.charAt(0),be=Math.log(ye)/Math.log(256),ve=Math.log(256)/Math.log(ye);function decodeUnsafe(G){if("string"!=typeof G)throw new TypeError("Expected String");if(0===G.length)return ig.alloc(0);for(var ne=0,ue=0,pe=0;G[ne]===me;)ue++,ne++;for(var he=(G.length-ne)*be+1>>>0,ve=new Uint8Array(he);G[ne];){var _e=K[G.charCodeAt(ne)];if(255===_e)return;for(var Te=0,Ee=he-1;(0!==_e||Te<pe)&&-1!==Ee;Ee--,Te++)_e+=ye*ve[Ee]>>>0,ve[Ee]=_e%256>>>0,_e=_e/256>>>0;if(0!==_e)throw new Error("Non-zero carry");pe=Te,ne++}for(var Pe=he-pe;Pe!==he&&0===ve[Pe];)Pe++;var Se=ig.allocUnsafe(ue+(he-Pe));Se.fill(0,0,ue);for(var Ce=ue;Pe!==he;)Se[Ce++]=ve[Pe++];return Se}return{encode:function encode(K){if((Array.isArray(K)||K instanceof Uint8Array)&&(K=ig.from(K)),!ig.isBuffer(K))throw new TypeError("Expected Buffer");if(0===K.length)return"";for(var ne=0,ue=0,pe=0,he=K.length;pe!==he&&0===K[pe];)pe++,ne++;for(var be=(he-pe)*ve+1>>>0,_e=new Uint8Array(be);pe!==he;){for(var Te=K[pe],Ee=0,Pe=be-1;(0!==Te||Ee<ue)&&-1!==Pe;Pe--,Ee++)Te+=256*_e[Pe]>>>0,_e[Pe]=Te%ye>>>0,Te=Te/ye>>>0;if(0!==Te)throw new Error("Non-zero carry");ue=Ee,pe++}for(var Se=be-ue;Se!==be&&0===_e[Se];)Se++;for(var Ce=me.repeat(ne);Se<be;++Se)Ce+=G.charAt(_e[Se]);return Ce},decodeUnsafe:decodeUnsafe,decode:function decode(G){var K=decodeUnsafe(G);if(K)return K;throw new Error("Non-base"+ye+" character")}}},og=sg("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),cg=ry.Buffer,dg=Bb,bs58checkBase=function(G){function decodeRaw(K){var ne=K.slice(0,-4),ue=K.slice(-4),pe=G(ne);if(!(ue[0]^pe[0]|ue[1]^pe[1]|ue[2]^pe[2]|ue[3]^pe[3]))return ne}return{encode:function encode(K){var ne=G(K);return og.encode(cg.concat([K,ne],K.length+4))},decode:function decode(G){var K=decodeRaw(og.decode(G));if(!K)throw new Error("Invalid checksum");return K},decodeUnsafe:function decodeUnsafe(G){var K=og.decodeUnsafe(G);if(K)return decodeRaw(K)}}};var ug=bs58checkBase((function sha256x2(G){var K=dg("sha256").update(G).digest();return dg("sha256").update(K).digest()})),fg={},lg={};Object.defineProperty(lg,"__esModule",{value:!0});var pg=cd.ripemd160,hg=yy;lg.ripemd160=hg.createHashFunction((function(){return new pg}));var yg={};Object.defineProperty(yg,"__esModule",{value:!0});var mg=Dc,bg=yy;yg.sha256=bg.createHashFunction((function(){return new mg}));var gg=nc,vg=ry.Buffer,wg=kb,_g=vg.alloc(128),Tg=64;function Hmac$1(G,K){wg.call(this,"digest"),"string"==typeof K&&(K=vg.from(K)),this._alg=G,this._key=K,K.length>Tg?K=G(K):K.length<Tg&&(K=vg.concat([K,_g],Tg));for(var ne=this._ipad=vg.allocUnsafe(Tg),ue=this._opad=vg.allocUnsafe(Tg),pe=0;pe<Tg;pe++)ne[pe]=54^K[pe],ue[pe]=92^K[pe];this._hash=[ne]}gg(Hmac$1,wg),Hmac$1.prototype._update=function(G){this._hash.push(G)},Hmac$1.prototype._final=function(){var G=this._alg(vg.concat(this._hash));return this._alg(vg.concat([this._opad,G]))};var Ag=_m,Eg=nc,Pg=Hmac$1,Sg=kb,Ig=ry.Buffer,md5$2=function(G){return(new Ag).update(G).digest()},Cg=xm,Rg=wb,kg=Ig.alloc(128);function Hmac(G,K){Sg.call(this,"digest"),"string"==typeof K&&(K=Ig.from(K));var ne="sha512"===G||"sha384"===G?128:64;(this._alg=G,this._key=K,K.length>ne)?K=("rmd160"===G?new Cg:Rg(G)).update(K).digest():K.length<ne&&(K=Ig.concat([K,kg],ne));for(var ue=this._ipad=Ig.allocUnsafe(ne),pe=this._opad=Ig.allocUnsafe(ne),he=0;he<ne;he++)ue[he]=54^K[he],pe[he]=92^K[he];this._hash="rmd160"===G?new Cg:Rg(G),this._hash.update(ue)}Eg(Hmac,Sg),Hmac.prototype._update=function(G){this._hash.update(G)},Hmac.prototype._final=function(){var G=this._hash.digest();return("rmd160"===this._alg?new Cg:Rg(this._alg)).update(this._opad).update(G).digest()};Object.defineProperty(fg,"__esModule",{value:!0});var Og=lg,xg=yg;fg.createHmac=function createHmac(G,K){return"rmd160"===(G=G.toLowerCase())||"ripemd160"===G?new Hmac("rmd160",K):"md5"===G?new Pg(md5$2,K):new Hmac(G,K)},fg.randomBytes=oy;var Ng=function(){function Hash(G){this.hashFunction=G,this.buffers=[]}return Hash.prototype.update=function(G){if(!Buffer.isBuffer(G))throw new Error("hdkey-crypto shim is outdated");return this.buffers.push(G),this},Hash.prototype.digest=function(G){if(G)throw new Error("hdkey-crypto shim is outdated");return this.hashFunction(Buffer.concat(this.buffers))},Hash}();fg.createHash=function(G){if("ripemd160"===G)return new Ng(Og.ripemd160);if("sha256"===G)return new Ng(xg.sha256);throw new Error("hdkey-crypto shim is outdated")};var Mg={},Bg={},Fg=pn&&pn.__importStar||function(G){if(G&&G.__esModule)return G;var K={};if(null!=G)for(var ne in G)Object.hasOwnProperty.call(G,ne)&&(K[ne]=G[ne]);return K.default=G,K};Object.defineProperty(Bg,"__esModule",{value:!0});var Dg=Fg(Zh);function _interopDefault$1(G){return G&&"object"==typeof G&&"default"in G?G.default:G}Bg.privateKeyVerify=function privateKeyVerify(G){return Dg.privateKeyVerify(G)},Bg.publicKeyCreate=function publicKeyCreate(G,K){return void 0===K&&(K=!0),Buffer.from(Dg.publicKeyCreate(G,K))},Bg.publicKeyVerify=function publicKeyVerify(G){return Dg.publicKeyVerify(G)},Bg.publicKeyConvert=function publicKeyConvert(G,K){return void 0===K&&(K=!0),Buffer.from(Dg.publicKeyConvert(G,K))},Bg.privateKeyTweakAdd=function privateKeyTweakAdd(G,K){return Buffer.from(Dg.privateKeyTweakAdd(Buffer.from(G),K))},Bg.publicKeyTweakAdd=function publicKeyTweakAdd(G,K,ne){return void 0===ne&&(ne=!0),Buffer.from(Dg.publicKeyTweakAdd(Buffer.from(G),K,ne))},Bg.sign=function sign(G,K){var ne=Dg.ecdsaSign(G,K);return{signature:Buffer.from(ne.signature),recovery:ne.recid}},Bg.verify=function verify(G,K,ne){return Dg.ecdsaVerify(K,G,ne)},function(G){Object.defineProperty(G,"__esModule",{value:!0}),function __export(K){for(var ne in K)G.hasOwnProperty(ne)||(G[ne]=K[ne])}(Bg)}(Mg);var Lg=_interopDefault$1(_p),Ug=_interopDefault$1(ry),$g=_interopDefault$1(ug),qg=fg,Gg=Mg,jg=Ug.Buffer,Hg=jg.from("Bitcoin seed","utf8"),Wg=2147483648,zg={private:76066276,public:76067358};function HDKey(G){this.versions=G||zg,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}function serialize(G,K,ne){var ue=jg.allocUnsafe(78);ue.writeUInt32BE(K,0),ue.writeUInt8(G.depth,4);var pe=G.depth?G.parentFingerprint:0;return ue.writeUInt32BE(pe,5),ue.writeUInt32BE(G.index,9),G.chainCode.copy(ue,13),ne.copy(ue,45),ue}function hash160(G){var K=qg.createHash("sha256").update(G).digest();return qg.createHash("ripemd160").update(K).digest()}Object.defineProperty(HDKey.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(HDKey.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(HDKey.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(HDKey.prototype,"privateKey",{get:function(){return this._privateKey},set:function(G){Lg.equal(G.length,32,"Private key must be 32 bytes."),Lg(!0===Gg.privateKeyVerify(G),"Invalid private key"),this._privateKey=G,this._publicKey=Gg.publicKeyCreate(G,!0),this._identifier=hash160(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(HDKey.prototype,"publicKey",{get:function(){return this._publicKey},set:function(G){Lg(33===G.length||65===G.length,"Public key must be 33 or 65 bytes."),Lg(!0===Gg.publicKeyVerify(G),"Invalid public key"),this._publicKey=Gg.publicKeyConvert(G,!0),this._identifier=hash160(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(HDKey.prototype,"privateExtendedKey",{get:function(){return this._privateKey?$g.encode(serialize(this,this.versions.private,jg.concat([jg.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(HDKey.prototype,"publicExtendedKey",{get:function(){return $g.encode(serialize(this,this.versions.public,this.publicKey))}}),HDKey.prototype.derive=function(G){if("m"===G||"M"===G||"m'"===G||"M'"===G)return this;var K=G.split("/"),ne=this;return K.forEach((function(G,K){if(0!==K){var ue=G.length>1&&"'"===G[G.length-1],pe=parseInt(G,10);Lg(pe<Wg,"Invalid index"),ue&&(pe+=Wg),ne=ne.deriveChild(pe)}else Lg(/^[mM]{1}/.test(G),'Path must start with "m" or "M"')})),ne},HDKey.prototype.deriveChild=function(G){var K,ne=G>=Wg,ue=jg.allocUnsafe(4);if(ue.writeUInt32BE(G,0),ne){Lg(this.privateKey,"Could not derive hardened child key");var pe=this.privateKey,he=jg.alloc(1,0);pe=jg.concat([he,pe]),K=jg.concat([pe,ue])}else K=jg.concat([this.publicKey,ue]);var ye=qg.createHmac("sha512",this.chainCode).update(K).digest(),me=ye.slice(0,32),be=ye.slice(32),ve=new HDKey(this.versions);if(this.privateKey)try{ve.privateKey=Gg.privateKeyTweakAdd(this.privateKey,me)}catch(K){return this.deriveChild(G+1)}else try{ve.publicKey=Gg.publicKeyTweakAdd(this.publicKey,me,!0)}catch(K){return this.deriveChild(G+1)}return ve.chainCode=be,ve.depth=this.depth+1,ve.parentFingerprint=this.fingerprint,ve.index=G,ve},HDKey.prototype.sign=function(G){return Gg.sign(G,this.privateKey).signature},HDKey.prototype.verify=function(G,K){return Gg.verify(G,K,this.publicKey)},HDKey.prototype.wipePrivateData=function(){return this._privateKey&&qg.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},HDKey.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},HDKey.fromMasterSeed=function(G,K){var ne=qg.createHmac("sha512",Hg).update(G).digest(),ue=ne.slice(0,32),pe=ne.slice(32),he=new HDKey(K);return he.chainCode=pe,he.privateKey=ue,he},HDKey.fromExtendedKey=function(G,K){var ne=new HDKey(K=K||zg),ue=$g.decode(G),pe=ue.readUInt32BE(0);Lg(pe===K.private||pe===K.public,"Version mismatch: does not match private or public"),ne.depth=ue.readUInt8(4),ne.parentFingerprint=ue.readUInt32BE(5),ne.index=ue.readUInt32BE(9),ne.chainCode=ue.slice(13,45);var he=ue.slice(45);return 0===he.readUInt8(0)?(Lg(pe===K.private,"Version mismatch: version does not match private"),ne.privateKey=he.slice(1)):(Lg(pe===K.public,"Version mismatch: version does not match public"),ne.publicKey=he),ne},HDKey.fromJSON=function(G){return HDKey.fromExtendedKey(G.xpriv)},HDKey.HARDENED_OFFSET=Wg;var Vg=HDKey;Object.defineProperty(ag,"__esModule",{value:!0});var Kg,Jg=Vg;ag.HDKey=Jg;var Xg={},Qg={};
/*! https://mths.be/utf8js v3.0.0 by @mathias */
!function(G){!function(G){var K,ne,ue,pe=String.fromCharCode;function ucs2decode(G){for(var K,ne,ue=[],pe=0,he=G.length;pe<he;)(K=G.charCodeAt(pe++))>=55296&&K<=56319&&pe<he?56320==(64512&(ne=G.charCodeAt(pe++)))?ue.push(((1023&K)<<10)+(1023&ne)+65536):(ue.push(K),pe--):ue.push(K);return ue}function checkScalarValue(G){if(G>=55296&&G<=57343)throw Error("Lone surrogate U+"+G.toString(16).toUpperCase()+" is not a scalar value")}function createByte(G,K){return pe(G>>K&63|128)}function encodeCodePoint(G){if(0==(4294967168&G))return pe(G);var K="";return 0==(4294965248&G)?K=pe(G>>6&31|192):0==(4294901760&G)?(checkScalarValue(G),K=pe(G>>12&15|224),K+=createByte(G,6)):0==(4292870144&G)&&(K=pe(G>>18&7|240),K+=createByte(G,12),K+=createByte(G,6)),K+=pe(63&G|128)}function readContinuationByte(){if(ue>=ne)throw Error("Invalid byte index");var G=255&K[ue];if(ue++,128==(192&G))return 63&G;throw Error("Invalid continuation byte")}function decodeSymbol(){var G,pe;if(ue>ne)throw Error("Invalid byte index");if(ue==ne)return!1;if(G=255&K[ue],ue++,0==(128&G))return G;if(192==(224&G)){if((pe=(31&G)<<6|readContinuationByte())>=128)return pe;throw Error("Invalid continuation byte")}if(224==(240&G)){if((pe=(15&G)<<12|readContinuationByte()<<6|readContinuationByte())>=2048)return checkScalarValue(pe),pe;throw Error("Invalid continuation byte")}if(240==(248&G)&&(pe=(7&G)<<18|readContinuationByte()<<12|readContinuationByte()<<6|readContinuationByte())>=65536&&pe<=1114111)return pe;throw Error("Invalid UTF-8 detected")}G.version="3.0.0",G.encode=function utf8encode(G){for(var K=ucs2decode(G),ne=K.length,ue=-1,pe="";++ue<ne;)pe+=encodeCodePoint(K[ue]);return pe},G.decode=function utf8decode(G){K=ucs2decode(G),ne=K.length,ue=0;for(var he,ye=[];!1!==(he=decodeSymbol());)ye.push(he);return function ucs2encode(G){for(var K,ne=G.length,ue=-1,he="";++ue<ne;)(K=G[ue])>65535&&(he+=pe((K-=65536)>>>10&1023|55296),K=56320|1023&K),he+=pe(K);return he}(ye)}}(G)}(Qg);var Zg={exports:{}};
/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */!function(G,K){!function(K){function checkInt(G){return parseInt(G)===G}function checkInts(G){if(!checkInt(G.length))return!1;for(var K=0;K<G.length;K++)if(!checkInt(G[K])||G[K]<0||G[K]>255)return!1;return!0}function coerceArray(G,K){if(G.buffer&&"Uint8Array"===G.name)return K&&(G=G.slice?G.slice():Array.prototype.slice.call(G)),G;if(Array.isArray(G)){if(!checkInts(G))throw new Error("Array contains invalid value: "+G);return new Uint8Array(G)}if(checkInt(G.length)&&checkInts(G))return new Uint8Array(G);throw new Error("unsupported array-like object")}function createArray(G){return new Uint8Array(G)}function copyArray(G,K,ne,ue,pe){null==ue&&null==pe||(G=G.slice?G.slice(ue,pe):Array.prototype.slice.call(G,ue,pe)),K.set(G,ne)}var ne,ue={toBytes:function toBytes(G){var K=[],ne=0;for(G=encodeURI(G);ne<G.length;){var ue=G.charCodeAt(ne++);37===ue?(K.push(parseInt(G.substr(ne,2),16)),ne+=2):K.push(ue)}return coerceArray(K)},fromBytes:function fromBytes(G){for(var K=[],ne=0;ne<G.length;){var ue=G[ne];ue<128?(K.push(String.fromCharCode(ue)),ne++):ue>191&&ue<224?(K.push(String.fromCharCode((31&ue)<<6|63&G[ne+1])),ne+=2):(K.push(String.fromCharCode((15&ue)<<12|(63&G[ne+1])<<6|63&G[ne+2])),ne+=3)}return K.join("")}},pe=(ne="0123456789abcdef",{toBytes:function toBytes(G){for(var K=[],ne=0;ne<G.length;ne+=2)K.push(parseInt(G.substr(ne,2),16));return K},fromBytes:function fromBytes(G){for(var K=[],ue=0;ue<G.length;ue++){var pe=G[ue];K.push(ne[(240&pe)>>4]+ne[15&pe])}return K.join("")}}),he={16:10,24:12,32:14},ye=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],me=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],be=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],ve=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],_e=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Te=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ee=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Pe=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Se=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Ce=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],ke=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Oe=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],xe=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ne=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Me=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(G){for(var K=[],ne=0;ne<G.length;ne+=4)K.push(G[ne]<<24|G[ne+1]<<16|G[ne+2]<<8|G[ne+3]);return K}var AES=function(G){if(!(this instanceof AES))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:coerceArray(G,!0)}),this._prepare()};AES.prototype._prepare=function(){var G=he[this.key.length];if(null==G)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var K=0;K<=G;K++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var ne,ue=4*(G+1),pe=this.key.length/4,be=convertToInt32(this.key);for(K=0;K<pe;K++)ne=K>>2,this._Ke[ne][K%4]=be[K],this._Kd[G-ne][K%4]=be[K];for(var ve,_e=0,Te=pe;Te<ue;){if(ve=be[pe-1],be[0]^=me[ve>>16&255]<<24^me[ve>>8&255]<<16^me[255&ve]<<8^me[ve>>24&255]^ye[_e]<<24,_e+=1,8!=pe)for(K=1;K<pe;K++)be[K]^=be[K-1];else{for(K=1;K<pe/2;K++)be[K]^=be[K-1];ve=be[pe/2-1],be[pe/2]^=me[255&ve]^me[ve>>8&255]<<8^me[ve>>16&255]<<16^me[ve>>24&255]<<24;for(K=pe/2+1;K<pe;K++)be[K]^=be[K-1]}for(K=0;K<pe&&Te<ue;)Ee=Te>>2,Pe=Te%4,this._Ke[Ee][Pe]=be[K],this._Kd[G-Ee][Pe]=be[K++],Te++}for(var Ee=1;Ee<G;Ee++)for(var Pe=0;Pe<4;Pe++)ve=this._Kd[Ee][Pe],this._Kd[Ee][Pe]=Oe[ve>>24&255]^xe[ve>>16&255]^Ne[ve>>8&255]^Me[255&ve]},AES.prototype.encrypt=function(G){if(16!=G.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var K=this._Ke.length-1,ne=[0,0,0,0],ue=convertToInt32(G),pe=0;pe<4;pe++)ue[pe]^=this._Ke[0][pe];for(var he=1;he<K;he++){for(pe=0;pe<4;pe++)ne[pe]=ve[ue[pe]>>24&255]^_e[ue[(pe+1)%4]>>16&255]^Te[ue[(pe+2)%4]>>8&255]^Ee[255&ue[(pe+3)%4]]^this._Ke[he][pe];ue=ne.slice()}var ye,be=createArray(16);for(pe=0;pe<4;pe++)ye=this._Ke[K][pe],be[4*pe]=255&(me[ue[pe]>>24&255]^ye>>24),be[4*pe+1]=255&(me[ue[(pe+1)%4]>>16&255]^ye>>16),be[4*pe+2]=255&(me[ue[(pe+2)%4]>>8&255]^ye>>8),be[4*pe+3]=255&(me[255&ue[(pe+3)%4]]^ye);return be},AES.prototype.decrypt=function(G){if(16!=G.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var K=this._Kd.length-1,ne=[0,0,0,0],ue=convertToInt32(G),pe=0;pe<4;pe++)ue[pe]^=this._Kd[0][pe];for(var he=1;he<K;he++){for(pe=0;pe<4;pe++)ne[pe]=Pe[ue[pe]>>24&255]^Se[ue[(pe+3)%4]>>16&255]^Ce[ue[(pe+2)%4]>>8&255]^ke[255&ue[(pe+1)%4]]^this._Kd[he][pe];ue=ne.slice()}var ye,me=createArray(16);for(pe=0;pe<4;pe++)ye=this._Kd[K][pe],me[4*pe]=255&(be[ue[pe]>>24&255]^ye>>24),me[4*pe+1]=255&(be[ue[(pe+3)%4]>>16&255]^ye>>16),me[4*pe+2]=255&(be[ue[(pe+2)%4]>>8&255]^ye>>8),me[4*pe+3]=255&(be[255&ue[(pe+1)%4]]^ye);return me};var ModeOfOperationECB=function(G){if(!(this instanceof ModeOfOperationECB))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new AES(G)};ModeOfOperationECB.prototype.encrypt=function(G){if((G=coerceArray(G)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var K=createArray(G.length),ne=createArray(16),ue=0;ue<G.length;ue+=16)copyArray(G,ne,0,ue,ue+16),copyArray(ne=this._aes.encrypt(ne),K,ue);return K},ModeOfOperationECB.prototype.decrypt=function(G){if((G=coerceArray(G)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var K=createArray(G.length),ne=createArray(16),ue=0;ue<G.length;ue+=16)copyArray(G,ne,0,ue,ue+16),copyArray(ne=this._aes.decrypt(ne),K,ue);return K};var ModeOfOperationCBC=function(G,K){if(!(this instanceof ModeOfOperationCBC))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",K){if(16!=K.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else K=createArray(16);this._lastCipherblock=coerceArray(K,!0),this._aes=new AES(G)};ModeOfOperationCBC.prototype.encrypt=function(G){if((G=coerceArray(G)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var K=createArray(G.length),ne=createArray(16),ue=0;ue<G.length;ue+=16){copyArray(G,ne,0,ue,ue+16);for(var pe=0;pe<16;pe++)ne[pe]^=this._lastCipherblock[pe];this._lastCipherblock=this._aes.encrypt(ne),copyArray(this._lastCipherblock,K,ue)}return K},ModeOfOperationCBC.prototype.decrypt=function(G){if((G=coerceArray(G)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var K=createArray(G.length),ne=createArray(16),ue=0;ue<G.length;ue+=16){copyArray(G,ne,0,ue,ue+16),ne=this._aes.decrypt(ne);for(var pe=0;pe<16;pe++)K[ue+pe]=ne[pe]^this._lastCipherblock[pe];copyArray(G,this._lastCipherblock,0,ue,ue+16)}return K};var ModeOfOperationCFB=function(G,K,ne){if(!(this instanceof ModeOfOperationCFB))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",K){if(16!=K.length)throw new Error("invalid initialation vector size (must be 16 size)")}else K=createArray(16);ne||(ne=1),this.segmentSize=ne,this._shiftRegister=coerceArray(K,!0),this._aes=new AES(G)};ModeOfOperationCFB.prototype.encrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var K,ne=coerceArray(G,!0),ue=0;ue<ne.length;ue+=this.segmentSize){K=this._aes.encrypt(this._shiftRegister);for(var pe=0;pe<this.segmentSize;pe++)ne[ue+pe]^=K[pe];copyArray(this._shiftRegister,this._shiftRegister,0,this.segmentSize),copyArray(ne,this._shiftRegister,16-this.segmentSize,ue,ue+this.segmentSize)}return ne},ModeOfOperationCFB.prototype.decrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var K,ne=coerceArray(G,!0),ue=0;ue<ne.length;ue+=this.segmentSize){K=this._aes.encrypt(this._shiftRegister);for(var pe=0;pe<this.segmentSize;pe++)ne[ue+pe]^=K[pe];copyArray(this._shiftRegister,this._shiftRegister,0,this.segmentSize),copyArray(G,this._shiftRegister,16-this.segmentSize,ue,ue+this.segmentSize)}return ne};var ModeOfOperationOFB=function(G,K){if(!(this instanceof ModeOfOperationOFB))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",K){if(16!=K.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else K=createArray(16);this._lastPrecipher=coerceArray(K,!0),this._lastPrecipherIndex=16,this._aes=new AES(G)};ModeOfOperationOFB.prototype.encrypt=function(G){for(var K=coerceArray(G,!0),ne=0;ne<K.length;ne++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),K[ne]^=this._lastPrecipher[this._lastPrecipherIndex++];return K},ModeOfOperationOFB.prototype.decrypt=ModeOfOperationOFB.prototype.encrypt;var Counter=function(G){if(!(this instanceof Counter))throw Error("Counter must be instanitated with `new`");0===G||G||(G=1),"number"==typeof G?(this._counter=createArray(16),this.setValue(G)):this.setBytes(G)};Counter.prototype.setValue=function(G){if("number"!=typeof G||parseInt(G)!=G)throw new Error("invalid counter value (must be an integer)");if(G>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var K=15;K>=0;--K)this._counter[K]=G%256,G=parseInt(G/256)},Counter.prototype.setBytes=function(G){if(16!=(G=coerceArray(G,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=G},Counter.prototype.increment=function(){for(var G=15;G>=0;G--){if(255!==this._counter[G]){this._counter[G]++;break}this._counter[G]=0}};var ModeOfOperationCTR=function(G,K){if(!(this instanceof ModeOfOperationCTR))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",K instanceof Counter||(K=new Counter(K)),this._counter=K,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new AES(G)};ModeOfOperationCTR.prototype.encrypt=function(G){for(var K=coerceArray(G,!0),ne=0;ne<K.length;ne++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),K[ne]^=this._remainingCounter[this._remainingCounterIndex++];return K},ModeOfOperationCTR.prototype.decrypt=ModeOfOperationCTR.prototype.encrypt;var Be={AES:AES,Counter:Counter,ModeOfOperation:{ecb:ModeOfOperationECB,cbc:ModeOfOperationCBC,cfb:ModeOfOperationCFB,ofb:ModeOfOperationOFB,ctr:ModeOfOperationCTR},utils:{hex:pe,utf8:ue},padding:{pkcs7:{pad:function pkcs7pad(G){var K=16-(G=coerceArray(G,!0)).length%16,ne=createArray(G.length+K);copyArray(G,ne);for(var ue=G.length;ue<ne.length;ue++)ne[ue]=K;return ne},strip:function pkcs7strip(G){if((G=coerceArray(G,!0)).length<16)throw new Error("PKCS#7 invalid length");var K=G[G.length-1];if(K>16)throw new Error("PKCS#7 padding byte out of range");for(var ne=G.length-K,ue=0;ue<K;ue++)if(G[ne+ue]!==K)throw new Error("PKCS#7 invalid padding byte");var pe=createArray(ne);return copyArray(G,pe,0,0,ne),pe}}},_arrayTest:{coerceArray:coerceArray,createArray:createArray,copyArray:copyArray}};G.exports=Be}()}(Zg);var Yg,ev,tv=Zg.exports;function requireThirdparty(){if(Yg)return Xg;Yg=1;var G=pn&&pn.__createBinding||(Object.create?function(G,K,ne,ue){void 0===ue&&(ue=ne),Object.defineProperty(G,ue,{enumerable:!0,get:function(){return K[ne]}})}:function(G,K,ne,ue){void 0===ue&&(ue=ne),G[ue]=K[ne]}),K=pn&&pn.__setModuleDefault||(Object.create?function(G,K){Object.defineProperty(G,"default",{enumerable:!0,value:K})}:function(G,K){G.default=K}),ne=pn&&pn.__importStar||function(ne){if(ne&&ne.__esModule)return ne;var ue={};if(null!=ne)for(var pe in ne)"default"!==pe&&Object.prototype.hasOwnProperty.call(ne,pe)&&G(ue,ne,pe);return K(ue,ne),ue},ue=pn&&pn.__awaiter||function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))},pe=pn&&pn.__generator||function(G,K){var ne,ue,pe,he,ye={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return he={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(he[Symbol.iterator]=function(){return this}),he;function verb(he){return function(me){return function step(he){if(ne)throw new TypeError("Generator is already executing.");for(;ye;)try{if(ne=1,ue&&(pe=2&he[0]?ue.return:he[0]?ue.throw||((pe=ue.return)&&pe.call(ue),0):ue.next)&&!(pe=pe.call(ue,he[1])).done)return pe;switch(ue=0,pe&&(he=[2&he[0],pe.value]),he[0]){case 0:case 1:pe=he;break;case 4:return ye.label++,{value:he[1],done:!1};case 5:ye.label++,ue=he[1],he=[0];continue;case 7:he=ye.ops.pop(),ye.trys.pop();continue;default:if(!(pe=ye.trys,(pe=pe.length>0&&pe[pe.length-1])||6!==he[0]&&2!==he[0])){ye=0;continue}if(3===he[0]&&(!pe||he[1]>pe[0]&&he[1]<pe[3])){ye.label=he[1];break}if(6===he[0]&&ye.label<pe[1]){ye.label=pe[1],pe=he;break}if(pe&&ye.label<pe[2]){ye.label=pe[2],ye.ops.push(he);break}pe[2]&&ye.ops.pop(),ye.trys.pop();continue}he=K.call(G,ye)}catch(G){he=[6,G],ue=0}finally{ne=pe=0}if(5&he[0])throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}([he,me])}}},he=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.fromQuorumWallet=Xg.fromKryptoKit=Xg.fromEtherCamp=Xg.fromEtherWallet=void 0;var ye=ne(bf),me=Ol,be=Tu,ve=he(requireDist_browser()),_e=Qg,Te=tv;var Ee={count:1,keysize:16,ivsize:16,digest:"md5"};function evp_kdf(G,K,ne){var ue=function mergeEvpKdfOptsWithDefaults(G){return G?{count:G.count||Ee.count,keysize:G.keysize||Ee.keysize,ivsize:G.ivsize||Ee.ivsize,digest:G.digest||Ee.digest}:Ee}(ne);function iter(ne){var pe=ye.createHash(ue.digest);pe.update(ne),pe.update(G),pe.update(K),ne=pe.digest();for(var he=1,me=ue.count;he<me;he++)(pe=ye.createHash(ue.digest)).update(ne),ne=pe.digest();return ne}for(var pe=[],he=0;Buffer.concat(pe).length<ue.keysize+ue.ivsize;)pe[he]=iter(0===he?Buffer.alloc(0):pe[he-1]),he++;var me=Buffer.concat(pe);return{key:me.slice(0,ue.keysize),iv:me.slice(ue.keysize,ue.keysize+ue.ivsize)}}function fromEtherWallet(G,K){var ne,ue="object"==typeof G?G:JSON.parse(G);if(ue.locked){if("string"!=typeof K)throw new Error("Password required");if(K.length<7)throw new Error("Password must be at least 7 characters");var pe=function decodeCryptojsSalt(G){var K=Buffer.from(G,"base64");return"Salted__"===K.slice(0,8).toString()?{salt:K.slice(8,16),ciphertext:K.slice(16)}:{ciphertext:K}}(ue.encrypted?ue.private.slice(0,128):ue.private);if(!pe.salt)throw new Error("Unsupported EtherWallet key format");var he=evp_kdf(Buffer.from(K),pe.salt,{keysize:32,ivsize:16});ne=function runCipherBuffer(G,K){return Buffer.concat([G.update(K),G.final()])}(ye.createDecipheriv("aes-256-cbc",he.key,he.iv),Buffer.from(pe.ciphertext)),ne=Buffer.from(_e.decode(ne.toString()),"hex")}else{if(64!==ue.private.length)throw new Error("Invalid private key length");ne=Buffer.from(ue.private,"hex")}var me=new ve.default(ne);if(me.getAddressString()!==ue.address)throw new Error("Invalid private key or address");return me}function fromEtherCamp(G){return new ve.default((0,me.keccak256)(Buffer.from(G)))}function fromKryptoKit(G,K){return ue(this,void 0,void 0,(function(){var ne,ue,he,ye,_e,Ee,Pe;return pe(this,(function(pe){switch(pe.label){case 0:return"#"===G[0]&&(G=G.slice(1)),ne=G[0],G=G.slice(1),"d"!==ne?[3,1]:(ue=(0,me.sha256)((0,me.toBuffer)(G)),[3,4]);case 1:if("q"!==ne)return[3,3];if("string"!=typeof K)throw new Error("Password required");return he=(0,me.sha256)(Buffer.from(G.slice(0,30))),ye=G.slice(30,46),_e=function kryptoKitBrokenScryptSeed(G){function decodeUtf8Char(G){try{return decodeURIComponent(G)}catch(G){return String.fromCharCode(65533)}}for(var K="",ne="",ue=0;ue<G.length;ue++)G[ue]<=127?(K+=decodeUtf8Char(ne)+String.fromCharCode(G[ue]),ne=""):ne+="%"+G[ue].toString(16);return Buffer.from(K+decodeUtf8Char(ne))}(he),[4,(0,be.scrypt)(Buffer.from(K,"utf8"),_e,16384,8,1,32)];case 2:if(Ee=pe.sent(),Pe=new Te.ModeOfOperation.ecb(Ee),ue=Buffer.concat([Buffer.from(Pe.decrypt(he.slice(0,16))),Buffer.from(Pe.decrypt(he.slice(16,32)))]),ye.length>0&&ye!==(0,me.sha256)((0,me.sha256)(ue)).slice(0,8).toString("hex"))throw new Error("Failed to decrypt input - possibly invalid passphrase");return[3,4];case 3:throw new Error("Unsupported or invalid entropy type");case 4:return[2,new ve.default(ue)]}}))}))}function fromQuorumWallet(G,K){if(G.length<10)throw new Error("Passphrase must be at least 10 characters");if(K.length<10)throw new Error("User id must be at least 10 characters");var ne=G+K,ue=ye.pbkdf2Sync(ne,ne,2e3,32,"sha256");return new ve.default(ue)}Xg.fromEtherWallet=fromEtherWallet,Xg.fromEtherCamp=fromEtherCamp,Xg.fromKryptoKit=fromKryptoKit,Xg.fromQuorumWallet=fromQuorumWallet;var Pe={fromEtherWallet:fromEtherWallet,fromEtherCamp:fromEtherCamp,fromKryptoKit:fromKryptoKit,fromQuorumWallet:fromQuorumWallet};return Xg.default=Pe,Xg}var rv=new Uint8Array(16);function rng(){if(!ev&&!(ev="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ev(rv)}var nv=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(G){return"string"==typeof G&&nv.test(G)}for(var av,iv,sv=[],ov=0;ov<256;++ov)sv.push((ov+256).toString(16).substr(1));function stringify$1(G){var K=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,ne=(sv[G[K+0]]+sv[G[K+1]]+sv[G[K+2]]+sv[G[K+3]]+"-"+sv[G[K+4]]+sv[G[K+5]]+"-"+sv[G[K+6]]+sv[G[K+7]]+"-"+sv[G[K+8]]+sv[G[K+9]]+"-"+sv[G[K+10]]+sv[G[K+11]]+sv[G[K+12]]+sv[G[K+13]]+sv[G[K+14]]+sv[G[K+15]]).toLowerCase();if(!validate(ne))throw TypeError("Stringified UUID is invalid");return ne}var cv=0,dv=0;function parse(G){if(!validate(G))throw TypeError("Invalid UUID");var K,ne=new Uint8Array(16);return ne[0]=(K=parseInt(G.slice(0,8),16))>>>24,ne[1]=K>>>16&255,ne[2]=K>>>8&255,ne[3]=255&K,ne[4]=(K=parseInt(G.slice(9,13),16))>>>8,ne[5]=255&K,ne[6]=(K=parseInt(G.slice(14,18),16))>>>8,ne[7]=255&K,ne[8]=(K=parseInt(G.slice(19,23),16))>>>8,ne[9]=255&K,ne[10]=(K=parseInt(G.slice(24,36),16))/1099511627776&255,ne[11]=K/4294967296&255,ne[12]=K>>>24&255,ne[13]=K>>>16&255,ne[14]=K>>>8&255,ne[15]=255&K,ne}function v35(G,K,ne){function generateUUID(G,ue,pe,he){if("string"==typeof G&&(G=function stringToBytes(G){G=unescape(encodeURIComponent(G));for(var K=[],ne=0;ne<G.length;++ne)K.push(G.charCodeAt(ne));return K}(G)),"string"==typeof ue&&(ue=parse(ue)),16!==ue.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var ye=new Uint8Array(16+G.length);if(ye.set(ue),ye.set(G,ue.length),(ye=ne(ye))[6]=15&ye[6]|K,ye[8]=63&ye[8]|128,pe){he=he||0;for(var me=0;me<16;++me)pe[he+me]=ye[me];return pe}return stringify$1(ye)}try{generateUUID.name=G}catch(G){}return generateUUID.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",generateUUID.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",generateUUID}function getOutputLength(G){return 14+(G+64>>>9<<4)+1}function safeAdd(G,K){var ne=(65535&G)+(65535&K);return(G>>16)+(K>>16)+(ne>>16)<<16|65535&ne}function md5cmn(G,K,ne,ue,pe,he){return safeAdd(function bitRotateLeft(G,K){return G<<K|G>>>32-K}(safeAdd(safeAdd(K,G),safeAdd(ue,he)),pe),ne)}function md5ff(G,K,ne,ue,pe,he,ye){return md5cmn(K&ne|~K&ue,G,K,pe,he,ye)}function md5gg(G,K,ne,ue,pe,he,ye){return md5cmn(K&ue|ne&~ue,G,K,pe,he,ye)}function md5hh(G,K,ne,ue,pe,he,ye){return md5cmn(K^ne^ue,G,K,pe,he,ye)}function md5ii(G,K,ne,ue,pe,he,ye){return md5cmn(ne^(K|~ue),G,K,pe,he,ye)}var uv=v35("v3",48,(function md5$1(G){if("string"==typeof G){var K=unescape(encodeURIComponent(G));G=new Uint8Array(K.length);for(var ne=0;ne<K.length;++ne)G[ne]=K.charCodeAt(ne)}return function md5ToHexEncodedArray(G){for(var K=[],ne=32*G.length,ue="0123456789abcdef",pe=0;pe<ne;pe+=8){var he=G[pe>>5]>>>pe%32&255,ye=parseInt(ue.charAt(he>>>4&15)+ue.charAt(15&he),16);K.push(ye)}return K}(function wordsToMd5(G,K){G[K>>5]|=128<<K%32,G[getOutputLength(K)-1]=K;for(var ne=1732584193,ue=-271733879,pe=-1732584194,he=271733878,ye=0;ye<G.length;ye+=16){var me=ne,be=ue,ve=pe,_e=he;ne=md5ff(ne,ue,pe,he,G[ye],7,-680876936),he=md5ff(he,ne,ue,pe,G[ye+1],12,-389564586),pe=md5ff(pe,he,ne,ue,G[ye+2],17,606105819),ue=md5ff(ue,pe,he,ne,G[ye+3],22,-1044525330),ne=md5ff(ne,ue,pe,he,G[ye+4],7,-176418897),he=md5ff(he,ne,ue,pe,G[ye+5],12,1200080426),pe=md5ff(pe,he,ne,ue,G[ye+6],17,-1473231341),ue=md5ff(ue,pe,he,ne,G[ye+7],22,-45705983),ne=md5ff(ne,ue,pe,he,G[ye+8],7,1770035416),he=md5ff(he,ne,ue,pe,G[ye+9],12,-1958414417),pe=md5ff(pe,he,ne,ue,G[ye+10],17,-42063),ue=md5ff(ue,pe,he,ne,G[ye+11],22,-1990404162),ne=md5ff(ne,ue,pe,he,G[ye+12],7,1804603682),he=md5ff(he,ne,ue,pe,G[ye+13],12,-40341101),pe=md5ff(pe,he,ne,ue,G[ye+14],17,-1502002290),ne=md5gg(ne,ue=md5ff(ue,pe,he,ne,G[ye+15],22,1236535329),pe,he,G[ye+1],5,-165796510),he=md5gg(he,ne,ue,pe,G[ye+6],9,-1069501632),pe=md5gg(pe,he,ne,ue,G[ye+11],14,643717713),ue=md5gg(ue,pe,he,ne,G[ye],20,-373897302),ne=md5gg(ne,ue,pe,he,G[ye+5],5,-701558691),he=md5gg(he,ne,ue,pe,G[ye+10],9,38016083),pe=md5gg(pe,he,ne,ue,G[ye+15],14,-660478335),ue=md5gg(ue,pe,he,ne,G[ye+4],20,-405537848),ne=md5gg(ne,ue,pe,he,G[ye+9],5,568446438),he=md5gg(he,ne,ue,pe,G[ye+14],9,-1019803690),pe=md5gg(pe,he,ne,ue,G[ye+3],14,-187363961),ue=md5gg(ue,pe,he,ne,G[ye+8],20,1163531501),ne=md5gg(ne,ue,pe,he,G[ye+13],5,-1444681467),he=md5gg(he,ne,ue,pe,G[ye+2],9,-51403784),pe=md5gg(pe,he,ne,ue,G[ye+7],14,1735328473),ne=md5hh(ne,ue=md5gg(ue,pe,he,ne,G[ye+12],20,-1926607734),pe,he,G[ye+5],4,-378558),he=md5hh(he,ne,ue,pe,G[ye+8],11,-2022574463),pe=md5hh(pe,he,ne,ue,G[ye+11],16,1839030562),ue=md5hh(ue,pe,he,ne,G[ye+14],23,-35309556),ne=md5hh(ne,ue,pe,he,G[ye+1],4,-1530992060),he=md5hh(he,ne,ue,pe,G[ye+4],11,1272893353),pe=md5hh(pe,he,ne,ue,G[ye+7],16,-155497632),ue=md5hh(ue,pe,he,ne,G[ye+10],23,-1094730640),ne=md5hh(ne,ue,pe,he,G[ye+13],4,681279174),he=md5hh(he,ne,ue,pe,G[ye],11,-358537222),pe=md5hh(pe,he,ne,ue,G[ye+3],16,-722521979),ue=md5hh(ue,pe,he,ne,G[ye+6],23,76029189),ne=md5hh(ne,ue,pe,he,G[ye+9],4,-640364487),he=md5hh(he,ne,ue,pe,G[ye+12],11,-421815835),pe=md5hh(pe,he,ne,ue,G[ye+15],16,530742520),ne=md5ii(ne,ue=md5hh(ue,pe,he,ne,G[ye+2],23,-995338651),pe,he,G[ye],6,-198630844),he=md5ii(he,ne,ue,pe,G[ye+7],10,1126891415),pe=md5ii(pe,he,ne,ue,G[ye+14],15,-1416354905),ue=md5ii(ue,pe,he,ne,G[ye+5],21,-57434055),ne=md5ii(ne,ue,pe,he,G[ye+12],6,1700485571),he=md5ii(he,ne,ue,pe,G[ye+3],10,-1894986606),pe=md5ii(pe,he,ne,ue,G[ye+10],15,-1051523),ue=md5ii(ue,pe,he,ne,G[ye+1],21,-2054922799),ne=md5ii(ne,ue,pe,he,G[ye+8],6,1873313359),he=md5ii(he,ne,ue,pe,G[ye+15],10,-30611744),pe=md5ii(pe,he,ne,ue,G[ye+6],15,-1560198380),ue=md5ii(ue,pe,he,ne,G[ye+13],21,1309151649),ne=md5ii(ne,ue,pe,he,G[ye+4],6,-145523070),he=md5ii(he,ne,ue,pe,G[ye+11],10,-1120210379),pe=md5ii(pe,he,ne,ue,G[ye+2],15,718787259),ue=md5ii(ue,pe,he,ne,G[ye+9],21,-343485551),ne=safeAdd(ne,me),ue=safeAdd(ue,be),pe=safeAdd(pe,ve),he=safeAdd(he,_e)}return[ne,ue,pe,he]}(function bytesToWords(G){if(0===G.length)return[];for(var K=8*G.length,ne=new Uint32Array(getOutputLength(K)),ue=0;ue<K;ue+=8)ne[ue>>5]|=(255&G[ue/8])<<ue%32;return ne}(G),8*G.length))}));function v4(G,K,ne){var ue=(G=G||{}).random||(G.rng||rng)();if(ue[6]=15&ue[6]|64,ue[8]=63&ue[8]|128,K){ne=ne||0;for(var pe=0;pe<16;++pe)K[ne+pe]=ue[pe];return K}return stringify$1(ue)}function f$4(G,K,ne,ue){switch(G){case 0:return K&ne^~K&ue;case 1:case 3:return K^ne^ue;case 2:return K&ne^K&ue^ne&ue}}function ROTL(G,K){return G<<K|G>>>32-K}var fv=v35("v5",80,(function sha1$1(G){var K=[1518500249,1859775393,2400959708,3395469782],ne=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof G){var ue=unescape(encodeURIComponent(G));G=[];for(var pe=0;pe<ue.length;++pe)G.push(ue.charCodeAt(pe))}else Array.isArray(G)||(G=Array.prototype.slice.call(G));G.push(128);for(var he=G.length/4+2,ye=Math.ceil(he/16),me=new Array(ye),be=0;be<ye;++be){for(var ve=new Uint32Array(16),_e=0;_e<16;++_e)ve[_e]=G[64*be+4*_e]<<24|G[64*be+4*_e+1]<<16|G[64*be+4*_e+2]<<8|G[64*be+4*_e+3];me[be]=ve}me[ye-1][14]=8*(G.length-1)/Math.pow(2,32),me[ye-1][14]=Math.floor(me[ye-1][14]),me[ye-1][15]=8*(G.length-1)&4294967295;for(var Te=0;Te<ye;++Te){for(var Ee=new Uint32Array(80),Pe=0;Pe<16;++Pe)Ee[Pe]=me[Te][Pe];for(var Se=16;Se<80;++Se)Ee[Se]=ROTL(Ee[Se-3]^Ee[Se-8]^Ee[Se-14]^Ee[Se-16],1);for(var Ce=ne[0],ke=ne[1],Oe=ne[2],xe=ne[3],Ne=ne[4],Me=0;Me<80;++Me){var Be=Math.floor(Me/20),Fe=ROTL(Ce,5)+f$4(Be,ke,Oe,xe)+Ne+K[Be]+Ee[Me]>>>0;Ne=xe,xe=Oe,Oe=ROTL(ke,30)>>>0,ke=Ce,Ce=Fe}ne[0]=ne[0]+Ce>>>0,ne[1]=ne[1]+ke>>>0,ne[2]=ne[2]+Oe>>>0,ne[3]=ne[3]+xe>>>0,ne[4]=ne[4]+Ne>>>0}return[ne[0]>>24&255,ne[0]>>16&255,ne[0]>>8&255,255&ne[0],ne[1]>>24&255,ne[1]>>16&255,ne[1]>>8&255,255&ne[1],ne[2]>>24&255,ne[2]>>16&255,ne[2]>>8&255,255&ne[2],ne[3]>>24&255,ne[3]>>16&255,ne[3]>>8&255,255&ne[3],ne[4]>>24&255,ne[4]>>16&255,ne[4]>>8&255,255&ne[4]]}));var lv,pv=Object.freeze({__proto__:null,NIL:"00000000-0000-0000-0000-000000000000",parse:parse,stringify:stringify$1,v1:function v1$1(G,K,ne){var ue=K&&ne||0,pe=K||new Array(16),he=(G=G||{}).node||av,ye=void 0!==G.clockseq?G.clockseq:iv;if(null==he||null==ye){var me=G.random||(G.rng||rng)();null==he&&(he=av=[1|me[0],me[1],me[2],me[3],me[4],me[5]]),null==ye&&(ye=iv=16383&(me[6]<<8|me[7]))}var be=void 0!==G.msecs?G.msecs:Date.now(),ve=void 0!==G.nsecs?G.nsecs:dv+1,_e=be-cv+(ve-dv)/1e4;if(_e<0&&void 0===G.clockseq&&(ye=ye+1&16383),(_e<0||be>cv)&&void 0===G.nsecs&&(ve=0),ve>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");cv=be,dv=ve,iv=ye;var Te=(1e4*(268435455&(be+=122192928e5))+ve)%4294967296;pe[ue++]=Te>>>24&255,pe[ue++]=Te>>>16&255,pe[ue++]=Te>>>8&255,pe[ue++]=255&Te;var Ee=be/4294967296*1e4&268435455;pe[ue++]=Ee>>>8&255,pe[ue++]=255&Ee,pe[ue++]=Ee>>>24&15|16,pe[ue++]=Ee>>>16&255,pe[ue++]=ye>>>8|128,pe[ue++]=255&ye;for(var Pe=0;Pe<6;++Pe)pe[ue+Pe]=he[Pe];return K||stringify$1(pe)},v3:uv,v4:v4,v5:fv,validate:validate,version:function version$d(G){if(!validate(G))throw TypeError("Invalid UUID");return parseInt(G.substr(14,1),16)}}),hv=getAugmentedNamespace$1(pv);function requireDist_browser(){return lv||(lv=1,function(G){var K=pn&&pn.__assign||function(){return K=Object.assign||function(G){for(var K,ne=1,ue=arguments.length;ne<ue;ne++)for(var pe in K=arguments[ne])Object.prototype.hasOwnProperty.call(K,pe)&&(G[pe]=K[pe]);return G},K.apply(this,arguments)},ne=pn&&pn.__createBinding||(Object.create?function(G,K,ne,ue){void 0===ue&&(ue=ne),Object.defineProperty(G,ue,{enumerable:!0,get:function(){return K[ne]}})}:function(G,K,ne,ue){void 0===ue&&(ue=ne),G[ue]=K[ne]}),ue=pn&&pn.__setModuleDefault||(Object.create?function(G,K){Object.defineProperty(G,"default",{enumerable:!0,value:K})}:function(G,K){G.default=K}),pe=pn&&pn.__importStar||function(G){if(G&&G.__esModule)return G;var K={};if(null!=G)for(var pe in G)"default"!==pe&&Object.prototype.hasOwnProperty.call(G,pe)&&ne(K,G,pe);return ue(K,G),K},he=pn&&pn.__awaiter||function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))},ye=pn&&pn.__generator||function(G,K){var ne,ue,pe,he,ye={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return he={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(he[Symbol.iterator]=function(){return this}),he;function verb(he){return function(me){return function step(he){if(ne)throw new TypeError("Generator is already executing.");for(;ye;)try{if(ne=1,ue&&(pe=2&he[0]?ue.return:he[0]?ue.throw||((pe=ue.return)&&pe.call(ue),0):ue.next)&&!(pe=pe.call(ue,he[1])).done)return pe;switch(ue=0,pe&&(he=[2&he[0],pe.value]),he[0]){case 0:case 1:pe=he;break;case 4:return ye.label++,{value:he[1],done:!1};case 5:ye.label++,ue=he[1],he=[0];continue;case 7:he=ye.ops.pop(),ye.trys.pop();continue;default:if(!(pe=ye.trys,(pe=pe.length>0&&pe[pe.length-1])||6!==he[0]&&2!==he[0])){ye=0;continue}if(3===he[0]&&(!pe||he[1]>pe[0]&&he[1]<pe[3])){ye.label=he[1];break}if(6===he[0]&&ye.label<pe[1]){ye.label=pe[1],pe=he;break}if(pe&&ye.label<pe[2]){ye.label=pe[2],ye.ops.push(he);break}pe[2]&&ye.ops.pop(),ye.trys.pop();continue}he=K.call(G,ye)}catch(G){he=[6,G],ue=0}finally{ne=pe=0}if(5&he[0])throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}([he,me])}}},me=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(G,"__esModule",{value:!0}),G.thirdparty=G.hdkey=void 0;var be=pe(bf),ve=Ol,_e=Tu,Te=function requireHdkey(){if(Kg)return ng;Kg=1;var G=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(ng,"__esModule",{value:!0});var K=G(requireDist_browser()),ne=ag,ue=function(){function EthereumHDKey(G){this._hdkey=G}return EthereumHDKey.fromMasterSeed=function(G){return new EthereumHDKey(ne.HDKey.fromMasterSeed(G))},EthereumHDKey.fromExtendedKey=function(G){return new EthereumHDKey(ne.HDKey.fromExtendedKey(G))},EthereumHDKey.prototype.privateExtendedKey=function(){if(!this._hdkey.privateExtendedKey)throw new Error("This is a public key only wallet");return this._hdkey.privateExtendedKey},EthereumHDKey.prototype.publicExtendedKey=function(){return this._hdkey.publicExtendedKey},EthereumHDKey.prototype.derivePath=function(G){return new EthereumHDKey(this._hdkey.derive(G))},EthereumHDKey.prototype.deriveChild=function(G){return new EthereumHDKey(this._hdkey.deriveChild(G))},EthereumHDKey.prototype.getWallet=function(){return this._hdkey._privateKey?K.default.fromPrivateKey(this._hdkey._privateKey):K.default.fromPublicKey(this._hdkey._publicKey,!0)},EthereumHDKey}();return ng.default=ue,ng}();Object.defineProperty(G,"hdkey",{enumerable:!0,get:function(){return me(Te).default}});var Ee=requireThirdparty();Object.defineProperty(G,"thirdparty",{enumerable:!0,get:function(){return me(Ee).default}});var Pe=ug,Se=oy,Ce=hv.v4;function validateHexString(G,K,ne){if(K.toLowerCase().startsWith("0x")&&(K=K.slice(2)),!K&&!ne)return K;if(ne%2)throw new Error("Invalid length argument, must be an even number");if("number"==typeof ne&&K.length!==ne)throw new Error("Invalid "+G+", string must be "+ne+" hex characters");if(!/^([0-9a-f]{2})+$/i.test(K))throw new Error("Invalid "+G+", string must be "+("number"==typeof ne?ne:"empty or a non-zero even number of")+" hex characters");return K}function validateBuffer(G,K,ne){if(!Buffer.isBuffer(K))throw new Error("Invalid "+G+", must be a string ("+("number"==typeof ne?""+2*ne:"empty or a non-zero even number of")+" hex characters) or buffer"+("number"==typeof ne?" ("+ne+" bytes)":""));if("number"==typeof ne&&K.length!==ne)throw new Error("Invalid "+G+", buffer must be "+ne+" bytes");return K}var ke=function(){function Wallet(G,K){if(void 0===K&&(K=void 0),this.privateKey=G,this.publicKey=K,G&&K)throw new Error("Cannot supply both a private and a public key to the constructor");if(G&&!(0,ve.isValidPrivate)(G))throw new Error("Private key does not satisfy the curve requirements (ie. it is invalid)");if(K&&!(0,ve.isValidPublic)(K))throw new Error("Invalid public key")}return Wallet.generate=function(G){if(void 0===G&&(G=!1),!G)return new Wallet(Se(32));for(var K=new ve.BN("088f924eeceeda7fe92e1f5b0fffffffffffffff",16);;){var ne=Se(32);if(new ve.BN((0,ve.privateToAddress)(ne)).lte(K))return new Wallet(ne)}},Wallet.generateVanityAddress=function(G){for(G instanceof RegExp||(G=new RegExp(G));;){var K=Se(32),ne=(0,ve.privateToAddress)(K);if(G.test(ne.toString("hex")))return new Wallet(K)}},Wallet.fromPublicKey=function(G,K){return void 0===K&&(K=!1),K&&(G=(0,ve.importPublic)(G)),new Wallet(void 0,G)},Wallet.fromExtendedPublicKey=function(G){if("xpub"!==G.slice(0,4))throw new Error("Not an extended public key");var K=Pe.decode(G).slice(45);return Wallet.fromPublicKey(K,!0)},Wallet.fromPrivateKey=function(G){return new Wallet(G)},Wallet.fromExtendedPrivateKey=function(G){if("xprv"!==G.slice(0,4))throw new Error("Not an extended private key");var K=Pe.decode(G);if(0!==K[45])throw new Error("Invalid extended private key");return Wallet.fromPrivateKey(K.slice(46))},Wallet.fromV1=function(G,K){return he(this,void 0,void 0,(function(){var ne,ue,pe,he,me;return ye(this,(function(ye){switch(ye.label){case 0:if("1"!==(ne="object"==typeof G?G:JSON.parse(G)).Version)throw new Error("Not a V1 Wallet");if("scrypt"!==ne.Crypto.KeyHeader.Kdf)throw new Error("Unsupported key derivation scheme");return ue=ne.Crypto.KeyHeader.KdfParams,[4,(0,_e.scrypt)(Buffer.from(K),Buffer.from(ne.Crypto.Salt,"hex"),ue.N,ue.R,ue.P,ue.DkLen)];case 1:if(pe=ye.sent(),he=Buffer.from(ne.Crypto.CipherText,"hex"),(0,ve.keccak256)(Buffer.concat([pe.slice(16,32),he])).toString("hex")!==ne.Crypto.MAC)throw new Error("Key derivation failed - possibly wrong passphrase");return me=be.createDecipheriv("aes-128-cbc",(0,ve.keccak256)(pe.slice(0,16)).slice(0,16),Buffer.from(ne.Crypto.IV,"hex")),[2,new Wallet(runCipherBuffer(me,he))]}}))}))},Wallet.fromV3=function(G,K,ne){return void 0===ne&&(ne=!1),he(this,void 0,void 0,(function(){var ue,pe,he,me,Te;return ye(this,(function(ye){switch(ye.label){case 0:if(3!==(ue="object"==typeof G?G:JSON.parse(ne?G.toLowerCase():G)).version)throw new Error("Not a V3 wallet");return"scrypt"!==ue.crypto.kdf?[3,2]:(he=ue.crypto.kdfparams,[4,(0,_e.scrypt)(Buffer.from(K),Buffer.from(he.salt,"hex"),he.n,he.r,he.p,he.dklen)]);case 1:return pe=ye.sent(),[3,3];case 2:if("pbkdf2"!==ue.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(he=ue.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");pe=be.pbkdf2Sync(Buffer.from(K),Buffer.from(he.salt,"hex"),he.c,he.dklen,"sha256"),ye.label=3;case 3:if(me=Buffer.from(ue.crypto.ciphertext,"hex"),(0,ve.keccak256)(Buffer.concat([Buffer.from(pe.slice(16,32)),me])).toString("hex")!==ue.crypto.mac)throw new Error("Key derivation failed - possibly wrong passphrase");return Te=be.createDecipheriv(ue.crypto.cipher,pe.slice(0,16),Buffer.from(ue.crypto.cipherparams.iv,"hex")),[2,new Wallet(runCipherBuffer(Te,me))]}}))}))},Wallet.fromEthSale=function(G,K){var ne="object"==typeof G?G:JSON.parse(G),ue=Buffer.from(ne.encseed,"hex"),pe=be.pbkdf2Sync(K,K,2e3,32,"sha256").slice(0,16),he=runCipherBuffer(be.createDecipheriv("aes-128-cbc",pe,ue.slice(0,16)),ue.slice(16)),ye=new Wallet((0,ve.keccak256)(he));if(ye.getAddress().toString("hex")!==ne.ethaddr)throw new Error("Decoded key mismatch - possibly wrong passphrase");return ye},Object.defineProperty(Wallet.prototype,"pubKey",{get:function(){return keyExists(this.publicKey)||(this.publicKey=(0,ve.privateToPublic)(this.privateKey)),this.publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(Wallet.prototype,"privKey",{get:function(){if(!keyExists(this.privateKey))throw new Error("This is a public key only wallet");return this.privateKey},enumerable:!1,configurable:!0}),Wallet.prototype.getPrivateKey=function(){return this.privKey},Wallet.prototype.getPrivateKeyString=function(){return(0,ve.bufferToHex)(this.privKey)},Wallet.prototype.getPublicKey=function(){return this.pubKey},Wallet.prototype.getPublicKeyString=function(){return(0,ve.bufferToHex)(this.getPublicKey())},Wallet.prototype.getAddress=function(){return(0,ve.publicToAddress)(this.pubKey)},Wallet.prototype.getAddressString=function(){return(0,ve.bufferToHex)(this.getAddress())},Wallet.prototype.getChecksumAddressString=function(){return(0,ve.toChecksumAddress)(this.getAddressString())},Wallet.prototype.toV3=function(G,ne){return he(this,void 0,void 0,(function(){var ue,pe,he,me,Te,Ee;return ye(this,(function(ye){switch(ye.label){case 0:if(!keyExists(this.privateKey))throw new Error("This is a public key only wallet");switch(ue=function mergeToV3ParamsWithDefaults(G){var ne={cipher:"aes-128-ctr",kdf:"scrypt",salt:Se(32),iv:Se(16),uuid:Se(16),dklen:32,c:262144,n:262144,r:8,p:1};return G?("string"==typeof G.salt&&(G.salt=Buffer.from(validateHexString("salt",G.salt),"hex")),"string"==typeof G.iv&&(G.iv=Buffer.from(validateHexString("iv",G.iv,32),"hex")),"string"==typeof G.uuid&&(G.uuid=Buffer.from(validateHexString("uuid",G.uuid,32),"hex")),G.salt&&validateBuffer("salt",G.salt),G.iv&&validateBuffer("iv",G.iv,16),G.uuid&&validateBuffer("uuid",G.uuid,16),K(K({},ne),G)):ne}(ne),ue.kdf){case"pbkdf2":return[3,1];case"scrypt":return[3,2]}return[3,4];case 1:return pe=function kdfParamsForPBKDF(G){return{dklen:G.dklen,salt:G.salt,c:G.c,prf:"hmac-sha256"}}(ue),he=be.pbkdf2Sync(Buffer.from(G),pe.salt,pe.c,pe.dklen,"sha256"),[3,5];case 2:return pe=function kdfParamsForScrypt(G){return{dklen:G.dklen,salt:G.salt,n:G.n,r:G.r,p:G.p}}(ue),[4,(0,_e.scrypt)(Buffer.from(G),pe.salt,pe.n,pe.r,pe.p,pe.dklen)];case 3:return he=ye.sent(),[3,5];case 4:throw new Error("Unsupported kdf");case 5:if(!(me=be.createCipheriv(ue.cipher,he.slice(0,16),ue.iv)))throw new Error("Unsupported cipher");return Te=runCipherBuffer(me,this.privKey),Ee=(0,ve.keccak256)(Buffer.concat([Buffer.from(he.slice(16,32)),Buffer.from(Te)])),[2,{version:3,id:Ce({random:ue.uuid}),address:this.getAddress().toString("hex"),crypto:{ciphertext:Te.toString("hex"),cipherparams:{iv:ue.iv.toString("hex")},cipher:ue.cipher,kdf:ue.kdf,kdfparams:K(K({},pe),{salt:pe.salt.toString("hex")}),mac:Ee.toString("hex")}}]}}))}))},Wallet.prototype.getV3Filename=function(G){return["UTC--",(G?new Date(G):new Date).toJSON().replace(/:/g,"-"),"--",this.getAddress().toString("hex")].join("")},Wallet.prototype.toV3String=function(G,K){return he(this,void 0,void 0,(function(){var ne,ue;return ye(this,(function(pe){switch(pe.label){case 0:return ue=(ne=JSON).stringify,[4,this.toV3(G,K)];case 1:return[2,ue.apply(ne,[pe.sent()])]}}))}))},Wallet}();function runCipherBuffer(G,K){return Buffer.concat([G.update(K),G.final()])}function keyExists(G){return null!=G}G.default=ke}(kl)),kl}var yv=requireDist_browser();class ApiConfiguration extends wa.Configuration{}const mv={"x-sdk-version":"ts-immutable-sdk-1.78.11"},createConfig=({coreContractAddress:G,registrationContractAddress:K,registrationV4ContractAddress:ne,chainID:ue,basePath:pe,headers:he,sdkVersion:ye,baseConfig:me})=>{if(!pe.trim())throw Error("basePath can not be empty");ye&&(mv["x-sdk-version"]=ye),he={...he||{},...addKeysToHeadersOverride(me,{headers:he})?.headers||{},...mv};return{apiConfiguration:new ApiConfiguration({basePath:pe,baseOptions:{headers:he}}),ethConfiguration:{coreContractAddress:G,registrationContractAddress:K,registrationV4ContractAddress:ne,chainID:ue}}},createImmutableXConfiguration=({basePath:G,chainID:K,coreContractAddress:ne,registrationContractAddress:ue,registrationV4ContractAddress:pe,baseConfig:he})=>createConfig({basePath:G,chainID:K,coreContractAddress:ne,registrationContractAddress:ue,registrationV4ContractAddress:pe,sdkVersion:"ts-immutable-sdk-1.78.11",baseConfig:he}),production=({baseConfig:G})=>createImmutableXConfiguration({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c",registrationV4ContractAddress:"0xac88a57943b5BBa1ecd931F8494cAd0B7F717590",baseConfig:G}),sandbox=({baseConfig:G})=>createImmutableXConfiguration({basePath:"https://api.sandbox.x.immutable.com",chainID:11155111,coreContractAddress:"0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98",registrationContractAddress:"0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97",registrationV4ContractAddress:"0xd1527c65c6287ec5ab816d328eb83bb4cb690e92",baseConfig:G});class ImxConfiguration{immutableXConfig;baseConfig;constructor({baseConfig:G,overrides:K}){if(this.baseConfig=G,K)this.immutableXConfig=K.immutableXConfig;else switch(G.environment){case Jn.SANDBOX:this.immutableXConfig=sandbox({baseConfig:G});break;case Jn.PRODUCTION:this.immutableXConfig=production({baseConfig:G});break;default:this.immutableXConfig=sandbox({baseConfig:G})}}}class IMXError extends Error{code;details;constructor({code:G,details:K,message:ne}){super(ne),this.code=G,this.details=K}}function formatError(G){if(er.isAxiosError(G)&&G.response){const K=G.response.data;return K.code&&K.message?new IMXError({code:K.code,details:K.details,message:K.message}):new IMXError({code:G.code??G.response?.status.toString()??"unknown_error_code",message:String(G)})}return new IMXError({code:"unknown_error_code",message:String(G)})}function convertToSignableToken$1(G){switch(G.type){case"ERC721":return{type:"ERC721",data:{token_id:G.tokenId,token_address:G.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:G.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}const bv=[["49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804","3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a"],["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"],["234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b","3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615"],["3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476","7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19"],["40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c","109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740"],["2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b","6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26"],["6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674","606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2"],["7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62","a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae"],["3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec","45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9"],["1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e","30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a"],["6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26","31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2"],["54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4","c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5"],["35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6","5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d"],["4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23","5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820"],["648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf","72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c"],["bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b","6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6"],["35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357","3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14"],["36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643","7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c"],["5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661","9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753"],["21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6","51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c"],["19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9","515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa"],["888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24","730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea"],["75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977","4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8"],["640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5","3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c"],["6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96","7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645"],["5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876","518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200"],["6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4","2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc"],["542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18","5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c"],["299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de","1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958"],["628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73","ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d"],["6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933","6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db"],["28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a","7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba"],["619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02","2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308"],["641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96","6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837"],["58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2","124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9"],["a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74","1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8"],["744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b","7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f"],["434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c","7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39"],["7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73","56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431"],["4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7","ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e"],["250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe","1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04"],["2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2","55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63"],["249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245","7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e"],["6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb","640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8"],["2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9","636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be"],["4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea","1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff"],["46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca","1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f"],["2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152","1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7"],["386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b","2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5"],["407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90","436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f"],["1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f","69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec"],["7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e","34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69"],["299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913","b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675"],["551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5","5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e"],["7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2","3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6"],["28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504","7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b"],["1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b","4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4"],["2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b","9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911"],["770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed","42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd"],["5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9","3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d"],["6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825","1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177"],["404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1","3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb"],["20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc","106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7"],["119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa","1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773"],["45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749","ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965"],["1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38","593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f"],["186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3","55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c"],["58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9","6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0"],["13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b","3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4"],["48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676","4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1"],["4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158","620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef"],["4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b","4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8"],["7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9","2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de"],["65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f","3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6"],["1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d","21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a"],["3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b","5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f"],["4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4","5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b"],["6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8","e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9"],["748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5","3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93"],["7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3","5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4"],["6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f","32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039"],["1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309","56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4"],["1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd","431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c"],["6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162","14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3"],["738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e","33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47"],["2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8","92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc"],["181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe","5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff"],["1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a","4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f"],["e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873","34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f"],["4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45","3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af"],["37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed","37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6"],["27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c","6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d"],["2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf","306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413"],["307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72","3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995"],["79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc","40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2"],["4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292","7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717"],["645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2","15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab"],["1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f","583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c"],["66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca","505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4"],["5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1","bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323"],["a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194","4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689"],["1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c","7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf"],["48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f","781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3"],["17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd","6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223"],["5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89","1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff"],["6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58","436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e"],["7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6","484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4"],["17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d","7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f"],["7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf","33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78"],["7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d","6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb"],["273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128","653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f"],["3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212","65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e"],["5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee","3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22"],["7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9","71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e"],["40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62","499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42"],["6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465","35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37"],["604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6","68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457"],["73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4","4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb"],["3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1","677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0"],["39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f","20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952"],["326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c","7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1"],["53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632","2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1"],["6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e","beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63"],["3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332","529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7"],["3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e","3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740"],["7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a","68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400"],["1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb","5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9"],["3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344","52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590"],["44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa","6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940"],["7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e","78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9"],["7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d","4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62"],["7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c","636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84"],["758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2","1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245"],["7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e","229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470"],["78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614","246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675"],["6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647","599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4"],["4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e","1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad"],["3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d","617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c"],["5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287","1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d"],["3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004","7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232"],["3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb","563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6"],["16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52","7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e"],["75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4","35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0"],["3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8","6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd"],["54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579","7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0"],["d1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0","2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45"],["2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d","70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b"],["752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3","3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef"],["63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e","37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e"],["d6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b","5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018"],["12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557","6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613"],["46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c","76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df"],["4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516","5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29"],["71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833","85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346"],["5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61","3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950"],["161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941","78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b"],["1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1","66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d"],["56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44","47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e"],["4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491","430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4"],["7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606","312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295"],["16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe","7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24"],["323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b","4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265"],["624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d","261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430"],["f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d","b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6"],["686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec","7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6"],["3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e","634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af"],["484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b","34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8"],["203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a","2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2"],["2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d","6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6"],["5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef","30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d"],["57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741","7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad"],["611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1","3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4"],["1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31","3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527"],["275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234","2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521"],["6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95","5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e"],["44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c","3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e"],["fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966","110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9"],["9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef","4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51"],["71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7","7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9"],["1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345","4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc"],["3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115","a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24"],["c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d","729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d"],["44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d","212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8"],["35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f","74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62"],["e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03","3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357"],["3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a","5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df"],["222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c","72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42"],["3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764","480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c"],["adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187","60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8"],["3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9","7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996"],["12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32","6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1"],["27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b","c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917"],["431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6","30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197"],["4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33","627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c"],["2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8","1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f"],["e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc","58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9"],["7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5","74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1"],["62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b","1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315"],["1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938","44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b"],["78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea","6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41"],["5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d","1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb"],["62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04","6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f"],["4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f","941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494"],["52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1","987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782"],["1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f","38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b"],["4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232","7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c"],["69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73","a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897"],["b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62","24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915"],["5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb","6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9"],["1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0","23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699"],["2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5","1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862"],["d26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3","34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a"],["91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563","e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a"],["1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7","7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd"],["4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f","47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e"],["3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069","47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc"],["758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657","3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83"],["19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8","5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709"],["28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855","14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2"],["3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f","69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d"],["77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b","7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df"],["97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6","2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223"],["a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647","37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2"],["e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc","1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a"],["2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de","6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591"],["744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f","685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d"],["40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd","2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e"],["5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc","2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2"],["5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985","49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183"],["2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649","61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d"],["ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381","190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60"],["233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c","7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef"],["42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce","12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65"],["30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44","5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a"],["4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a","4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93"],["62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466","5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0"],["5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f","5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94"],["670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728","26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0"],["3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5","56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015"],["4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3","1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e"],["4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0","97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09"],["574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219","49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8"],["7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554","47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba"],["67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6","39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8"],["63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b","60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9"],["3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543","56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628"],["758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129","622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746"],["38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c","145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e"],["206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad","6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8"],["56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d","526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6"],["4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378","3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d"],["450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58","1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7"],["6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d","28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2"],["1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf","fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb"],["4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997","40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c"],["21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef","4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f"],["350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046","5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b"],["529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6","3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491"],["55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d","159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9"],["405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f","4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d"],["376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe","5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba"],["2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38","7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089"],["3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed","5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5"],["7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4","3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe"],["4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d","204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89"],["79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72","3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb"],["297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c","6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993"],["44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7","1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc"],["6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26","64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd"],["14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24","5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1"],["95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83","1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1"],["2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5","5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67"],["61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d","23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795"],["79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf","2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6"],["45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b","2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd"],["37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007","50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c"],["71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b","3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6"],["78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06","5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256"],["b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15","653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83"],["441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc","4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59"],["2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa","4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0"],["3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f","4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c"],["5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092","5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56"],["3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771","459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999"],["5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f","56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49"],["1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281","5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a"],["1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40","6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488"],["61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b","27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad"],["7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e","481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf"],["124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316","33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987"],["61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c","5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb"],["70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d","3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc"],["41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f","7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce"],["62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8","1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771"],["441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a","29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086"],["2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee","11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77"],["5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea","63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc"],["3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7","7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092"],["95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922","159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9"],["621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c","65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd"],["54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e","680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313"],["21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d","7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8"],["3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3","12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801"],["befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392","6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8"],["15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6","30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df"],["38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8","786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13"],["6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72","1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a"],["5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30","1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea"],["309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1","505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851"],["89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc","1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540"],["480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84","511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570"],["3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb","49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920"],["66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd","4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b"],["373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3","5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c"],["26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7","157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc"],["ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f","517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7"],["25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66","10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8"],["243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742","1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f"],["48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562","3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264"],["592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca","48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc"],["31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d","a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5"],["4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc","512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47"],["26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc","75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e"],["3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe","20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d"],["483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97","2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d"],["65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9","562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373"],["284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35","5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02"],["32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85","7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd"],["1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a","478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742"],["270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf","3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b"],["6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d","5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33"],["48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1","2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0"],["e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5","36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997"],["5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8","6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c"],["15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6","69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903"],["274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50","6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656"],["4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123","116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba"],["4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a","2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f"],["5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3","4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b"],["11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483","36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8"],["4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3","e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64"],["2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3","527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d"],["52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf","19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41"],["541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961","78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2"],["5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd","137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc"],["15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4","4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549"],["68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4","7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f"],["67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df","7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01"],["596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334","49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0"],["567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395","6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd"],["cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7","4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7"],["4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06","2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566"],["760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359","1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e"],["6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2","3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd"],["4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b","2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f"],["5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7","76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39"],["2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7","62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e"],["5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00","14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1"],["7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c","bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970"],["37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843","672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb"],["5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114","7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e"],["25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63","3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb"],["32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0","bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459"],["49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f","57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8"],["10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd","8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0"],["79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36","146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c"],["6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439","68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82"],["71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097","54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c"],["27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b","14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3"],["6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c","5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048"],["32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9","518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4"],["4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e","3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4"],["4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10","20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918"],["87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a","112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb"],["6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae","54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1"],["19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a","1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510"],["12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d","4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7"],["13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2","40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1"],["255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d","3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc"],["7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31","4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6"],["2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35","44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf"],["750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b","54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c"],["3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72","7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359"],["4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb","63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235"],["1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f","4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d"],["2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087","2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d"],["4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3","5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621"],["2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05","1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19"],["4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c","33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614"],["7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b","5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722"],["7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51","26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056"],["36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881","33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5"],["403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd","47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5"],["3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb","2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e"],["3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537","f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4"],["235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65","37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5"],["3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b","4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe"],["48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518","73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee"],["48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0","3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903"],["2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097","19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541"],["1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676","36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7"],["2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b","7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b"],["348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a","3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969"],["7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31","42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd"],["2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a","5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83"],["1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2","dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d"],["54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e","16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089"],["525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b","58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea"],["54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd","53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76"],["4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae","2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17"],["21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708","59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c"],["167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66","22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a"],["31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843","1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c"],["1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b","2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b"],["c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0","45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327"],["394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6","1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd"],["410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27","361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa"],["38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734","624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1"],["78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608","19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198"],["6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867","7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb"],["32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602","3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377"],["49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5","1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d"],["2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5","759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96"],["3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70","22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6"],["5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab","715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8"],["19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a","896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5"],["61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc","38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8"],["2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df","1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb"],["7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54","21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b"],["b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed","5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf"],["e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc","550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a"],["7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4","2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f"],["7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c","410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e"],["225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5","411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e"],["1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1","3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8"],["59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335","1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8"],["2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3","62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535"],["6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb","7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f"],["34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88","3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d"],["436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d","67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044"],["592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4","27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5"],["89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009","557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b"],["1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e","72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a"],["574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03","5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3"],["513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1","687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5"],["53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9","35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be"],["213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44","744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89"],["735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c","7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9"],["3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001","79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8"],["51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74","10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad"],["c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc","53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a"],["5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece","39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f"],["3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299","15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975"],["6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0","11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744"],["7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65","3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb"],["2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6","461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d"],["34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f","33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44"],["6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441","6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693"],["17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce","3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7"],["70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27","d18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8"],["2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf","5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1"],["5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1","eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487"],["6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61","911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984"],["74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293","761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92"],["44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9","249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0"],["2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc","6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5"],["3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb","6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb"],["284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677","516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7"],["2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32","7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec"],["5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7","6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece"],["74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f","156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531"],["334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45","221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2"],["7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30","3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86"],["4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8","6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749"],["1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7","3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583"],["294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1","d837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad"],["753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39","6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75"],["5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e","7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8"],["4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f","21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e"],["726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8","15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12"],["38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2","73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b"],["6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291","4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75"],["6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f","26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05"],["2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155","5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244"],["4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7","5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1"],["110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3","7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43"],["5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096","7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2"],["2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d","62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b"],["1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d","309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4"],["2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d","3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf"],["376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543","6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547"],["a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066","6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471"],["223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed","c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa"],["102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2","6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65"],["891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2","5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37"],["215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203","10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266"],["21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36","3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3"],["60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae","e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879"],["1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5","69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3"],["5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e","134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec"],["626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8","7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0"],["23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd","7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf"],["54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202","1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426"],["13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c","62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9"],["47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98","75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb"],["2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585","5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c"]],gv=new Ei("800000000000011000000000000000000000000000000000000000000000001",16),vv=new Ei("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16),wv=new Rl.ec(new Rl.curves.PresetCurve({type:"short",prime:null,p:gv,a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:vv,hash:Ad.sha256,gRed:!1,g:bv[1]}));bv.map((G=>wv.curve.point(new Ei(G[0],16),new Ei(G[1],16))))[0],new Ei("0"),new Ei("1"),new Ei("3"),new Ei("4"),new Ei("1000"),new Ei("1001"),new Ei("1002"),new Ei("1003"),new Ei("0"),new Ei("1"),new Ei("400000",16),new Ei("80000000",16),new Ei("8000000000000000",16),new Ei("800000000000011000000000000000000000000000000000000000000000001",16),new Ei("800000000000000000000000000000000000000000000000000000000000000",16);const _v=new Ei("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16),Tv=new Ei("FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141",16);function getIntFromBits(G,K,ne=void 0){const ue=ys(G).slice(K,ne);return gs(ue)}function hashKeyWithIndex$1(G,K){return new Ei(Ad.sha256().update(hs(_s(G)+vs(bs(K),2))).digest("hex"),16)}function grindKey$1(G){let K=0,ne=hashKeyWithIndex$1(G,K);for(;!ne.lt(Tv.sub(Tv.mod(_v)));)ne=hashKeyWithIndex$1(ne.toString(16),K),K=K++;return ne.mod(_v).toString("hex")}var Av;!function(G){G.StarkCurveInvalidMessageLength="invalid message length"}(Av||(Av={}));class StandardStarkSigner{privateKey;keyPair;constructor(G){this.privateKey=G,this.keyPair=wv.keyFromPrivate(G,"hex")}getAddress(){const G=this.keyPair.getPublic().getX().toString("hex");return As(G)}async signMessage(G){return this.serialize(this.keyPair.sign(this.fixMsgHashLen(G)))}serialize(G){return Ts(ws(G.r.toString("hex"),64)+ws(G.s.toString("hex"),64))}getYCoordinate(){const G=vs(this.keyPair.getPublic().getY().toString(16),2);return Promise.resolve(G)}fixMsgHashLen(G){if(G=_s(G),(G=new Ei(G,"hex").toString("hex")).length<=62)return G;if(63!==G.length)throw new Error(Av.StarkCurveInvalidMessageLength);return`${G}0`}}function createStarkSigner(G){return new StandardStarkSigner(G)}const{curves:Ev,ec:Pv}=Rl,Sv=new Ei("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16);new Pv(new Ev.PresetCurve({type:"short",prime:null,p:"08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001",a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:Sv.toString("hex"),hash:Ad.sha256,gRed:!1,g:["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"]}));const MAX_ALLOWED_VAL=()=>{const G=new Ei("1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",16);return G.sub(G.mod(Sv))};function hashKeyWithIndex(G,K){return new Ei(Ad.sha256().update(hs(_s(G)+vs(bs(K),2))).digest("hex"),16)}async function getKeyFromPath(G,K,ne){const ue=function getPrivateKeyFromPath(G,K){const ne=yv.hdkey.fromMasterSeed(Buffer.from(G.slice(2),"hex")).derivePath(K).getWallet().getPrivateKey();return new Ei(ne)}(G,K),pe=function grindKey(G){const K=MAX_ALLOWED_VAL();let ne=hashKeyWithIndex(G.toString("hex",64),0);for(let G=1;ne.gte(K);G++)ne=hashKeyWithIndex(ne.toString("hex"),G);return ne.umod(Sv).toString("hex")}(ue);if(!function checkIfHashedKeyIsAboveLimit(G){const K=MAX_ALLOWED_VAL();return hashKeyWithIndex(G.toString("hex",64),0).gte(K)}(ue))return pe;const he=await async function getStarkPublicKeyFromImx(G){try{if(G){const K=(await er.get(`https://api.x.immutable.com/v1/users/${G}`)).data;if(K?.accounts&&K.accounts.length>0)return{starkPublicKey:K.accounts[0],accountNotFound:!1}}}catch(G){if(er.isAxiosError(G)&&"account_not_found"===G.response?.data.code)return{starkPublicKey:"",accountNotFound:!0}}}(ne);if(void 0===he)throw new Error("Error fetching stark public key from IMX");if(he.accountNotFound)return pe;const ye=new Ei(_s(he.starkPublicKey),16);let me=await createStarkSigner(pe).getAddress();if(ye.eq(new Ei(_s(me),16)))return pe;const be=function grindKeyV201(G){const K=MAX_ALLOWED_VAL();let ne=hashKeyWithIndex(G.toString("hex",64),0);for(let G=0;ne.gte(K);G++)ne=hashKeyWithIndex(ne.toString("hex"),G);return ne.umod(Sv).toString("hex")}(ue);if(me=await createStarkSigner(be).getAddress(),ye.eq(new Ei(_s(me),16)))return be;const ve=function getPrivateKeyFromPath$1(G,K){return yv.hdkey.fromMasterSeed(Buffer.from(G.slice(2),"hex")).derivePath(K).getWallet().getPrivateKeyString()}(G,K),_e=grindKey$1(ve);if(me=await createStarkSigner(_e).getAddress(),ye.eq(new Ei(_s(me),16)))return _e;throw new Error("Can not deterministically generate stark private key - please contact support")}async function generateLegacyStarkPrivateKey(G){const K=(await G.getAddress()).toLowerCase(),ne=splitSignature(await G.signMessage("Only sign this request if you’ve initiated an action with Immutable X.")).s,ue=function getAccountPath(G,K,ne,ue){const pe=Ad.sha256().update(G).digest("hex"),he=Ad.sha256().update(K).digest("hex");return`m/2645'/${getIntFromBits(pe,-31)}'/${getIntFromBits(he,-31)}'/${getIntFromBits(ne,-31)}'/${getIntFromBits(ne,-62,-31)}'/${ue}`}("starkex","immutablex",K,"1");return(await getKeyFromPath(ne,ue,K)).padStart(64,"0")}function importRecoveryParam$1(G){return G.trim()?-1!==new Ei(G,16).cmp(new Ei(27))?new Ei(G,16).sub(new Ei(27)).toNumber():new Ei(G,16).toNumber():void 0}function deserializeSignature$1(G,K=64){return G=_s(G),{r:new Ei(G.substring(0,K),"hex"),s:new Ei(G.substring(K,2*K),"hex"),recoveryParam:importRecoveryParam$1(G.substring(2*K,2*K+2))}}async function signRaw$1(G,K){return function serializeEthSignature$1(G){return Ts(ws(G.r.toString(16),64)+ws(G.s.toString(16),64)+ws(G.recoveryParam?.toString(16)||"",2))}(deserializeSignature$1(await K.signMessage(G)))}async function generateIMXAuthorisationHeaders(G){const K=Math.floor(Date.now()/1e3).toString();return{timestamp:K,signature:await signRaw$1(K,G)}}function serializePackedSignature(G,K){return As(ws(G.r.toString(16),64)+ws(G.s.toString(16),64,"0")+ws(new Ei(_s(K),"hex").toString(16),64,"0"))}async function signRegisterEthAddress(G,K,ne){const ue=keccak256$2(["string","address","uint256"],["UserRegistration:",K,ne]),pe=new Ei(_s(ue),16).mod(Sv);return serializePackedSignature(deserializeSignature$1(await G.signMessage(pe.toString(16))),As(await G.getYCoordinate()))}class Workflows{config;mintsApi;projectsApi;collectionsApi;metadataApi;metadataRefreshesApi;exchangesApi;isChainValid(G){return G===this.config.ethConfiguration.chainID}constructor(G,K,ne,ue,pe,he,ye){this.config=G,this.config=G,this.collectionsApi=K,this.exchangesApi=ne,this.metadataApi=ue,this.metadataRefreshesApi=pe,this.mintsApi=he,this.projectsApi=ye}async validateChain(G){const K=await G.getChainId();if(!this.isChainValid(K))throw new Error("The wallet used for this operation is not from the correct network.")}async getStarkExContractVersion(){const G={baseURL:`${this.config.apiConfiguration.basePath}/v1`};return er.get("/starkex-contract-version",G)}async mint(G,K){return await this.validateChain(G),async function mintingWorkflow(G,K,ne){const ue=K.users.map((G=>({ether_key:G.user,tokens:G.tokens.map((G=>({id:G.id,blueprint:G.blueprint,...G.royalties&&G.royalties.length>0&&{royalties:G.royalties.map((G=>({recipient:G.recipient,percentage:G.percentage})))}})))}))),{royalties:pe}=K,he={contract_address:K.contract_address,...pe&&pe.length>0&&{royalties:pe.map((G=>({recipient:G.recipient,percentage:G.percentage})))},users:ue,auth_signature:""},ye=keccak256$3(toUtf8Bytes$2(JSON.stringify(he))),me=await signRaw$1(ye,G),be={mintTokensRequestV2:[{users:he.users.map((G=>({user:G.ether_key,tokens:G.tokens}))),...pe&&pe.length>0&&{royalties:pe},contract_address:K.contract_address,auth_signature:me}]};return(await ne.mintTokens(be)).data}(G,K,this.mintsApi)}async exchangeTransfer(G,K){return await this.validateChain(G.ethSigner),async function exchangeTransfersWorkflow({ethSigner:G,starkSigner:K,request:ne,exchangesApi:ue}){const pe=await G.getAddress(),he=ne.amount,ye=await ue.getExchangeSignableTransfer({id:ne.transactionID,getSignableTransferRequest:{sender:pe,token:convertToSignableToken$1(ne),amount:he,receiver:ne.receiver}}),{signable_message:me,payload_hash:be}=ye.data,ve=await signRaw$1(me,G),_e=await K.signMessage(be),Te={sender_stark_key:ye.data.sender_stark_key,sender_vault_id:ye.data.sender_vault_id,receiver_stark_key:ye.data.receiver_stark_key,receiver_vault_id:ye.data.receiver_vault_id,asset_id:ye.data.asset_id,amount:ye.data.amount,nonce:ye.data.nonce,expiration_timestamp:ye.data.expiration_timestamp,stark_signature:_e},Ee=await ue.createExchangeTransfer({id:ne.transactionID,createTransferRequest:Te,xImxEthAddress:pe,xImxEthSignature:ve});return{sent_signature:Ee?.data.sent_signature,status:Ee?.data.status?.toString(),time:Ee?.data.time,transfer_id:Ee?.data.transfer_id}}({...G,request:K,exchangesApi:this.exchangesApi})}async getProject(G,K){const ne=await generateIMXAuthorisationHeaders(G);return this.projectsApi.getProject({id:K,iMXSignature:ne.signature,iMXTimestamp:ne.timestamp})}async createCollection(G,K){const ne=await generateIMXAuthorisationHeaders(G);return this.collectionsApi.createCollection({iMXSignature:ne.signature,iMXTimestamp:ne.timestamp,createCollectionRequest:K})}async updateCollection(G,K,ne){const ue=await generateIMXAuthorisationHeaders(G);return this.collectionsApi.updateCollection({iMXSignature:ue.signature,iMXTimestamp:ue.timestamp,address:K,updateCollectionRequest:ne})}async addMetadataSchemaToCollection(G,K,ne){const ue=await generateIMXAuthorisationHeaders(G);return this.metadataApi.addMetadataSchemaToCollection({iMXSignature:ue.signature,iMXTimestamp:ue.timestamp,addMetadataSchemaToCollectionRequest:ne,address:K})}async updateMetadataSchemaByName(G,K,ne,ue){const pe=await generateIMXAuthorisationHeaders(G);return this.metadataApi.updateMetadataSchemaByName({iMXSignature:pe.signature,iMXTimestamp:pe.timestamp,address:K,name:ne,metadataSchemaRequest:ue})}async listMetadataRefreshes(G,K,ne,ue){const pe=await generateIMXAuthorisationHeaders(G),he=await G.getAddress();return this.metadataRefreshesApi.getAListOfMetadataRefreshes({xImxEthSignature:pe.signature,xImxEthTimestamp:pe.timestamp,xImxEthAddress:he,collectionAddress:K,pageSize:ne,cursor:ue})}async getMetadataRefreshErrors(G,K,ne,ue){const pe=await generateIMXAuthorisationHeaders(G),he=await G.getAddress();return this.metadataRefreshesApi.getMetadataRefreshErrors({xImxEthSignature:pe.signature,xImxEthTimestamp:pe.timestamp,xImxEthAddress:he,refreshId:K,pageSize:ne,cursor:ue})}async getMetadataRefreshResults(G,K){const ne=await generateIMXAuthorisationHeaders(G),ue=await G.getAddress();return this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:ne.signature,xImxEthTimestamp:ne.timestamp,xImxEthAddress:ue,refreshId:K})}async createMetadataRefresh(G,K){const ne=await generateIMXAuthorisationHeaders(G),ue=await G.getAddress();return this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:ne.signature,xImxEthTimestamp:ne.timestamp,xImxEthAddress:ue,createMetadataRefreshRequest:K})}}class IMXClient{immutableX;imxConfig;assetApi;balanceApi;collectionApi;depositsApi;encodingApi;exchangeApi;metadataApi;metadataRefreshesApi;mintsApi;nftCheckoutPrimaryApi;ordersApi;projectsApi;tokensApi;tradesApi;transfersApi;usersApi;withdrawalsApi;workflows;constructor(G){this.imxConfig=new ImxConfiguration(G),this.immutableX=new ImxApiClients(this.imxConfig.immutableXConfig.apiConfiguration),this.assetApi=this.immutableX.assetApi,this.balanceApi=this.immutableX.balanceApi,this.collectionApi=this.immutableX.collectionApi,this.depositsApi=this.immutableX.depositsApi,this.encodingApi=this.immutableX.encodingApi,this.exchangeApi=this.immutableX.exchangeApi,this.metadataApi=this.immutableX.metadataApi,this.metadataRefreshesApi=this.immutableX.metadataRefreshesApi,this.mintsApi=this.immutableX.mintsApi,this.nftCheckoutPrimaryApi=this.immutableX.nftCheckoutPrimaryApi,this.ordersApi=this.immutableX.ordersApi,this.projectsApi=this.immutableX.projectsApi,this.tokensApi=this.immutableX.tokensApi,this.tradesApi=this.immutableX.tradesApi,this.transfersApi=this.immutableX.transfersApi,this.usersApi=this.immutableX.usersApi,this.withdrawalsApi=this.immutableX.withdrawalsApi,this.workflows=new Workflows(this.imxConfig.immutableXConfig,this.immutableX.collectionApi,this.immutableX.exchangeApi,this.immutableX.metadataApi,this.immutableX.metadataRefreshesApi,this.immutableX.mintsApi,this.immutableX.projectsApi)}getDeposit(G){return this.depositsApi.getDeposit(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listDeposits(G){return this.depositsApi.listDeposits(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getUser(G){return this.usersApi.getUsers({user:G}).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getAsset(G){return this.assetApi.getAsset(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listAssets(G){return this.assetApi.listAssets(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}createCollection(G,K){return this.workflows.createCollection(G,K).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getCollection(G){return this.collectionApi.getCollection(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listCollectionFilters(G){return this.collectionApi.listCollectionFilters(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listCollections(G){return this.collectionApi.listCollections(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}updateCollection(G,K,ne){return this.workflows.updateCollection(G,K,ne).then((G=>G.data)).catch((G=>{throw formatError(G)}))}addMetadataSchemaToCollection(G,K,ne){return this.workflows.addMetadataSchemaToCollection(G,K,ne).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getMetadataSchema(G){return this.metadataApi.getMetadataSchema(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}updateMetadataSchemaByName(G,K,ne,ue){return this.workflows.updateMetadataSchemaByName(G,K,ne,ue).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listMetadataRefreshes(G,K,ne,ue){return this.workflows.listMetadataRefreshes(G,K,ne,ue).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getMetadataRefreshErrors(G,K,ne,ue){return this.workflows.getMetadataRefreshErrors(G,K,ne,ue).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getMetadataRefreshResults(G,K){return this.workflows.getMetadataRefreshResults(G,K).then((G=>G.data)).catch((G=>{throw formatError(G)}))}createMetadataRefresh(G,K){return this.workflows.createMetadataRefresh(G,K).then((G=>G.data)).catch((G=>{throw formatError(G)}))}async getProject(G,K){return this.workflows.getProject(G,K).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getBalance(G){return this.balanceApi.getBalance(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listBalances(G){return this.balanceApi.listBalances(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getMint(G){return this.mintsApi.getMint(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listMints(G){return this.mintsApi.listMints(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}mint(G,K){return this.workflows.mint(G,K)}listWithdrawals(G){return this.withdrawalsApi.listWithdrawals(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getWithdrawal(G){return this.withdrawalsApi.getWithdrawal(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getOrder(G){return this.ordersApi.getOrderV3(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listOrders(G){return this.ordersApi.listOrdersV3(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getTrade(G){return this.tradesApi.getTradeV3(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listTrades(G){return this.tradesApi.listTradesV3(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getToken(G){return this.tokensApi.getToken(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listTokens(G){return this.tokensApi.listTokens(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getTransfer(G){return this.transfersApi.getTransfer(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}listTransfers(G){return this.transfersApi.listTransfers(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}createExchange(G){return this.exchangeApi.createExchange(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getExchange(G){return this.exchangeApi.getExchange(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getExchanges(G){return this.exchangeApi.getExchanges(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}exchangeTransfer(G,K){return this.workflows.exchangeTransfer(G,K)}createNftPrimary(G){return this.nftCheckoutPrimaryApi.createNftPrimary(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getCurrenciesNFTCheckoutPrimary(G){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getNftPrimaryTransaction(G){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}getNftPrimaryTransactions(G){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(G).then((G=>G.data)).catch((G=>{throw formatError(G)}))}}const Iv=[{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:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",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:[],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"}];const Cv=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];const Rv=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"depositorEthKey",type:"address"},{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogDepositCancel",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogDepositCancelReclaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogDepositNftCancelReclaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"}],name:"LogFullWithdrawalRequest",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogMintWithdrawalPerformed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogMintableWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"depositorEthKey",type:"address"},{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogNftDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogNftWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"}],name:"LogNftWithdrawalPerformed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"sequenceNumber",type:"uint256"},{indexed:!1,internalType:"uint256",name:"batchId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultRoot",type:"uint256"},{indexed:!1,internalType:"uint256",name:"orderRoot",type:"uint256"}],name:"LogRootUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"stateTransitionFact",type:"bytes32"}],name:"LogStateTransitionFact",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"int256",name:"quantizedAmountChange",type:"int256"}],name:"LogVaultBalanceChangeApplied",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"}],name:"LogWithdrawalPerformed",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"announceAvailabilityVerifierRemovalIntent",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"announceVerifierRemovalIntent",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositCancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"depositERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"depositNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"depositNftReclaim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositReclaim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"escape",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"freezeRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"fullWithdrawalRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetType",type:"uint256"}],name:"getAssetInfo",outputs:[{internalType:"bytes",name:"assetInfo",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getCancellationRequest",outputs:[{internalType:"uint256",name:"request",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getDepositBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"}],name:"getEthKey",outputs:[{internalType:"address",name:"ethKey",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getFullWithdrawalRequest",outputs:[{internalType:"uint256",name:"res",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBatchId",outputs:[{internalType:"uint256",name:"batchId",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOrderRoot",outputs:[{internalType:"uint256",name:"root",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOrderTreeHeight",outputs:[{internalType:"uint256",name:"height",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getQuantizedDepositBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"presumedAssetType",type:"uint256"}],name:"getQuantum",outputs:[{internalType:"uint256",name:"quantum",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRegisteredAvailabilityVerifiers",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getRegisteredVerifiers",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getSequenceNumber",outputs:[{internalType:"uint256",name:"seq",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVaultRoot",outputs:[{internalType:"uint256",name:"root",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVaultTreeHeight",outputs:[{internalType:"uint256",name:"height",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"}],name:"getWithdrawalBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isAvailabilityVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"isFrozen",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isTokenAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isUserAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mainAcceptGovernance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mainCancelNomination",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"mainIsGovernor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"mainNominateNewGovernor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"mainRemoveGovernor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"registerAndDepositERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"registerAndDepositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"string",name:"",type:"string"}],name:"registerAvailabilityVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"registerOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"registerToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"registerTokenAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"registerUser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"registerUserAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"string",name:"",type:"string"}],name:"registerVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"removeAvailabilityVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"removeVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unFreeze",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"unregisterOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"unregisterTokenAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"unregisterUserAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"publicInput",type:"uint256[]"},{internalType:"uint256[]",name:"applicationData",type:"uint256[]"}],name:"updateState",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"mintingBlob",type:"bytes"}],name:"withdrawAndMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"withdrawNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"withdrawNftTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"}];const kv=[{inputs:[{internalType:"contract Core",name:"_imx",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"imx",outputs:[{internalType:"contract Core",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"}],name:"isRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"registerAndDepositNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"}],name:"registerAndWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"registerAndWithdrawNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"registerAndWithdrawNftTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"registerAndWithdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"mintingBlob",type:"bytes"}],name:"regsiterAndWithdrawAndMint",outputs:[],stateMutability:"nonpayable",type:"function"}],Ov="0x60806040523480156200001157600080fd5b5060405162001313380380620013138339818101604052810190620000379190620000fc565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200012e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b08262000083565b9050919050565b6000620000c482620000a3565b9050919050565b620000d681620000b7565b8114620000e257600080fd5b50565b600081519050620000f681620000cb565b92915050565b6000602082840312156200011557620001146200007e565b5b60006200012584828501620000e5565b91505092915050565b6111d5806200013e6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80634280d50a1161005b5780634280d50a146100ff5780634627d5981461011b578063579a698814610137578063ea864adf1461016757610088565b80630a9c3beb1461008d5780630f08025f146100a95780631259cc6c146100c7578063352eb84c146100e3575b600080fd5b6100a760048036038101906100a29190610a72565b610183565b005b6100b16102ae565b6040516100be9190610b8d565b60405180910390f35b6100e160048036038101906100dc9190610ba8565b6102d2565b005b6100fd60048036038101906100f89190610c57565b6103fd565b005b61011960048036038101906101149190610cf1565b610525565b005b61013560048036038101906101309190610da0565b610650565b005b610151600480360381019061014c9190610e3a565b610778565b60405161015e9190610e82565b60405180910390f35b610181600480360381019061017c9190610e9d565b61084a565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4888888886040518563ffffffff1660e01b81526004016101e29493929190610fa1565b600060405180830381600087803b1580156101fc57600080fd5b505af1158015610210573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d91443b7878585856040518563ffffffff1660e01b81526004016102739493929190610fe1565b600060405180830381600087803b15801561028d57600080fd5b505af11580156102a1573d6000803e3d6000fd5b5050505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4888888886040518563ffffffff1660e01b81526004016103319493929190610fa1565b600060405180830381600087803b15801561034b57600080fd5b505af115801561035f573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ebef0fd0878585856040518563ffffffff1660e01b81526004016103c29493929190611021565b600060405180830381600087803b1580156103dc57600080fd5b505af11580156103f0573d6000803e3d6000fd5b5050505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4878787876040518563ffffffff1660e01b815260040161045c9493929190610fa1565b600060405180830381600087803b15801561047657600080fd5b505af115801561048a573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663019b417a8684846040518463ffffffff1660e01b81526004016104eb93929190611066565b600060405180830381600087803b15801561050557600080fd5b505af1158015610519573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4888888886040518563ffffffff1660e01b81526004016105849493929190610fa1565b600060405180830381600087803b15801561059e57600080fd5b505af11580156105b2573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae1cdde6878585856040518563ffffffff1660e01b8152600401610615949392919061109d565b600060405180830381600087803b15801561062f57600080fd5b505af1158015610643573d6000803e3d6000fd5b5050505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4878787876040518563ffffffff1660e01b81526004016106af9493929190610fa1565b600060405180830381600087803b1580156106c957600080fd5b505af11580156106dd573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166314cd70e48684846040518463ffffffff1660e01b815260040161073e939291906110e2565b600060405180830381600087803b15801561075857600080fd5b505af115801561076c573d6000803e3d6000fd5b50505050505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dbd1da7846040518263ffffffff1660e01b81526004016107ea9190611119565b602060405180830381865afa158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b9190611149565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd2414d4868686866040518563ffffffff1660e01b81526004016108a99493929190610fa1565b600060405180830381600087803b1580156108c357600080fd5b505af11580156108d7573d6000803e3d6000fd5b5050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663441a3e7085836040518363ffffffff1660e01b8152600401610936929190611176565b600060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b505050505050505050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006109a482610979565b9050919050565b6109b481610999565b81146109bf57600080fd5b50565b6000813590506109d1816109ab565b92915050565b6000819050919050565b6109ea816109d7565b81146109f557600080fd5b50565b600081359050610a07816109e1565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112610a3257610a31610a0d565b5b8235905067ffffffffffffffff811115610a4f57610a4e610a12565b5b602083019150836001820283011115610a6b57610a6a610a17565b5b9250929050565b600080600080600080600060a0888a031215610a9157610a9061096f565b5b6000610a9f8a828b016109c2565b9750506020610ab08a828b016109f8565b965050604088013567ffffffffffffffff811115610ad157610ad0610974565b5b610add8a828b01610a1c565b95509550506060610af08a828b016109f8565b935050608088013567ffffffffffffffff811115610b1157610b10610974565b5b610b1d8a828b01610a1c565b925092505092959891949750929550565b6000819050919050565b6000610b53610b4e610b4984610979565b610b2e565b610979565b9050919050565b6000610b6582610b38565b9050919050565b6000610b7782610b5a565b9050919050565b610b8781610b6c565b82525050565b6000602082019050610ba26000830184610b7e565b92915050565b600080600080600080600060c0888a031215610bc757610bc661096f565b5b6000610bd58a828b016109c2565b9750506020610be68a828b016109f8565b965050604088013567ffffffffffffffff811115610c0757610c06610974565b5b610c138a828b01610a1c565b95509550506060610c268a828b016109f8565b9350506080610c378a828b016109f8565b92505060a0610c488a828b016109c2565b91505092959891949750929550565b60008060008060008060a08789031215610c7457610c7361096f565b5b6000610c8289828a016109c2565b9650506020610c9389828a016109f8565b955050604087013567ffffffffffffffff811115610cb457610cb3610974565b5b610cc089828a01610a1c565b94509450506060610cd389828a016109f8565b9250506080610ce489828a016109f8565b9150509295509295509295565b600080600080600080600060c0888a031215610d1057610d0f61096f565b5b6000610d1e8a828b016109c2565b9750506020610d2f8a828b016109f8565b965050604088013567ffffffffffffffff811115610d5057610d4f610974565b5b610d5c8a828b01610a1c565b95509550506060610d6f8a828b016109f8565b9350506080610d808a828b016109f8565b92505060a0610d918a828b016109f8565b91505092959891949750929550565b60008060008060008060a08789031215610dbd57610dbc61096f565b5b6000610dcb89828a016109c2565b9650506020610ddc89828a016109f8565b955050604087013567ffffffffffffffff811115610dfd57610dfc610974565b5b610e0989828a01610a1c565b94509450506060610e1c89828a016109f8565b9250506080610e2d89828a016109c2565b9150509295509295509295565b600060208284031215610e5057610e4f61096f565b5b6000610e5e848285016109f8565b91505092915050565b60008115159050919050565b610e7c81610e67565b82525050565b6000602082019050610e976000830184610e73565b92915050565b600080600080600060808688031215610eb957610eb861096f565b5b6000610ec7888289016109c2565b9550506020610ed8888289016109f8565b945050604086013567ffffffffffffffff811115610ef957610ef8610974565b5b610f0588828901610a1c565b93509350506060610f18888289016109f8565b9150509295509295909350565b610f2e81610999565b82525050565b610f3d816109d7565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b6000610f808385610f43565b9350610f8d838584610f54565b610f9683610f63565b840190509392505050565b6000606082019050610fb66000830187610f25565b610fc36020830186610f34565b8181036040830152610fd6818486610f74565b905095945050505050565b6000606082019050610ff66000830187610f34565b6110036020830186610f34565b8181036040830152611016818486610f74565b905095945050505050565b60006080820190506110366000830187610f34565b6110436020830186610f34565b6110506040830185610f34565b61105d6060830184610f25565b95945050505050565b600060608201905061107b6000830186610f34565b6110886020830185610f34565b6110956040830184610f34565b949350505050565b60006080820190506110b26000830187610f34565b6110bf6020830186610f34565b6110cc6040830185610f34565b6110d96060830184610f34565b95945050505050565b60006060820190506110f76000830186610f34565b6111046020830185610f34565b6111116040830184610f25565b949350505050565b600060208201905061112e6000830184610f34565b92915050565b600081519050611143816109ab565b92915050565b60006020828403121561115f5761115e61096f565b5b600061116d84828501611134565b91505092915050565b600060408201905061118b6000830185610f34565b6111986020830184610f34565b939250505056fea2646970667358221220ec3495278afe78566e74b538d48e94b094c110ca38b03493e90e5e382cc99d0264736f6c63430008130033";const xv=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"},{indexed:!1,internalType:"uint256",name:"updatedActivationTime",type:"uint256"}],name:"ImplementationActivationRescheduled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newDefaultLockTime",type:"uint256"}],name:"LogDefaultVaultWithdrawalLockSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"depositorEthKey",type:"address"},{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogDepositCancel",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogDepositCancelReclaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogDepositNftCancelReclaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogDepositToVault",type:"event"},{anonymous:!1,inputs:[],name:"LogFrozen",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"}],name:"LogFullWithdrawalRequest",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogMintWithdrawalPerformed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogMintableWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"acceptedGovernor",type:"address"}],name:"LogNewGovernorAccepted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"depositorEthKey",type:"address"},{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogNftDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"}],name:"LogNftWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"}],name:"LogNftWithdrawalPerformed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"nominatedGovernor",type:"address"}],name:"LogNominatedGovernor",type:"event"},{anonymous:!1,inputs:[],name:"LogNominationCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"operator",type:"address"}],name:"LogOperatorAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"operator",type:"address"}],name:"LogOperatorRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"entry",type:"address"},{indexed:!1,internalType:"string",name:"entryId",type:"string"}],name:"LogRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"entry",type:"address"},{indexed:!1,internalType:"string",name:"entryId",type:"string"}],name:"LogRemovalIntent",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"entry",type:"address"},{indexed:!1,internalType:"string",name:"entryId",type:"string"}],name:"LogRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"removedGovernor",type:"address"}],name:"LogRemovedGovernor",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"sequenceNumber",type:"uint256"},{indexed:!1,internalType:"uint256",name:"batchId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultRoot",type:"uint256"},{indexed:!1,internalType:"uint256",name:"orderRoot",type:"uint256"}],name:"LogRootUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"stateTransitionFact",type:"bytes32"}],name:"LogStateTransitionFact",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"tokenAdmin",type:"address"}],name:"LogTokenAdminAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"tokenAdmin",type:"address"}],name:"LogTokenAdminRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"assetInfo",type:"bytes"},{indexed:!1,internalType:"uint256",name:"quantum",type:"uint256"}],name:"LogTokenRegistered",type:"event"},{anonymous:!1,inputs:[],name:"LogUnFrozen",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"starkKey",type:"uint256"},{indexed:!1,internalType:"address",name:"sender",type:"address"}],name:"LogUserRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"int256",name:"quantizedAmountChange",type:"int256"}],name:"LogVaultBalanceChangeApplied",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timeRelease",type:"uint256"}],name:"LogVaultWithdrawalLockSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogWithdrawalAllowed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"ethKey",type:"address"},{indexed:!1,internalType:"uint256",name:"assetId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"vaultId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"LogWithdrawalFromVault",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"ownerKey",type:"uint256"},{indexed:!1,internalType:"uint256",name:"assetType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nonQuantizedAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantizedAmount",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"}],name:"LogWithdrawalPerformed",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"DEPOSIT_CANCEL_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"FREEZE_GRACE_PERIOD",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAIN_GOVERNANCE_INFO_TAG",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_FORCED_ACTIONS_REQS_PER_BLOCK",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_VERIFIER_COUNT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"STARKEX_MAX_DEFAULT_VAULT_LOCK",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNFREEZE_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"VERIFIER_REMOVAL_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"VERSION",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"}],name:"announceAvailabilityVerifierRemovalIntent",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"}],name:"announceVerifierRemovalIntent",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"defaultVaultWithdrawalLock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositCancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"depositERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"depositERC20ToVault",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositEthToVault",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"depositNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"depositNftReclaim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"depositReclaim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"escape",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"freezeRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"fullWithdrawalRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getActionCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"actionIndex",type:"uint256"}],name:"getActionHashByIndex",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"assetType",type:"uint256"}],name:"getAssetInfo",outputs:[{internalType:"bytes",name:"assetInfo",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getCancellationRequest",outputs:[{internalType:"uint256",name:"request",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getDepositBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"}],name:"getEthKey",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getFullWithdrawalRequest",outputs:[{internalType:"uint256",name:"res",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBatchId",outputs:[{internalType:"uint256",name:"batchId",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOrderRoot",outputs:[{internalType:"uint256",name:"root",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOrderTreeHeight",outputs:[{internalType:"uint256",name:"height",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getQuantizedDepositBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getQuantizedVaultBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"presumedAssetType",type:"uint256"}],name:"getQuantum",outputs:[{internalType:"uint256",name:"quantum",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRegisteredAvailabilityVerifiers",outputs:[{internalType:"address[]",name:"_verifers",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRegisteredVerifiers",outputs:[{internalType:"address[]",name:"_verifers",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSequenceNumber",outputs:[{internalType:"uint256",name:"seq",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getVaultBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVaultRoot",outputs:[{internalType:"uint256",name:"root",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVaultTreeHeight",outputs:[{internalType:"uint256",name:"height",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"getVaultWithdrawalLock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetId",type:"uint256"}],name:"getWithdrawalBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetType",type:"uint256"}],name:"isAssetRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"verifierAddress",type:"address"}],name:"isAvailabilityVerifier",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"isFrozen",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"testedOperator",type:"address"}],name:"isOperator",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"isStrictVaultBalancePolicy",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"testedAdmin",type:"address"}],name:"isTokenAdmin",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"isVaultLocked",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"verifierAddress",type:"address"}],name:"isVerifier",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"lockTime",type:"uint256"}],name:"lockVault",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mainAcceptGovernance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mainCancelNomination",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"testGovernor",type:"address"}],name:"mainIsGovernor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newGovernor",type:"address"}],name:"mainNominateNewGovernor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"governorForRemoval",type:"address"}],name:"mainRemoveGovernor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"orderRegistryAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"registerAndDepositERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"}],name:"registerAndDepositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"},{internalType:"string",name:"identifier",type:"string"}],name:"registerAvailabilityVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"starkSignature",type:"bytes"}],name:"registerEthAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOperator",type:"address"}],name:"registerOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"starkSignature",type:"bytes"}],name:"registerSender",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"assetInfo",type:"bytes"}],name:"registerToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"assetInfo",type:"bytes"},{internalType:"uint256",name:"quantum",type:"uint256"}],name:"registerToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newAdmin",type:"address"}],name:"registerTokenAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"},{internalType:"string",name:"identifier",type:"string"}],name:"registerVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"}],name:"removeAvailabilityVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"verifier",type:"address"}],name:"removeVerifier",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newDefaultTime",type:"uint256"}],name:"setDefaultVaultWithdrawalLock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unFreeze",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"removedOperator",type:"address"}],name:"unregisterOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"oldAdmin",type:"address"}],name:"unregisterTokenAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bool",name:"finalize",type:"bool"}],name:"updateImplementationActivationTime",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"publicInput",type:"uint256[]"},{internalType:"uint256[]",name:"applicationData",type:"uint256[]"}],name:"updateState",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"mintingBlob",type:"bytes"}],name:"withdrawAndMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"assetId",type:"uint256"},{internalType:"uint256",name:"vaultId",type:"uint256"},{internalType:"uint256",name:"quantizedAmount",type:"uint256"}],name:"withdrawFromVault",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ownerKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"withdrawNft",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];const Nv=[{inputs:[{internalType:"address payable",name:"_imx",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"uint256",name:"ethKey",type:"uint256"},{internalType:"uint256",name:"starkKey",type:"uint256"}],name:"NoFundsToWithdraw",type:"error"},{inputs:[],name:"getVersion",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"imx",outputs:[{internalType:"contract CoreV4",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"starkKey",type:"uint256"}],name:"isRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"}],name:"registerAndWithdrawAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"registerAndWithdrawNft",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ethKey",type:"address"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"uint256",name:"assetType",type:"uint256"},{internalType:"bytes",name:"mintingBlob",type:"bytes"}],name:"registerWithdrawAndMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"ethKey",type:"uint256"},{internalType:"uint256",name:"starkKey",type:"uint256"},{internalType:"uint256",name:"assetType",type:"uint256"}],name:"withdrawAll",outputs:[],stateMutability:"nonpayable",type:"function"}],Mv="0x60a06040523480156200001157600080fd5b50604051620012bc380380620012bc8339818101604052810190620000379190620000dc565b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506200010e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000a48262000077565b9050919050565b620000b68162000097565b8114620000c257600080fd5b50565b600081519050620000d681620000ab565b92915050565b600060208284031215620000f557620000f462000072565b5b60006200010584828501620000c5565b91505092915050565b608051611145620001776000396000818161016d01528181610229015281816102c2015281816102f30152818161038501528181610429015281816104bb0152818161056e01528181610629015281816106c9015281816107c4015261085b01526111456000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063352eb84c1161005b578063352eb84c146100da57806343fa186d146100f6578063579a698814610112578063d2fc99b5146101425761007d565b8063022cabbc146100825780630d8e6e2c1461009e5780630f08025f146100bc575b600080fd5b61009c600480360381019061009791906109fb565b61015e565b005b6100a6610225565b6040516100b39190610b13565b60405180910390f35b6100c46102c0565b6040516100d19190610b94565b60405180910390f35b6100f460048036038101906100ef9190610baf565b6102e4565b005b610110600480360381019061010b9190610c49565b61041a565b005b61012c60048036038101906101279190610d05565b610553565b6040516101399190610d4d565b60405180910390f35b61015c60048036038101906101579190610d68565b610625565b005b61016784610553565b6101fd577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187868686866040518563ffffffff1660e01b81526004016101ca9493929190610e26565b600060405180830381600087803b1580156101e457600080fd5b505af11580156101f8573d6000803e3d6000fd5b505050505b61021e8573ffffffffffffffffffffffffffffffffffffffff168583610625565b5050505050565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ffa1ad746040518163ffffffff1660e01b8152600401600060405180830381865afa158015610292573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102bb9190610f87565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6102ed85610553565b610383577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187878787876040518563ffffffff1660e01b81526004016103509493929190610e26565b600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663019b417a8684846040518463ffffffff1660e01b81526004016103e093929190610fd0565b600060405180830381600087803b1580156103fa57600080fd5b505af115801561040e573d6000803e3d6000fd5b50505050505050505050565b61042386610553565b6104b9577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187888888886040518563ffffffff1660e01b81526004016104869493929190610e26565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d91443b7878585856040518563ffffffff1660e01b81526004016105189493929190611007565b600060405180830381600087803b15801561053257600080fd5b505af1158015610546573d6000803e3d6000fd5b5050505050505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631dbd1da7846040518263ffffffff1660e01b81526004016105c59190611047565b602060405180830381865afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190611077565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ec3161b085846040518363ffffffff1660e01b81526004016106829291906110a4565b602060405180830381865afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c391906110e2565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ec3161b085856040518363ffffffff1660e01b81526004016107229291906110a4565b602060405180830381865afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906110e2565b90506000821480156107755750600081145b156107b95784846040517f1362cdf20000000000000000000000000000000000000000000000000000000081526004016107b09291906110a4565b60405180910390fd5b6000821115610850577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663441a3e7086856040518363ffffffff1660e01b815260040161081d9291906110a4565b600060405180830381600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b505050505b60008111156108e7577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663441a3e7085856040518363ffffffff1660e01b81526004016108b49291906110a4565b600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b505050505b5050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061092d82610902565b9050919050565b61093d81610922565b811461094857600080fd5b50565b60008135905061095a81610934565b92915050565b6000819050919050565b61097381610960565b811461097e57600080fd5b50565b6000813590506109908161096a565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126109bb576109ba610996565b5b8235905067ffffffffffffffff8111156109d8576109d761099b565b5b6020830191508360018202830111156109f4576109f36109a0565b5b9250929050565b600080600080600060808688031215610a1757610a166108f8565b5b6000610a258882890161094b565b9550506020610a3688828901610981565b945050604086013567ffffffffffffffff811115610a5757610a566108fd565b5b610a63888289016109a5565b93509350506060610a7688828901610981565b9150509295509295909350565b600081519050919050565b600082825260208201905092915050565b60005b83811015610abd578082015181840152602081019050610aa2565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ae582610a83565b610aef8185610a8e565b9350610aff818560208601610a9f565b610b0881610ac9565b840191505092915050565b60006020820190508181036000830152610b2d8184610ada565b905092915050565b6000819050919050565b6000610b5a610b55610b5084610902565b610b35565b610902565b9050919050565b6000610b6c82610b3f565b9050919050565b6000610b7e82610b61565b9050919050565b610b8e81610b73565b82525050565b6000602082019050610ba96000830184610b85565b92915050565b60008060008060008060a08789031215610bcc57610bcb6108f8565b5b6000610bda89828a0161094b565b9650506020610beb89828a01610981565b955050604087013567ffffffffffffffff811115610c0c57610c0b6108fd565b5b610c1889828a016109a5565b94509450506060610c2b89828a01610981565b9250506080610c3c89828a01610981565b9150509295509295509295565b600080600080600080600060a0888a031215610c6857610c676108f8565b5b6000610c768a828b0161094b565b9750506020610c878a828b01610981565b965050604088013567ffffffffffffffff811115610ca857610ca76108fd565b5b610cb48a828b016109a5565b95509550506060610cc78a828b01610981565b935050608088013567ffffffffffffffff811115610ce857610ce76108fd565b5b610cf48a828b016109a5565b925092505092959891949750929550565b600060208284031215610d1b57610d1a6108f8565b5b6000610d2984828501610981565b91505092915050565b60008115159050919050565b610d4781610d32565b82525050565b6000602082019050610d626000830184610d3e565b92915050565b600080600060608486031215610d8157610d806108f8565b5b6000610d8f86828701610981565b9350506020610da086828701610981565b9250506040610db186828701610981565b9150509250925092565b610dc481610922565b82525050565b610dd381610960565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000610e058385610dd9565b9350610e12838584610dea565b610e1b83610ac9565b840190509392505050565b6000606082019050610e3b6000830187610dbb565b610e486020830186610dca565b8181036040830152610e5b818486610df9565b905095945050505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610ea382610ac9565b810181811067ffffffffffffffff82111715610ec257610ec1610e6b565b5b80604052505050565b6000610ed56108ee565b9050610ee18282610e9a565b919050565b600067ffffffffffffffff821115610f0157610f00610e6b565b5b610f0a82610ac9565b9050602081019050919050565b6000610f2a610f2584610ee6565b610ecb565b905082815260208101848484011115610f4657610f45610e66565b5b610f51848285610a9f565b509392505050565b600082601f830112610f6e57610f6d610996565b5b8151610f7e848260208601610f17565b91505092915050565b600060208284031215610f9d57610f9c6108f8565b5b600082015167ffffffffffffffff811115610fbb57610fba6108fd565b5b610fc784828501610f59565b91505092915050565b6000606082019050610fe56000830186610dca565b610ff26020830185610dca565b610fff6040830184610dca565b949350505050565b600060608201905061101c6000830187610dca565b6110296020830186610dca565b818103604083015261103c818486610df9565b905095945050505050565b600060208201905061105c6000830184610dca565b92915050565b60008151905061107181610934565b92915050565b60006020828403121561108d5761108c6108f8565b5b600061109b84828501611062565b91505092915050565b60006040820190506110b96000830185610dca565b6110c66020830184610dca565b9392505050565b6000815190506110dc8161096a565b92915050565b6000602082840312156110f8576110f76108f8565b5b6000611106848285016110cd565b9150509291505056fea2646970667358221220c33e1830b470bf1e012ac831ec80242d6268e5e6e990b7e1574a230f71533ebd64736f6c63430008130033";var Bv=Object.freeze({__proto__:null,Core:class Core__factory{static abi=Rv;static createInterface(){return new Ho(Rv)}static connect(G,K){return new iu(G,Rv,K)}},CoreV4:class CoreV4__factory{static abi=xv;static createInterface(){return new Ho(xv)}static connect(G,K){return new iu(G,xv,K)}},IERC20:class IERC20__factory{static abi=Iv;static createInterface(){return new Ho(Iv)}static connect(G,K){return new iu(G,Iv,K)}},IERC721:class IERC721__factory{static abi=Cv;static createInterface(){return new Ho(Cv)}static connect(G,K){return new iu(G,Cv,K)}},Registration:class Registration__factory extends ContractFactory{constructor(...G){G.length>1?super(...G):super(kv,Ov,G[0])}deploy(G,K){return super.deploy(G,K||{})}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}attach(G){return super.attach(G)}connect(G){return super.connect(G)}static bytecode=Ov;static abi=kv;static createInterface(){return new Ho(kv)}static connect(G,K){return new iu(G,kv,K)}},RegistrationV4:class RegistrationV4__factory extends ContractFactory{constructor(...G){G.length>1?super(...G):super(Nv,Mv,G[0])}deploy(G,K){return super.deploy(G,K||{})}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}attach(G){return super.attach(G)}connect(G){return super.connect(G)}static bytecode=Mv;static abi=Nv;static createInterface(){return new Ho(Nv)}static connect(G,K){return new iu(G,Nv,K)}}});class AssetsApi extends wa.AssetsApi{}class BalancesApi extends wa.BalancesApi{}class CollectionsApi extends wa.CollectionsApi{}class DepositsApi extends wa.DepositsApi{}class EncodingApi extends wa.EncodingApi{}class ExchangesApi extends wa.ExchangesApi{}class MintsApi extends wa.MintsApi{}class MetadataApi extends wa.MetadataApi{}class MetadataRefreshesApi extends wa.MetadataRefreshesApi{}class NftCheckoutPrimaryApi extends wa.NftCheckoutPrimaryApi{}class OrdersApi extends wa.OrdersApi{}class ProjectsApi extends wa.ProjectsApi{}class TokensApi extends wa.TokensApi{}class TradesApi extends wa.TradesApi{}class TransfersApi extends wa.TransfersApi{}class UsersApi extends wa.UsersApi{}class WithdrawalsApi extends wa.WithdrawalsApi{}const Fv=wa.MetadataSchemaRequestTypeEnum;function commonjsRequire(G){throw new Error('Could not dynamically require "'+G+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dv={exports:{}};!function(G,K){G.exports=function(){var G=G||function(G,K){var ne;if("undefined"!=typeof window&&window.crypto&&(ne=window.crypto),"undefined"!=typeof self&&self.crypto&&(ne=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(ne=globalThis.crypto),!ne&&"undefined"!=typeof window&&window.msCrypto&&(ne=window.msCrypto),!ne&&void 0!==pn&&pn.crypto&&(ne=pn.crypto),!ne)try{ne=bf}catch(G){}var cryptoSecureRandomInt=function(){if(ne){if("function"==typeof ne.getRandomValues)try{return ne.getRandomValues(new Uint32Array(1))[0]}catch(G){}if("function"==typeof ne.randomBytes)try{return ne.randomBytes(4).readInt32LE()}catch(G){}}throw new Error("Native crypto module could not be used to get secure random number.")},ue=Object.create||function(){function F(){}return function(G){var K;return F.prototype=G,K=new F,F.prototype=null,K}}(),pe={},he=pe.lib={},ye=he.Base={extend:function(G){var K=ue(this);return G&&K.mixIn(G),K.hasOwnProperty("init")&&this.init!==K.init||(K.init=function(){K.$super.init.apply(this,arguments)}),K.init.prototype=K,K.$super=this,K},create:function(){var G=this.extend();return G.init.apply(G,arguments),G},init:function(){},mixIn:function(G){for(var K in G)G.hasOwnProperty(K)&&(this[K]=G[K]);G.hasOwnProperty("toString")&&(this.toString=G.toString)},clone:function(){return this.init.prototype.extend(this)}},me=he.WordArray=ye.extend({init:function(G,ne){G=this.words=G||[],this.sigBytes=ne!=K?ne:4*G.length},toString:function(G){return(G||ve).stringify(this)},concat:function(G){var K=this.words,ne=G.words,ue=this.sigBytes,pe=G.sigBytes;if(this.clamp(),ue%4)for(var he=0;he<pe;he++){var ye=ne[he>>>2]>>>24-he%4*8&255;K[ue+he>>>2]|=ye<<24-(ue+he)%4*8}else for(var me=0;me<pe;me+=4)K[ue+me>>>2]=ne[me>>>2];return this.sigBytes+=pe,this},clamp:function(){var K=this.words,ne=this.sigBytes;K[ne>>>2]&=4294967295<<32-ne%4*8,K.length=G.ceil(ne/4)},clone:function(){var G=ye.clone.call(this);return G.words=this.words.slice(0),G},random:function(G){for(var K=[],ne=0;ne<G;ne+=4)K.push(cryptoSecureRandomInt());return new me.init(K,G)}}),be=pe.enc={},ve=be.Hex={stringify:function(G){for(var K=G.words,ne=G.sigBytes,ue=[],pe=0;pe<ne;pe++){var he=K[pe>>>2]>>>24-pe%4*8&255;ue.push((he>>>4).toString(16)),ue.push((15&he).toString(16))}return ue.join("")},parse:function(G){for(var K=G.length,ne=[],ue=0;ue<K;ue+=2)ne[ue>>>3]|=parseInt(G.substr(ue,2),16)<<24-ue%8*4;return new me.init(ne,K/2)}},_e=be.Latin1={stringify:function(G){for(var K=G.words,ne=G.sigBytes,ue=[],pe=0;pe<ne;pe++){var he=K[pe>>>2]>>>24-pe%4*8&255;ue.push(String.fromCharCode(he))}return ue.join("")},parse:function(G){for(var K=G.length,ne=[],ue=0;ue<K;ue++)ne[ue>>>2]|=(255&G.charCodeAt(ue))<<24-ue%4*8;return new me.init(ne,K)}},Te=be.Utf8={stringify:function(G){try{return decodeURIComponent(escape(_e.stringify(G)))}catch(G){throw new Error("Malformed UTF-8 data")}},parse:function(G){return _e.parse(unescape(encodeURIComponent(G)))}},Ee=he.BufferedBlockAlgorithm=ye.extend({reset:function(){this._data=new me.init,this._nDataBytes=0},_append:function(G){"string"==typeof G&&(G=Te.parse(G)),this._data.concat(G),this._nDataBytes+=G.sigBytes},_process:function(K){var ne,ue=this._data,pe=ue.words,he=ue.sigBytes,ye=this.blockSize,be=he/(4*ye),ve=(be=K?G.ceil(be):G.max((0|be)-this._minBufferSize,0))*ye,_e=G.min(4*ve,he);if(ve){for(var Te=0;Te<ve;Te+=ye)this._doProcessBlock(pe,Te);ne=pe.splice(0,ve),ue.sigBytes-=_e}return new me.init(ne,_e)},clone:function(){var G=ye.clone.call(this);return G._data=this._data.clone(),G},_minBufferSize:0});he.Hasher=Ee.extend({cfg:ye.extend(),init:function(G){this.cfg=this.cfg.extend(G),this.reset()},reset:function(){Ee.reset.call(this),this._doReset()},update:function(G){return this._append(G),this._process(),this},finalize:function(G){return G&&this._append(G),this._doFinalize()},blockSize:16,_createHelper:function(G){return function(K,ne){return new G.init(ne).finalize(K)}},_createHmacHelper:function(G){return function(K,ne){return new Pe.HMAC.init(G,ne).finalize(K)}}});var Pe=pe.algo={};return pe}(Math);return G}()}(Dv);var Lv=Dv.exports,Uv=getDefaultExportFromCjs$1(Lv),$v={exports:{}};!function(G,K){G.exports=function(G){return function(K){var ne=G,ue=ne.lib,pe=ue.WordArray,he=ue.Hasher,ye=ne.algo,me=[],be=[];!function(){function isPrime(G){for(var ne=K.sqrt(G),ue=2;ue<=ne;ue++)if(!(G%ue))return!1;return!0}function getFractionalBits(G){return 4294967296*(G-(0|G))|0}for(var G=2,ne=0;ne<64;)isPrime(G)&&(ne<8&&(me[ne]=getFractionalBits(K.pow(G,.5))),be[ne]=getFractionalBits(K.pow(G,1/3)),ne++),G++}();var ve=[],_e=ye.SHA256=he.extend({_doReset:function(){this._hash=new pe.init(me.slice(0))},_doProcessBlock:function(G,K){for(var ne=this._hash.words,ue=ne[0],pe=ne[1],he=ne[2],ye=ne[3],me=ne[4],_e=ne[5],Te=ne[6],Ee=ne[7],Pe=0;Pe<64;Pe++){if(Pe<16)ve[Pe]=0|G[K+Pe];else{var Se=ve[Pe-15],Ce=(Se<<25|Se>>>7)^(Se<<14|Se>>>18)^Se>>>3,ke=ve[Pe-2],Oe=(ke<<15|ke>>>17)^(ke<<13|ke>>>19)^ke>>>10;ve[Pe]=Ce+ve[Pe-7]+Oe+ve[Pe-16]}var xe=ue&pe^ue&he^pe&he,Ne=(ue<<30|ue>>>2)^(ue<<19|ue>>>13)^(ue<<10|ue>>>22),Me=Ee+((me<<26|me>>>6)^(me<<21|me>>>11)^(me<<7|me>>>25))+(me&_e^~me&Te)+be[Pe]+ve[Pe];Ee=Te,Te=_e,_e=me,me=ye+Me|0,ye=he,he=pe,pe=ue,ue=Me+(Ne+xe)|0}ne[0]=ne[0]+ue|0,ne[1]=ne[1]+pe|0,ne[2]=ne[2]+he|0,ne[3]=ne[3]+ye|0,ne[4]=ne[4]+me|0,ne[5]=ne[5]+_e|0,ne[6]=ne[6]+Te|0,ne[7]=ne[7]+Ee|0},_doFinalize:function(){var G=this._data,ne=G.words,ue=8*this._nDataBytes,pe=8*G.sigBytes;return ne[pe>>>5]|=128<<24-pe%32,ne[14+(pe+64>>>9<<4)]=K.floor(ue/4294967296),ne[15+(pe+64>>>9<<4)]=ue,G.sigBytes=4*ne.length,this._process(),this._hash},clone:function(){var G=he.clone.call(this);return G._hash=this._hash.clone(),G}});ne.SHA256=he._createHelper(_e),ne.HmacSHA256=he._createHmacHelper(_e)}(Math),G.SHA256}(Lv)}($v);var qv=$v.exports,Gv=getDefaultExportFromCjs$1(qv),jv={exports:{}};!function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.WordArray;function parseLoop(G,K,ue){for(var pe=[],he=0,ye=0;ye<K;ye++)if(ye%4){var me=ue[G.charCodeAt(ye-1)]<<ye%4*2|ue[G.charCodeAt(ye)]>>>6-ye%4*2;pe[he>>>2]|=me<<24-he%4*8,he++}return ne.create(pe,he)}K.enc.Base64={stringify:function(G){var K=G.words,ne=G.sigBytes,ue=this._map;G.clamp();for(var pe=[],he=0;he<ne;he+=3)for(var ye=(K[he>>>2]>>>24-he%4*8&255)<<16|(K[he+1>>>2]>>>24-(he+1)%4*8&255)<<8|K[he+2>>>2]>>>24-(he+2)%4*8&255,me=0;me<4&&he+.75*me<ne;me++)pe.push(ue.charAt(ye>>>6*(3-me)&63));var be=ue.charAt(64);if(be)for(;pe.length%4;)pe.push(be);return pe.join("")},parse:function(G){var K=G.length,ne=this._map,ue=this._reverseMap;if(!ue){ue=this._reverseMap=[];for(var pe=0;pe<ne.length;pe++)ue[ne.charCodeAt(pe)]=pe}var he=ne.charAt(64);if(he){var ye=G.indexOf(he);-1!==ye&&(K=ye)}return parseLoop(G,K,ue)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),G.enc.Base64}(Lv)}(jv);var Hv=jv.exports,Wv=getDefaultExportFromCjs$1(Hv),zv={exports:{}};!function(G,K){G.exports=function(G){return G.enc.Utf8}(Lv)}(zv);var Vv=getDefaultExportFromCjs$1(zv.exports);function e(G){this.message=G}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var Kv="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(G){var K=String(G).replace(/=+$/,"");if(K.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var ne,ue,pe=0,he=0,ye="";ue=K.charAt(he++);~ue&&(ne=pe%4?64*ne+ue:ue,pe++%4)?ye+=String.fromCharCode(255&ne>>(-2*pe&6)):0)ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ue);return ye};function t$1(G){var K=G.replace(/-/g,"+").replace(/_/g,"/");switch(K.length%4){case 0:break;case 2:K+="==";break;case 3:K+="=";break;default:throw"Illegal base64url string!"}try{return function(G){return decodeURIComponent(Kv(G).replace(/(.)/g,(function(G,K){var ne=K.charCodeAt(0).toString(16).toUpperCase();return ne.length<2&&(ne="0"+ne),"%"+ne})))}(K)}catch(G){return Kv(K)}}function n$2(G){this.message=G}function o$1(G,K){if("string"!=typeof G)throw new n$2("Invalid token specified");var ne=!0===(K=K||{}).header?0:1;try{return JSON.parse(t$1(G.split(".")[ne]))}catch(G){throw new n$2("Invalid token specified: "+G.message)}}n$2.prototype=new Error,n$2.prototype.name="InvalidTokenError";var Jv,Xv,Qv,Zv={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Yv=(G=>(G[G.NONE=0]="NONE",G[G.ERROR=1]="ERROR",G[G.WARN=2]="WARN",G[G.INFO=3]="INFO",G[G.DEBUG=4]="DEBUG",G))(Yv||{});(Qv=Yv||(Yv={})).reset=function reset(){Jv=3,Xv=Zv},Qv.setLevel=function setLevel(G){if(!(0<=G&&G<=4))throw new Error("Invalid log level");Jv=G},Qv.setLogger=function setLogger(G){Xv=G};var ew=class Logger{constructor(G){this._name=G}debug(...G){Jv>=4&&Xv.debug(ew._format(this._name,this._method),...G)}info(...G){Jv>=3&&Xv.info(ew._format(this._name,this._method),...G)}warn(...G){Jv>=2&&Xv.warn(ew._format(this._name,this._method),...G)}error(...G){Jv>=1&&Xv.error(ew._format(this._name,this._method),...G)}throw(G){throw this.error(G),G}create(G){const K=Object.create(this);return K._method=G,K.debug("begin"),K}static createStatic(G,K){const ne=new ew(`${G}.${K}`);return ne.debug("begin"),ne}static _format(G,K){const ne=`[${G}]`;return K?`${ne} ${K}:`:ne}static debug(G,...K){Jv>=4&&Xv.debug(ew._format(G),...K)}static info(G,...K){Jv>=3&&Xv.info(ew._format(G),...K)}static warn(G,...K){Jv>=2&&Xv.warn(ew._format(G),...K)}static error(G,...K){Jv>=1&&Xv.error(ew._format(G),...K)}};Yv.reset();var tw=class{static _randomWord(){return Uv.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const G="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(G=>(+G^tw._randomWord()&15>>+G/4).toString(16)));return G.replace(/-/g,"")}static generateCodeVerifier(){return tw.generateUUIDv4()+tw.generateUUIDv4()+tw.generateUUIDv4()}static generateCodeChallenge(G){try{const K=Gv(G);return Wv.stringify(K).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(G){throw ew.error("CryptoUtils.generateCodeChallenge",G),G}}static generateBasicAuth(G,K){const ne=Vv.parse([G,K].join(":"));return Wv.stringify(ne)}},rw=class{constructor(G){this._name=G,this._logger=new ew(`Event('${this._name}')`),this._callbacks=[]}addHandler(G){return this._callbacks.push(G),()=>this.removeHandler(G)}removeHandler(G){const K=this._callbacks.lastIndexOf(G);K>=0&&this._callbacks.splice(K,1)}raise(...G){this._logger.debug("raise:",...G);for(const K of this._callbacks)K(...G)}},nw=class{static decode(G){try{return o$1(G)}catch(G){throw ew.error("JwtUtils.decode",G),G}}},aw=class{static center({...G}){var K;return null==G.width&&(G.width=null!=(K=[800,720,600,480].find((G=>G<=window.outerWidth/1.618)))?K:360),null!=G.left||(G.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-G.width)/2))),null!=G.height&&(null!=G.top||(G.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-G.height)/2)))),G}static serialize(G){return Object.entries(G).filter((([,G])=>null!=G)).map((([G,K])=>`${G}=${"boolean"!=typeof K?K:K?"yes":"no"}`)).join(",")}},iw=class extends rw{constructor(){super(...arguments),this._logger=new ew(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const G=this._expiration-iw.getEpochTime();this._logger.debug("timer completes in",G),this._expiration<=iw.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(G){const K=this._logger.create("init");G=Math.max(Math.floor(G),1);const ne=iw.getEpochTime()+G;if(this.expiration===ne&&this._timerHandle)return void K.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),K.debug("using duration",G),this._expiration=ne;const ue=Math.min(G,5);this._timerHandle=setInterval(this._callback,1e3*ue)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},sw=class{static readParams(G,K="query"){if(!G)throw new TypeError("Invalid URL");const ne=new URL(G,"http://127.0.0.1")["fragment"===K?"hash":"search"];return new URLSearchParams(ne.slice(1))}},ow=class extends Error{constructor(G,K){var ne,ue,pe;if(super(G.error_description||G.error||""),this.form=K,this.name="ErrorResponse",!G.error)throw ew.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=G.error,this.error_description=null!=(ne=G.error_description)?ne:null,this.error_uri=null!=(ue=G.error_uri)?ue:null,this.state=G.userState,this.session_state=null!=(pe=G.session_state)?pe:null,this.url_state=G.url_state}},cw=class extends Error{constructor(G){super(G),this.name="ErrorTimeout"}},dw=class{constructor(G){this._logger=new ew("AccessTokenEvents"),this._expiringTimer=new iw("Access token expiring"),this._expiredTimer=new iw("Access token expired"),this._expiringNotificationTimeInSeconds=G.expiringNotificationTimeInSeconds}load(G){const K=this._logger.create("load");if(G.access_token&&void 0!==G.expires_in){const ne=G.expires_in;if(K.debug("access token present, remaining duration:",ne),ne>0){let G=ne-this._expiringNotificationTimeInSeconds;G<=0&&(G=1),K.debug("registering expiring timer, raising in",G,"seconds"),this._expiringTimer.init(G)}else K.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const ue=ne+1;K.debug("registering expired timer, raising in",ue,"seconds"),this._expiredTimer.init(ue)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(G){return this._expiringTimer.addHandler(G)}removeAccessTokenExpiring(G){this._expiringTimer.removeHandler(G)}addAccessTokenExpired(G){return this._expiredTimer.addHandler(G)}removeAccessTokenExpired(G){this._expiredTimer.removeHandler(G)}},uw=class{constructor(){this._logger=new ew("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(G){return this._logger.create(`getItem('${G}')`),this._data[G]}setItem(G,K){this._logger.create(`setItem('${G}')`),this._data[G]=K}removeItem(G){this._logger.create(`removeItem('${G}')`),delete this._data[G]}get length(){return Object.getOwnPropertyNames(this._data).length}key(G){return Object.getOwnPropertyNames(this._data)[G]}},fw=class{constructor(G=[],K=null,ne={}){this._jwtHandler=K,this._extraHeaders=ne,this._logger=new ew("JsonService"),this._contentTypes=[],this._contentTypes.push(...G,"application/json"),K&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(G,K={}){const{timeoutInSeconds:ne,...ue}=K;if(!ne)return await fetch(G,ue);const pe=new AbortController,he=setTimeout((()=>pe.abort()),1e3*ne);try{return await fetch(G,{...K,signal:pe.signal})}catch(G){if(G instanceof DOMException&&"AbortError"===G.name)throw new cw("Network timed out");throw G}finally{clearTimeout(he)}}async getJson(G,{token:K,credentials:ne}={}){const ue=this._logger.create("getJson"),pe={Accept:this._contentTypes.join(", ")};let he;K&&(ue.debug("token passed, setting Authorization header"),pe.Authorization="Bearer "+K),this.appendExtraHeaders(pe);try{ue.debug("url:",G),he=await this.fetchWithTimeout(G,{method:"GET",headers:pe,credentials:ne})}catch(G){throw ue.error("Network Error"),G}ue.debug("HTTP response received, status",he.status);const ye=he.headers.get("Content-Type");if(ye&&!this._contentTypes.find((G=>ye.startsWith(G)))&&ue.throw(new Error(`Invalid response Content-Type: ${null!=ye?ye:"undefined"}, from URL: ${G}`)),he.ok&&this._jwtHandler&&(null==ye?void 0:ye.startsWith("application/jwt")))return await this._jwtHandler(await he.text());let me;try{me=await he.json()}catch(G){if(ue.error("Error parsing JSON response",G),he.ok)throw G;throw new Error(`${he.statusText} (${he.status})`)}if(!he.ok){if(ue.error("Error from server:",me),me.error)throw new ow(me);throw new Error(`${he.statusText} (${he.status}): ${JSON.stringify(me)}`)}return me}async postForm(G,{body:K,basicAuth:ne,timeoutInSeconds:ue,initCredentials:pe}){const he=this._logger.create("postForm"),ye={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let me;void 0!==ne&&(ye.Authorization="Basic "+ne),this.appendExtraHeaders(ye);try{he.debug("url:",G),me=await this.fetchWithTimeout(G,{method:"POST",headers:ye,body:K,timeoutInSeconds:ue,credentials:pe})}catch(G){throw he.error("Network error"),G}he.debug("HTTP response received, status",me.status);const be=me.headers.get("Content-Type");if(be&&!this._contentTypes.find((G=>be.startsWith(G))))throw new Error(`Invalid response Content-Type: ${null!=be?be:"undefined"}, from URL: ${G}`);const ve=await me.text();let _e={};if(ve)try{_e=JSON.parse(ve)}catch(G){if(he.error("Error parsing JSON response",G),me.ok)throw G;throw new Error(`${me.statusText} (${me.status})`)}if(!me.ok){if(he.error("Error from server:",_e),_e.error)throw new ow(_e,K);throw new Error(`${me.statusText} (${me.status}): ${JSON.stringify(_e)}`)}return _e}appendExtraHeaders(G){const K=this._logger.create("appendExtraHeaders"),ne=Object.keys(this._extraHeaders),ue=["authorization","accept","content-type"];0!==ne.length&&ne.forEach((ne=>{if(ue.includes(ne.toLocaleLowerCase()))return void K.warn("Protected header could not be overridden",ne,ue);const pe="function"==typeof this._extraHeaders[ne]?this._extraHeaders[ne]():this._extraHeaders[ne];pe&&""!==pe&&(G[ne]=pe)}))}},lw=class{constructor({prefix:G="oidc.",store:K=localStorage}={}){this._logger=new ew("WebStorageStateStore"),this._store=K,this._prefix=G}async set(G,K){this._logger.create(`set('${G}')`),G=this._prefix+G,await this._store.setItem(G,K)}async get(G){this._logger.create(`get('${G}')`),G=this._prefix+G;return await this._store.getItem(G)}async remove(G){this._logger.create(`remove('${G}')`),G=this._prefix+G;const K=await this._store.getItem(G);return await this._store.removeItem(G),K}async getAllKeys(){this._logger.create("getAllKeys");const G=await this._store.length,K=[];for(let ne=0;ne<G;ne++){const G=await this._store.key(ne);G&&0===G.indexOf(this._prefix)&&K.push(G.substr(this._prefix.length))}return K}},pw=class{constructor({authority:G,metadataUrl:K,metadata:ne,signingKeys:ue,metadataSeed:pe,client_id:he,client_secret:ye,response_type:me="code",scope:be="openid",redirect_uri:ve,post_logout_redirect_uri:_e,client_authentication:Te="client_secret_post",prompt:Ee,display:Pe,max_age:Se,ui_locales:Ce,acr_values:ke,resource:Oe,response_mode:xe="query",filterProtocolClaims:Ne=!0,loadUserInfo:Me=!1,staleStateAgeInSeconds:Be=900,clockSkewInSeconds:Fe=300,userInfoJwtIssuer:De="OP",mergeClaims:Le=!1,disablePKCE:Ue=!1,stateStore:je,refreshTokenCredentials:ze,revokeTokenAdditionalContentTypes:Je,fetchRequestCredentials:Xe,refreshTokenAllowedScope:Qe,extraQueryParams:Ye={},extraTokenParams:et={},extraHeaders:tt={}}){if(this.authority=G,K?this.metadataUrl=K:(this.metadataUrl=G,G&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=ne,this.metadataSeed=pe,this.signingKeys=ue,this.client_id=he,this.client_secret=ye,this.response_type=me,this.scope=be,this.redirect_uri=ve,this.post_logout_redirect_uri=_e,this.client_authentication=Te,this.prompt=Ee,this.display=Pe,this.max_age=Se,this.ui_locales=Ce,this.acr_values=ke,this.resource=Oe,this.response_mode=xe,this.filterProtocolClaims=null==Ne||Ne,this.loadUserInfo=!!Me,this.staleStateAgeInSeconds=Be,this.clockSkewInSeconds=Fe,this.userInfoJwtIssuer=De,this.mergeClaims=!!Le,this.disablePKCE=!!Ue,this.revokeTokenAdditionalContentTypes=Je,Xe&&ze&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=Xe||(ze||"same-origin"),je)this.stateStore=je;else{const G="undefined"!=typeof window?window.localStorage:new uw;this.stateStore=new lw({store:G})}this.refreshTokenAllowedScope=Qe,this.extraQueryParams=Ye,this.extraTokenParams=et,this.extraHeaders=tt}},hw=class{constructor(G,K){this._settings=G,this._metadataService=K,this._logger=new ew("TokenClient"),this._jsonService=new fw(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:G="authorization_code",redirect_uri:K=this._settings.redirect_uri,client_id:ne=this._settings.client_id,client_secret:ue=this._settings.client_secret,...pe}){const he=this._logger.create("exchangeCode");ne||he.throw(new Error("A client_id is required")),K||he.throw(new Error("A redirect_uri is required")),pe.code||he.throw(new Error("A code is required"));const ye=new URLSearchParams({grant_type:G,redirect_uri:K});for(const[G,K]of Object.entries(pe))null!=K&&ye.set(G,K);let me;switch(this._settings.client_authentication){case"client_secret_basic":if(!ue)throw he.throw(new Error("A client_secret is required")),null;me=tw.generateBasicAuth(ne,ue);break;case"client_secret_post":ye.append("client_id",ne),ue&&ye.append("client_secret",ue)}const be=await this._metadataService.getTokenEndpoint(!1);he.debug("got token endpoint");const ve=await this._jsonService.postForm(be,{body:ye,basicAuth:me,initCredentials:this._settings.fetchRequestCredentials});return he.debug("got response"),ve}async exchangeCredentials({grant_type:G="password",client_id:K=this._settings.client_id,client_secret:ne=this._settings.client_secret,scope:ue=this._settings.scope,...pe}){const he=this._logger.create("exchangeCredentials");K||he.throw(new Error("A client_id is required"));const ye=new URLSearchParams({grant_type:G,scope:ue});for(const[G,K]of Object.entries(pe))null!=K&&ye.set(G,K);let me;switch(this._settings.client_authentication){case"client_secret_basic":if(!ne)throw he.throw(new Error("A client_secret is required")),null;me=tw.generateBasicAuth(K,ne);break;case"client_secret_post":ye.append("client_id",K),ne&&ye.append("client_secret",ne)}const be=await this._metadataService.getTokenEndpoint(!1);he.debug("got token endpoint");const ve=await this._jsonService.postForm(be,{body:ye,basicAuth:me,initCredentials:this._settings.fetchRequestCredentials});return he.debug("got response"),ve}async exchangeRefreshToken({grant_type:G="refresh_token",client_id:K=this._settings.client_id,client_secret:ne=this._settings.client_secret,timeoutInSeconds:ue,...pe}){const he=this._logger.create("exchangeRefreshToken");K||he.throw(new Error("A client_id is required")),pe.refresh_token||he.throw(new Error("A refresh_token is required"));const ye=new URLSearchParams({grant_type:G});for(const[G,K]of Object.entries(pe))Array.isArray(K)?K.forEach((K=>ye.append(G,K))):null!=K&&ye.set(G,K);let me;switch(this._settings.client_authentication){case"client_secret_basic":if(!ne)throw he.throw(new Error("A client_secret is required")),null;me=tw.generateBasicAuth(K,ne);break;case"client_secret_post":ye.append("client_id",K),ne&&ye.append("client_secret",ne)}const be=await this._metadataService.getTokenEndpoint(!1);he.debug("got token endpoint");const ve=await this._jsonService.postForm(be,{body:ye,basicAuth:me,timeoutInSeconds:ue,initCredentials:this._settings.fetchRequestCredentials});return he.debug("got response"),ve}async revoke(G){var K;const ne=this._logger.create("revoke");G.token||ne.throw(new Error("A token is required"));const ue=await this._metadataService.getRevocationEndpoint(!1);ne.debug(`got revocation endpoint, revoking ${null!=(K=G.token_type_hint)?K:"default token type"}`);const pe=new URLSearchParams;for(const[K,ne]of Object.entries(G))null!=ne&&pe.set(K,ne);pe.set("client_id",this._settings.client_id),this._settings.client_secret&&pe.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(ue,{body:pe}),ne.debug("got response")}},yw=class{constructor(G){this.id=G.id||tw.generateUUIDv4(),this.data=G.data,G.created&&G.created>0?this.created=G.created:this.created=iw.getEpochTime(),this.request_type=G.request_type,this.url_state=G.url_state}toStorageString(){return new ew("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(G){return ew.createStatic("State","fromStorageString"),new yw(JSON.parse(G))}static async clearStaleState(G,K){const ne=ew.createStatic("State","clearStaleState"),ue=iw.getEpochTime()-K,pe=await G.getAllKeys();ne.debug("got keys",pe);for(let K=0;K<pe.length;K++){const he=pe[K],ye=await G.get(he);let me=!1;if(ye)try{const G=yw.fromStorageString(ye);ne.debug("got item from key:",he,G.created),G.created<=ue&&(me=!0)}catch(G){ne.error("Error parsing state for key:",he,G),me=!0}else ne.debug("no item in storage for key:",he),me=!0;me&&(ne.debug("removed item for key:",he),G.remove(he))}}},mw=class extends yw{constructor(G){super(G),!0===G.code_verifier?this.code_verifier=tw.generateCodeVerifier():G.code_verifier&&(this.code_verifier=G.code_verifier),this.code_verifier&&(this.code_challenge=tw.generateCodeChallenge(this.code_verifier)),this.authority=G.authority,this.client_id=G.client_id,this.redirect_uri=G.redirect_uri,this.scope=G.scope,this.client_secret=G.client_secret,this.extraTokenParams=G.extraTokenParams,this.response_mode=G.response_mode,this.skipUserInfo=G.skipUserInfo}toStorageString(){return new ew("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(G){ew.createStatic("SigninState","fromStorageString");const K=JSON.parse(G);return new mw(K)}},bw=class{constructor(G){if(this.access_token="",this.token_type="",this.profile={},this.state=G.get("state"),this.session_state=G.get("session_state"),this.state){const G=decodeURIComponent(this.state).split(";");this.state=G[0],G.length>1&&(this.url_state=G.slice(1).join(";"))}this.error=G.get("error"),this.error_description=G.get("error_description"),this.error_uri=G.get("error_uri"),this.code=G.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-iw.getEpochTime()}set expires_in(G){"string"==typeof G&&(G=Number(G)),void 0!==G&&G>=0&&(this.expires_at=Math.floor(G)+iw.getEpochTime())}get isOpenId(){var G;return(null==(G=this.scope)?void 0:G.split(" ").includes("openid"))||!!this.id_token}},gw=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],vw=["sub","iss","aud","exp","iat"],ww=class{constructor(G){var K;this.id_token=G.id_token,this.session_state=null!=(K=G.session_state)?K:null,this.access_token=G.access_token,this.refresh_token=G.refresh_token,this.token_type=G.token_type,this.scope=G.scope,this.profile=G.profile,this.expires_at=G.expires_at,this.state=G.userState,this.url_state=G.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-iw.getEpochTime()}set expires_in(G){void 0!==G&&(this.expires_at=Math.floor(G)+iw.getEpochTime())}get expired(){const G=this.expires_in;if(void 0!==G)return G<=0}get scopes(){var G,K;return null!=(K=null==(G=this.scope)?void 0:G.split(" "))?K:[]}toStorageString(){return new ew("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(G){return ew.createStatic("User","fromStorageString"),new ww(JSON.parse(G))}},_w="oidc-client",Tw=class{constructor(){this._abort=new rw("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(G){const K=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");K.debug("setting URL in window"),this._window.location.replace(G.url);const{url:ne,keepOpen:ue}=await new Promise(((ne,ue)=>{const listener=pe=>{var he;const ye=pe.data,me=null!=(he=G.scriptOrigin)?he:window.location.origin;if(pe.origin===me&&(null==ye?void 0:ye.source)===_w){try{const ne=sw.readParams(ye.url,G.response_mode).get("state");if(ne||K.warn("no state found in response url"),pe.source!==this._window&&ne!==G.state)return}catch(G){this._dispose(),ue(new Error("Invalid response from window"))}ne(ye)}};window.addEventListener("message",listener,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",listener,!1))),this._disposeHandlers.add(this._abort.addHandler((G=>{this._dispose(),ue(G)})))}));return K.debug("got response from window"),this._dispose(),ue||this.close(),{url:ne}}_dispose(){this._logger.create("_dispose");for(const G of this._disposeHandlers)G();this._disposeHandlers.clear()}static _notifyParent(G,K,ne=!1,ue=window.location.origin){G.postMessage({source:_w,url:K,keepOpen:ne},ue)}},Aw={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Ew="_blank",Pw=60,Sw=2,Iw=10,Cw=class extends pw{constructor(G){const{popup_redirect_uri:K=G.redirect_uri,popup_post_logout_redirect_uri:ne=G.post_logout_redirect_uri,popupWindowFeatures:ue=Aw,popupWindowTarget:pe=Ew,redirectMethod:he="assign",redirectTarget:ye="self",iframeNotifyParentOrigin:me=G.iframeNotifyParentOrigin,iframeScriptOrigin:be=G.iframeScriptOrigin,silent_redirect_uri:ve=G.redirect_uri,silentRequestTimeoutInSeconds:_e=Iw,automaticSilentRenew:Te=!0,validateSubOnSilentRenew:Ee=!0,includeIdTokenInSilentRenew:Pe=!1,monitorSession:Se=!1,monitorAnonymousSession:Ce=!1,checkSessionIntervalInSeconds:ke=Sw,query_status_response_type:Oe="code",stopCheckSessionOnError:xe=!0,revokeTokenTypes:Ne=["access_token","refresh_token"],revokeTokensOnSignout:Me=!1,includeIdTokenInSilentSignout:Be=!1,accessTokenExpiringNotificationTimeInSeconds:Fe=Pw,userStore:De}=G;if(super(G),this.popup_redirect_uri=K,this.popup_post_logout_redirect_uri=ne,this.popupWindowFeatures=ue,this.popupWindowTarget=pe,this.redirectMethod=he,this.redirectTarget=ye,this.iframeNotifyParentOrigin=me,this.iframeScriptOrigin=be,this.silent_redirect_uri=ve,this.silentRequestTimeoutInSeconds=_e,this.automaticSilentRenew=Te,this.validateSubOnSilentRenew=Ee,this.includeIdTokenInSilentRenew=Pe,this.monitorSession=Se,this.monitorAnonymousSession=Ce,this.checkSessionIntervalInSeconds=ke,this.stopCheckSessionOnError=xe,this.query_status_response_type=Oe,this.revokeTokenTypes=Ne,this.revokeTokensOnSignout=Me,this.includeIdTokenInSilentSignout=Be,this.accessTokenExpiringNotificationTimeInSeconds=Fe,De)this.userStore=De;else{const G="undefined"!=typeof window?window.sessionStorage:new uw;this.userStore=new lw({store:G})}}},Rw=class extends Tw{constructor({silentRequestTimeoutInSeconds:G=Iw}){super(),this._logger=new ew("IFrameWindow"),this._timeoutInSeconds=G,this._frame=Rw.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const G=window.document.createElement("iframe");return G.style.visibility="hidden",G.style.position="fixed",G.style.left="-1000px",G.style.top="0",G.width="0",G.height="0",window.document.body.appendChild(G),G}async navigate(G){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const K=setTimeout((()=>this._abort.raise(new cw("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(K))),await super.navigate(G)}close(){var G;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(G=>{var K;const ne=G.target;null==(K=ne.parentNode)||K.removeChild(ne),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(G=this._frame.contentWindow)||G.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(G,K){return super._notifyParent(window.parent,G,!1,K)}},kw=class extends Tw{constructor({popupWindowTarget:G=Ew,popupWindowFeatures:K={}}){super(),this._logger=new ew("PopupWindow");const ne=aw.center({...Aw,...K});this._window=window.open(void 0,G,aw.serialize(ne)),K.closePopupWindowAfterInSeconds&&K.closePopupWindowAfterInSeconds>0&&setTimeout((()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))}),1e3*K.closePopupWindowAfterInSeconds)}async navigate(G){var K;null==(K=this._window)||K.focus();const ne=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(ne))),await super.navigate(G)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(G,K){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,G,K)}},Ow=class extends dw{constructor(G){super({expiringNotificationTimeInSeconds:G.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new ew("UserManagerEvents"),this._userLoaded=new rw("User loaded"),this._userUnloaded=new rw("User unloaded"),this._silentRenewError=new rw("Silent renew error"),this._userSignedIn=new rw("User signed in"),this._userSignedOut=new rw("User signed out"),this._userSessionChanged=new rw("User session changed")}load(G,K=!0){super.load(G),K&&this._userLoaded.raise(G)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(G){return this._userLoaded.addHandler(G)}removeUserLoaded(G){return this._userLoaded.removeHandler(G)}addUserUnloaded(G){return this._userUnloaded.addHandler(G)}removeUserUnloaded(G){return this._userUnloaded.removeHandler(G)}addSilentRenewError(G){return this._silentRenewError.addHandler(G)}removeSilentRenewError(G){return this._silentRenewError.removeHandler(G)}_raiseSilentRenewError(G){this._silentRenewError.raise(G)}addUserSignedIn(G){return this._userSignedIn.addHandler(G)}removeUserSignedIn(G){this._userSignedIn.removeHandler(G)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(G){return this._userSignedOut.addHandler(G)}removeUserSignedOut(G){this._userSignedOut.removeHandler(G)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(G){return this._userSessionChanged.addHandler(G)}removeUserSessionChanged(G){this._userSessionChanged.removeHandler(G)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},xw={exports:{}};
/*!
      localForage -- Offline Storage, Improved
      Version 1.10.0
      https://localforage.github.io/localForage
      (c) 2013-2017 Mozilla, Apache License 2.0
  */
!function(G,K){G.exports=function e(G,K,ne){function s(pe,he){if(!K[pe]){if(!G[pe]){if(!he&&commonjsRequire)return commonjsRequire(pe);if(ue)return ue(pe,!0);var ye=new Error("Cannot find module '"+pe+"'");throw ye.code="MODULE_NOT_FOUND",ye}var me=K[pe]={exports:{}};G[pe][0].call(me.exports,(function(K){var ne=G[pe][1][K];return s(ne||K)}),me,me.exports,e,G,K,ne)}return K[pe].exports}for(var ue=commonjsRequire,pe=0;pe<ne.length;pe++)s(ne[pe]);return s}({1:[function(G,K,ne){(function(G){var ne,ue,pe=G.MutationObserver||G.WebKitMutationObserver;if(pe){var he=0,ye=new pe(nextTick),me=G.document.createTextNode("");ye.observe(me,{characterData:!0}),ne=function(){me.data=he=++he%2}}else if(G.setImmediate||void 0===G.MessageChannel)ne="document"in G&&"onreadystatechange"in G.document.createElement("script")?function(){var K=G.document.createElement("script");K.onreadystatechange=function(){nextTick(),K.onreadystatechange=null,K.parentNode.removeChild(K),K=null},G.document.documentElement.appendChild(K)}:function(){setTimeout(nextTick,0)};else{var be=new G.MessageChannel;be.port1.onmessage=nextTick,ne=function(){be.port2.postMessage(0)}}var ve=[];function nextTick(){var G,K;ue=!0;for(var ne=ve.length;ne;){for(K=ve,ve=[],G=-1;++G<ne;)K[G]();ne=ve.length}ue=!1}function immediate(G){1!==ve.push(G)||ue||ne()}K.exports=immediate}).call(this,void 0!==pn?pn:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(G,K,ne){var ue=G(1);function INTERNAL(){}var pe={},he=["REJECTED"],ye=["FULFILLED"],me=["PENDING"];function Promise(G){if("function"!=typeof G)throw new TypeError("resolver must be a function");this.state=me,this.queue=[],this.outcome=void 0,G!==INTERNAL&&safelyResolveThenable(this,G)}function QueueItem(G,K,ne){this.promise=G,"function"==typeof K&&(this.onFulfilled=K,this.callFulfilled=this.otherCallFulfilled),"function"==typeof ne&&(this.onRejected=ne,this.callRejected=this.otherCallRejected)}function unwrap(G,K,ne){ue((function(){var ue;try{ue=K(ne)}catch(K){return pe.reject(G,K)}ue===G?pe.reject(G,new TypeError("Cannot resolve promise with itself")):pe.resolve(G,ue)}))}function getThen(G){var K=G&&G.then;if(G&&("object"==typeof G||"function"==typeof G)&&"function"==typeof K)return function appyThen(){K.apply(G,arguments)}}function safelyResolveThenable(G,K){var ne=!1;function onError(K){ne||(ne=!0,pe.reject(G,K))}function onSuccess(K){ne||(ne=!0,pe.resolve(G,K))}function tryToUnwrap(){K(onSuccess,onError)}var ue=tryCatch(tryToUnwrap);"error"===ue.status&&onError(ue.value)}function tryCatch(G,K){var ne={};try{ne.value=G(K),ne.status="success"}catch(G){ne.status="error",ne.value=G}return ne}function resolve(G){return G instanceof this?G:pe.resolve(new this(INTERNAL),G)}function reject(G){var K=new this(INTERNAL);return pe.reject(K,G)}function all(G){var K=this;if("[object Array]"!==Object.prototype.toString.call(G))return this.reject(new TypeError("must be an array"));var ne=G.length,ue=!1;if(!ne)return this.resolve([]);for(var he=new Array(ne),ye=0,me=-1,be=new this(INTERNAL);++me<ne;)allResolver(G[me],me);return be;function allResolver(G,me){function resolveFromAll(G){he[me]=G,++ye!==ne||ue||(ue=!0,pe.resolve(be,he))}K.resolve(G).then(resolveFromAll,(function(G){ue||(ue=!0,pe.reject(be,G))}))}}function race(G){var K=this;if("[object Array]"!==Object.prototype.toString.call(G))return this.reject(new TypeError("must be an array"));var ne=G.length,ue=!1;if(!ne)return this.resolve([]);for(var he=-1,ye=new this(INTERNAL);++he<ne;)resolver(G[he]);return ye;function resolver(G){K.resolve(G).then((function(G){ue||(ue=!0,pe.resolve(ye,G))}),(function(G){ue||(ue=!0,pe.reject(ye,G))}))}}K.exports=Promise,Promise.prototype.catch=function(G){return this.then(null,G)},Promise.prototype.then=function(G,K){if("function"!=typeof G&&this.state===ye||"function"!=typeof K&&this.state===he)return this;var ne=new this.constructor(INTERNAL);return this.state!==me?unwrap(ne,this.state===ye?G:K,this.outcome):this.queue.push(new QueueItem(ne,G,K)),ne},QueueItem.prototype.callFulfilled=function(G){pe.resolve(this.promise,G)},QueueItem.prototype.otherCallFulfilled=function(G){unwrap(this.promise,this.onFulfilled,G)},QueueItem.prototype.callRejected=function(G){pe.reject(this.promise,G)},QueueItem.prototype.otherCallRejected=function(G){unwrap(this.promise,this.onRejected,G)},pe.resolve=function(G,K){var ne=tryCatch(getThen,K);if("error"===ne.status)return pe.reject(G,ne.value);var ue=ne.value;if(ue)safelyResolveThenable(G,ue);else{G.state=ye,G.outcome=K;for(var he=-1,me=G.queue.length;++he<me;)G.queue[he].callFulfilled(K)}return G},pe.reject=function(G,K){G.state=he,G.outcome=K;for(var ne=-1,ue=G.queue.length;++ne<ue;)G.queue[ne].callRejected(K);return G},Promise.resolve=resolve,Promise.reject=reject,Promise.all=all,Promise.race=race},{1:1}],3:[function(G,K,ne){(function(K){"function"!=typeof K.Promise&&(K.Promise=G(2))}).call(this,void 0!==pn?pn:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(G,K,ne){var ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(G){return typeof G}:function(G){return G&&"function"==typeof Symbol&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G};function _classCallCheck(G,K){if(!(G instanceof K))throw new TypeError("Cannot call a class as a function")}function getIDB(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(G){return}}var pe=getIDB();function isIndexedDBValid(){try{if(!pe||!pe.open)return!1;var G="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!G||K)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(G){return!1}}function createBlob(G,K){G=G||[],K=K||{};try{return new Blob(G,K)}catch(pe){if("TypeError"!==pe.name)throw pe;for(var ne=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),ue=0;ue<G.length;ue+=1)ne.append(G[ue]);return ne.getBlob(K.type)}}"undefined"==typeof Promise&&G(3);var he=Promise;function executeCallback(G,K){K&&G.then((function(G){K(null,G)}),(function(G){K(G)}))}function executeTwoCallbacks(G,K,ne){"function"==typeof K&&G.then(K),"function"==typeof ne&&G.catch(ne)}function normalizeKey(G){return"string"!=typeof G&&(console.warn(G+" used as a key, but it is not a string."),G=String(G)),G}function getCallback(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var ye="local-forage-detect-blob-support",me=void 0,be={},ve=Object.prototype.toString,_e="readonly",Te="readwrite";function _binStringToArrayBuffer(G){for(var K=G.length,ne=new ArrayBuffer(K),ue=new Uint8Array(ne),pe=0;pe<K;pe++)ue[pe]=G.charCodeAt(pe);return ne}function _checkBlobSupportWithoutCaching(G){return new he((function(K){var ne=G.transaction(ye,Te),ue=createBlob([""]);ne.objectStore(ye).put(ue,"key"),ne.onabort=function(G){G.preventDefault(),G.stopPropagation(),K(!1)},ne.oncomplete=function(){var G=navigator.userAgent.match(/Chrome\/(\d+)/),ne=navigator.userAgent.match(/Edge\//);K(ne||!G||parseInt(G[1],10)>=43)}})).catch((function(){return!1}))}function _checkBlobSupport(G){return"boolean"==typeof me?he.resolve(me):_checkBlobSupportWithoutCaching(G).then((function(G){return me=G}))}function _deferReadiness(G){var K=be[G.name],ne={};ne.promise=new he((function(G,K){ne.resolve=G,ne.reject=K})),K.deferredOperations.push(ne),K.dbReady?K.dbReady=K.dbReady.then((function(){return ne.promise})):K.dbReady=ne.promise}function _advanceReadiness(G){var K=be[G.name].deferredOperations.pop();if(K)return K.resolve(),K.promise}function _rejectReadiness(G,K){var ne=be[G.name].deferredOperations.pop();if(ne)return ne.reject(K),ne.promise}function _getConnection(G,K){return new he((function(ne,ue){if(be[G.name]=be[G.name]||createDbContext(),G.db){if(!K)return ne(G.db);_deferReadiness(G),G.db.close()}var he=[G.name];K&&he.push(G.version);var me=pe.open.apply(pe,he);K&&(me.onupgradeneeded=function(K){var ne=me.result;try{ne.createObjectStore(G.storeName),K.oldVersion<=1&&ne.createObjectStore(ye)}catch(ne){if("ConstraintError"!==ne.name)throw ne;console.warn('The database "'+G.name+'" has been upgraded from version '+K.oldVersion+" to version "+K.newVersion+', but the storage "'+G.storeName+'" already exists.')}}),me.onerror=function(G){G.preventDefault(),ue(me.error)},me.onsuccess=function(){var K=me.result;K.onversionchange=function(G){G.target.close()},ne(K),_advanceReadiness(G)}}))}function _getOriginalConnection(G){return _getConnection(G,!1)}function _getUpgradedConnection(G){return _getConnection(G,!0)}function _isUpgradeNeeded(G,K){if(!G.db)return!0;var ne=!G.db.objectStoreNames.contains(G.storeName),ue=G.version<G.db.version,pe=G.version>G.db.version;if(ue&&(G.version!==K&&console.warn('The database "'+G.name+"\" can't be downgraded from version "+G.db.version+" to version "+G.version+"."),G.version=G.db.version),pe||ne){if(ne){var he=G.db.version+1;he>G.version&&(G.version=he)}return!0}return!1}function _encodeBlob(G){return new he((function(K,ne){var ue=new FileReader;ue.onerror=ne,ue.onloadend=function(ne){var ue=btoa(ne.target.result||"");K({__local_forage_encoded_blob:!0,data:ue,type:G.type})},ue.readAsBinaryString(G)}))}function _decodeBlob(G){return createBlob([_binStringToArrayBuffer(atob(G.data))],{type:G.type})}function _isEncodedBlob(G){return G&&G.__local_forage_encoded_blob}function _fullyReady(G){var K=this,ne=K._initReady().then((function(){var G=be[K._dbInfo.name];if(G&&G.dbReady)return G.dbReady}));return executeTwoCallbacks(ne,G,G),ne}function _tryReconnect(G){_deferReadiness(G);for(var K=be[G.name],ne=K.forages,ue=0;ue<ne.length;ue++){var pe=ne[ue];pe._dbInfo.db&&(pe._dbInfo.db.close(),pe._dbInfo.db=null)}return G.db=null,_getOriginalConnection(G).then((function(K){return G.db=K,_isUpgradeNeeded(G)?_getUpgradedConnection(G):K})).then((function(ue){G.db=K.db=ue;for(var pe=0;pe<ne.length;pe++)ne[pe]._dbInfo.db=ue})).catch((function(K){throw _rejectReadiness(G,K),K}))}function createTransaction(G,K,ne,ue){void 0===ue&&(ue=1);try{var pe=G.db.transaction(G.storeName,K);ne(null,pe)}catch(pe){if(ue>0&&(!G.db||"InvalidStateError"===pe.name||"NotFoundError"===pe.name))return he.resolve().then((function(){if(!G.db||"NotFoundError"===pe.name&&!G.db.objectStoreNames.contains(G.storeName)&&G.version<=G.db.version)return G.db&&(G.version=G.db.version+1),_getUpgradedConnection(G)})).then((function(){return _tryReconnect(G).then((function(){createTransaction(G,K,ne,ue-1)}))})).catch(ne);ne(pe)}}function createDbContext(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function _initStorage(G){var K=this,ne={db:null};if(G)for(var ue in G)ne[ue]=G[ue];var pe=be[ne.name];pe||(pe=createDbContext(),be[ne.name]=pe),pe.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=_fullyReady);var ye=[];function ignoreErrors(){return he.resolve()}for(var me=0;me<pe.forages.length;me++){var ve=pe.forages[me];ve!==K&&ye.push(ve._initReady().catch(ignoreErrors))}var _e=pe.forages.slice(0);return he.all(ye).then((function(){return ne.db=pe.db,_getOriginalConnection(ne)})).then((function(G){return ne.db=G,_isUpgradeNeeded(ne,K._defaultConfig.version)?_getUpgradedConnection(ne):G})).then((function(G){ne.db=pe.db=G,K._dbInfo=ne;for(var ue=0;ue<_e.length;ue++){var he=_e[ue];he!==K&&(he._dbInfo.db=ne.db,he._dbInfo.version=ne.version)}}))}function getItem(G,K){var ne=this;G=normalizeKey(G);var ue=new he((function(K,ue){ne.ready().then((function(){createTransaction(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).get(G);ye.onsuccess=function(){var G=ye.result;void 0===G&&(G=null),_isEncodedBlob(G)&&(G=_decodeBlob(G)),K(G)},ye.onerror=function(){ue(ye.error)}}catch(G){ue(G)}}))})).catch(ue)}));return executeCallback(ue,K),ue}function iterate(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){createTransaction(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).openCursor(),me=1;ye.onsuccess=function(){var ne=ye.result;if(ne){var ue=ne.value;_isEncodedBlob(ue)&&(ue=_decodeBlob(ue));var pe=G(ue,ne.key,me++);void 0!==pe?K(pe):ne.continue()}else K()},ye.onerror=function(){ue(ye.error)}}catch(G){ue(G)}}))})).catch(ue)}));return executeCallback(ue,K),ue}function setItem(G,K,ne){var ue=this;G=normalizeKey(G);var pe=new he((function(ne,pe){var he;ue.ready().then((function(){return he=ue._dbInfo,"[object Blob]"===ve.call(K)?_checkBlobSupport(he.db).then((function(G){return G?K:_encodeBlob(K)})):K})).then((function(K){createTransaction(ue._dbInfo,Te,(function(he,ye){if(he)return pe(he);try{var me=ye.objectStore(ue._dbInfo.storeName);null===K&&(K=void 0);var be=me.put(K,G);ye.oncomplete=function(){void 0===K&&(K=null),ne(K)},ye.onabort=ye.onerror=function(){var G=be.error?be.error:be.transaction.error;pe(G)}}catch(G){pe(G)}}))})).catch(pe)}));return executeCallback(pe,ne),pe}function removeItem(G,K){var ne=this;G=normalizeKey(G);var ue=new he((function(K,ue){ne.ready().then((function(){createTransaction(ne._dbInfo,Te,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).delete(G);he.oncomplete=function(){K()},he.onerror=function(){ue(ye.error)},he.onabort=function(){var G=ye.error?ye.error:ye.transaction.error;ue(G)}}catch(G){ue(G)}}))})).catch(ue)}));return executeCallback(ue,K),ue}function clear(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){createTransaction(K._dbInfo,Te,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).clear();pe.oncomplete=function(){G()},pe.onabort=pe.onerror=function(){var G=he.error?he.error:he.transaction.error;ne(G)}}catch(G){ne(G)}}))})).catch(ne)}));return executeCallback(ne,G),ne}function length(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){createTransaction(K._dbInfo,_e,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).count();he.onsuccess=function(){G(he.result)},he.onerror=function(){ne(he.error)}}catch(G){ne(G)}}))})).catch(ne)}));return executeCallback(ne,G),ne}function key(G,K){var ne=this,ue=new he((function(K,ue){G<0?K(null):ne.ready().then((function(){createTransaction(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName),me=!1,be=ye.openKeyCursor();be.onsuccess=function(){var ne=be.result;ne?0===G||me?K(ne.key):(me=!0,ne.advance(G)):K(null)},be.onerror=function(){ue(be.error)}}catch(G){ue(G)}}))})).catch(ue)}));return executeCallback(ue,K),ue}function keys(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){createTransaction(K._dbInfo,_e,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).openKeyCursor(),ye=[];he.onsuccess=function(){var K=he.result;K?(ye.push(K.key),K.continue()):G(ye)},he.onerror=function(){ne(he.error)}}catch(G){ne(G)}}))})).catch(ne)}));return executeCallback(ne,G),ne}function dropInstance(G,K){K=getCallback.apply(this,arguments);var ne=this.config();(G="function"!=typeof G&&G||{}).name||(G.name=G.name||ne.name,G.storeName=G.storeName||ne.storeName);var ue,ye=this;if(G.name){var me=G.name===ne.name&&ye._dbInfo.db?he.resolve(ye._dbInfo.db):_getOriginalConnection(G).then((function(K){var ne=be[G.name],ue=ne.forages;ne.db=K;for(var pe=0;pe<ue.length;pe++)ue[pe]._dbInfo.db=K;return K}));ue=G.storeName?me.then((function(K){if(K.objectStoreNames.contains(G.storeName)){var ne=K.version+1;_deferReadiness(G);var ue=be[G.name],ye=ue.forages;K.close();for(var me=0;me<ye.length;me++){var ve=ye[me];ve._dbInfo.db=null,ve._dbInfo.version=ne}var _e=new he((function(K,ue){var he=pe.open(G.name,ne);he.onerror=function(G){he.result.close(),ue(G)},he.onupgradeneeded=function(){he.result.deleteObjectStore(G.storeName)},he.onsuccess=function(){var G=he.result;G.close(),K(G)}}));return _e.then((function(G){ue.db=G;for(var K=0;K<ye.length;K++){var ne=ye[K];ne._dbInfo.db=G,_advanceReadiness(ne._dbInfo)}})).catch((function(K){throw(_rejectReadiness(G,K)||he.resolve()).catch((function(){})),K}))}})):me.then((function(K){_deferReadiness(G);var ne=be[G.name],ue=ne.forages;K.close();for(var ye=0;ye<ue.length;ye++)ue[ye]._dbInfo.db=null;var me=new he((function(K,ne){var ue=pe.deleteDatabase(G.name);ue.onerror=function(){var G=ue.result;G&&G.close(),ne(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+G.name+'" until all open connections are closed')},ue.onsuccess=function(){var G=ue.result;G&&G.close(),K(G)}}));return me.then((function(G){ne.db=G;for(var K=0;K<ue.length;K++)_advanceReadiness(ue[K]._dbInfo)})).catch((function(K){throw(_rejectReadiness(G,K)||he.resolve()).catch((function(){})),K}))}))}else ue=he.reject("Invalid arguments");return executeCallback(ue,K),ue}var Ee={_driver:"asyncStorage",_initStorage:_initStorage,_support:isIndexedDBValid(),iterate:iterate,getItem:getItem,setItem:setItem,removeItem:removeItem,clear:clear,length:length,key:key,keys:keys,dropInstance:dropInstance};function isWebSQLValid(){return"function"==typeof openDatabase}var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se="~~local_forage_type~",Ce=/^~~local_forage_type~([^~]+)~/,ke="__lfsc__:",Oe=ke.length,xe="arbf",Ne="blob",Me="si08",Be="ui08",Fe="uic8",De="si16",Le="si32",Ue="ur16",je="ui32",ze="fl32",Je="fl64",Xe=Oe+xe.length,Qe=Object.prototype.toString;function stringToBuffer(G){var K,ne,ue,pe,he,ye=.75*G.length,me=G.length,be=0;"="===G[G.length-1]&&(ye--,"="===G[G.length-2]&&ye--);var ve=new ArrayBuffer(ye),_e=new Uint8Array(ve);for(K=0;K<me;K+=4)ne=Pe.indexOf(G[K]),ue=Pe.indexOf(G[K+1]),pe=Pe.indexOf(G[K+2]),he=Pe.indexOf(G[K+3]),_e[be++]=ne<<2|ue>>4,_e[be++]=(15&ue)<<4|pe>>2,_e[be++]=(3&pe)<<6|63&he;return ve}function bufferToString(G){var K,ne=new Uint8Array(G),ue="";for(K=0;K<ne.length;K+=3)ue+=Pe[ne[K]>>2],ue+=Pe[(3&ne[K])<<4|ne[K+1]>>4],ue+=Pe[(15&ne[K+1])<<2|ne[K+2]>>6],ue+=Pe[63&ne[K+2]];return ne.length%3==2?ue=ue.substring(0,ue.length-1)+"=":ne.length%3==1&&(ue=ue.substring(0,ue.length-2)+"=="),ue}function serialize(G,K){var ne="";if(G&&(ne=Qe.call(G)),G&&("[object ArrayBuffer]"===ne||G.buffer&&"[object ArrayBuffer]"===Qe.call(G.buffer))){var ue,pe=ke;G instanceof ArrayBuffer?(ue=G,pe+=xe):(ue=G.buffer,"[object Int8Array]"===ne?pe+=Me:"[object Uint8Array]"===ne?pe+=Be:"[object Uint8ClampedArray]"===ne?pe+=Fe:"[object Int16Array]"===ne?pe+=De:"[object Uint16Array]"===ne?pe+=Ue:"[object Int32Array]"===ne?pe+=Le:"[object Uint32Array]"===ne?pe+=je:"[object Float32Array]"===ne?pe+=ze:"[object Float64Array]"===ne?pe+=Je:K(new Error("Failed to get type for BinaryArray"))),K(pe+bufferToString(ue))}else if("[object Blob]"===ne){var he=new FileReader;he.onload=function(){var ne=Se+G.type+"~"+bufferToString(this.result);K(ke+Ne+ne)},he.readAsArrayBuffer(G)}else try{K(JSON.stringify(G))}catch(ne){console.error("Couldn't convert value into a JSON string: ",G),K(null,ne)}}function deserialize(G){if(G.substring(0,Oe)!==ke)return JSON.parse(G);var K,ne=G.substring(Xe),ue=G.substring(Oe,Xe);if(ue===Ne&&Ce.test(ne)){var pe=ne.match(Ce);K=pe[1],ne=ne.substring(pe[0].length)}var he=stringToBuffer(ne);switch(ue){case xe:return he;case Ne:return createBlob([he],{type:K});case Me:return new Int8Array(he);case Be:return new Uint8Array(he);case Fe:return new Uint8ClampedArray(he);case De:return new Int16Array(he);case Ue:return new Uint16Array(he);case Le:return new Int32Array(he);case je:return new Uint32Array(he);case ze:return new Float32Array(he);case Je:return new Float64Array(he);default:throw new Error("Unkown type: "+ue)}}var Ye={serialize:serialize,deserialize:deserialize,stringToBuffer:stringToBuffer,bufferToString:bufferToString};function createDbTable(G,K,ne,ue){G.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],ne,ue)}function _initStorage$1(G){var K=this,ne={db:null};if(G)for(var ue in G)ne[ue]="string"!=typeof G[ue]?G[ue].toString():G[ue];var pe=new he((function(G,ue){try{ne.db=openDatabase(ne.name,String(ne.version),ne.description,ne.size)}catch(G){return ue(G)}ne.db.transaction((function(pe){createDbTable(pe,ne,(function(){K._dbInfo=ne,G()}),(function(G,K){ue(K)}))}),ue)}));return ne.serializer=Ye,pe}function tryExecuteSql(G,K,ne,ue,pe,he){G.executeSql(ne,ue,pe,(function(G,ye){ye.code===ye.SYNTAX_ERR?G.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],(function(G,me){me.rows.length?he(G,ye):createDbTable(G,K,(function(){G.executeSql(ne,ue,pe,he)}),he)}),he):he(G,ye)}),he)}function getItem$1(G,K){var ne=this;G=normalizeKey(G);var ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){tryExecuteSql(ne,pe,"SELECT * FROM "+pe.storeName+" WHERE key = ? LIMIT 1",[G],(function(G,ne){var ue=ne.rows.length?ne.rows.item(0).value:null;ue&&(ue=pe.serializer.deserialize(ue)),K(ue)}),(function(G,K){ue(K)}))}))})).catch(ue)}));return executeCallback(ue,K),ue}function iterate$1(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){tryExecuteSql(ne,pe,"SELECT * FROM "+pe.storeName,[],(function(ne,ue){for(var he=ue.rows,ye=he.length,me=0;me<ye;me++){var be=he.item(me),ve=be.value;if(ve&&(ve=pe.serializer.deserialize(ve)),void 0!==(ve=G(ve,be.key,me+1)))return void K(ve)}K()}),(function(G,K){ue(K)}))}))})).catch(ue)}));return executeCallback(ue,K),ue}function _setItem(G,K,ne,ue){var pe=this;G=normalizeKey(G);var ye=new he((function(he,ye){pe.ready().then((function(){void 0===K&&(K=null);var me=K,be=pe._dbInfo;be.serializer.serialize(K,(function(K,ve){ve?ye(ve):be.db.transaction((function(ne){tryExecuteSql(ne,be,"INSERT OR REPLACE INTO "+be.storeName+" (key, value) VALUES (?, ?)",[G,K],(function(){he(me)}),(function(G,K){ye(K)}))}),(function(K){if(K.code===K.QUOTA_ERR){if(ue>0)return void he(_setItem.apply(pe,[G,me,ne,ue-1]));ye(K)}}))}))})).catch(ye)}));return executeCallback(ye,ne),ye}function setItem$1(G,K,ne){return _setItem.apply(this,[G,K,ne,1])}function removeItem$1(G,K){var ne=this;G=normalizeKey(G);var ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){tryExecuteSql(ne,pe,"DELETE FROM "+pe.storeName+" WHERE key = ?",[G],(function(){K()}),(function(G,K){ue(K)}))}))})).catch(ue)}));return executeCallback(ue,K),ue}function clear$1(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){tryExecuteSql(K,ue,"DELETE FROM "+ue.storeName,[],(function(){G()}),(function(G,K){ne(K)}))}))})).catch(ne)}));return executeCallback(ne,G),ne}function length$1(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){tryExecuteSql(K,ue,"SELECT COUNT(key) as c FROM "+ue.storeName,[],(function(K,ne){var ue=ne.rows.item(0).c;G(ue)}),(function(G,K){ne(K)}))}))})).catch(ne)}));return executeCallback(ne,G),ne}function key$1(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){tryExecuteSql(ne,pe,"SELECT key FROM "+pe.storeName+" WHERE id = ? LIMIT 1",[G+1],(function(G,ne){var ue=ne.rows.length?ne.rows.item(0).key:null;K(ue)}),(function(G,K){ue(K)}))}))})).catch(ue)}));return executeCallback(ue,K),ue}function keys$1(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){tryExecuteSql(K,ue,"SELECT key FROM "+ue.storeName,[],(function(K,ne){for(var ue=[],pe=0;pe<ne.rows.length;pe++)ue.push(ne.rows.item(pe).key);G(ue)}),(function(G,K){ne(K)}))}))})).catch(ne)}));return executeCallback(ne,G),ne}function getAllStoreNames(G){return new he((function(K,ne){G.transaction((function(ue){ue.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(ne,ue){for(var pe=[],he=0;he<ue.rows.length;he++)pe.push(ue.rows.item(he).name);K({db:G,storeNames:pe})}),(function(G,K){ne(K)}))}),(function(G){ne(G)}))}))}function dropInstance$1(G,K){K=getCallback.apply(this,arguments);var ne=this.config();(G="function"!=typeof G&&G||{}).name||(G.name=G.name||ne.name,G.storeName=G.storeName||ne.storeName);var ue,pe=this;return ue=G.name?new he((function(K){var ue;ue=G.name===ne.name?pe._dbInfo.db:openDatabase(G.name,"","",0),G.storeName?K({db:ue,storeNames:[G.storeName]}):K(getAllStoreNames(ue))})).then((function(G){return new he((function(K,ne){G.db.transaction((function(ue){function dropTable(G){return new he((function(K,ne){ue.executeSql("DROP TABLE IF EXISTS "+G,[],(function(){K()}),(function(G,K){ne(K)}))}))}for(var pe=[],ye=0,me=G.storeNames.length;ye<me;ye++)pe.push(dropTable(G.storeNames[ye]));he.all(pe).then((function(){K()})).catch((function(G){ne(G)}))}),(function(G){ne(G)}))}))})):he.reject("Invalid arguments"),executeCallback(ue,K),ue}var et={_driver:"webSQLStorage",_initStorage:_initStorage$1,_support:isWebSQLValid(),iterate:iterate$1,getItem:getItem$1,setItem:setItem$1,removeItem:removeItem$1,clear:clear$1,length:length$1,key:key$1,keys:keys$1,dropInstance:dropInstance$1};function isLocalStorageValid(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(G){return!1}}function _getKeyPrefix(G,K){var ne=G.name+"/";return G.storeName!==K.storeName&&(ne+=G.storeName+"/"),ne}function checkIfLocalStorageThrows(){var G="_localforage_support_test";try{return localStorage.setItem(G,!0),localStorage.removeItem(G),!1}catch(G){return!0}}function _isLocalStorageUsable(){return!checkIfLocalStorageThrows()||localStorage.length>0}function _initStorage$2(G){var K=this,ne={};if(G)for(var ue in G)ne[ue]=G[ue];return ne.keyPrefix=_getKeyPrefix(G,K._defaultConfig),_isLocalStorageUsable()?(K._dbInfo=ne,ne.serializer=Ye,he.resolve()):he.reject()}function clear$2(G){var K=this,ne=K.ready().then((function(){for(var G=K._dbInfo.keyPrefix,ne=localStorage.length-1;ne>=0;ne--){var ue=localStorage.key(ne);0===ue.indexOf(G)&&localStorage.removeItem(ue)}}));return executeCallback(ne,G),ne}function getItem$2(G,K){var ne=this;G=normalizeKey(G);var ue=ne.ready().then((function(){var K=ne._dbInfo,ue=localStorage.getItem(K.keyPrefix+G);return ue&&(ue=K.serializer.deserialize(ue)),ue}));return executeCallback(ue,K),ue}function iterate$2(G,K){var ne=this,ue=ne.ready().then((function(){for(var K=ne._dbInfo,ue=K.keyPrefix,pe=ue.length,he=localStorage.length,ye=1,me=0;me<he;me++){var be=localStorage.key(me);if(0===be.indexOf(ue)){var ve=localStorage.getItem(be);if(ve&&(ve=K.serializer.deserialize(ve)),void 0!==(ve=G(ve,be.substring(pe),ye++)))return ve}}}));return executeCallback(ue,K),ue}function key$2(G,K){var ne=this,ue=ne.ready().then((function(){var K,ue=ne._dbInfo;try{K=localStorage.key(G)}catch(G){K=null}return K&&(K=K.substring(ue.keyPrefix.length)),K}));return executeCallback(ue,K),ue}function keys$2(G){var K=this,ne=K.ready().then((function(){for(var G=K._dbInfo,ne=localStorage.length,ue=[],pe=0;pe<ne;pe++){var he=localStorage.key(pe);0===he.indexOf(G.keyPrefix)&&ue.push(he.substring(G.keyPrefix.length))}return ue}));return executeCallback(ne,G),ne}function length$2(G){var K=this.keys().then((function(G){return G.length}));return executeCallback(K,G),K}function removeItem$2(G,K){var ne=this;G=normalizeKey(G);var ue=ne.ready().then((function(){var K=ne._dbInfo;localStorage.removeItem(K.keyPrefix+G)}));return executeCallback(ue,K),ue}function setItem$2(G,K,ne){var ue=this;G=normalizeKey(G);var pe=ue.ready().then((function(){void 0===K&&(K=null);var ne=K;return new he((function(pe,he){var ye=ue._dbInfo;ye.serializer.serialize(K,(function(K,ue){if(ue)he(ue);else try{localStorage.setItem(ye.keyPrefix+G,K),pe(ne)}catch(G){"QuotaExceededError"!==G.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==G.name||he(G),he(G)}}))}))}));return executeCallback(pe,ne),pe}function dropInstance$2(G,K){if(K=getCallback.apply(this,arguments),!(G="function"!=typeof G&&G||{}).name){var ne=this.config();G.name=G.name||ne.name,G.storeName=G.storeName||ne.storeName}var ue,pe=this;return ue=G.name?new he((function(K){G.storeName?K(_getKeyPrefix(G,pe._defaultConfig)):K(G.name+"/")})).then((function(G){for(var K=localStorage.length-1;K>=0;K--){var ne=localStorage.key(K);0===ne.indexOf(G)&&localStorage.removeItem(ne)}})):he.reject("Invalid arguments"),executeCallback(ue,K),ue}var tt={_driver:"localStorageWrapper",_initStorage:_initStorage$2,_support:isLocalStorageValid(),iterate:iterate$2,getItem:getItem$2,setItem:setItem$2,removeItem:removeItem$2,clear:clear$2,length:length$2,key:key$2,keys:keys$2,dropInstance:dropInstance$2},rt=function sameValue(G,K){return G===K||"number"==typeof G&&"number"==typeof K&&isNaN(G)&&isNaN(K)},nt=function includes(G,K){for(var ne=G.length,ue=0;ue<ne;){if(rt(G[ue],K))return!0;ue++}return!1},at=Array.isArray||function(G){return"[object Array]"===Object.prototype.toString.call(G)},it={},ot={},ct={INDEXEDDB:Ee,WEBSQL:et,LOCALSTORAGE:tt},dt=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],ut=["dropInstance"],ft=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ut),yt={description:"",driver:dt.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function callWhenReady(G,K){G[K]=function(){var ne=arguments;return G.ready().then((function(){return G[K].apply(G,ne)}))}}function extend(){for(var G=1;G<arguments.length;G++){var K=arguments[G];if(K)for(var ne in K)K.hasOwnProperty(ne)&&(at(K[ne])?arguments[0][ne]=K[ne].slice():arguments[0][ne]=K[ne])}return arguments[0]}var wt=function(){function LocalForage(G){for(var K in _classCallCheck(this,LocalForage),ct)if(ct.hasOwnProperty(K)){var ne=ct[K],ue=ne._driver;this[K]=ue,it[ue]||this.defineDriver(ne)}this._defaultConfig=extend({},yt),this._config=extend({},this._defaultConfig,G),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return LocalForage.prototype.config=function config(G){if("object"===(void 0===G?"undefined":ue(G))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var K in G){if("storeName"===K&&(G[K]=G[K].replace(/\W/g,"_")),"version"===K&&"number"!=typeof G[K])return new Error("Database version must be a number.");this._config[K]=G[K]}return!("driver"in G)||!G.driver||this.setDriver(this._config.driver)}return"string"==typeof G?this._config[G]:this._config},LocalForage.prototype.defineDriver=function defineDriver(G,K,ne){var ue=new he((function(K,ne){try{var ue=G._driver,pe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!G._driver)return void ne(pe);for(var ye=ft.concat("_initStorage"),me=0,be=ye.length;me<be;me++){var ve=ye[me];if((!nt(ut,ve)||G[ve])&&"function"!=typeof G[ve])return void ne(pe)}var _e=function configureMissingMethods(){for(var K=function methodNotImplementedFactory(G){return function(){var K=new Error("Method "+G+" is not implemented by the current driver"),ne=he.reject(K);return executeCallback(ne,arguments[arguments.length-1]),ne}},ne=0,ue=ut.length;ne<ue;ne++){var pe=ut[ne];G[pe]||(G[pe]=K(pe))}};_e();var Te=function setDriverSupport(ne){it[ue]&&console.info("Redefining LocalForage driver: "+ue),it[ue]=G,ot[ue]=ne,K()};"_support"in G?G._support&&"function"==typeof G._support?G._support().then(Te,ne):Te(!!G._support):Te(!0)}catch(G){ne(G)}}));return executeTwoCallbacks(ue,K,ne),ue},LocalForage.prototype.driver=function driver(){return this._driver||null},LocalForage.prototype.getDriver=function getDriver(G,K,ne){var ue=it[G]?he.resolve(it[G]):he.reject(new Error("Driver not found."));return executeTwoCallbacks(ue,K,ne),ue},LocalForage.prototype.getSerializer=function getSerializer(G){var K=he.resolve(Ye);return executeTwoCallbacks(K,G),K},LocalForage.prototype.ready=function ready(G){var K=this,ne=K._driverSet.then((function(){return null===K._ready&&(K._ready=K._initDriver()),K._ready}));return executeTwoCallbacks(ne,G,G),ne},LocalForage.prototype.setDriver=function setDriver(G,K,ne){var ue=this;at(G)||(G=[G]);var pe=this._getSupportedDrivers(G);function setDriverToConfig(){ue._config.driver=ue.driver()}function extendSelfWithDriver(G){return ue._extend(G),setDriverToConfig(),ue._ready=ue._initStorage(ue._config),ue._ready}function initDriver(G){return function(){var K=0;function driverPromiseLoop(){for(;K<G.length;){var ne=G[K];return K++,ue._dbInfo=null,ue._ready=null,ue.getDriver(ne).then(extendSelfWithDriver).catch(driverPromiseLoop)}setDriverToConfig();var pe=new Error("No available storage method found.");return ue._driverSet=he.reject(pe),ue._driverSet}return driverPromiseLoop()}}var ye=null!==this._driverSet?this._driverSet.catch((function(){return he.resolve()})):he.resolve();return this._driverSet=ye.then((function(){var G=pe[0];return ue._dbInfo=null,ue._ready=null,ue.getDriver(G).then((function(G){ue._driver=G._driver,setDriverToConfig(),ue._wrapLibraryMethodsWithReady(),ue._initDriver=initDriver(pe)}))})).catch((function(){setDriverToConfig();var G=new Error("No available storage method found.");return ue._driverSet=he.reject(G),ue._driverSet})),executeTwoCallbacks(this._driverSet,K,ne),this._driverSet},LocalForage.prototype.supports=function supports(G){return!!ot[G]},LocalForage.prototype._extend=function _extend(G){extend(this,G)},LocalForage.prototype._getSupportedDrivers=function _getSupportedDrivers(G){for(var K=[],ne=0,ue=G.length;ne<ue;ne++){var pe=G[ne];this.supports(pe)&&K.push(pe)}return K},LocalForage.prototype._wrapLibraryMethodsWithReady=function _wrapLibraryMethodsWithReady(){for(var G=0,K=ft.length;G<K;G++)callWhenReady(this,ft[G])},LocalForage.prototype.createInstance=function createInstance(G){return new LocalForage(G)},LocalForage}(),At=new wt;K.exports=At},{3:3}]},{},[4])(4)}(xw);var Nw,Mw,Bw=getDefaultExportFromCjs$1(xw.exports),Fw=(G=>(G.MissingApiKey="MISSING_API_KEY",G.ModalNotReady="MODAL_NOT_READY",G.ConnectionLost="CONNECTION_WAS_LOST",G.MalformedResponse="MALFORMED_RESPONSE",G.InvalidArgument="INVALID_ARGUMENT",G.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",G.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",G))(Fw||{}),Dw=(G=>(G.SyncWeb3Method="SYNC_WEB3_METHOD",G.DuplicateIframe="DUPLICATE_IFRAME",G.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",G.DeprecationNotice="DEPRECATION_NOTICE",G.ProductAnnouncement="ANNOUNCEMENT",G))(Dw||{}),Lw=(G=>(G[G.ParseError=-32700]="ParseError",G[G.InvalidRequest=-32600]="InvalidRequest",G[G.MethodNotFound=-32601]="MethodNotFound",G[G.InvalidParams=-32602]="InvalidParams",G[G.InternalError=-32603]="InternalError",G[G.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",G[G.MagicLinkExpired=-10001]="MagicLinkExpired",G[G.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",G[G.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",G[G.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",G[G.UpdateEmailFailed=-10004]="UpdateEmailFailed",G[G.UserRequestEditEmail=-10005]="UserRequestEditEmail",G[G.InactiveRecipient=-10010]="InactiveRecipient",G[G.AccessDeniedToUser=-10011]="AccessDeniedToUser",G[G.RedirectLoginComplete=-10015]="RedirectLoginComplete",G))(Lw||{}),Uw=(G=>(G.PROVIDER="magic_3pw_provider",G.ADDRESS="magic_3pw_address",G.CHAIN_ID="magic_3pw_chainId",G))(Uw||{}),$w=(G=>(G.WalletConnected="wallet_connected",G.WalletRejected="wallet_rejected",G.Web3ModalSelected="web3modal_selected",G))($w||{}),qw=(G=>(G.LoginWithSms="magic_auth_login_with_sms",G.LoginWithEmailOTP="magic_auth_login_with_email_otp",G.LoginWithMagicLink="magic_auth_login_with_magic_link",G.LoginWithCredential="magic_auth_login_with_credential",G.SetAuthorizationToken="magic_auth_set_authorization_token",G.GetIdToken="magic_auth_get_id_token",G.GenerateIdToken="magic_auth_generate_id_token",G.GetMetadata="magic_auth_get_metadata",G.IsLoggedIn="magic_is_logged_in",G.Logout="magic_auth_logout",G.UpdateEmail="magic_auth_update_email",G.UserSettings="magic_auth_settings",G.UserSettingsTestMode="magic_auth_settings_testing_mode",G.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",G.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",G.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",G.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",G.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",G.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",G.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",G.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",G.LogoutTestMode="magic_auth_logout_testing_mode",G.UpdateEmailTestMode="magic_auth_update_email_testing_mode",G.IntermediaryEvent="magic_intermediary_event",G.RequestAccounts="eth_requestAccounts",G.GetInfo="magic_get_info",G.ShowUI="magic_wallet",G.NFTPurchase="magic_nft_purchase",G.NFTCheckout="magic_nft_checkout",G.NFTTransfer="magic_nft_transfer",G.RequestUserInfoWithUI="mc_request_user_info",G.Disconnect="mc_disconnect",G.RecoverAccount="magic_auth_recover_account",G.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",G.MagicBoxHeartBeat="magic_box_heart_beat",G.AutoConnect="mc_auto_connect",G.Login="mc_login",G.EncryptV1="magic_auth_encrypt_v1",G.DecryptV1="magic_auth_decrypt_v1",G.ShowNFTs="magic_show_nfts",G.ShowOnRamp="magic_show_fiat_onramp",G.ShowSendTokensUI="magic_show_send_tokens_ui",G.ShowAddress="magic_show_address",G.ShowBalances="magic_show_balances",G.SendGaslessTransaction="eth_sendGaslessTransaction",G.RevealPK="magic_reveal_key",G.EnableMFA="magic_auth_enable_mfa_flow",G.DisableMFA="magic_auth_disable_mfa_flow",G))(qw||{}),Gw=["magic_intermediary_event","magic_nft_checkout","mc_login"],jw=(G=>(G.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",G.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",G.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",G.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",G.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",G.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",G.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",G.MAGIC_PONG="MAGIC_PONG",G.MAGIC_POPUP_RESPONSE="MAGIC_POPUP_RESPONSE",G.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE="MAGIC_POPUP_OAUTH_VERIFY_RESPONSE",G))(jw||{}),Hw=((Nw=Hw||{}).MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",Nw.MAGIC_PING="MAGIC_PING",Nw),Ww=(G=>(G.UpdateEmail="update-email",G.MFA="mfa",G.Recovery="recovery",G))(Ww||{}),zw=(G=>(G.Retry="retry",G))(zw||{}),Vw=(G=>(G.EmailSent="email-sent",G.EmailNotDeliverable="email-not-deliverable",G))(Vw||{}),Kw=(G=>(G.VerifyEmailOtp="verify-email-otp",G.VerifyMFACode="verify-mfa-code",G.LostDevice="lost-device",G.VerifyRecoveryCode="verify-recovery-code",G.Cancel="cancel",G))(Kw||{}),Jw=(G=>(G.VerifySmsOtp="verify-sms-otp",G.Cancel="cancel",G.Retry="retry",G))(Jw||{}),Xw=(G=>(G.SmsOTPSent="sms-otp-sent",G.InvalidSmsOtp="invalid-sms-otp",G.ExpiredSmsOtp="expired-sms-otp",G))(Xw||{}),Qw=((Mw=Qw||{}).EmailOTPSent="email-otp-sent",Mw.InvalidEmailOtp="invalid-email-otp",Mw.InvalidMfaOtp="invalid-mfa-otp",Mw.ExpiredEmailOtp="expired-email-otp",Mw.MfaSentHandle="mfa-sent-handle",Mw.RecoveryCodeSentHandle="recovery-code-sent-handle",Mw.InvalidRecoveryCode="invalid-recovery-code",Mw.RecoveryCodeSuccess="recovery-code-success",Mw),Zw=(G=>(G.Retry="device-retry",G))(Zw||{}),Yw=(G=>(G.DeviceApproved="device-approved",G.DeviceNeedsApproval="device-needs-approval",G.DeviceVerificationLinkExpired="device-verification-link-expired",G.DeviceVerificationEmailSent="device-verification-email-sent",G))(Yw||{}),e_=(G=>(G.Retry="Recency/auth-factor-retry",G.Cancel="Recency/auth-factor-verification-cancel",G.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",G.VerifyMFACode="Recency/verify-mfa-code",G))(e_||{}),t_=(G=>(G.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",G.PrimaryAuthFactorVerified="Recency/auth-factor-verified",G.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",G.EmailExpired="Recency/auth-factor-verification-email-expired",G.EmailSent="Recency/auth-factor-verification-email-sent",G.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",G))(t_||{}),r_=(G=>(G.RetryWithNewEmail="UpdateEmail/retry-with-new-email",G.Cancel="UpdateEmail/new-email-verification-cancel",G.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",G))(r_||{}),n_=(G=>(G.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",G.EmailUpdated="UpdateEmail/email-updated",G.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",G.EmailExpired="UpdateEmail/new-email-verification-email-expired",G.EmailSent="UpdateEmail/new-email-verification-email-sent",G.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",G.InvalidEmail="UpdateEmail/new-email-invalid",G.EmailAlreadyExists="UpdateEmail/new-email-already-exists",G))(n_||{}),a_=(G=>(G.IDTokenCreated="Auth/id-token-created",G))(a_||{}),i_=(G=>(G.Cancel="Farcaster/cancel",G))(i_||{}),s_=(G=>(G.MFASecretGenerated="mfa-secret-generated",G.InvalidMFAOtp="invalid-mfa-otp",G.MFARecoveryCodes="mfa-recovery-codes",G))(s_||{}),o_=(G=>(G.VerifyMFACode="verify-mfa-code",G.Cancel="cancel-mfa-setup",G))(o_||{}),c_=(G=>(G.MFACodeRequested="mfa-code-requested",G.InvalidMFAOtp="invalid-mfa-otp",G.InvalidRecoveryCode="invalid-recovery-code",G))(c_||{}),d_=(G=>(G.VerifyMFACode="verify-mfa-code",G.LostDevice="lost-device",G.Cancel="cancel-mfa-disable",G))(d_||{}),u_=(G=>(G.Harmony="HARMONY",G))(u_||{}),f_=(G=>(G.ClosedByUser="closed-by-user",G))(f_||{}),l_=(G=>(G.ClosedByUser="closed-by-user-on-received",G))(l_||{}),p_=(G=>(G.EnterNewPhoneNumber="enter-new-phone-number",G.EnterOtpCode="enter-otp-code",G.RecoveryFactorAlreadyExists="recovery-factor-already-exists",G.MalformedPhoneNumber="malformed-phone-number",G.InvalidOtpCode="invalid-otp-code",G))(p_||{}),h_=(G=>(G.SendNewPhoneNumber="send-new-phone-number",G.SendOtpCode="send-otp-code",G.Cancel="cancel",G.StartEditPhoneNumber="start-edit-phone-number",G))(h_||{}),y_=(G=>(G.PhoneNumber="phone_number",G))(y_||{}),m_=(G=>(G.SmsOtpSent="sms-otp-sent",G.LoginThrottled="login-throttled",G.InvalidSmsOtp="invalid-sms-otp",G.SmsVerified="sms-verified",G.AccountRecovered="account-recovered",G.UpdateEmailRequired="update-email-required",G))(m_||{}),b_=(G=>(G.Cancel="cancel",G.VerifyOtp="verify-otp-code",G.ResendSms="resend-sms-otp",G.UpdateEmail="update-email",G))(b_||{}),g_=(G=>(G.Success="nft-checkout-success",G.Failure="nft-checkout-failure",G.Initiated="nft-checkout-initiated",G.Disconnect="disconnect",G))(g_||{}),v_=(G=>(G.WalletInfoFetched="Wallet/wallet-info-fetched",G))(v_||{}),w_=(G=>(G.CloseMagicWindow="close-magic-window",G))(w_||{}),T_=Object.create,A_=Object.defineProperty,E_=Object.defineProperties,P_=Object.getOwnPropertyDescriptor,S_=Object.getOwnPropertyDescriptors,I_=Object.getOwnPropertyNames,C_=Object.getOwnPropertySymbols,R_=Object.getPrototypeOf,k_=Object.prototype.hasOwnProperty,O_=Object.prototype.propertyIsEnumerable,tt$1=(G,K,ne)=>K in G?A_(G,K,{enumerable:!0,configurable:!0,writable:!0,value:ne}):G[K]=ne,k$1=(G,K)=>{for(var ne in K||(K={}))k_.call(K,ne)&&tt$1(G,ne,K[ne]);if(C_)for(var ne of C_(K))O_.call(K,ne)&&tt$1(G,ne,K[ne]);return G},H$1=(G,K)=>E_(G,S_(K)),m$2=(G,K,ne)=>new Promise(((ue,pe)=>{var s=G=>{try{a(ne.next(G))}catch(G){pe(G)}},o=G=>{try{a(ne.throw(G))}catch(G){pe(G)}},a=G=>G.done?ue(G.value):Promise.resolve(G.value).then(s,o);a((ne=ne.apply(G,K)).next())})),x_=((G,K)=>()=>(K||G((K={exports:{}}).exports,K),K.exports))(((G,K)=>{var ne=Object.prototype.hasOwnProperty,ue="~";function ae(){}function dn(G,K,ne){this.fn=G,this.context=K,this.once=ne||!1}function Ct(G,K,ne,pe,he){if("function"!=typeof ne)throw new TypeError("The listener must be a function");var ye=new dn(ne,pe||G,he),me=ue?ue+K:K;return G._events[me]?G._events[me].fn?G._events[me]=[G._events[me],ye]:G._events[me].push(ye):(G._events[me]=ye,G._eventsCount++),G}function Re(G,K){0==--G._eventsCount?G._events=new ae:delete G._events[K]}function I(){this._events=new ae,this._eventsCount=0}Object.create&&(ae.prototype=Object.create(null),(new ae).__proto__||(ue=!1)),I.prototype.eventNames=function(){var G,K,pe=[];if(0===this._eventsCount)return pe;for(K in G=this._events)ne.call(G,K)&&pe.push(ue?K.slice(1):K);return Object.getOwnPropertySymbols?pe.concat(Object.getOwnPropertySymbols(G)):pe},I.prototype.listeners=function(G){var K=ue?ue+G:G,ne=this._events[K];if(!ne)return[];if(ne.fn)return[ne.fn];for(var pe=0,he=ne.length,ye=new Array(he);pe<he;pe++)ye[pe]=ne[pe].fn;return ye},I.prototype.listenerCount=function(G){var K=ue?ue+G:G,ne=this._events[K];return ne?ne.fn?1:ne.length:0},I.prototype.emit=function(G,K,ne,pe,he,ye){var me=ue?ue+G:G;if(!this._events[me])return!1;var be,ve,_e=this._events[me],Te=arguments.length;if(_e.fn){switch(_e.once&&this.removeListener(G,_e.fn,void 0,!0),Te){case 1:return _e.fn.call(_e.context),!0;case 2:return _e.fn.call(_e.context,K),!0;case 3:return _e.fn.call(_e.context,K,ne),!0;case 4:return _e.fn.call(_e.context,K,ne,pe),!0;case 5:return _e.fn.call(_e.context,K,ne,pe,he),!0;case 6:return _e.fn.call(_e.context,K,ne,pe,he,ye),!0}for(ve=1,be=new Array(Te-1);ve<Te;ve++)be[ve-1]=arguments[ve];_e.fn.apply(_e.context,be)}else{var Ee,Pe=_e.length;for(ve=0;ve<Pe;ve++)switch(_e[ve].once&&this.removeListener(G,_e[ve].fn,void 0,!0),Te){case 1:_e[ve].fn.call(_e[ve].context);break;case 2:_e[ve].fn.call(_e[ve].context,K);break;case 3:_e[ve].fn.call(_e[ve].context,K,ne);break;case 4:_e[ve].fn.call(_e[ve].context,K,ne,pe);break;default:if(!be)for(Ee=1,be=new Array(Te-1);Ee<Te;Ee++)be[Ee-1]=arguments[Ee];_e[ve].fn.apply(_e[ve].context,be)}}return!0},I.prototype.on=function(G,K,ne){return Ct(this,G,K,ne,!1)},I.prototype.once=function(G,K,ne){return Ct(this,G,K,ne,!0)},I.prototype.removeListener=function(G,K,ne,pe){var he=ue?ue+G:G;if(!this._events[he])return this;if(!K)return Re(this,he),this;var ye=this._events[he];if(ye.fn)ye.fn===K&&(!pe||ye.once)&&(!ne||ye.context===ne)&&Re(this,he);else{for(var me=0,be=[],ve=ye.length;me<ve;me++)(ye[me].fn!==K||pe&&!ye[me].once||ne&&ye[me].context!==ne)&&be.push(ye[me]);be.length?this._events[he]=1===be.length?be[0]:be:Re(this,he)}return this},I.prototype.removeAllListeners=function(G){var K;return G?(K=ue?ue+G:G,this._events[K]&&Re(this,K)):(this._events=new ae,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=ue,I.EventEmitter=I,typeof K<"u"&&(K.exports=I)}));var N_={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},E$2=()=>{},M_=function hr(G){let K={exports:{}};return G(K,K.exports),K.exports}((function(G,K){let{MAX_SAFE_COMPONENT_LENGTH:ne}=N_,ue=(K=G.exports={}).re=[],pe=K.src=[],he=K.t={},ye=0,a=(G,K,ne)=>{let me=ye++;he[G]=me,pe[me]=K,ue[me]=new RegExp(K,ne?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${pe[he.NUMERICIDENTIFIER]})\\.(${pe[he.NUMERICIDENTIFIER]})\\.(${pe[he.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${pe[he.NUMERICIDENTIFIERLOOSE]})\\.(${pe[he.NUMERICIDENTIFIERLOOSE]})\\.(${pe[he.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${pe[he.NUMERICIDENTIFIER]}|${pe[he.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${pe[he.NUMERICIDENTIFIERLOOSE]}|${pe[he.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${pe[he.PRERELEASEIDENTIFIER]}(?:\\.${pe[he.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${pe[he.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${pe[he.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${pe[he.BUILDIDENTIFIER]}(?:\\.${pe[he.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${pe[he.MAINVERSION]}${pe[he.PRERELEASE]}?${pe[he.BUILD]}?`),a("FULL",`^${pe[he.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${pe[he.MAINVERSIONLOOSE]}${pe[he.PRERELEASELOOSE]}?${pe[he.BUILD]}?`),a("LOOSE",`^${pe[he.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",`${pe[he.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),a("XRANGEIDENTIFIER",`${pe[he.NUMERICIDENTIFIER]}|x|X|\\*`),a("XRANGEPLAIN",`[v=\\s]*(${pe[he.XRANGEIDENTIFIER]})(?:\\.(${pe[he.XRANGEIDENTIFIER]})(?:\\.(${pe[he.XRANGEIDENTIFIER]})(?:${pe[he.PRERELEASE]})?${pe[he.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${pe[he.XRANGEIDENTIFIERLOOSE]})(?:\\.(${pe[he.XRANGEIDENTIFIERLOOSE]})(?:\\.(${pe[he.XRANGEIDENTIFIERLOOSE]})(?:${pe[he.PRERELEASELOOSE]})?${pe[he.BUILD]}?)?)?`),a("XRANGE",`^${pe[he.GTLT]}\\s*${pe[he.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${pe[he.GTLT]}\\s*${pe[he.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${ne}})(?:\\.(\\d{1,${ne}}))?(?:\\.(\\d{1,${ne}}))?(?:$|[^\\d])`),a("COERCERTL",pe[he.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${pe[he.LONETILDE]}\\s+`,!0),K.tildeTrimReplace="$1~",a("TILDE",`^${pe[he.LONETILDE]}${pe[he.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${pe[he.LONETILDE]}${pe[he.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${pe[he.LONECARET]}\\s+`,!0),K.caretTrimReplace="$1^",a("CARET",`^${pe[he.LONECARET]}${pe[he.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${pe[he.LONECARET]}${pe[he.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${pe[he.GTLT]}\\s*(${pe[he.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${pe[he.GTLT]}\\s*(${pe[he.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${pe[he.GTLT]}\\s*(${pe[he.LOOSEPLAIN]}|${pe[he.XRANGEPLAIN]})`,!0),K.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${pe[he.XRANGEPLAIN]})\\s+-\\s+(${pe[he.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${pe[he.XRANGEPLAINLOOSE]})\\s+-\\s+(${pe[he.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),B_=/^[0-9]+$/,pt=(G,K)=>{let ne=B_.test(G),ue=B_.test(K);return ne&&ue&&(G=+G,K=+K),G===K?0:ne&&!ue?-1:ue&&!ne?1:G<K?-1:1},F_={compareIdentifiers:pt,rcompareIdentifiers:(G,K)=>pt(K,G)},{MAX_LENGTH:D_,MAX_SAFE_INTEGER:L_}=N_,{re:U_,t:$_}=M_,{compareIdentifiers:q_}=F_,G_=class f{constructor(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof G_){if(G.loose===!!K.loose&&G.includePrerelease===!!K.includePrerelease)return G;G=G.version}else if("string"!=typeof G)throw new TypeError(`Invalid Version: ${G}`);if(G.length>D_)throw new TypeError(`version is longer than ${D_} characters`);this.options=K,this.loose=!!K.loose,this.includePrerelease=!!K.includePrerelease;let ne=G.trim().match(K.loose?U_[$_.LOOSE]:U_[$_.FULL]);if(!ne)throw new TypeError(`Invalid Version: ${G}`);if(this.raw=G,this.major=+ne[1],this.minor=+ne[2],this.patch=+ne[3],this.major>L_||this.major<0)throw new TypeError("Invalid major version");if(this.minor>L_||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>L_||this.patch<0)throw new TypeError("Invalid patch version");ne[4]?this.prerelease=ne[4].split(".").map((G=>{if(/^[0-9]+$/.test(G)){let K=+G;if(K>=0&&K<L_)return K}return G})):this.prerelease=[],this.build=ne[5]?ne[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(G){if(E$2("SemVer.compare",this.version,this.options),!(G instanceof G_)){if("string"==typeof G&&G===this.version)return 0;G=new G_(G,this.options)}return G.version===this.version?0:this.compareMain(G)||this.comparePre(G)}compareMain(G){return G instanceof G_||(G=new G_(G,this.options)),q_(this.major,G.major)||q_(this.minor,G.minor)||q_(this.patch,G.patch)}comparePre(G){if(G instanceof G_||(G=new G_(G,this.options)),this.prerelease.length&&!G.prerelease.length)return-1;if(!this.prerelease.length&&G.prerelease.length)return 1;if(!this.prerelease.length&&!G.prerelease.length)return 0;let K=0;do{let ne=this.prerelease[K],ue=G.prerelease[K];if(void 0===ne&&void 0===ue)return 0;if(void 0===ue)return 1;if(void 0===ne)return-1;if(ne!==ue)return q_(ne,ue)}while(++K)}compareBuild(G){G instanceof G_||(G=new G_(G,this.options));let K=0;do{let ne=this.build[K],ue=G.build[K];if(void 0===ne&&void 0===ue)return 0;if(void 0===ue)return 1;if(void 0===ne)return-1;if(ne!==ue)return q_(ne,ue)}while(++K)}inc(G,K){switch(G){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",K);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",K);break;case"prepatch":this.prerelease.length=0,this.inc("patch",K),this.inc("pre",K);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",K),this.inc("pre",K);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let G=this.prerelease.length;for(;--G>=0;)"number"==typeof this.prerelease[G]&&(this.prerelease[G]++,G=-2);-1===G&&this.prerelease.push(0)}K&&(this.prerelease[0]===K?isNaN(this.prerelease[1])&&(this.prerelease=[K,0]):this.prerelease=[K,0]);break;default:throw new Error(`invalid increment argument: ${G}`)}return this.format(),this.raw=this.version,this}},X$1=(G,K,ne)=>new G_(G,ne).compare(new G_(K,ne)),Tr=(G,K,ne)=>0===X$1(G,K,ne),br=(G,K,ne)=>0!==X$1(G,K,ne),wr=(G,K,ne)=>X$1(G,K,ne)>0,Mr=(G,K,ne)=>X$1(G,K,ne)>=0,Nr=(G,K,ne)=>X$1(G,K,ne)<0,Ar=(G,K,ne)=>X$1(G,K,ne)<=0,ke$1=(G,K,ne,ue)=>{switch(K){case"===":return"object"==typeof G&&(G=G.version),"object"==typeof ne&&(ne=ne.version),G===ne;case"!==":return"object"==typeof G&&(G=G.version),"object"==typeof ne&&(ne=ne.version),G!==ne;case"":case"=":case"==":return Tr(G,ne,ue);case"!=":return br(G,ne,ue);case">":return wr(G,ne,ue);case">=":return Mr(G,ne,ue);case"<":return Nr(G,ne,ue);case"<=":return Ar(G,ne,ue);default:throw new TypeError(`Invalid operator: ${K}`)}},j_=Symbol("SemVer ANY"),H_=class D{static get ANY(){return j_}constructor(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof H_){if(G.loose===!!K.loose)return G;G=G.value}this.options=K,this.loose=!!K.loose,this.parse(G),this.semver===j_?this.value="":this.value=this.operator+this.semver.version}parse(G){let K=this.options.loose?W_[z_.COMPARATORLOOSE]:W_[z_.COMPARATOR],ne=G.match(K);if(!ne)throw new TypeError(`Invalid comparator: ${G}`);this.operator=void 0!==ne[1]?ne[1]:"","="===this.operator&&(this.operator=""),ne[2]?this.semver=new G_(ne[2],this.options.loose):this.semver=j_}toString(){return this.value}test(G){if(E$2("Comparator.test",G,this.options.loose),this.semver===j_||G===j_)return!0;if("string"==typeof G)try{G=new G_(G,this.options)}catch(G){return!1}return ke$1(G,this.operator,this.semver,this.options)}intersects(G,K){if(!(G instanceof H_))throw new TypeError("a Comparator is required");if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),""===this.operator)return""===this.value||new V_(G.value,K).test(this.value);if(""===G.operator)return""===G.value||new V_(this.value,K).test(G.semver);let ne=!(">="!==this.operator&&">"!==this.operator||">="!==G.operator&&">"!==G.operator),ue=!("<="!==this.operator&&"<"!==this.operator||"<="!==G.operator&&"<"!==G.operator),pe=this.semver.version===G.semver.version,he=!(">="!==this.operator&&"<="!==this.operator||">="!==G.operator&&"<="!==G.operator),ye=ke$1(this.semver,"<",G.semver,K)&&(">="===this.operator||">"===this.operator)&&("<="===G.operator||"<"===G.operator),me=ke$1(this.semver,">",G.semver,K)&&("<="===this.operator||"<"===this.operator)&&(">="===G.operator||">"===G.operator);return ne||ue||pe&&he||ye||me}},{re:W_,t:z_}=M_,V_=class{constructor(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof V_)return G.loose===!!K.loose&&G.includePrerelease===!!K.includePrerelease?G:new V_(G.raw,K);if(G instanceof H_)return this.raw=G.value,this.set=[[G]],this.format(),this;if(this.options=K,this.loose=!!K.loose,this.includePrerelease=!!K.includePrerelease,this.raw=G,this.set=G.split(/\s*\|\|\s*/).map((G=>this.parseRange(G.trim()))).filter((G=>G.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${G}`);this.format()}format(){return this.range=this.set.map((G=>G.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(G){let{loose:K}=this.options;G=G.trim();let ne=K?K_[J_.HYPHENRANGELOOSE]:K_[J_.HYPHENRANGE];G=(G=G.replace(ne,jr(this.options.includePrerelease))).replace(K_[J_.COMPARATORTRIM],X_),E$2("comparator trim",G,K_[J_.COMPARATORTRIM]),G=(G=(G=G.replace(K_[J_.TILDETRIM],Q_)).replace(K_[J_.CARETTRIM],Z_)).split(/\s+/).join(" ");let ue=K?K_[J_.COMPARATORLOOSE]:K_[J_.COMPARATOR];return G.split(" ").map((G=>kr$1(G,this.options))).join(" ").split(/\s+/).map((G=>Kr(G,this.options))).filter(this.options.loose?G=>!!G.match(ue):()=>!0).map((G=>new H_(G,this.options)))}intersects(G,K){if(!(G instanceof V_))throw new TypeError("a Range is required");return this.set.some((ne=>lt(ne,K)&&G.set.some((G=>lt(G,K)&&ne.every((ne=>G.every((G=>ne.intersects(G,K)))))))))}test(G){if(!G)return!1;if("string"==typeof G)try{G=new G_(G,this.options)}catch(G){return!1}for(let K=0;K<this.set.length;K++)if(Br(this.set[K],G,this.options))return!0;return!1}},{re:K_,t:J_,comparatorTrimReplace:X_,tildeTrimReplace:Q_,caretTrimReplace:Z_}=M_,lt=(G,K)=>{let ne=!0,ue=G.slice(),pe=ue.pop();for(;ne&&ue.length;)ne=ue.every((G=>pe.intersects(G,K))),pe=ue.pop();return ne},kr$1=(G,K)=>(G=Ur(G,K),G=Dr(G,K),G=Wr(G,K),G=Gr(G)),P$1=G=>!G||"x"===G.toLowerCase()||"*"===G,Dr=(G,K)=>G.trim().split(/\s+/).map((G=>qr$1(G,K))).join(" "),qr$1=(G,K)=>{let ne=K.loose?K_[J_.TILDELOOSE]:K_[J_.TILDE];return G.replace(ne,((G,K,ne,ue,pe)=>{let he;return he=P$1(K)?"":P$1(ne)?`>=${K}.0.0 <${+K+1}.0.0-0`:P$1(ue)?`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:pe?`>=${K}.${ne}.${ue}-${pe} <${K}.${+ne+1}.0-0`:`>=${K}.${ne}.${ue} <${K}.${+ne+1}.0-0`,he}))},Ur=(G,K)=>G.trim().split(/\s+/).map((G=>Fr(G,K))).join(" "),Fr=(G,K)=>{let ne=K.loose?K_[J_.CARETLOOSE]:K_[J_.CARET],ue=K.includePrerelease?"-0":"";return G.replace(ne,((G,K,ne,pe,he)=>{let ye;return ye=P$1(K)?"":P$1(ne)?`>=${K}.0.0${ue} <${+K+1}.0.0-0`:P$1(pe)?"0"===K?`>=${K}.${ne}.0${ue} <${K}.${+ne+1}.0-0`:`>=${K}.${ne}.0${ue} <${+K+1}.0.0-0`:he?"0"===K?"0"===ne?`>=${K}.${ne}.${pe}-${he} <${K}.${ne}.${+pe+1}-0`:`>=${K}.${ne}.${pe}-${he} <${K}.${+ne+1}.0-0`:`>=${K}.${ne}.${pe}-${he} <${+K+1}.0.0-0`:"0"===K?"0"===ne?`>=${K}.${ne}.${pe}${ue} <${K}.${ne}.${+pe+1}-0`:`>=${K}.${ne}.${pe}${ue} <${K}.${+ne+1}.0-0`:`>=${K}.${ne}.${pe} <${+K+1}.0.0-0`,ye}))},Wr=(G,K)=>G.split(/\s+/).map((G=>Jr(G,K))).join(" "),Jr=(G,K)=>{G=G.trim();let ne=K.loose?K_[J_.XRANGELOOSE]:K_[J_.XRANGE];return G.replace(ne,((G,ne,ue,pe,he,ye)=>{let me=P$1(ue),be=me||P$1(pe),ve=be||P$1(he),_e=ve;return"="===ne&&_e&&(ne=""),ye=K.includePrerelease?"-0":"",me?G=">"===ne||"<"===ne?"<0.0.0-0":"*":ne&&_e?(be&&(pe=0),he=0,">"===ne?(ne=">=",be?(ue=+ue+1,pe=0,he=0):(pe=+pe+1,he=0)):"<="===ne&&(ne="<",be?ue=+ue+1:pe=+pe+1),"<"===ne&&(ye="-0"),G=`${ne+ue}.${pe}.${he}${ye}`):be?G=`>=${ue}.0.0${ye} <${+ue+1}.0.0-0`:ve&&(G=`>=${ue}.${pe}.0${ye} <${ue}.${+pe+1}.0-0`),G}))},Gr=(G,K)=>G.trim().replace(K_[J_.STAR],""),Kr=(G,K)=>G.trim().replace(K_[K.includePrerelease?J_.GTE0PRE:J_.GTE0],""),jr=G=>(K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe)=>`${ne=P$1(ue)?"":P$1(pe)?`>=${ue}.0.0${G?"-0":""}`:P$1(he)?`>=${ue}.${pe}.0${G?"-0":""}`:ye?`>=${ne}`:`>=${ne}${G?"-0":""}`} ${be=P$1(ve)?"":P$1(_e)?`<${+ve+1}.0.0-0`:P$1(Te)?`<${ve}.${+_e+1}.0-0`:Ee?`<=${ve}.${_e}.${Te}-${Ee}`:G?`<${ve}.${_e}.${+Te+1}-0`:`<=${be}`}`.trim(),Br=(G,K,ne)=>{for(let ne=0;ne<G.length;ne++)if(!G[ne].test(K))return!1;if(K.prerelease.length&&!ne.includePrerelease){for(let ne=0;ne<G.length;ne++)if(E$2(G[ne].semver),G[ne].semver!==H_.ANY&&G[ne].semver.prerelease.length>0){let ue=G[ne].semver;if(ue.major===K.major&&ue.minor===K.minor&&ue.patch===K.patch)return!0}return!1}return!0},mt=(G,K,ne)=>{try{K=new V_(K,ne)}catch(G){return!1}return K.test(G)},{MAX_LENGTH:Y_}=N_,{re:eT,t:tT}=M_,Xr=(G,K)=>{if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof G_)return G;if("string"!=typeof G||G.length>Y_||!(K.loose?eT[tT.LOOSE]:eT[tT.FULL]).test(G))return null;try{return new G_(G,K)}catch(G){return null}},{re:rT,t:nT}=M_,ht=(G,K)=>{if(G instanceof G_)return G;if("number"==typeof G&&(G=String(G)),"string"!=typeof G)return null;let ne=null;if((K=K||{}).rtl){let K;for(;(K=rT[nT.COERCERTL].exec(G))&&(!ne||ne.index+ne[0].length!==G.length);)ne&&K.index+K[0].length===ne.index+ne[0].length||(ne=K),rT[nT.COERCERTL].lastIndex=K.index+K[1].length+K[2].length;rT[nT.COERCERTL].lastIndex=-1}else ne=G.match(rT[nT.COERCE]);return null===ne?null:Xr(`${ne[2]}.${ne[3]||"0"}.${ne[4]||"0"}`,K)};function zr(G){return String.fromCharCode(parseInt(G.slice(1),16))}function Yr(G){return`%${`00${G.charCodeAt(0).toString(16)}`.slice(-2)}`}function fe(G){return function Qr(G){return btoa(encodeURIComponent(G).replace(/%[0-9A-F]{2}/g,zr))}(JSON.stringify(G))}function Et(G){return JSON.parse(function Zr$1(G){return decodeURIComponent(Array.from(atob(G),Yr).join(""))}(G))}function L$1(G){return void 0===G}function ge$1(G){return function rn(G){return null===G}(G)||L$1(G)}function ie(G){if(!G)return!0;for(let K in G)if(Object.hasOwnProperty.call(G,K))return!1;return!0}var aT={};var iT={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},sT=class C extends Error{constructor(G,K){super(`Magic SDK Error: [${G}] ${K}`),this.code=G,this.rawMessage=K,this.__proto__=Error,Object.setPrototypeOf(this,sT.prototype)}},oT=class O extends Error{constructor(G){super(),this.__proto__=Error;let K=Number(null==G?void 0:G.code);this.rawMessage=(null==G?void 0:G.message)||"Internal error",this.code=function gt(G){return!ge$1(G)&&"number"==typeof G&&Object.values(Lw).includes(G)}(K)?K:Lw.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==G?void 0:G.data)||void 0,Object.setPrototypeOf(this,oT.prototype)}},cT=class q{constructor(G,K){this.code=G,this.rawMessage=K,this.message=`Magic SDK Warning: [${G}] ${K}`}log(){console.warn(this.message)}},dT=class extends Error{constructor(G,K,ne,ue){super(`Magic Extension Error (${G.name}): [${K}] ${ne}`),this.code=K,this.rawMessage=ne,this.data=ue,this.__proto__=Error,Object.setPrototypeOf(this,dT.prototype)}},uT=class{constructor(G,K,ne){this.code=K,this.rawMessage=ne,this.message=`Magic Extension Warning (${G.name}): [${K}] ${ne}`}log(){console.warn(this.message)}};function vt(){return new sT(Fw.ModalNotReady,"Modal is not ready")}var fT=function*on(){let G=0;for(;;)G<Number.MAX_SAFE_INTEGER?yield++G:G=0}();function qe(){return fT.next().value}var lT=Symbol("Payload pre-processed by Magic SDK");function Nt(G){return Object.defineProperty(G,lT,{value:!0,enumerable:!1}),G}function j$1(G){var K,ne,ue;return function cn(G){return!!G[lT]}(G)||(G.jsonrpc=null!=(K=G.jsonrpc)?K:"2.0",G.id=qe(),G.method=null!=(ne=G.method)?ne:"noop",G.params=null!=(ue=G.params)?ue:[],Nt(G)),G}function p$1(G,K=[]){return Nt({params:K,method:G,jsonrpc:"2.0",id:qe()})}var pT=class U{constructor(G){G instanceof pT?(this._jsonrpc=G.payload.jsonrpc,this._id=G.payload.id,this._result=G.payload.result,this._error=G.payload.error):function ft$1(G){return!ge$1(G)&&!(L$1(G.jsonrpc)||L$1(G.id)||L$1(G.result)&&L$1(G.error))}(G)?(this._jsonrpc=G.jsonrpc,this._id=G.id,this._result=G.result,this._error=G.error):(this._jsonrpc=G.jsonrpc,this._id=G.id,this._result=void 0,this._error=void 0)}applyError(G){return this._error=G,this}applyResult(G){return this._result=G,this}get hasError(){return void 0!==this._error&&null!==this._error}get hasResult(){return void 0!==this._result}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},hT=((G,K,ne)=>(ne=null!=G?T_(R_(G)):{},((G,K,ne,ue)=>{if(K&&"object"==typeof K||"function"==typeof K)for(let pe of I_(K))!k_.call(G,pe)&&pe!==ne&&A_(G,pe,{get:()=>K[pe],enumerable:!(ue=P_(K,pe))||ue.enumerable});return G})(G&&G.__esModule?ne:A_(ne,"default",{value:G,enumerable:!0}),G)))(x_()),yT=class extends hT.default{};function ve$1(){let G=new yT;return{emitter:G,createChainingEmitterMethod:(K,ne)=>(...ue)=>(G[K].apply(G,ue),ne),createBoundEmitterMethod:K=>(...ne)=>G[K].apply(G,ne)}}var mT=Symbol("isPromiEvent");function Ot(G){return!!G[mT]}function x$3(G){let K=We(G),{createBoundEmitterMethod:ne,createChainingEmitterMethod:ue}=ve$1(),pe=Symbol("Promise.then"),he=Symbol("Promise.catch"),ye=Symbol("Promise.finally"),a=(G,K)=>(...ne)=>{let ue=K[G].apply(K,ne);return c(ue)},c=G=>Object.assign(G,{[mT]:!0,[pe]:G[pe]||G.then,[he]:G[he]||G.catch,[ye]:G[ye]||G.finally,then:a(pe,G),catch:a(he,G),finally:a(ye,G),on:ue("on",G),once:ue("once",G),addListener:ue("addListener",G),off:ue("off",G),removeListener:ue("removeListener",G),removeAllListeners:ue("removeAllListeners",G),emit:ne("emit"),eventNames:ne("eventNames"),listeners:ne("listeners"),listenerCount:ne("listenerCount")}),me=c(K.then((G=>(me.emit("done",G),me.emit("settled"),G)),(G=>{throw me.emit("error",G),me.emit("settled"),G})));return me.on(l_.ClosedByUser,(()=>{me.emit(f_.ClosedByUser)})),me}function We(G){return new Promise(((K,ne)=>{let ue=G(K,ne);Promise.resolve(ue).catch(ne)}))}var bT=class y{constructor(G){this.sdk=G}get overlay(){return this.sdk.overlay}request(G){if(this.sdk.thirdPartyWallets.isConnected&&!Gw.includes(G.method))return x$3(((K,ne)=>{this.sdk.thirdPartyWallets.requestOverride(G).then(K).catch(ne)}));let K=this.overlay.post(Hw.MAGIC_HANDLE_REQUEST,j$1(G)),ne=x$3(((G,ne)=>{K.then((K=>{if(ue(),K.hasError)ne(new oT(K.payload.error));else{if(!K.hasResult)throw function Tt(){return new sT(Fw.MalformedResponse,"Response from the Magic iframe is malformed.")}();G(K.payload.result)}})).catch((G=>{ue(),ne(G)}))})),ue=this.overlay.on(jw.MAGIC_HANDLE_EVENT,(K=>{var ue;let{response:pe}=K.data;if(pe.id===G.id&&(null==(ue=pe.result)?void 0:ue.event)){let{event:G,params:K=[]}=pe.result;ne.emit(G,...K)}}));return ne}createIntermediaryEvent(G,K){return ne=>{let ue=p$1(qw.IntermediaryEvent,[{payloadId:K,eventType:G,args:ne}]);this.request(ue)}}};var gT,vT={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},wT=class extends bT{loginWithMagicLink(G){let K="@magic-sdk/react-native"===aT.sdkName||"@magic-sdk/react-native-bare"===aT.sdkName||"@magic-sdk/react-native-expo"===aT.sdkName;if(K&&function _t(G,K){let[ne]=G.split(".").map(Number);return ne>=K}(aT.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");K&&function Mt(G){let{method:K,removalVersions:ne,useInstead:ue}=G,pe=ne[aT.sdkName],he=ue?` Use \`${ue}\` instead.`:"",ye=`\`${K}\` will be removed from \`${aT.sdkName}\` in version \`${pe}\`.${he}`;return new cT(Dw.DeprecationNotice,ye)}({method:"auth.loginWithMagicLink()",removalVersions:vT,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:ne,showUI:ue=!0,redirectURI:pe,overrides:he,lifespan:ye}=G,me=p$1(this.sdk.testMode?qw.LoginWithMagicLinkTestMode:qw.LoginWithMagicLink,[{email:ne,showUI:ue,redirectURI:pe,overrides:he,lifespan:ye}]);return this.request(me)}loginWithSMS(G){let{phoneNumber:K,showUI:ne=!0,lifespan:ue}=G,pe=p$1(this.sdk.testMode?qw.LoginWithSmsTestMode:qw.LoginWithSms,[{phoneNumber:K,showUI:ne,lifespan:ue}]),he=this.request(pe);return!ne&&he&&(he.on(Jw.VerifySmsOtp,(G=>{this.createIntermediaryEvent(Jw.VerifySmsOtp,pe.id)(G)})),he.on(Jw.Cancel,(()=>{this.createIntermediaryEvent(Jw.Cancel,pe.id)()}))),he}loginWithEmailOTP(G){let{email:K,showUI:ne,deviceCheckUI:ue,overrides:pe,lifespan:he}=G,ye=p$1(this.sdk.testMode?qw.LoginWithEmailOTPTestMode:qw.LoginWithEmailOTP,[{email:K,showUI:ne,deviceCheckUI:ue,overrides:pe,lifespan:he}]),me=this.request(ye);return!ue&&me&&me.on(Zw.Retry,(()=>{this.createIntermediaryEvent(Zw.Retry,ye.id)()})),!ne&&me&&(me.on(Kw.VerifyEmailOtp,(G=>{this.createIntermediaryEvent(Kw.VerifyEmailOtp,ye.id)(G)})),me.on(Kw.VerifyMFACode,(G=>{this.createIntermediaryEvent(Kw.VerifyMFACode,ye.id)(G)})),me.on(Kw.LostDevice,(()=>{this.createIntermediaryEvent(Kw.LostDevice,ye.id)()})),me.on(Kw.VerifyRecoveryCode,(G=>{this.createIntermediaryEvent(Kw.VerifyRecoveryCode,ye.id)(G)})),me.on(Kw.Cancel,(()=>{this.createIntermediaryEvent(Kw.Cancel,ye.id)()}))),me}loginWithCredential(G){let{credentialOrQueryString:K,lifespan:ne}=G||{},ue=null!=K?K:"";if(!K&&"web"===aT.platform){ue=window.location.search;let G=window.location.origin+window.location.pathname;window.history.replaceState(null,"",G)}let pe=p$1(this.sdk.testMode?qw.LoginWithCredentialTestMode:qw.LoginWithCredential,[ue,ne]);return this.request(pe)}setAuthorizationToken(G){let K=p$1(qw.SetAuthorizationToken,[{jwt:G}]);return this.request(K)}updateEmailWithUI(G){let{email:K,showUI:ne=!0}=G,ue=p$1(this.sdk.testMode?qw.UpdateEmailTestMode:qw.UpdateEmail,[{email:K,showUI:ne}]),pe=this.request(ue);return ne||(pe.on(e_.Retry,(()=>{this.createIntermediaryEvent(e_.Retry,ue.id)()})),pe.on(e_.Cancel,(()=>{this.createIntermediaryEvent(e_.Cancel,ue.id)()})),pe.on(e_.VerifyEmailOtp,(G=>{this.createIntermediaryEvent(e_.VerifyEmailOtp,ue.id)(G)})),pe.on(e_.VerifyMFACode,(G=>{this.createIntermediaryEvent(e_.VerifyMFACode,ue.id)(G)})),pe.on(r_.RetryWithNewEmail,(G=>{this.createIntermediaryEvent(r_.RetryWithNewEmail,ue.id)(G)})),pe.on(r_.Cancel,(()=>{this.createIntermediaryEvent(r_.Cancel,ue.id)()})),pe.on(r_.VerifyEmailOtp,(G=>{this.createIntermediaryEvent(r_.VerifyEmailOtp,ue.id)(G)}))),pe}},_T={};function W$1(G){return(...K)=>m$2(this,null,(function*(){return gT||(gT=yield aT.configureStorage()),yield gT.ready(),gT[G](...K)}))}((G,K)=>{for(var ne in K)A_(G,ne,{get:K[ne],enumerable:!0})})(_T,{clear:()=>PT,getItem:()=>TT,iterate:()=>RT,key:()=>IT,keys:()=>CT,length:()=>ST,removeItem:()=>ET,setItem:()=>AT});var TT=W$1("getItem"),AT=W$1("setItem"),ET=W$1("removeItem"),PT=W$1("clear"),ST=W$1("length"),IT=W$1("key"),CT=W$1("keys"),RT=W$1("iterate");function Dt(){let G=window.crypto.getRandomValues(new Uint8Array(16));G[6]=15&G[6]|64,G[8]=191&G[8]|128;let K="";return K+=G[0].toString(16),K+=G[1].toString(16),K+=G[2].toString(16),K+=G[3].toString(16),K+="-",K+=G[4].toString(16),K+=G[5].toString(16),K+="-",K+=G[6].toString(16),K+=G[7].toString(16),K+="-",K+=G[8].toString(16),K+=G[9].toString(16),K+="-",K+=G[10].toString(16),K+=G[11].toString(16),K+=G[12].toString(16),K+=G[13].toString(16),K+=G[14].toString(16),K+=G[15].toString(16),K}var kT="STORE_KEY_PRIVATE_KEY",OT="STORE_KEY_PUBLIC_JWK",xT="ECDSA",NT={name:xT,namedCurve:"P-256"};function le(){let G="undefined"!=typeof window&&!!window.crypto,K=G&&!!window.crypto.subtle;return G&&K}function Ft(){return m$2(this,null,(function*(){let G=yield function Pn(){return m$2(this,null,(function*(){if(le())return(yield TT(OT))||(yield function wn(){return m$2(this,null,(function*(){let{subtle:G}=window.crypto,K=yield G.generateKey(NT,!1,["sign"]),ne=yield G.exportKey("jwk",K.publicKey);yield AT(kT,K.privateKey),yield AT(OT,ne)}))}()),TT(OT);console.info("webcrypto is not supported")}))}();if(!G)return void console.info("unable to create public key or webcrypto is unsupported");let{subtle:K}=window.crypto,ne=yield TT(kT);if(!ne||!K)return void console.info("unable to find private key or webcrypto unsupported");let ue={iat:Math.floor((new Date).getTime()/1e3),jti:Dt()},pe={typ:"dpop+jwt",alg:"ES256",jwk:G},he=qt(JSON.stringify(pe)),ye=qt(JSON.stringify(ue)),me=function xn(G){return(new TextEncoder).encode(G)}(`${he}.${ye}`),be={name:xT,hash:{name:"SHA-256"}},ve=function Sn(G){let K="";return G.forEach((G=>{K+=String.fromCharCode(G)})),Wt(K)}(new Uint8Array(yield K.sign(be,ne,me)));return`${he}.${ye}.${ve}`}))}function qt(G){return Wt(function Mn(G){return encodeURIComponent(G).replace(/%([0-9A-F]{2})/g,((G,K)=>String.fromCharCode(parseInt(K,16))))}(G))}function Wt(G){return btoa(G).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var MT="ds",BT="ek",FT="iv",DT="AES-GCM",LT=256;function we(){return m$2(this,null,(function*(){let G=[];yield RT(((K,ne,ue)=>{ne.startsWith(`${MT}_`)&&G.push(ne)}));for(let K of G)yield ET(K)}))}function Jt(G){let K="",ne=new Uint8Array(G),ue=ne.byteLength;for(let G=0;G<ue;G++)K+=String.fromCharCode(ne[G]);return window.btoa(K)}function Gt(G){let K=window.atob(G),ne=K.length,ue=new Uint8Array(ne);for(let G=0;G<ne;G++)ue[G]=K.charCodeAt(G);return ue.buffer}function Kt(G,K){return m$2(this,null,(function*(){let ne=yield function Cn(){return m$2(this,null,(function*(){if(!le())return void console.info("webcrypto is not supported");let{crypto:G}=window;return(yield TT(FT))||G.getRandomValues(new Uint8Array(12))}))}(),ue=yield function An(){return m$2(this,null,(function*(){if(!le())return void console.info("webcrypto is not supported");let{subtle:G}=window.crypto;return(yield TT(BT))||(yield G.generateKey({name:DT,length:LT},!1,["encrypt","decrypt"]))}))}();if(!ne||!ue||!G)return;let pe=Gt(G),{subtle:he}=window.crypto,ye=Jt(yield he.encrypt({name:DT,iv:ne},ue,pe));yield AT(`${MT}_${K}`,ye),yield AT(BT,ue),yield AT(FT,ne)}))}function He(G,K){return K?new URL(G,K):new URL(G)}var UT=class extends bT{constructor(){super(...arguments),this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(G){let K=p$1(this.sdk.testMode?qw.GetIdTokenTestMode:qw.GetIdToken,[G]);return this.request(K)}generateIdToken(G){let K=p$1(this.sdk.testMode?qw.GenerateIdTokenTestMode:qw.GenerateIdToken,[G]);return this.request(K)}getInfo(){let G=p$1(qw.GetInfo,[]);return this.request(G)}isLoggedIn(){return x$3(((G,K)=>m$2(this,null,(function*(){try{let K=!1;this.sdk.useStorageCache&&(K="true"===(yield TT(this.localForageIsLoggedInKey)),K&&G(!0));let ne=p$1(this.sdk.testMode?qw.IsLoggedInTestMode:qw.IsLoggedIn),ue=yield this.request(ne);this.sdk.useStorageCache&&(ue?AT(this.localForageIsLoggedInKey,!0):ET(this.localForageIsLoggedInKey),K&&!ue&&this.emitUserLoggedOut(!0)),G(ue)}catch(G){K(G)}}))))}logout(){return ET(this.localForageIsLoggedInKey),we(),x$3(((G,K)=>m$2(this,null,(function*(){try{let K=p$1(this.sdk.testMode?qw.LogoutTestMode:qw.Logout),ne=yield this.request(K);this.sdk.useStorageCache&&this.emitUserLoggedOut(ne),G(ne)}catch(G){K(G)}}))))}requestInfoWithUI(G){let K=p$1(qw.RequestUserInfoWithUI,G?[G]:[]);return this.request(K)}showSettings(G){let{showUI:K=!0}=G||{},ne=p$1(this.sdk.testMode?qw.UserSettingsTestMode:qw.UserSettings,[G]),ue=this.request(ne);return!K&&ue&&(ue.on(h_.SendNewPhoneNumber,(G=>{this.createIntermediaryEvent(h_.SendNewPhoneNumber,ne.id)(G)})),ue.on(h_.SendOtpCode,(G=>{this.createIntermediaryEvent(h_.SendOtpCode,ne.id)(G)})),ue.on(h_.StartEditPhoneNumber,(()=>{this.createIntermediaryEvent(h_.StartEditPhoneNumber,ne.id)()})),ue.on(h_.Cancel,(()=>{this.createIntermediaryEvent(h_.Cancel,ne.id)()})),ue.on(e_.VerifyEmailOtp,(G=>{this.createIntermediaryEvent(e_.VerifyEmailOtp,ne.id)(G)}))),ue}recoverAccount(G){let{email:K,showUI:ne}=G,ue=p$1(this.sdk.testMode?qw.RecoverAccountTestMode:qw.RecoverAccount,[{email:K,showUI:ne}]),pe=this.request(ue);return!ne&&pe&&(pe.on(b_.Cancel,(()=>{this.createIntermediaryEvent(b_.Cancel,ue.id)()})),pe.on(b_.ResendSms,(()=>{this.createIntermediaryEvent(b_.ResendSms,ue.id)()})),pe.on(b_.VerifyOtp,(G=>{this.createIntermediaryEvent(b_.VerifyOtp,ue.id)(G)})),pe.on(b_.UpdateEmail,(G=>{this.createIntermediaryEvent(b_.UpdateEmail,ue.id)(G)})),pe.on(r_.Cancel,(()=>{this.createIntermediaryEvent(r_.Cancel,ue.id)()})),pe.on(r_.RetryWithNewEmail,(G=>{this.createIntermediaryEvent(r_.RetryWithNewEmail,ue.id)(G)})),pe.on(r_.VerifyEmailOtp,(G=>{this.createIntermediaryEvent(r_.VerifyEmailOtp,ue.id)(G)}))),pe}revealPrivateKey(){let G=p$1(qw.RevealPK);return this.request(G)}onUserLoggedOut(G){this.userLoggedOutCallbacks.push(G)}enableMFA(G){let{showUI:K=!0}=G,ne=p$1(qw.EnableMFA,[{showUI:K}]),ue=this.request(ne);return!K&&ue&&(ue.on(o_.VerifyMFACode,(G=>{this.createIntermediaryEvent(o_.VerifyMFACode,ne.id)(G)})),ue.on(o_.Cancel,(()=>{this.createIntermediaryEvent(o_.Cancel,ne.id)()}))),ue}disableMFA(G){let{showUI:K=!0}=G,ne=p$1(qw.DisableMFA,[{showUI:K}]),ue=this.request(ne);return!K&&ue&&(ue.on(d_.VerifyMFACode,(G=>{this.createIntermediaryEvent(d_.VerifyMFACode,ne.id)(G)})),ue.on(d_.LostDevice,(G=>{this.createIntermediaryEvent(d_.LostDevice,ne.id)(G)})),ue.on(d_.Cancel,(()=>{this.createIntermediaryEvent(d_.Cancel,ne.id)()}))),ue}emitUserLoggedOut(G){this.userLoggedOutCallbacks.forEach((K=>{K(G)}))}},$T=class extends bT{connectWithUI(G){let K=x$3(((ne,ue)=>m$2(this,null,(function*(){try{let pe=p$1(qw.Login,[k$1({enabledWallets:this.sdk.thirdPartyWallets.enabledWallets},G)]),he=this.request(pe);this.sdk.thirdPartyWallets.eventListeners.forEach((({event:G,callback:K})=>{he.on(G,(()=>K(pe.id)))})),he.on("id-token-created",(G=>{K.emit("id-token-created",G)}));let ye=yield he;ye.error&&ue(ye),ne(ye)}catch(G){ue(G)}}))));return K}showUI(G){return this.request(p$1(qw.ShowUI,[G]))}showAddress(){return this.request(p$1(qw.ShowAddress))}showSendTokensUI(){return this.request(p$1(qw.ShowSendTokensUI))}showOnRamp(){return this.request(p$1(qw.ShowOnRamp))}showNFTs(){return this.request(p$1(qw.ShowNFTs))}showBalances(){return this.request(p$1(qw.ShowBalances))}sendGaslessTransaction(G,K){return this.request(p$1(qw.SendGaslessTransaction,[G,K]))}},qT=class extends bT{constructor(){super(...arguments),this.eventListeners=[],this.enabledWallets={},this.isConnected=!1}resetThirdPartyWalletState(){localStorage.removeItem(Uw.PROVIDER),localStorage.removeItem(Uw.ADDRESS),localStorage.removeItem(Uw.CHAIN_ID),this.isConnected=!1}requestOverride(G){return G.method===qw.Login?(this.resetThirdPartyWalletState(),super.request(G)):G.method===qw.GetInfo?this.getInfo(G):G.method===qw.IsLoggedIn?this.isLoggedIn(G):G.method===qw.Logout?this.logout(G):"web3modal"===localStorage.getItem(Uw.PROVIDER)?this.web3modalRequest(G):(this.resetThirdPartyWalletState(),super.request(G))}isLoggedIn(G){return"web3modal"===localStorage.getItem(Uw.PROVIDER)?this.web3modalIsLoggedIn():(this.resetThirdPartyWalletState(),super.request(G))}getInfo(G){return"web3modal"===localStorage.getItem(Uw.PROVIDER)?this.web3modalGetInfo():(this.resetThirdPartyWalletState(),super.request(G))}logout(G){let K=localStorage.getItem(Uw.PROVIDER);return"web3modal"===(this.resetThirdPartyWalletState(),K)?this.web3modalLogout():super.request(G)}web3modalRequest(G){return x$3(((K,ne)=>{this.sdk.web3modal.modal.getWalletProvider().request(G).then(K).catch(ne)}))}web3modalIsLoggedIn(){return x$3((G=>{let K=this.sdk.web3modal.modal.getStatus();if("connected"===K&&G(!0),"disconnected"===K&&(this.resetThirdPartyWalletState(),G(!1)),"reconnecting"===K){let K=this.sdk.web3modal.modal.subscribeProvider((({status:ne})=>{"connected"===ne&&(K(),G(!0)),"disconnected"===ne&&(K(),this.resetThirdPartyWalletState(),G(!1))}))}}))}formatWeb3modalGetInfoResponse(){var G;let K=null==(G=this.sdk.web3modal.modal.getWalletInfo())?void 0:G.name,ne=this.sdk.web3modal.modal.getAddress();return{publicAddress:ne,email:null,issuer:`did:ethr:${ne}`,phoneNumber:null,isMfaEnabled:!1,recoveryFactors:[],walletType:K||"web3modal"}}web3modalGetInfo(){return x$3(((G,K)=>{let ne=this.sdk.web3modal.modal.getStatus();if("connected"===ne&&G(this.formatWeb3modalGetInfoResponse()),"disconnected"===ne&&(this.resetThirdPartyWalletState(),K("Magic RPC Error: [-32603] Internal error: User denied account access.")),"reconnecting"===ne){let ne=this.sdk.web3modal.modal.subscribeProvider((({status:ue})=>{"connected"===ue&&(ne(),G(this.formatWeb3modalGetInfoResponse())),"disconnected"===ue&&(ne(),this.resetThirdPartyWalletState(),K("Magic RPC Error: [-32603] Internal error: User denied account access."))}))}}))}web3modalLogout(){return x$3((G=>m$2(this,null,(function*(){try{yield this.sdk.web3modal.modal.disconnect()}catch(G){console.error(G)}G(!0)}))))}},{createBoundEmitterMethod:GT,createChainingEmitterMethod:jT}=ve$1(),HT=class $e extends bT{constructor(){super(...arguments),this.isMagic=!0,this.on=jT("on",this),this.once=jT("once",this),this.addListener=jT("addListener",this),this.off=jT("off",this),this.removeListener=jT("removeListener",this),this.removeAllListeners=jT("removeAllListeners",this),this.emit=GT("emit"),this.eventNames=GT("eventNames"),this.listeners=GT("listeners"),this.listenerCount=GT("listenerCount")}sendAsync(G,K){if(!K)throw function Pt(G){return new sT(Fw.InvalidArgument,`Invalid ${(G=>{let K=G+1,ne=K%10,ue=K%100;return 1===ne&&11!==ue?`${K}st`:2===ne&&12!==ue?`${K}nd`:3===ne&&13!==ue?`${K}rd`:`${K}th`})(G.argument)} argument given to \`${G.procedure}\`.\n  Expected: \`${G.expected}\`\n  Received: \`${G.received}\``)}({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===K?"null":typeof K});if(Array.isArray(G))this.overlay.post(Hw.MAGIC_HANDLE_REQUEST,G.map((G=>{let K=j$1(G);return this.prefixPayloadMethodForTestMode(K),K}))).then((G=>{K(null,G.map((G=>H$1(k$1({},G.payload),{error:G.hasError?new oT(G.payload.error):null}))))}));else{let ne=j$1(G);this.prefixPayloadMethodForTestMode(ne),this.overlay.post(Hw.MAGIC_HANDLE_REQUEST,ne).then((G=>{K(G.hasError?new oT(G.payload.error):null,G.payload)}))}}send(G,K){if("string"==typeof G){let ne=p$1(G,Array.isArray(K)?K:[]);return this.request(ne)}if(Array.isArray(G)||K)return void this.sendAsync(G,K);let ne=function wt$1(){return new cT(Dw.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}();return ne.log(),new pT(G).applyError({code:-32603,message:ne.rawMessage}).payload}enable(){let G=p$1(qw.Login);return this.request(G)}request(G){return this.prefixPayloadMethodForTestMode(G),super.request(G)}prefixPayloadMethodForTestMode(G){this.sdk.testMode&&(G.method=`testMode/eth/${G.method}`)}},WT=["request","overlay","sdk"];function Ln(G){let K=Object.getPrototypeOf(G),ne=[K];for(;K!==bT.prototype;)K=Object.getPrototypeOf(K),ne.push(K);return ne}var zT=class extends bT{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:x$3,isPromiEvent:Ot,encodeJSON:fe,decodeJSON:Et,createJsonRpcRequestPayload:p$1,standardizeJsonRpcRequestPayload:j$1,storage:_T};let G=[this,...Ln(this)];WT.forEach((K=>{let ne=G.map((G=>Object.getOwnPropertyDescriptor(G,K))),ue=ne.findIndex((G=>Boolean(G))),pe=ue>0,he=ne[ue];he&&(this.__sdk_access_field_descriptors__.set(K,{descriptor:he,isPrototypeField:pe}),Object.defineProperty(this,K,{configurable:!0,get:()=>{throw function It(G){return new sT(Fw.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${G}\` can be accessed. Do not invoke \`Extension.${G}\` inside an extension constructor.`)}(K)}}))}))}init(G){this.__is_initialized__||(WT.forEach((G=>{if(this.__sdk_access_field_descriptors__.has(G)){let{descriptor:K,isPrototypeField:ne}=this.__sdk_access_field_descriptors__.get(G);ne?delete this[G]:Object.defineProperty(this,G,K)}})),this.sdk=G,this.__is_initialized__=!0)}createDeprecationWarning(G){let{method:K,removalVersion:ne,useInstead:ue}=G;return new uT(this,"DEPRECATION_NOTICE",`\`${K}\` will be removed from this Extension in version \`${ne}\`.${ue?` Use \`${ue}\` instead.`:""}`)}createWarning(G,K){return new uT(this,G,K)}createError(G,K,ne){return new dT(this,G,K,ne)}},VT=class V{};VT.Internal=class extends zT{};var KT=class extends bT{purchase(G){let K=p$1(qw.NFTPurchase,[G]);return this.request(K)}checkout(G){let K=this.sdk.thirdPartyWallets.isConnected,ne=p$1(qw.NFTCheckout,[H$1(k$1({},G),{walletProvider:K?"web3modal":"magic"})]),ue=this.request(ne);return K&&(ue.on(g_.Initiated,(G=>m$2(this,null,(function*(){try{let K=yield this.request({method:"eth_sendTransaction",params:[G]});this.createIntermediaryEvent(g_.Success,ne.id)(K)}catch(G){this.createIntermediaryEvent(g_.Failure,ne.id)()}})))),ue.on(g_.Disconnect,(()=>{this.sdk.thirdPartyWallets.resetThirdPartyWalletState(),ue.emit("disconnect")}))),ue}transfer(G){let K=p$1(qw.NFTTransfer,[G]);return this.request(K)}};function Xt(G){return!G.compat||null==G.compat[aT.sdkName]||("string"==typeof G.compat[aT.sdkName]?mt(ht(aT.version),G.compat[aT.sdkName]):!!G.compat[aT.sdkName])}function _n(G){var K;let ne=null!=(K=null==G?void 0:G.extensions)?K:[],ue={},pe=[];if(Array.isArray(ne)?ne.forEach((G=>{Xt(G)?(G.init(this),G.name&&(this[G.name]=G),G instanceof VT.Internal&&(ie(G.config)||(ue[G.name]=G.config))):pe.push(G)})):Object.keys(ne).forEach((G=>{if(Xt(ne[G])){ne[G].init(this);let K=ne[G];this[G]=K,K instanceof VT.Internal&&(ie(K.config)||(ue[ne[G].name]=K.config))}else pe.push(ne[G])})),pe.length)throw function bt(G){let K=`Some extensions are incompatible with \`${aT.sdkName}@${aT.version}\`:`;return G.filter((G=>void 0!==G.compat&&null!==G.compat)).forEach((G=>{let ne=G.compat[aT.sdkName];"string"==typeof ne?K+=`\n  - Extension \`${G.name}\` supports version(s) \`${ne}\``:ne||(K+=`\n  - Extension \`${G.name}\` does not support ${aT.platform} environments.`)})),new sT(Fw.IncompatibleExtensions,K)}(pe);return ue}var JT=class{constructor(G,K){var ne;if(this.apiKey=G,!G)throw function Rt(){return new sT(Fw.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}();"react-native"===aT.platform&&(null==K?void 0:K.endpoint)&&function xt(){return new cT(Dw.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${aT.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}().log();let{defaultEndpoint:ue,version:pe}=aT;this.testMode=!(null==K||!K.testMode),this.useStorageCache=!(null==K||!K.useStorageCache),this.endpoint=He(null!=(ne=null==K?void 0:K.endpoint)?ne:ue).origin,this.auth=new wT(this),this.user=new UT(this),this.wallet=new $T(this),this.nft=new KT(this),this.thirdPartyWallets=new qT(this),this.rpcProvider=new HT(this);let he=_n.call(this,K);this.parameters=fe(H$1(k$1({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==K?void 0:K.network,host:He(this.endpoint).host,sdk:iT[aT.sdkName],version:pe,ext:ie(he)?void 0:he,locale:(null==K?void 0:K.locale)||"en_US"},aT.bundleId?{bundleId:aT.bundleId}:{}),{meta:null==K?void 0:K.meta})),this.networkHash=function On(G,K,ne){return K||ne?ne?`${G}_${JSON.stringify(ne)}`:K?"string"==typeof K?`${G}_eth_${K}`:`${G}_${K.rpcUrl}_${K.chainId}_${K.chainType}`:`${G}_unknown`:`${G}_eth_mainnet`}(this.apiKey,null==K?void 0:K.network,ie(he)?void 0:he),null!=K&&K.deferPreload||this.preload()}get overlay(){if(!JT.__overlays__.has(this.parameters)){let G=new aT.ViewController(this.endpoint,this.parameters,this.networkHash);G.init(),JT.__overlays__.set(this.parameters,G)}return JT.__overlays__.get(this.parameters)}preload(){return m$2(this,null,(function*(){yield this.overlay.waitForReady()}))}},XT=JT;function zt(G,K){var ne;let ue=null==(ne=K.data.response)?void 0:ne.id,pe=function kn(G,K){return K&&Array.isArray(G)?G.find((G=>G.id===K)):G}(G,ue);if(ue&&pe){return{id:ue,response:new pT(pe).applyResult(K.data.response.result).applyError(K.data.response.error)}}return{}}function Yt(G,K,ne){return m$2(this,null,(function*(){var ue;let pe,he=yield TT("rt");if("web"===aT.platform)try{pe=null!=(ue=yield TT("jwt"))?ue:yield Ft()}catch(G){console.error("webcrypto error",G)}let ye={msgType:G,payload:K};pe&&(ye.jwt=pe),pe&&he&&(ye.rt=he);let me=yield function jt(G){return m$2(this,null,(function*(){let K=yield TT(`${MT}_${G}`),ne=yield TT(FT),ue=yield TT(BT);if(!(ne&&K&&ue&&le()))return;let{subtle:pe}=window.crypto;return Jt(yield pe.decrypt({name:DT,iv:ne},ue,Gt(K)))}))}(ne);return me&&(ye.deviceShare=me),ye}))}XT.__overlays__=new Map;var QT=3e5,ZT=class{constructor(G,K,ne){this.endpoint=G,this.parameters=K,this.networkHash=ne,this.isReadyForRequest=!1,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.lastPongTime=null,this.heartbeatIntervalTimer=null,this.heartbeatDebounce=function Zt(G,K){let ne=null;return function(...ue){ne&&clearTimeout(ne),ne=setTimeout((()=>{G(...ue)}),K)}}((()=>{"https://auth.magic.link/"===this.endpoint&&this.heartBeatCheck()}),36e5),this.listen()}post(G,K){return m$2(this,null,(function*(){return We(((ne,ue)=>m$2(this,null,(function*(){if(!this.isConnectedToInternet){let G=vt();ue(G)}(yield this.checkRelayerExistsInDOM())||(this.isReadyForRequest=!1,yield this.reloadRelayer()),this.isReadyForRequest||(yield this.waitForReady());let pe=[],he=Array.isArray(K)?K.map((G=>G.id)):[],ye=yield Yt(`${G}-${this.parameters}`,K,this.networkHash);yield this._post(ye);let me=this.on(jw.MAGIC_HANDLE_RESPONSE,(G=>ue=>{var ye;let{id:me,response:be}=zt(K,ue);if(function Qt(G){return m$2(this,null,(function*(){!G.data.rt||(yield AT("rt",G.data.rt))}))}(ue),"User denied account access."===(null==(ye=null==be?void 0:be.payload.error)?void 0:ye.message))we();else if(ue.data.deviceShare){let{deviceShare:G}=ue.data;Kt(G,this.networkHash)}me&&be&&Array.isArray(K)&&he.includes(me)?(pe.push(be),pe.length===K.length&&(G(),ne(pe))):me&&be&&!Array.isArray(K)&&me===K.id&&(G(),ne(be))})((()=>me())))}))))}))}on(G,K){let ne=K.bind(window),i=K=>{K.data.msgType===`${G}-${this.parameters}`&&ne(K)};return this.messageHandlers.add(i),()=>this.messageHandlers.delete(i)}waitForReady(){return new Promise((G=>{let K=this.on(jw.MAGIC_OVERLAY_READY,(()=>{this.isReadyForRequest=!0,G(),K()}))}))}listen(){this.on(jw.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(jw.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()})),this.on(jw.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,(G=>{G.data.response.result.product_announcement&&new cT(Dw.ProductAnnouncement,G.data.response.result.product_announcement).log()}))}heartBeatCheck(){let G=!0,t=()=>m$2(this,null,(function*(){let G={msgType:`${Hw.MAGIC_PING}-${this.parameters}`,payload:[]};yield this._post(G)}));this.heartbeatIntervalTimer=setInterval((()=>m$2(this,null,(function*(){if(this.lastPongTime){if(Date.now()-this.lastPongTime>2*QT)return this.reloadRelayer(),void(G=!0)}else if(!G)return this.reloadRelayer(),void(G=!0);yield t(),G=!1}))),QT)}stopHeartBeat(){this.heartbeatDebounce(),this.lastPongTime=null,this.heartbeatIntervalTimer&&(clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null)}},YT=(G=>(G.MissingApiKey="MISSING_API_KEY",G.ModalNotReady="MODAL_NOT_READY",G.ConnectionLost="CONNECTION_WAS_LOST",G.MalformedResponse="MALFORMED_RESPONSE",G.InvalidArgument="INVALID_ARGUMENT",G.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",G.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",G))(YT||{}),eA=(G=>(G.SyncWeb3Method="SYNC_WEB3_METHOD",G.DuplicateIframe="DUPLICATE_IFRAME",G.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",G.DeprecationNotice="DEPRECATION_NOTICE",G.ProductAnnouncement="ANNOUNCEMENT",G))(eA||{}),tA=(G=>(G[G.ParseError=-32700]="ParseError",G[G.InvalidRequest=-32600]="InvalidRequest",G[G.MethodNotFound=-32601]="MethodNotFound",G[G.InvalidParams=-32602]="InvalidParams",G[G.InternalError=-32603]="InternalError",G[G.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",G[G.MagicLinkExpired=-10001]="MagicLinkExpired",G[G.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",G[G.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",G[G.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",G[G.UpdateEmailFailed=-10004]="UpdateEmailFailed",G[G.UserRequestEditEmail=-10005]="UserRequestEditEmail",G[G.InactiveRecipient=-10010]="InactiveRecipient",G[G.AccessDeniedToUser=-10011]="AccessDeniedToUser",G[G.RedirectLoginComplete=-10015]="RedirectLoginComplete",G))(tA||{}),rA=(G=>(G.PROVIDER="magic_3pw_provider",G.ADDRESS="magic_3pw_address",G.CHAIN_ID="magic_3pw_chainId",G))(rA||{}),nA=(G=>(G.WalletConnected="wallet_connected",G.WalletRejected="wallet_rejected",G.Web3ModalSelected="web3modal_selected",G))(nA||{}),aA=(G=>(G.LoginWithSms="magic_auth_login_with_sms",G.LoginWithEmailOTP="magic_auth_login_with_email_otp",G.LoginWithMagicLink="magic_auth_login_with_magic_link",G.LoginWithCredential="magic_auth_login_with_credential",G.SetAuthorizationToken="magic_auth_set_authorization_token",G.GetIdToken="magic_auth_get_id_token",G.GenerateIdToken="magic_auth_generate_id_token",G.GetMetadata="magic_auth_get_metadata",G.IsLoggedIn="magic_is_logged_in",G.Logout="magic_auth_logout",G.UpdateEmail="magic_auth_update_email",G.UserSettings="magic_auth_settings",G.UserSettingsTestMode="magic_auth_settings_testing_mode",G.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",G.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",G.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",G.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",G.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",G.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",G.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",G.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",G.LogoutTestMode="magic_auth_logout_testing_mode",G.UpdateEmailTestMode="magic_auth_update_email_testing_mode",G.IntermediaryEvent="magic_intermediary_event",G.RequestAccounts="eth_requestAccounts",G.GetInfo="magic_get_info",G.ShowUI="magic_wallet",G.NFTPurchase="magic_nft_purchase",G.NFTCheckout="magic_nft_checkout",G.NFTTransfer="magic_nft_transfer",G.RequestUserInfoWithUI="mc_request_user_info",G.Disconnect="mc_disconnect",G.RecoverAccount="magic_auth_recover_account",G.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",G.MagicBoxHeartBeat="magic_box_heart_beat",G.AutoConnect="mc_auto_connect",G.Login="mc_login",G.EncryptV1="magic_auth_encrypt_v1",G.DecryptV1="magic_auth_decrypt_v1",G.ShowNFTs="magic_show_nfts",G.ShowOnRamp="magic_show_fiat_onramp",G.ShowSendTokensUI="magic_show_send_tokens_ui",G.ShowAddress="magic_show_address",G.ShowBalances="magic_show_balances",G.SendGaslessTransaction="eth_sendGaslessTransaction",G.RevealPK="magic_reveal_key",G.EnableMFA="magic_auth_enable_mfa_flow",G.DisableMFA="magic_auth_disable_mfa_flow",G))(aA||{}),iA=(G=>(G.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",G.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",G.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",G.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",G.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",G.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",G.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",G.MAGIC_PONG="MAGIC_PONG",G.MAGIC_POPUP_RESPONSE="MAGIC_POPUP_RESPONSE",G.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE="MAGIC_POPUP_OAUTH_VERIFY_RESPONSE",G))(iA||{}),sA=(G=>(G.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",G.MAGIC_PING="MAGIC_PING",G))(sA||{}),oA=(G=>(G.UpdateEmail="update-email",G.MFA="mfa",G.Recovery="recovery",G))(oA||{}),cA=(G=>(G.Retry="retry",G))(cA||{}),dA=(G=>(G.EmailSent="email-sent",G.EmailNotDeliverable="email-not-deliverable",G))(dA||{}),uA=(G=>(G.VerifyEmailOtp="verify-email-otp",G.VerifyMFACode="verify-mfa-code",G.LostDevice="lost-device",G.VerifyRecoveryCode="verify-recovery-code",G.Cancel="cancel",G))(uA||{}),fA=(G=>(G.VerifySmsOtp="verify-sms-otp",G.Cancel="cancel",G.Retry="retry",G))(fA||{}),lA=(G=>(G.SmsOTPSent="sms-otp-sent",G.InvalidSmsOtp="invalid-sms-otp",G.ExpiredSmsOtp="expired-sms-otp",G))(lA||{}),pA=(G=>(G.EmailOTPSent="email-otp-sent",G.InvalidEmailOtp="invalid-email-otp",G.InvalidMfaOtp="invalid-mfa-otp",G.ExpiredEmailOtp="expired-email-otp",G.MfaSentHandle="mfa-sent-handle",G.RecoveryCodeSentHandle="recovery-code-sent-handle",G.InvalidRecoveryCode="invalid-recovery-code",G.RecoveryCodeSuccess="recovery-code-success",G))(pA||{}),hA=(G=>(G.Retry="device-retry",G))(hA||{}),yA=(G=>(G.DeviceApproved="device-approved",G.DeviceNeedsApproval="device-needs-approval",G.DeviceVerificationLinkExpired="device-verification-link-expired",G.DeviceVerificationEmailSent="device-verification-email-sent",G))(yA||{}),mA=(G=>(G.Retry="Recency/auth-factor-retry",G.Cancel="Recency/auth-factor-verification-cancel",G.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",G.VerifyMFACode="Recency/verify-mfa-code",G))(mA||{}),bA=(G=>(G.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",G.PrimaryAuthFactorVerified="Recency/auth-factor-verified",G.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",G.EmailExpired="Recency/auth-factor-verification-email-expired",G.EmailSent="Recency/auth-factor-verification-email-sent",G.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",G))(bA||{}),gA=(G=>(G.RetryWithNewEmail="UpdateEmail/retry-with-new-email",G.Cancel="UpdateEmail/new-email-verification-cancel",G.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",G))(gA||{}),vA=(G=>(G.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",G.EmailUpdated="UpdateEmail/email-updated",G.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",G.EmailExpired="UpdateEmail/new-email-verification-email-expired",G.EmailSent="UpdateEmail/new-email-verification-email-sent",G.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",G.InvalidEmail="UpdateEmail/new-email-invalid",G.EmailAlreadyExists="UpdateEmail/new-email-already-exists",G))(vA||{}),wA=(G=>(G.IDTokenCreated="Auth/id-token-created",G))(wA||{}),_A=(G=>(G.Cancel="Farcaster/cancel",G))(_A||{}),TA=(G=>(G.MFASecretGenerated="mfa-secret-generated",G.InvalidMFAOtp="invalid-mfa-otp",G.MFARecoveryCodes="mfa-recovery-codes",G))(TA||{}),AA=(G=>(G.VerifyMFACode="verify-mfa-code",G.Cancel="cancel-mfa-setup",G))(AA||{}),EA=(G=>(G.MFACodeRequested="mfa-code-requested",G.InvalidMFAOtp="invalid-mfa-otp",G.InvalidRecoveryCode="invalid-recovery-code",G))(EA||{}),PA=(G=>(G.VerifyMFACode="verify-mfa-code",G.LostDevice="lost-device",G.Cancel="cancel-mfa-disable",G))(PA||{}),SA=(G=>(G.Harmony="HARMONY",G))(SA||{}),IA=(G=>(G.ClosedByUser="closed-by-user",G))(IA||{}),CA=(G=>(G.ClosedByUser="closed-by-user-on-received",G))(CA||{}),RA=(G=>(G.EnterNewPhoneNumber="enter-new-phone-number",G.EnterOtpCode="enter-otp-code",G.RecoveryFactorAlreadyExists="recovery-factor-already-exists",G.MalformedPhoneNumber="malformed-phone-number",G.InvalidOtpCode="invalid-otp-code",G))(RA||{}),kA=(G=>(G.SendNewPhoneNumber="send-new-phone-number",G.SendOtpCode="send-otp-code",G.Cancel="cancel",G.StartEditPhoneNumber="start-edit-phone-number",G))(kA||{}),OA=(G=>(G.PhoneNumber="phone_number",G))(OA||{}),xA=(G=>(G.SmsOtpSent="sms-otp-sent",G.LoginThrottled="login-throttled",G.InvalidSmsOtp="invalid-sms-otp",G.SmsVerified="sms-verified",G.AccountRecovered="account-recovered",G.UpdateEmailRequired="update-email-required",G))(xA||{}),NA=(G=>(G.Cancel="cancel",G.VerifyOtp="verify-otp-code",G.ResendSms="resend-sms-otp",G.UpdateEmail="update-email",G))(NA||{}),MA=(G=>(G.Success="nft-checkout-success",G.Failure="nft-checkout-failure",G.Initiated="nft-checkout-initiated",G.Disconnect="disconnect",G))(MA||{}),BA=(G=>(G.WalletInfoFetched="Wallet/wallet-info-fetched",G))(BA||{}),FA=(G=>(G.CloseMagicWindow="close-magic-window",G))(FA||{}),DA=Object.create,LA=Object.defineProperty,UA=Object.getOwnPropertyDescriptor,$A=Object.getOwnPropertyNames,qA=Object.getPrototypeOf,GA=Object.prototype.hasOwnProperty,jA=(G=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(G,{get:(G,K)=>("undefined"!=typeof require?require:G)[K]}):G)((function(G){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+G+'" is not supported')})),$e=(G,K)=>()=>(K||G((K={exports:{}}).exports,K),K.exports),Ze=(G,K,ne)=>(ne=null!=G?DA(qA(G)):{},((G,K,ne,ue)=>{if(K&&"object"==typeof K||"function"==typeof K)for(let pe of $A(K))!GA.call(G,pe)&&pe!==ne&&LA(G,pe,{get:()=>K[pe],enumerable:!(ue=UA(K,pe))||ue.enumerable});return G})(G&&G.__esModule?ne:LA(ne,"default",{value:G,enumerable:!0}),G)),te=(G,K,ne)=>new Promise(((ue,pe)=>{var X=G=>{try{W(ne.next(G))}catch(G){pe(G)}},P=G=>{try{W(ne.throw(G))}catch(G){pe(G)}},W=G=>G.done?ue(G.value):Promise.resolve(G.value).then(X,P);W((ne=ne.apply(G,K)).next())})),HA=$e(((G,K)=>{!function(ne){if("object"==typeof G&&typeof K<"u")K.exports=ne();else if("function"==typeof define&&define.amd)define([],ne);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=ne()}}((function(){return function N(G,K,ne){function W(pe,he){if(!K[pe]){if(!G[pe]){var ye="function"==typeof jA&&jA;if(!he&&ye)return ye(pe,!0);if(ue)return ue(pe,!0);var me=new Error("Cannot find module '"+pe+"'");throw me.code="MODULE_NOT_FOUND",me}var be=K[pe]={exports:{}};G[pe][0].call(be.exports,(function(K){return W(G[pe][1][K]||K)}),be,be.exports,N,G,K,ne)}return K[pe].exports}for(var ue="function"==typeof jA&&jA,pe=0;pe<ne.length;pe++)W(ne[pe]);return W}({1:[function(G,K,ne){(function(G){var ne,ue=G.MutationObserver||G.WebKitMutationObserver;if(ue){var pe=0,he=new ue(z),ye=G.document.createTextNode("");he.observe(ye,{characterData:!0}),ne=function(){ye.data=pe=++pe%2}}else if(!G.setImmediate&&typeof G.MessageChannel<"u"){var me=new G.MessageChannel;me.port1.onmessage=z,ne=function(){me.port2.postMessage(0)}}else ne="document"in G&&"onreadystatechange"in G.document.createElement("script")?function(){var K=G.document.createElement("script");K.onreadystatechange=function(){z(),K.onreadystatechange=null,K.parentNode.removeChild(K),K=null},G.document.documentElement.appendChild(K)}:function(){setTimeout(z,0)};var be,ve=[];function z(){be=!0;for(var G,K,ne=ve.length;ne;){for(K=ve,ve=[],G=-1;++G<ne;)K[G]();ne=ve.length}be=!1}K.exports=function Z(G){1===ve.push(G)&&!be&&ne()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(G,K,ne){var ue=G(1);function W(){}var pe={},he=["REJECTED"],ye=["FULFILLED"],me=["PENDING"];function m(G){if("function"!=typeof G)throw new TypeError("resolver must be a function");this.state=me,this.queue=[],this.outcome=void 0,G!==W&&Z(this,G)}function w(G,K,ne){this.promise=G,"function"==typeof K&&(this.onFulfilled=K,this.callFulfilled=this.otherCallFulfilled),"function"==typeof ne&&(this.onRejected=ne,this.callRejected=this.otherCallRejected)}function x(G,K,ne){ue((function(){var ue;try{ue=K(ne)}catch(K){return pe.reject(G,K)}ue===G?pe.reject(G,new TypeError("Cannot resolve promise with itself")):pe.resolve(G,ue)}))}function z(G){var K=G&&G.then;if(G&&("object"==typeof G||"function"==typeof G)&&"function"==typeof K)return function(){K.apply(G,arguments)}}function Z(G,K){var ne=!1;function C(K){ne||(ne=!0,pe.reject(G,K))}function V(K){ne||(ne=!0,pe.resolve(G,K))}var ue=F((function j(){K(V,C)}));"error"===ue.status&&C(ue.value)}function F(G,K){var ne={};try{ne.value=G(K),ne.status="success"}catch(G){ne.status="error",ne.value=G}return ne}K.exports=m,m.prototype.catch=function(G){return this.then(null,G)},m.prototype.then=function(G,K){if("function"!=typeof G&&this.state===ye||"function"!=typeof K&&this.state===he)return this;var ne=new this.constructor(W);this.state!==me?x(ne,this.state===ye?G:K,this.outcome):this.queue.push(new w(ne,G,K));return ne},w.prototype.callFulfilled=function(G){pe.resolve(this.promise,G)},w.prototype.otherCallFulfilled=function(G){x(this.promise,this.onFulfilled,G)},w.prototype.callRejected=function(G){pe.reject(this.promise,G)},w.prototype.otherCallRejected=function(G){x(this.promise,this.onRejected,G)},pe.resolve=function(G,K){var ne=F(z,K);if("error"===ne.status)return pe.reject(G,ne.value);var ue=ne.value;if(ue)Z(G,ue);else{G.state=ye,G.outcome=K;for(var he=-1,me=G.queue.length;++he<me;)G.queue[he].callFulfilled(K)}return G},pe.reject=function(G,K){G.state=he,G.outcome=K;for(var ne=-1,ue=G.queue.length;++ne<ue;)G.queue[ne].callRejected(K);return G},m.resolve=function k(G){return G instanceof this?G:pe.resolve(new this(W),G)},m.reject=function U(G){var K=new this(W);return pe.reject(K,G)},m.all=function fe(G){var K=this;if("[object Array]"!==Object.prototype.toString.call(G))return this.reject(new TypeError("must be an array"));var ne=G.length,ue=!1;if(!ne)return this.resolve([]);for(var he=new Array(ne),ye=0,me=-1,be=new this(W);++me<ne;)ee(G[me],me);return be;function ee(G,me){K.resolve(G).then((function u(G){he[me]=G,++ye===ne&&!ue&&(ue=!0,pe.resolve(be,he))}),(function(G){ue||(ue=!0,pe.reject(be,G))}))}},m.race=function re(G){var K=this;if("[object Array]"!==Object.prototype.toString.call(G))return this.reject(new TypeError("must be an array"));var ne=G.length,ue=!1;if(!ne)return this.resolve([]);for(var he=-1,ye=new this(W);++he<ne;)Q(G[he]);return ye;function Q(G){K.resolve(G).then((function(G){ue||(ue=!0,pe.resolve(ye,G))}),(function(G){ue||(ue=!0,pe.reject(ye,G))}))}}},{1:1}],3:[function(G,K,ne){(function(K){"function"!=typeof K.Promise&&(K.Promise=G(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(G,K,ne){var ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(G){return typeof G}:function(G){return G&&"function"==typeof Symbol&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G};var pe=function S(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function $(G,K){G=G||[],K=K||{};try{return new Blob(G,K)}catch(pe){if("TypeError"!==pe.name)throw pe;for(var ne=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),ue=0;ue<G.length;ue+=1)ne.append(G[ue]);return ne.getBlob(K.type)}}typeof Promise>"u"&&G(3);var he=Promise;function w(G,K){K&&G.then((function(G){K(null,G)}),(function(G){K(G)}))}function x(G,K,ne){"function"==typeof K&&G.then(K),"function"==typeof ne&&G.catch(ne)}function z(G){return"string"!=typeof G&&(console.warn(G+" used as a key, but it is not a string."),G=String(G)),G}function Z(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var ye="local-forage-detect-blob-support",me=void 0,be={},ve=Object.prototype.toString,_e="readonly",Te="readwrite";function C(G){return"boolean"==typeof me?he.resolve(me):function E(G){return new he((function(K){var ne=G.transaction(ye,Te),ue=$([""]);ne.objectStore(ye).put(ue,"key"),ne.onabort=function(G){G.preventDefault(),G.stopPropagation(),K(!1)},ne.oncomplete=function(){var G=navigator.userAgent.match(/Chrome\/(\d+)/),ne=navigator.userAgent.match(/Edge\//);K(ne||!G||parseInt(G[1],10)>=43)}})).catch((function(){return!1}))}(G).then((function(G){return me=G}))}function V(G){var K=be[G.name],ne={};ne.promise=new he((function(G,K){ne.resolve=G,ne.reject=K})),K.deferredOperations.push(ne),K.dbReady?K.dbReady=K.dbReady.then((function(){return ne.promise})):K.dbReady=ne.promise}function j(G){var K=be[G.name].deferredOperations.pop();if(K)return K.resolve(),K.promise}function Q(G,K){var ne=be[G.name].deferredOperations.pop();if(ne)return ne.reject(K),ne.promise}function J(G,K){return new he((function(ne,ue){if(be[G.name]=be[G.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},G.db){if(!K)return ne(G.db);V(G),G.db.close()}var he=[G.name];K&&he.push(G.version);var me=pe.open.apply(pe,he);K&&(me.onupgradeneeded=function(K){var ne=me.result;try{ne.createObjectStore(G.storeName),K.oldVersion<=1&&ne.createObjectStore(ye)}catch(ne){if("ConstraintError"!==ne.name)throw ne;console.warn('The database "'+G.name+'" has been upgraded from version '+K.oldVersion+" to version "+K.newVersion+', but the storage "'+G.storeName+'" already exists.')}}),me.onerror=function(G){G.preventDefault(),ue(me.error)},me.onsuccess=function(){var K=me.result;K.onversionchange=function(G){G.target.close()},ne(K),j(G)}}))}function ee(G){return J(G,!1)}function ie(G){return J(G,!0)}function a(G,K){if(!G.db)return!0;var ne=!G.db.objectStoreNames.contains(G.storeName),ue=G.version<G.db.version,pe=G.version>G.db.version;if(ue&&(G.version!==K&&console.warn('The database "'+G.name+"\" can't be downgraded from version "+G.db.version+" to version "+G.version+"."),G.version=G.db.version),pe||ne){if(ne){var he=G.db.version+1;he>G.version&&(G.version=he)}return!0}return!1}function v(G){var K=function T(G){for(var K=G.length,ne=new ArrayBuffer(K),ue=new Uint8Array(ne),pe=0;pe<K;pe++)ue[pe]=G.charCodeAt(pe);return ne}(atob(G.data));return $([K],{type:G.type})}function g(G){return G&&G.__local_forage_encoded_blob}function b(G){var K=this,ne=K._initReady().then((function(){var G=be[K._dbInfo.name];if(G&&G.dbReady)return G.dbReady}));return x(ne,G,G),ne}function B(G,K,ne,ue){void 0===ue&&(ue=1);try{var pe=G.db.transaction(G.storeName,K);ne(null,pe)}catch(pe){if(ue>0&&(!G.db||"InvalidStateError"===pe.name||"NotFoundError"===pe.name))return he.resolve().then((function(){if(!G.db||"NotFoundError"===pe.name&&!G.db.objectStoreNames.contains(G.storeName)&&G.version<=G.db.version)return G.db&&(G.version=G.db.version+1),ie(G)})).then((function(){return function I(G){V(G);for(var K=be[G.name],ne=K.forages,ue=0;ue<ne.length;ue++){var pe=ne[ue];pe._dbInfo.db&&(pe._dbInfo.db.close(),pe._dbInfo.db=null)}return G.db=null,ee(G).then((function(K){return G.db=K,a(G)?ie(G):K})).then((function(ue){G.db=K.db=ue;for(var pe=0;pe<ne.length;pe++)ne[pe]._dbInfo.db=ue})).catch((function(K){throw Q(G,K),K}))}(G).then((function(){B(G,K,ne,ue-1)}))})).catch(ne);ne(pe)}}var Ee={_driver:"asyncStorage",_initStorage:function se(G){var K=this,ne={db:null};if(G)for(var ue in G)ne[ue]=G[ue];var pe=be[ne.name];pe||(pe={forages:[],db:null,dbReady:null,deferredOperations:[]},be[ne.name]=pe),pe.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=b);var ye=[];function f(){return he.resolve()}for(var me=0;me<pe.forages.length;me++){var ve=pe.forages[me];ve!==K&&ye.push(ve._initReady().catch(f))}var _e=pe.forages.slice(0);return he.all(ye).then((function(){return ne.db=pe.db,ee(ne)})).then((function(G){return ne.db=G,a(ne,K._defaultConfig.version)?ie(ne):G})).then((function(G){ne.db=pe.db=G,K._dbInfo=ne;for(var ue=0;ue<_e.length;ue++){var he=_e[ue];he!==K&&(he._dbInfo.db=ne.db,he._dbInfo.version=ne.version)}}))},_support:function H(){try{if(!pe||!pe.open)return!1;var G=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!G||K)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function ce(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){B(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).openCursor(),me=1;ye.onsuccess=function(){var ne=ye.result;if(ne){var ue=ne.value;g(ue)&&(ue=v(ue));var pe=G(ue,ne.key,me++);void 0!==pe?K(pe):ne.continue()}else K()},ye.onerror=function(){ue(ye.error)}}catch(G){ue(G)}}))})).catch(ue)}));return w(ue,K),ue},getItem:function ae(G,K){var ne=this;G=z(G);var ue=new he((function(K,ue){ne.ready().then((function(){B(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).get(G);ye.onsuccess=function(){var G=ye.result;void 0===G&&(G=null),g(G)&&(G=v(G)),K(G)},ye.onerror=function(){ue(ye.error)}}catch(G){ue(G)}}))})).catch(ue)}));return w(ue,K),ue},setItem:function nr(G,K,ne){var ue=this;G=z(G);var pe=new he((function(ne,pe){var ye;ue.ready().then((function(){return ye=ue._dbInfo,"[object Blob]"===ve.call(K)?C(ye.db).then((function(G){return G?K:function u(G){return new he((function(K,ne){var ue=new FileReader;ue.onerror=ne,ue.onloadend=function(ne){var ue=btoa(ne.target.result||"");K({__local_forage_encoded_blob:!0,data:ue,type:G.type})},ue.readAsBinaryString(G)}))}(K)})):K})).then((function(K){B(ue._dbInfo,Te,(function(he,ye){if(he)return pe(he);try{var me=ye.objectStore(ue._dbInfo.storeName);null===K&&(K=void 0);var be=me.put(K,G);ye.oncomplete=function(){void 0===K&&(K=null),ne(K)},ye.onabort=ye.onerror=function(){var G=be.error?be.error:be.transaction.error;pe(G)}}catch(G){pe(G)}}))})).catch(pe)}));return w(pe,ne),pe},removeItem:function or(G,K){var ne=this;G=z(G);var ue=new he((function(K,ue){ne.ready().then((function(){B(ne._dbInfo,Te,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName).delete(G);he.oncomplete=function(){K()},he.onerror=function(){ue(ye.error)},he.onabort=function(){var G=ye.error?ye.error:ye.transaction.error;ue(G)}}catch(G){ue(G)}}))})).catch(ue)}));return w(ue,K),ue},clear:function ir(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){B(K._dbInfo,Te,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).clear();pe.oncomplete=function(){G()},pe.onabort=pe.onerror=function(){var G=he.error?he.error:he.transaction.error;ne(G)}}catch(G){ne(G)}}))})).catch(ne)}));return w(ne,G),ne},length:function ar(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){B(K._dbInfo,_e,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).count();he.onsuccess=function(){G(he.result)},he.onerror=function(){ne(he.error)}}catch(G){ne(G)}}))})).catch(ne)}));return w(ne,G),ne},key:function fr(G,K){var ne=this,ue=new he((function(K,ue){G<0?K(null):ne.ready().then((function(){B(ne._dbInfo,_e,(function(pe,he){if(pe)return ue(pe);try{var ye=he.objectStore(ne._dbInfo.storeName),me=!1,be=ye.openKeyCursor();be.onsuccess=function(){var ne=be.result;ne?0===G||me?K(ne.key):(me=!0,ne.advance(G)):K(null)},be.onerror=function(){ue(be.error)}}catch(G){ue(G)}}))})).catch(ue)}));return w(ue,K),ue},keys:function sr(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){B(K._dbInfo,_e,(function(ue,pe){if(ue)return ne(ue);try{var he=pe.objectStore(K._dbInfo.storeName).openKeyCursor(),ye=[];he.onsuccess=function(){var K=he.result;K?(ye.push(K.key),K.continue()):G(ye)},he.onerror=function(){ne(he.error)}}catch(G){ne(G)}}))})).catch(ne)}));return w(ne,G),ne},dropInstance:function ur(G,K){K=Z.apply(this,arguments);var ne,ue=this.config();if((G="function"!=typeof G&&G||{}).name||(G.name=G.name||ue.name,G.storeName=G.storeName||ue.storeName),G.name){var ye=G.name===ue.name&&this._dbInfo.db?he.resolve(this._dbInfo.db):ee(G).then((function(K){var ne=be[G.name],ue=ne.forages;ne.db=K;for(var pe=0;pe<ue.length;pe++)ue[pe]._dbInfo.db=K;return K}));ne=G.storeName?ye.then((function(K){if(K.objectStoreNames.contains(G.storeName)){var ne=K.version+1;V(G);var ue=be[G.name],ye=ue.forages;K.close();for(var me=0;me<ye.length;me++){var ve=ye[me];ve._dbInfo.db=null,ve._dbInfo.version=ne}var _e=new he((function(K,ue){var he=pe.open(G.name,ne);he.onerror=function(G){he.result.close(),ue(G)},he.onupgradeneeded=function(){he.result.deleteObjectStore(G.storeName)},he.onsuccess=function(){var G=he.result;G.close(),K(G)}}));return _e.then((function(G){ue.db=G;for(var K=0;K<ye.length;K++){var ne=ye[K];ne._dbInfo.db=G,j(ne._dbInfo)}})).catch((function(K){throw(Q(G,K)||he.resolve()).catch((function(){})),K}))}})):ye.then((function(K){V(G);var ne=be[G.name],ue=ne.forages;K.close();for(var ye=0;ye<ue.length;ye++){ue[ye]._dbInfo.db=null}var me=new he((function(K,ne){var ue=pe.deleteDatabase(G.name);ue.onerror=function(){var G=ue.result;G&&G.close(),ne(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+G.name+'" until all open connections are closed')},ue.onsuccess=function(){var G=ue.result;G&&G.close(),K(G)}}));return me.then((function(G){ne.db=G;for(var K=0;K<ue.length;K++){j(ue[K]._dbInfo)}})).catch((function(K){throw(Q(G,K)||he.resolve()).catch((function(){})),K}))}))}else ne=he.reject("Invalid arguments");return w(ne,K),ne}};var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se=/^~~local_forage_type~([^~]+)~/,Ce="__lfsc__:",ke="arbf",Oe="blob",xe="si08",Ne="ui08",Me="uic8",Be="si16",Fe="si32",De="ur16",Le="ui32",Ue="fl32",je="fl64",ze=Object.prototype.toString;function Ke(G){var K,ne,ue,pe,he,ye=.75*G.length,me=G.length,be=0;"="===G[G.length-1]&&(ye--,"="===G[G.length-2]&&ye--);var ve=new ArrayBuffer(ye),_e=new Uint8Array(ve);for(K=0;K<me;K+=4)ne=Pe.indexOf(G[K]),ue=Pe.indexOf(G[K+1]),pe=Pe.indexOf(G[K+2]),he=Pe.indexOf(G[K+3]),_e[be++]=ne<<2|ue>>4,_e[be++]=(15&ue)<<4|pe>>2,_e[be++]=(3&pe)<<6|63&he;return ve}function Ie(G){var K,ne=new Uint8Array(G),ue="";for(K=0;K<ne.length;K+=3)ue+=Pe[ne[K]>>2],ue+=Pe[(3&ne[K])<<4|ne[K+1]>>4],ue+=Pe[(15&ne[K+1])<<2|ne[K+2]>>6],ue+=Pe[63&ne[K+2]];return ne.length%3==2?ue=ue.substring(0,ue.length-1)+"=":ne.length%3==1&&(ue=ue.substring(0,ue.length-2)+"=="),ue}var Je={serialize:function vr(G,K){var ne="";if(G&&(ne=ze.call(G)),G&&("[object ArrayBuffer]"===ne||G.buffer&&"[object ArrayBuffer]"===ze.call(G.buffer))){var ue,pe=Ce;G instanceof ArrayBuffer?(ue=G,pe+=ke):(ue=G.buffer,"[object Int8Array]"===ne?pe+=xe:"[object Uint8Array]"===ne?pe+=Ne:"[object Uint8ClampedArray]"===ne?pe+=Me:"[object Int16Array]"===ne?pe+=Be:"[object Uint16Array]"===ne?pe+=De:"[object Int32Array]"===ne?pe+=Fe:"[object Uint32Array]"===ne?pe+=Le:"[object Float32Array]"===ne?pe+=Ue:"[object Float64Array]"===ne?pe+=je:K(new Error("Failed to get type for BinaryArray"))),K(pe+Ie(ue))}else if("[object Blob]"===ne){var he=new FileReader;he.onload=function(){var ne="~~local_forage_type~"+G.type+"~"+Ie(this.result);K(Ce+Oe+ne)},he.readAsArrayBuffer(G)}else try{K(JSON.stringify(G))}catch(ne){console.error("Couldn't convert value into a JSON string: ",G),K(null,ne)}},deserialize:function hr(G){if(G.substring(0,9)!==Ce)return JSON.parse(G);var K,ne=G.substring(13),ue=G.substring(9,13);if(ue===Oe&&Se.test(ne)){var pe=ne.match(Se);K=pe[1],ne=ne.substring(pe[0].length)}var he=Ke(ne);switch(ue){case ke:return he;case Oe:return $([he],{type:K});case xe:return new Int8Array(he);case Ne:return new Uint8Array(he);case Me:return new Uint8ClampedArray(he);case Be:return new Int16Array(he);case De:return new Uint16Array(he);case Fe:return new Int32Array(he);case Le:return new Uint32Array(he);case Ue:return new Float32Array(he);case je:return new Float64Array(he);default:throw new Error("Unkown type: "+ue)}},stringToBuffer:Ke,bufferToString:Ie};function He(G,K,ne,ue){G.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],ne,ue)}function oe(G,K,ne,ue,pe,he){G.executeSql(ne,ue,pe,(function(G,ye){ye.code===ye.SYNTAX_ERR?G.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],(function(G,me){me.rows.length?he(G,ye):He(G,K,(function(){G.executeSql(ne,ue,pe,he)}),he)}),he):he(G,ye)}),he)}function Ve(G,K,ne,ue){var pe=this;G=z(G);var ye=new he((function(he,ye){pe.ready().then((function(){void 0===K&&(K=null);var me=K,be=pe._dbInfo;be.serializer.serialize(K,(function(K,ve){ve?ye(ve):be.db.transaction((function(ne){oe(ne,be,"INSERT OR REPLACE INTO "+be.storeName+" (key, value) VALUES (?, ?)",[G,K],(function(){he(me)}),(function(G,K){ye(K)}))}),(function(K){if(K.code===K.QUOTA_ERR){if(ue>0)return void he(Ve.apply(pe,[G,me,ne,ue-1]));ye(K)}}))}))})).catch(ye)}));return w(ye,ne),ye}var Xe={_driver:"webSQLStorage",_initStorage:function mr(G){var K=this,ne={db:null};if(G)for(var ue in G)ne[ue]="string"!=typeof G[ue]?G[ue].toString():G[ue];var pe=new he((function(G,ue){try{ne.db=openDatabase(ne.name,String(ne.version),ne.description,ne.size)}catch(G){return ue(G)}ne.db.transaction((function(pe){He(pe,ne,(function(){K._dbInfo=ne,G()}),(function(G,K){ue(K)}))}),ue)}));return ne.serializer=Je,pe},_support:function lr(){return"function"==typeof openDatabase}(),iterate:function pr(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){oe(ne,pe,"SELECT * FROM "+pe.storeName,[],(function(ne,ue){for(var he=ue.rows,ye=he.length,me=0;me<ye;me++){var be=he.item(me),ve=be.value;if(ve&&(ve=pe.serializer.deserialize(ve)),void 0!==(ve=G(ve,be.key,me+1)))return void K(ve)}K()}),(function(G,K){ue(K)}))}))})).catch(ue)}));return w(ue,K),ue},getItem:function yr(G,K){var ne=this;G=z(G);var ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){oe(ne,pe,"SELECT * FROM "+pe.storeName+" WHERE key = ? LIMIT 1",[G],(function(G,ne){var ue=ne.rows.length?ne.rows.item(0).value:null;ue&&(ue=pe.serializer.deserialize(ue)),K(ue)}),(function(G,K){ue(K)}))}))})).catch(ue)}));return w(ue,K),ue},setItem:function gr(G,K,ne){return Ve.apply(this,[G,K,ne,1])},removeItem:function br(G,K){var ne=this;G=z(G);var ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){oe(ne,pe,"DELETE FROM "+pe.storeName+" WHERE key = ?",[G],(function(){K()}),(function(G,K){ue(K)}))}))})).catch(ue)}));return w(ue,K),ue},clear:function _r(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){oe(K,ue,"DELETE FROM "+ue.storeName,[],(function(){G()}),(function(G,K){ne(K)}))}))})).catch(ne)}));return w(ne,G),ne},length:function wr(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){oe(K,ue,"SELECT COUNT(key) as c FROM "+ue.storeName,[],(function(K,ne){var ue=ne.rows.item(0).c;G(ue)}),(function(G,K){ne(K)}))}))})).catch(ne)}));return w(ne,G),ne},key:function Ir(G,K){var ne=this,ue=new he((function(K,ue){ne.ready().then((function(){var pe=ne._dbInfo;pe.db.transaction((function(ne){oe(ne,pe,"SELECT key FROM "+pe.storeName+" WHERE id = ? LIMIT 1",[G+1],(function(G,ne){var ue=ne.rows.length?ne.rows.item(0).key:null;K(ue)}),(function(G,K){ue(K)}))}))})).catch(ue)}));return w(ue,K),ue},keys:function Er(G){var K=this,ne=new he((function(G,ne){K.ready().then((function(){var ue=K._dbInfo;ue.db.transaction((function(K){oe(K,ue,"SELECT key FROM "+ue.storeName,[],(function(K,ne){for(var ue=[],pe=0;pe<ne.rows.length;pe++)ue.push(ne.rows.item(pe).key);G(ue)}),(function(G,K){ne(K)}))}))})).catch(ne)}));return w(ne,G),ne},dropInstance:function Ar(G,K){K=Z.apply(this,arguments);var ne=this.config();(G="function"!=typeof G&&G||{}).name||(G.name=G.name||ne.name,G.storeName=G.storeName||ne.storeName);var ue,pe=this;return ue=G.name?new he((function(K){var ue;ue=G.name===ne.name?pe._dbInfo.db:openDatabase(G.name,"","",0),G.storeName?K({db:ue,storeNames:[G.storeName]}):K(function Sr(G){return new he((function(K,ne){G.transaction((function(ue){ue.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(ne,ue){for(var pe=[],he=0;he<ue.rows.length;he++)pe.push(ue.rows.item(he).name);K({db:G,storeNames:pe})}),(function(G,K){ne(K)}))}),(function(G){ne(G)}))}))}(ue))})).then((function(G){return new he((function(K,ne){G.db.transaction((function(ue){function l(G){return new he((function(K,ne){ue.executeSql("DROP TABLE IF EXISTS "+G,[],(function(){K()}),(function(G,K){ne(K)}))}))}for(var pe=[],ye=0,me=G.storeNames.length;ye<me;ye++)pe.push(l(G.storeNames[ye]));he.all(pe).then((function(){K()})).catch((function(G){ne(G)}))}),(function(G){ne(G)}))}))})):he.reject("Invalid arguments"),w(ue,K),ue}};function Ge(G,K){var ne=G.name+"/";return G.storeName!==K.storeName&&(ne+=G.storeName+"/"),ne}function Br(){return!function Tr(){var G="_localforage_support_test";try{return localStorage.setItem(G,!0),localStorage.removeItem(G),!1}catch{return!0}}()||localStorage.length>0}var Qe={_driver:"localStorageWrapper",_initStorage:function Nr(G){var K={};if(G)for(var ne in G)K[ne]=G[ne];return K.keyPrefix=Ge(G,this._defaultConfig),Br()?(this._dbInfo=K,K.serializer=Je,he.resolve()):he.reject()},_support:function Dr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function Cr(G,K){var ne=this,ue=ne.ready().then((function(){for(var K=ne._dbInfo,ue=K.keyPrefix,pe=ue.length,he=localStorage.length,ye=1,me=0;me<he;me++){var be=localStorage.key(me);if(0===be.indexOf(ue)){var ve=localStorage.getItem(be);if(ve&&(ve=K.serializer.deserialize(ve)),void 0!==(ve=G(ve,be.substring(pe),ye++)))return ve}}}));return w(ue,K),ue},getItem:function Or(G,K){var ne=this;G=z(G);var ue=ne.ready().then((function(){var K=ne._dbInfo,ue=localStorage.getItem(K.keyPrefix+G);return ue&&(ue=K.serializer.deserialize(ue)),ue}));return w(ue,K),ue},setItem:function Ur(G,K,ne){var ue=this;G=z(G);var pe=ue.ready().then((function(){void 0===K&&(K=null);var ne=K;return new he((function(pe,he){var ye=ue._dbInfo;ye.serializer.serialize(K,(function(K,ue){if(ue)he(ue);else try{localStorage.setItem(ye.keyPrefix+G,K),pe(ne)}catch(G){("QuotaExceededError"===G.name||"NS_ERROR_DOM_QUOTA_REACHED"===G.name)&&he(G),he(G)}}))}))}));return w(pe,ne),pe},removeItem:function Fr(G,K){var ne=this;G=z(G);var ue=ne.ready().then((function(){var K=ne._dbInfo;localStorage.removeItem(K.keyPrefix+G)}));return w(ue,K),ue},clear:function xr(G){var K=this,ne=K.ready().then((function(){for(var G=K._dbInfo.keyPrefix,ne=localStorage.length-1;ne>=0;ne--){var ue=localStorage.key(ne);0===ue.indexOf(G)&&localStorage.removeItem(ue)}}));return w(ne,G),ne},length:function Mr(G){var K=this.keys().then((function(G){return G.length}));return w(K,G),K},key:function Lr(G,K){var ne=this,ue=ne.ready().then((function(){var K,ue=ne._dbInfo;try{K=localStorage.key(G)}catch{K=null}return K&&(K=K.substring(ue.keyPrefix.length)),K}));return w(ue,K),ue},keys:function Pr(G){var K=this,ne=K.ready().then((function(){for(var G=K._dbInfo,ne=localStorage.length,ue=[],pe=0;pe<ne;pe++){var he=localStorage.key(pe);0===he.indexOf(G.keyPrefix)&&ue.push(he.substring(G.keyPrefix.length))}return ue}));return w(ne,G),ne},dropInstance:function Wr(G,K){if(K=Z.apply(this,arguments),!(G="function"!=typeof G&&G||{}).name){var ne=this.config();G.name=G.name||ne.name,G.storeName=G.storeName||ne.storeName}var ue,pe=this;return ue=G.name?new he((function(K){G.storeName?K(Ge(G,pe._defaultConfig)):K(G.name+"/")})).then((function(G){for(var K=localStorage.length-1;K>=0;K--){var ne=localStorage.key(K);0===ne.indexOf(G)&&localStorage.removeItem(ne)}})):he.reject("Invalid arguments"),w(ue,K),ue}},Yr=function(G,K){return G===K||"number"==typeof G&&"number"==typeof K&&isNaN(G)&&isNaN(K)},Kr=function(G,K){for(var ne=G.length,ue=0;ue<ne;){if(Yr(G[ue],K))return!0;ue++}return!1},Ye=Array.isArray||function(G){return"[object Array]"===Object.prototype.toString.call(G)},et={},tt={},rt={INDEXEDDB:Ee,WEBSQL:Xe,LOCALSTORAGE:Qe},nt=[rt.INDEXEDDB._driver,rt.WEBSQL._driver,rt.LOCALSTORAGE._driver],at=["dropInstance"],it=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(at),ot={description:"",driver:nt.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Gr(G,K){G[K]=function(){var ne=arguments;return G.ready().then((function(){return G[K].apply(G,ne)}))}}function Ae(){for(var G=1;G<arguments.length;G++){var K=arguments[G];if(K)for(var ne in K)K.hasOwnProperty(ne)&&(Ye(K[ne])?arguments[0][ne]=K[ne].slice():arguments[0][ne]=K[ne])}return arguments[0]}var ct=function(){function e(G){for(var K in function W(G,K){if(!(G instanceof K))throw new TypeError("Cannot call a class as a function")}(this,e),rt)if(rt.hasOwnProperty(K)){var ne=rt[K],ue=ne._driver;this[K]=ue,et[ue]||this.defineDriver(ne)}this._defaultConfig=Ae({},ot),this._config=Ae({},this._defaultConfig,G),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(G){if("object"===(typeof G>"u"?"undefined":ue(G))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var K in G){if("storeName"===K&&(G[K]=G[K].replace(/\W/g,"_")),"version"===K&&"number"!=typeof G[K])return new Error("Database version must be a number.");this._config[K]=G[K]}return!("driver"in G)||!G.driver||this.setDriver(this._config.driver)}return"string"==typeof G?this._config[G]:this._config},e.prototype.defineDriver=function(G,K,ne){var ue=new he((function(K,ne){try{var ue=G._driver,pe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!G._driver)return void ne(pe);for(var ye=it.concat("_initStorage"),me=0,be=ye.length;me<be;me++){var ve=ye[me];if((!Kr(at,ve)||G[ve])&&"function"!=typeof G[ve])return void ne(pe)}!function(){for(var de=function(G){return function(){var K=new Error("Method "+G+" is not implemented by the current driver"),ne=he.reject(K);return w(ne,arguments[arguments.length-1]),ne}},K=0,ne=at.length;K<ne;K++){var ue=at[K];G[ue]||(G[ue]=de(ue))}}();var Y=function(ne){et[ue]&&console.info("Redefining LocalForage driver: "+ue),et[ue]=G,tt[ue]=ne,K()};"_support"in G?G._support&&"function"==typeof G._support?G._support().then(Y,ne):Y(!!G._support):Y(!0)}catch(G){ne(G)}}));return x(ue,K,ne),ue},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(G,K,ne){var ue=et[G]?he.resolve(et[G]):he.reject(new Error("Driver not found."));return x(ue,K,ne),ue},e.prototype.getSerializer=function(G){var K=he.resolve(Je);return x(K,G),K},e.prototype.ready=function(G){var K=this,ne=K._driverSet.then((function(){return null===K._ready&&(K._ready=K._initDriver()),K._ready}));return x(ne,G,G),ne},e.prototype.setDriver=function(G,K,ne){var ue=this;Ye(G)||(G=[G]);var pe=this._getSupportedDrivers(G);function s(){ue._config.driver=ue.driver()}function c(G){return ue._extend(G),s(),ue._ready=ue._initStorage(ue._config),ue._ready}var ye=null!==this._driverSet?this._driverSet.catch((function(){return he.resolve()})):he.resolve();return this._driverSet=ye.then((function(){var G=pe[0];return ue._dbInfo=null,ue._ready=null,ue.getDriver(G).then((function(G){ue._driver=G._driver,s(),ue._wrapLibraryMethodsWithReady(),ue._initDriver=function l(G){return function(){var K=0;return function O(){for(;K<G.length;){var ne=G[K];return K++,ue._dbInfo=null,ue._ready=null,ue.getDriver(ne).then(c).catch(O)}s();var pe=new Error("No available storage method found.");return ue._driverSet=he.reject(pe),ue._driverSet}()}}(pe)}))})).catch((function(){s();var G=new Error("No available storage method found.");return ue._driverSet=he.reject(G),ue._driverSet})),x(this._driverSet,K,ne),this._driverSet},e.prototype.supports=function(G){return!!tt[G]},e.prototype._extend=function(G){Ae(this,G)},e.prototype._getSupportedDrivers=function(G){for(var K=[],ne=0,ue=G.length;ne<ue;ne++){var pe=G[ne];this.supports(pe)&&K.push(pe)}return K},e.prototype._wrapLibraryMethodsWithReady=function(){for(var G=0,K=it.length;G<K;G++)Gr(this,it[G])},e.prototype.createInstance=function(G){return new e(G)},e}(),dt=new ct;K.exports=dt},{3:3}]},{},[4])(4)}))})),WA=$e(((G,K)=>{!function(ne,ue){"object"==typeof G&&typeof K<"u"?ue(G):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],ue):ue(ne.LocalforageDriverMemory={})}(typeof self<"u"?self:G,(function(G){var K=/^~~local_forage_type~([^~]+)~/,ne=Object.prototype.toString;function S(G){var K=.75*G.length,ne=G.length;"="===G[G.length-1]&&(K--,"="===G[G.length-2]&&K--);for(var ue=new ArrayBuffer(K),pe=new Uint8Array(ue),he=0,ye=0;he<ne;he+=4){var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(G[he]),be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(G[he+1]),ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(G[he+2]),_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(G[he+3]);pe[ye++]=me<<2|be>>4,pe[ye++]=(15&be)<<4|ve>>2,pe[ye++]=(3&ve)<<6|63&_e}return ue}function M(G){for(var K=new Uint8Array(G),ne="",ue=0;ue<K.length;ue+=3)ne+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[K[ue]>>2],ne+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&K[ue])<<4|K[ue+1]>>4],ne+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&K[ue+1])<<2|K[ue+2]>>6],ne+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&K[ue+2]];return K.length%3==2?ne=ne.substring(0,ne.length-1)+"=":K.length%3==1&&(ne=ne.substring(0,ne.length-2)+"=="),ne}function m(G){var K,ne;if(null===G||"object"!=typeof G||"isActiveClone"in G)return G;var ue=G instanceof Date?new Date(G):G.constructor();try{for(var pe=function p(G){var K="function"==typeof Symbol&&G[Symbol.iterator],ne=0;return K?K.call(G):{next:function(){return G&&ne>=G.length&&(G=void 0),{value:G&&G[ne++],done:!G}}}}(Object.keys(G)),he=pe.next();!he.done;he=pe.next()){var ye=he.value;Object.prototype.hasOwnProperty.call(G,ye)&&(G.isActiveClone=null,ue[ye]=m(G[ye]),delete G.isActiveClone)}}catch(G){K={error:G}}finally{try{he&&!he.done&&(ne=pe.return)&&ne.call(pe)}finally{if(K)throw K.error}}return ue}function w(G,K){return(G.name||K.name)+"/"+(G.storeName||K.storeName)+"/"}function x(G,K){K&&G.then((function(G){K(null,G)}),(function(G){K(G)}))}function z(){for(var G=[],K=0;K<arguments.length;K++)G[K]=arguments[K];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function Z(G,K){var ne,ue=this;if(K=z.apply(this,arguments),!(G="function"!=typeof G&&G||{}).name){var pe=this.config();G.name=G.name||pe.name,G.storeName=G.storeName||pe.storeName}return ne=G.name?new Promise((function(K){G.storeName?K(w(G,ue._defaultConfig)):K(G.name+"/")})):Promise.reject("Invalid arguments"),{promise:ne,callback:K}}function F(G){return"string"!=typeof G&&(console.warn(G+" used as a key, but it is not a string."),G=String(G)),G}var ue={bufferToString:M,deserialize:function $(G){if("__lfsc__:"!==G.substring(0,9))return JSON.parse(G);var ne,ue=G.substring(13),pe=G.substring(9,13);if("blob"===pe&&K.test(ue)){var he=ue.match(K);ne=he[1],ue=ue.substring(he[0].length)}var ye=S(ue);switch(pe){case"arbf":return ye;case"blob":return function N(G,K){G=G||[],K=K||{};try{return new Blob(G,K)}catch(pe){if("TypeError"!==pe.name)throw pe;for(var ne=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),ue=0;ue<G.length;ue+=1)ne.append(G[ue]);return ne.getBlob(K.type)}}([ye],{type:ne});case"si08":return new Int8Array(ye);case"ui08":return new Uint8Array(ye);case"uic8":return new Uint8ClampedArray(ye);case"si16":return new Int16Array(ye);case"ur16":return new Uint16Array(ye);case"si32":return new Int32Array(ye);case"ui32":return new Uint32Array(ye);case"fl32":return new Float32Array(ye);case"fl64":return new Float64Array(ye);default:throw new Error("Unkown type: "+pe)}},serialize:function H(G,K){var ue="";if(G&&(ue=ne.call(G)),G&&("[object ArrayBuffer]"===ue||G.buffer&&"[object ArrayBuffer]"===ne.call(G.buffer))){var pe=void 0,he="__lfsc__:";G instanceof ArrayBuffer?(pe=G,he+="arbf"):(pe=G.buffer,"[object Int8Array]"===ue?he+="si08":"[object Uint8Array]"===ue?he+="ui08":"[object Uint8ClampedArray]"===ue?he+="uic8":"[object Int16Array]"===ue?he+="si16":"[object Uint16Array]"===ue?he+="ur16":"[object Int32Array]"===ue?he+="si32":"[object Uint32Array]"===ue?he+="ui32":"[object Float32Array]"===ue?he+="fl32":"[object Float64Array]"===ue?he+="fl64":K(new Error("Failed to get type for BinaryArray"))),K(he+M(pe))}else if("[object Blob]"===ue){var ye=new FileReader;ye.onload=function(){var ne="~~local_forage_type~"+G.type+"~"+M(this.result);K("__lfsc__:blob"+ne)},ye.readAsArrayBuffer(G)}else try{K(JSON.stringify(G))}catch(ne){console.error("Couldn't convert value into a JSON string: ",G),K(null,ne)}},stringToBuffer:S},pe={},he=function(){function a(G){this.kp=G,this.data={}}return a.resolve=function(G){return pe[G]||(pe[G]=new a(G)),pe[G]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete pe[this.kp]},a.prototype.get=function(G){return this.data[G]},a.prototype.key=function(G){return this.keys()[G]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(G){delete this.data[G]},a.prototype.set=function(G,K){this.data[G]=K},a}();G._support=!0,G._driver="localforage-driver-memory",G._initStorage=function re(G){var K=G?m(G):{},ne=w(K,this._defaultConfig),pe=he.resolve(ne);return this._dbInfo=K,this._dbInfo.serializer=ue,this._dbInfo.keyPrefix=ne,this._dbInfo.mStore=pe,Promise.resolve()},G.clear=function h(G){var K=this,ne=this.ready().then((function(){K._dbInfo.mStore.clear()}));return x(ne,G),ne},G.dropInstance=function T(G,K){var ne=Z.apply(this,arguments),ue=ne.promise,pe=ne.callback,ye=ue.then((function(G){he.resolve(G).drop()}));return x(ye,pe),ue},G.getItem=function E(G,K){var ne=this;G=F(G);var ue=this.ready().then((function(){var K=ne._dbInfo.mStore.get(G);return null==K?null:ne._dbInfo.serializer.deserialize(K)}));return x(ue,K),ue},G.iterate=function C(G,K){var ne=this,ue=this.ready().then((function(){for(var K=ne._dbInfo.mStore,ue=K.keys(),pe=0;pe<ue.length;pe++){var he=K.get(ue[pe]);if(he&&(he=ne._dbInfo.serializer.deserialize(he)),void 0!==(he=G(he,ue[pe],pe+1)))return he}}));return x(ue,K),ue},G.key=function V(G,K){var ne=this,ue=this.ready().then((function(){var K;try{void 0===(K=ne._dbInfo.mStore.key(G))&&(K=null)}catch{K=null}return K}));return x(ue,K),ue},G.keys=function j(G){var K=this,ne=this.ready().then((function(){return K._dbInfo.mStore.keys()}));return x(ne,G),ne},G.length=function Q(G){var K=this.keys().then((function(G){return G.length}));return x(K,G),K},G.removeItem=function J(G,K){var ne=this;G=F(G);var ue=this.ready().then((function(){ne._dbInfo.mStore.rm(G)}));return x(ue,K),ue},G.setItem=function ee(G,K,ne){var ue=this;G=F(G);var pe=this.ready().then((function(){void 0===K&&(K=null);var ne=K;return new Promise((function(pe,he){ue._dbInfo.serializer.serialize(K,(function(K,ye){if(ye)he(ye);else try{ue._dbInfo.mStore.set(G,K),pe(ne)}catch(G){he(G)}}))}))}));return x(pe,ne),pe},Object.defineProperty(G,"__esModule",{value:!0})}))})),zA=Ze(HA()),VA=Ze(WA()),KA={display:"block",visibility:"hidden",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",opacity:"0",zIndex:"-1"};var JA=function nn(G,K){return Object.assign(aT,K),G}(XT,{platform:"web",sdkName:"magic-sdk",version:"29.0.5",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends ZT{constructor(){super(...arguments),this.activeElement=null,this.relayerSrc=He(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href}init(){this.test="hello",this.iframe=new Promise((G=>{let N=()=>{if(function ut$1(G){let K=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(K.find((K=>K.src.includes(G))))}(encodeURIComponent(this.parameters)))(function ts(){return new cT(Dw.DuplicateIframe,"Duplicate iframes found.")})().log();else{let K=document.createElement("iframe");K.classList.add("magic-iframe"),K.dataset.magicIframeLabel=He(this.endpoint).host,K.title="Secure Modal",K.src=this.relayerSrc,K.allow="clipboard-read; clipboard-write",function st(G){for(let[K,ne]of Object.entries(KA))G.style[K]=ne}(K),document.body.appendChild(K),G(K)}};["loaded","interactive","complete"].includes(document.readyState)?N():window.addEventListener("load",N,!1)})),this.iframe.then((G=>{G instanceof HTMLIFrameElement&&G.addEventListener("load",(()=>te(this,null,(function*(){this.heartbeatDebounce()}))))})),window.addEventListener("message",(G=>{var K;if(G.origin===this.endpoint&&G.data.msgType&&(G.data.msgType.includes(iA.MAGIC_PONG)&&(this.lastPongTime=Date.now()),G.data&&this.messageHandlers.size)){G.data.response=null!=(K=G.data.response)?K:{},this.stopHeartBeat();for(let K of this.messageHandlers.values())K(G)}})),window.addEventListener("beforeunload",(()=>{this.stopHeartBeat()}))}showOverlay(){return te(this,null,(function*(){let G=yield this.iframe;G.style.visibility="visible",G.style.zIndex="2147483647",G.style.opacity="1",this.activeElement=document.activeElement,G.focus()}))}hideOverlay(){return te(this,null,(function*(){var G;let K=yield this.iframe;K.style.visibility="hidden",K.style.zIndex="-1",K.style.opacity="0",null!=(G=this.activeElement)&&G.focus&&this.activeElement.focus(),this.activeElement=null}))}_post(G){return te(this,null,(function*(){let K=yield this.iframe;if(!K||!K.contentWindow)throw vt();K.contentWindow.postMessage(G,this.endpoint)}))}checkRelayerExistsInDOM(){return te(this,null,(function*(){let G=yield this.iframe;if(!G||!G.contentWindow)return!1;let K=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(K.find((G=>G.src.includes(encodeURIComponent(this.parameters)))))}))}reloadRelayer(){return te(this,null,(function*(){let G=yield this.iframe;return this.stopHeartBeat(),G?G.contentWindow?void(G&&(G.src=this.relayerSrc)):(document.body.appendChild(G),void console.warn("Magic SDK: Modal did not append in the iframe, re-initiating")):(this.init(),void console.warn("Magic SDK: Modal lost, re-initiating"))}))}},configureStorage:()=>te(void 0,null,(function*(){let G=zA.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield G.defineDriver(VA),yield G.setDriver([zA.default.INDEXEDDB,zA.default.LOCALSTORAGE,VA._driver]),G}))}),XA=(G=>(G.MissingApiKey="MISSING_API_KEY",G.ModalNotReady="MODAL_NOT_READY",G.MalformedResponse="MALFORMED_RESPONSE",G.InvalidArgument="INVALID_ARGUMENT",G.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",G.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",G))(XA||{}),QA=(G=>(G.SyncWeb3Method="SYNC_WEB3_METHOD",G.DuplicateIframe="DUPLICATE_IFRAME",G.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",G.DeprecationNotice="DEPRECATION_NOTICE",G))(QA||{}),ZA=(G=>(G[G.ParseError=-32700]="ParseError",G[G.InvalidRequest=-32600]="InvalidRequest",G[G.MethodNotFound=-32601]="MethodNotFound",G[G.InvalidParams=-32602]="InvalidParams",G[G.InternalError=-32603]="InternalError",G[G.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",G[G.MagicLinkExpired=-10001]="MagicLinkExpired",G[G.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",G[G.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",G[G.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",G[G.UpdateEmailFailed=-10004]="UpdateEmailFailed",G[G.UserRequestEditEmail=-10005]="UserRequestEditEmail",G[G.InactiveRecipient=-10010]="InactiveRecipient",G[G.AccessDeniedToUser=-10011]="AccessDeniedToUser",G[G.RedirectLoginComplete=-10015]="RedirectLoginComplete",G))(ZA||{}),YA=(G=>(G.MetaMask="metamask",G.CoinbaseWallet="coinbase_wallet",G))(YA||{}),eE=(G=>(G.WalletSelected="wallet_selected",G.WalletConnected="wallet_connected",G.WalletRejected="wallet_rejected",G))(eE||{}),tE=(G=>(G.LoginWithSms="magic_auth_login_with_sms",G.LoginWithEmailOTP="magic_auth_login_with_email_otp",G.LoginWithMagicLink="magic_auth_login_with_magic_link",G.LoginWithCredential="magic_auth_login_with_credential",G.SetAuthorizationToken="magic_auth_set_authorization_token",G.GetIdToken="magic_auth_get_id_token",G.GenerateIdToken="magic_auth_generate_id_token",G.GetMetadata="magic_auth_get_metadata",G.IsLoggedIn="magic_is_logged_in",G.Logout="magic_auth_logout",G.UpdateEmail="magic_auth_update_email",G.UserSettings="magic_auth_settings",G.UserSettingsTestMode="magic_auth_settings_testing_mode",G.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",G.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",G.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",G.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",G.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",G.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",G.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",G.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",G.LogoutTestMode="magic_auth_logout_testing_mode",G.UpdateEmailTestMode="magic_auth_update_email_testing_mode",G.IntermediaryEvent="magic_intermediary_event",G.RequestAccounts="eth_requestAccounts",G.GetInfo="magic_get_info",G.ShowUI="magic_wallet",G.NFTPurchase="magic_nft_purchase",G.NFTCheckout="magic_nft_checkout",G.NFTTransfer="magic_nft_transfer",G.RequestUserInfoWithUI="mc_request_user_info",G.Disconnect="mc_disconnect",G.RecoverAccount="magic_auth_recover_account",G.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",G.MagicBoxHeartBeat="magic_box_heart_beat",G.AutoConnect="mc_auto_connect",G.Login="mc_login",G.EncryptV1="magic_auth_encrypt_v1",G.DecryptV1="magic_auth_decrypt_v1",G.ShowNFTs="magic_show_nfts",G.ShowOnRamp="magic_show_fiat_onramp",G.ShowSendTokensUI="magic_show_send_tokens_ui",G.ShowAddress="magic_show_address",G.ShowBalances="magic_show_balances",G.SendGaslessTransaction="eth_sendGaslessTransaction",G))(tE||{}),rE=(G=>(G.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",G.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",G.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",G.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",G.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",G.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",G))(rE||{}),nE=(G=>(G.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",G))(nE||{}),aE=(G=>(G.UpdateEmail="update-email",G.MFA="mfa",G.Recovery="recovery",G))(aE||{}),iE=(G=>(G.Retry="retry",G))(iE||{}),sE=(G=>(G.EmailSent="email-sent",G.EmailNotDeliverable="email-not-deliverable",G))(sE||{}),oE=(G=>(G.VerifyEmailOtp="verify-email-otp",G.Cancel="cancel",G))(oE||{}),cE=(G=>(G.EmailOTPSent="email-otp-sent",G.InvalidEmailOtp="invalid-email-otp",G.ExpiredEmailOtp="expired-email-otp",G))(cE||{}),dE=(G=>(G.Retry="device-retry",G))(dE||{}),uE=(G=>(G.DeviceApproved="device-approved",G.DeviceNeedsApproval="device-needs-approval",G.DeviceVerificationLinkExpired="device-verification-link-expired",G.DeviceVerificationEmailSent="device-verification-email-sent",G))(uE||{}),fE=(G=>(G.Harmony="HARMONY",G))(fE||{}),lE=(G=>(G.PhoneNumber="phone_number",G))(lE||{}),pE=(G=>(G.LoginWithOIDC="magic_auth_login_with_oidc",G))(pE||{}),hE=class n extends VT.Internal{constructor(){super(...arguments),this.name="openid",this.config={}}loginWithOIDC(G){let K=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_oidc",[G]);return this.request(K)}};function importRecoveryParam(G){const K=-1!==new Ei(G,16).cmp(new Ei(27))?new Ei(G,16).sub(new Ei(27)).toNumber():new Ei(G,16).toNumber();return G.trim()?K:void 0}async function signRaw(G,K){return function serializeEthSignature(G){return Ts(ws(G.r.toString(16),64)+ws(G.s.toString(16),64)+ws(G.recoveryParam?.toString(16)||"",2))}(function deserializeSignature(G,K=64){const ne=_s(G);return{r:new Ei(ne.substring(0,K),"hex"),s:new Ei(ne.substring(K,2*K),"hex"),recoveryParam:importRecoveryParam(ne.substring(2*K,2*K+2))}}(await K.signMessage(G)))}function convertToSignableToken(G){switch(G.type){case"ERC721":return{type:"ERC721",data:{token_id:G.tokenId,token_address:G.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:G.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}var yE=Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}]});var mE=Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}});const bE={erc6492:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]}),erc5719:yE,erc1271:mE,factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G},_extends$4.apply(this,arguments)}const gE="0x1626ba7e",vE=[{inputs:[{internalType:"bytes32",type:"bytes32"},{internalType:"bytes",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",type:"bytes4"}],stateMutability:"view",type:"function"}];let wE=function(G){return G[G.EIP712=1]="EIP712",G[G.ETH_SIGN=2]="ETH_SIGN",G[G.WALLET_BYTES32=3]="WALLET_BYTES32",G}({});function recoverSigner(G,K){const ne=arrayify$1(K),ue=arrayify$1(G),pe=ne[ne.length-1],he={r:hexlify$2(ne.slice(0,32)),s:hexlify$2(ne.slice(32,64)),v:Oi.from(ne.slice(64,65)).toNumber()};if(pe===wE.EIP712)return recoverAddress$1(ue,he);if(pe===wE.ETH_SIGN)return recoverAddress$1(hashMessage(ue),he);throw new Error(`Unsupported signature type: ${pe}`)}function isValidSignature(G,K,ne,ue){const pe=arrayify$1(ne),he=pe[pe.length-1];if(he===wE.EIP712||he===wE.ETH_SIGN)return G===recoverSigner(K,ne);if(he===wE.WALLET_BYTES32)return async function isValidEIP1271Signature(G,K,ne,ue){const pe=new iu(G,vE,ue);return await pe.isValidSignature(K,ne)===gE}(G,hexlify$2(K),pe.slice(0,-1),ue);throw new Error(`Unsupported signature type: ${he}`)}let _E=function(G){return G[G.EOASignature=0]="EOASignature",G[G.Address=1]="Address",G[G.DynamicSignature=2]="DynamicSignature",G}({});function isAddressMember(G){return void 0!==G.address&&!isUnrecoveredSignatureMember(G)}function isUnrecoveredSignatureMember(G){return void 0!==G.signature&&void 0!==G.weight&&void 0!==G.isDynamic}function isUnrecoveredSignature$1(G){return void 0!==G.threshold&&void 0!==G.signers}function decodeSignature$1(G){const K=arrayify$1(G),ne=K[0]<<8|K[1],ue=[];for(let G=2;G<K.length;){const ne=K[G++],pe=K[G++];switch(ne){case _E.EOASignature:ue.push({unrecovered:!0,weight:pe,signature:hexlify$2(K.slice(G,G+66)),isDynamic:!1}),G+=66;break;case _E.Address:ue.push({weight:pe,address:getAddress$2(hexlify$2(K.slice(G,G+20)))}),G+=20;break;case _E.DynamicSignature:const he=getAddress$2(hexlify$2(K.slice(G,G+20)));G+=20;const ye=K[G]<<8|K[G+1];G+=2,ue.push({unrecovered:!0,weight:pe,signature:hexlify$2(K.slice(G,G+ye)),address:he,isDynamic:!0}),G+=ye;break;default:throw new Error(`Unknown signature part type: ${ne}`)}}return{version:1,threshold:ne,signers:ue}}function encodeSignature$1(G){if(isBytesLike$2(G))return hexlify$2(G);const{signers:K,threshold:ne}=isUnrecoveredSignature$1(G)?G:G.config,ue=K.map((G=>{if(isAddressMember(G))return pack$2(["uint8","uint8","address"],[_E.Address,G.weight,G.address]);if(G.isDynamic){const K=arrayify$1(G.signature);return pack$2(["uint8","uint8","address","uint16","bytes"],[_E.DynamicSignature,G.weight,G.address,K.length,K])}return pack$2(["uint8","uint8","bytes"],[_E.EOASignature,G.weight,G.signature])}));return pack$2(["uint16",...new Array(ue.length).fill("bytes")],[ne,...ue])}async function recoverSignature$1(G,K,ne){const ue=function subdigestOf(G){return keccak256$2(["bytes","uint256","address","bytes32"],["0x1901",G.chainId,G.address,G.digest])}(K),pe=await Promise.all(G.signers.map((async G=>{if(isAddressMember(G))return G;if(G.isDynamic){if(!G.address)throw new Error("Dynamic signature part must have address");if(!isValidSignature(G.address,ue,G.signature,ne))throw new Error(`Invalid dynamic signature part ${G.address}`);return{address:G.address,weight:G.weight,signature:G.signature}}return{address:recoverSigner(ue,G.signature),weight:G.weight,signature:G.signature}})));return{version:1,payload:K,subdigest:ue,config:{version:1,threshold:G.threshold,signers:pe}}}function encodeSigners$1(G,K,ne,ue){if(0!==ne.length)throw new Error("Explicit subdigests not supported on v1");let pe=Oi.from(0);const he=G.signers.map((G=>{if(!K.has(G.address))return G;const ne=K.get(G.address),ue=arrayify$1(ne.signature);return pe=pe.add(G.weight),ne.isDynamic||66!==ue.length?_extends$4({},G,{isDynamic:!0,signature:ne.signature,address:G.address}):_extends$4({},G,{isDynamic:!1,signature:ne.signature})}));return{encoded:encodeSignature$1({version:1,threshold:G.threshold,signers:he}),weight:pe}}const TE={decode:G=>decodeSignature$1(G),encode:G=>encodeSignature$1(G),trim:async G=>G,supportsNoChainId:!0,recover:(G,K,ne)=>recoverSignature$1(G,K,ne),encodeSigners:(G,K,ne,ue)=>encodeSigners$1(G,K,ne),hasEnoughSigningPower:(G,K)=>{const{weight:ne}=TE.encodeSigners(G,K,[],0);return ne.gte(G.threshold)},chainSignatures:(G,K)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(G){throw new Error("Image hash not supported on v1")},signaturesOf:G=>G.signers.filter((G=>void 0!==G.signature)).map((G=>({address:G.address,signature:G.signature}))),signaturesOfDecoded:function(G){return G.signers.map((G=>G.signature)).filter((G=>void 0!==G))}};var AE=Object.freeze({__proto__:null,SignaturePartType:_E,isAddressMember:isAddressMember,isUnrecoveredSignatureMember:isUnrecoveredSignatureMember,isUnrecoveredSignature:isUnrecoveredSignature$1,decodeSignature:decodeSignature$1,encodeSignature:encodeSignature$1,recoverSignature:recoverSignature$1,encodeSigners:encodeSigners$1,SignatureCoder:TE});const EE={isWalletConfig:G=>1===G.version&&void 0!==G.threshold&&void 0!==G.signers,imageHashOf:G=>G.signers.reduce(((G,K)=>keccak256$3(po.encode(["bytes32","uint8","address"],[G,K.weight,K.address]))),pack$2(["uint256"],[G.threshold])),hasSubdigest:(G,K)=>!1,isComplete:G=>!0,checkpointOf:G=>Oi.from(0),signersOf:G=>G.signers.map((G=>({address:G.address,weight:Oi.from(G.weight).toNumber()}))),fromSimple:G=>{if(!$i.eq(G.checkpoint))throw new Error("v1 wallet config does not support checkpoint");return{version:1,threshold:G.threshold,signers:G.signers}},update:{isKindUsed:!0,buildTransaction:(G,K,ne,ue)=>{const pe=new Ho([...bE.mainModule.abi,...bE.mainModuleUpgradable.abi]),he=[];return ue&&"first"!==ue||he.push({to:G,data:pe.encodeFunctionData(pe.getFunction("updateImplementation"),[ne.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),he.push({to:G,data:pe.encodeFunctionData(pe.getFunction("updateImageHash"),[EE.imageHashOf(K)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:G,transactions:he}},decodeTransaction:function(G){throw new Error("Function not implemented.")}},toJSON:function(G){const K=G.signers.map((G=>({weight:Oi.from(G.weight).toString(),address:G.address})));return JSON.stringify({version:G.version,threshold:Oi.from(G.threshold).toString(),signers:K})},fromJSON:function(G){const K=JSON.parse(G),ne=K.signers.map((G=>({weight:Oi.from(G.weight),address:G.address})));return{version:K.version,threshold:Oi.from(K.threshold),signers:ne}},editConfig:function(G,K){var ne;const ue=G.signers.slice();if(K.checkpoint&&!$i.eq(K.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(K.add)for(const G of K.add)ue.find((K=>K.address===G.address))||ue.push({weight:G.weight,address:G.address});if(K.remove)for(const G of K.remove){const K=ue.findIndex((K=>K.address===G));K>=0&&ue.splice(K,1)}return{version:G.version,threshold:null!=(ne=K.threshold)?ne:G.threshold,signers:ue}},buildStubSignature:function(G,K){const ne=new Map;for(const[ue,pe]of K.entries()){ne.set(ue,{signature:pe,isDynamic:!0});const{encoded:K,weight:he}=encodeSigners$1(G,ne,[]);if(he.gte(G.threshold))return K}const ue=G.signers;for(const{address:K}of ue.sort((({weight:G},{weight:K})=>Oi.from(G).sub(K).toNumber()))){const ue="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";ne.set(K,{signature:ue,isDynamic:!1});const{encoded:pe,weight:he}=encodeSigners$1(G,ne,[]);if(he.gte(G.threshold))return pe}return encodeSigners$1(G,ne,[]).encoded}};var PE=Object.freeze({__proto__:null,ConfigCoder:EE});const SE={version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var IE,CE=Object.freeze({__proto__:null,config:PE,signature:AE,version:1,DeployedWalletContext:SE});function isAPIError(G){return"code"in G&&"message"in G}!function(G){G.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",G.INVALID_CONFIGURATION="INVALID_CONFIGURATION",G.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",G.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",G.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",G.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",G.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",G.USER_NOT_REGISTERED_ERROR="USER_NOT_REGISTERED_ERROR",G.LOGOUT_ERROR="LOGOUT_ERROR",G.TRANSFER_ERROR="TRANSFER_ERROR",G.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",G.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",G.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",G.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",G.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR",G.LINK_WALLET_ALREADY_LINKED_ERROR="LINK_WALLET_ALREADY_LINKED_ERROR",G.LINK_WALLET_MAX_WALLETS_LINKED_ERROR="LINK_WALLET_MAX_WALLETS_LINKED_ERROR",G.LINK_WALLET_VALIDATION_ERROR="LINK_WALLET_VALIDATION_ERROR",G.LINK_WALLET_DUPLICATE_NONCE_ERROR="LINK_WALLET_DUPLICATE_NONCE_ERROR",G.LINK_WALLET_GENERIC_ERROR="LINK_WALLET_GENERIC_ERROR",G.SERVICE_UNAVAILABLE_ERROR="SERVICE_UNAVAILABLE_ERROR"}(IE||(IE={}));class PassportError extends Error{type;constructor(G,K){super(G),this.type=K}}const withPassportError=async(G,K)=>{try{return await G()}catch(G){let ne;if(G instanceof PassportError&&G.type===IE.SERVICE_UNAVAILABLE_ERROR)throw new PassportError(G.message,G.type);throw ne=Hr(G)&&G.response?.data&&isAPIError(G.response.data)?G.response.data.message:G.message,new PassportError(ne,K)}},RE="pkce_state",kE="pkce_verifier";class DeviceCredentialsManager{areValid(G){if(G){const K=this.isTokenValid(G.access_token),ne=this.isTokenValid(G.id_token);return K&&ne}return!1}isTokenValid(G){try{const K=o$1(G).exp??0;return K>Date.now()/1e3+3600}catch(G){return!1}}savePKCEData(G){localStorage.setItem(RE,G.state),localStorage.setItem(kE,G.verifier)}getPKCEData(){const G=localStorage.getItem(RE),K=localStorage.getItem(kE);return G&&K?{state:G,verifier:K}:null}}var OE,logger$f_warn=(...G)=>{};function isTokenExpired(G){const{id_token:K,expired:ne}=G;return!!ne||function isIdTokenExpired(G){if(!G)return!1;const K=o$1(G),ne=Math.floor(Date.now()/1e3);return K.exp<ne}(K)}!function(G){G.LOGGED_OUT="loggedOut",G.LOGGED_IN="loggedIn",G.ACCOUNTS_REQUESTED="accountsRequested"}(OE||(OE={}));const isUserZkEvm=G=>!!G.zkEvm,isUserImx=G=>!!G.imx,xE="passport-overlay",NE=`${xE}-close`,ME=`${xE}-try-again`,getOverlay=G=>`\n    <div\n      id="${xE}"\n      style="\n        position: fixed !important;\n        top: 0 !important;\n        left: 0 !important;\n        width: 100% !important;\n        height: 100% !important;\n        background: rgba(13, 13, 13, 0.48) !important;\n        backdrop-filter: blur(28px) !important;\n        -webkit-backdrop-filter: blur(28px) !important;\n        display: flex !important;\n        flex-direction: column !important;\n        justify-content: center !important;\n        align-items: center !important;\n        font-size: 16px !important;\n        line-height: 1.5 !important;\n        font-family: Roboto !important;\n        font-style: normal !important;\n        font-weight: 400 !important;\n        font-feature-settings: 'clig' off, 'liga' off !important;\n        z-index: 2147483647 !important;\n      "\n    >\n      \n    <button\n      id="${NE}"\n      style="\n        background: #f3f3f326 !important;\n        border: none !important;\n        border-radius: 50% !important;\n        width: 48px !important;\n        height: 48px !important;\n        position: absolute !important;\n        top: 40px !important;\n        right: 40px !important;\n        cursor: pointer !important;\n        display: flex !important;\n        align-items: center !important;\n        justify-content: center !important;\n      "\n    >\n      \n  <svg\n    viewBox="0 0 20 20"\n    fill="none"\n    xmlns="http://www.w3.org/2000/svg"\n    style="width: 20px !important;"\n    >\n      <path\n        d="M16.25 5.75833L14.2417 3.75L10 7.99167L5.75833 3.75L3.75 5.75833L7.99167 10L3.75 14.2417L5.75833 16.25L10 12.0083L14.2417 16.25L16.25 14.2417L12.0083 10L16.25 5.75833Z"\n        fill="#F3F3F3"\n      />\n  </svg>\n\n    </button>\n  \n      <div\n        style="\n          display: flex !important;\n          flex-direction: column !important;\n          align-items: center !important;\n          max-width: 400px !important;\n        "\n      >\n        \n  <svg\n    style="\n      max-width: 123px !important;\n      margin-bottom: 24px !important;\n    "\n    viewBox="0 0 124 112"\n    fill="none"\n    xmlns="http://www.w3.org/2000/svg"\n  >\n    <g clip-path="url(#clip0_332_47939)">\n      <g clip-path="url(#clip1_332_47939)">\n        <path\n          d="M4.10008 74.9453H0.5V93.6041H4.10008V74.9453Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M22.9585 80.0212C21.1727 80.0212 19.5283 80.7622 18.5505 82.3115C17.8209 80.8013 16.3595 80.0212 14.4691 80.0212C12.864 80.0212 11.3786 80.7231 10.4792 82.1681V80.282H7.00976V93.6063H10.4792V86.2032C10.4792 84.3432 11.7445 82.9503 13.3475 82.9503H13.5565C14.9787 82.9503 15.643 83.8477 15.643 85.6187V93.6085H19.1124V86.2054C19.1124 84.3453 20.3647 82.9525 21.9676 82.9525H22.1767C23.5989 82.9525 24.237 83.8499 24.237 85.6208V93.6106H27.7064V85.2188C27.7064 83.6435 27.3274 82.3832 26.5717 81.4315C25.8029 80.4949 24.6029 80.0256 22.9585 80.0256V80.0212Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M46.0291 80.0212C44.2432 80.0212 42.5989 80.7622 41.621 82.3115C40.8914 80.8013 39.43 80.0212 37.5396 80.0212C35.9345 80.0212 34.4492 80.7231 33.5497 82.1681V80.282H30.0803V93.6063H33.5497V86.2032C33.5497 84.3432 34.8151 82.9503 36.418 82.9503H36.6271C38.0493 82.9503 38.7135 83.8477 38.7135 85.6187V93.6085H42.1829V86.2054C42.1829 84.3453 43.4352 82.9525 45.0381 82.9525H45.2472C46.6694 82.9525 47.3075 83.8499 47.3075 85.6208V93.6106H50.7769V85.2188C50.7769 83.6435 50.398 82.3832 49.6422 81.4315C48.8734 80.4949 47.6734 80.0256 46.0291 80.0256V80.0212Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M72.3077 89.2061V83.0785H75.2936V80.282H72.3077V75.9622H68.8383V80.282H61.4312V87.6851C61.4312 89.5451 60.192 91.0683 58.6805 91.0683H58.4715C57.2061 91.0683 56.4896 90.1318 56.4896 88.413V80.282H53.0202V88.8041C53.0202 90.3534 53.3991 91.5746 54.1549 92.4872C54.8975 93.4107 56.0322 93.867 57.5328 93.867C59.188 93.867 60.6102 93.0218 61.4312 91.655V93.6063H64.9006V83.0807H68.8405V90.1448C68.8405 92.396 70.0536 93.6063 72.3099 93.6063H75.7009V90.6794H73.7843C72.5582 90.6794 72.3099 90.4317 72.3099 89.2083L72.3077 89.2061Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M88.0757 84.8082C88.0757 81.7378 85.8325 80.0191 82.4676 80.0191C79.1027 80.0191 77.0033 81.8791 76.7158 84.404H80.1982C80.2766 83.5979 81.0977 82.8156 82.35 82.8156H82.5722C83.8506 82.8156 84.7109 83.7391 84.7109 84.9364V85.2623L81.346 85.5622C79.9108 85.6795 78.7369 86.0945 77.8243 86.8246C76.9118 87.5525 76.4544 88.5934 76.4544 89.9471C76.4152 92.2895 78.4363 93.8888 80.8364 93.8627C82.5438 93.8627 83.9529 93.1348 84.7871 91.9766C84.8132 92.6785 84.8655 93.226 84.9439 93.6019H88.2042C88.1127 92.9783 88.0735 92.0005 88.0735 90.675V84.806L88.0757 84.8082ZM84.7109 88.1653C84.7109 89.8428 83.3148 91.0661 81.738 91.0661H81.5289C80.5772 91.0661 79.8737 90.5316 79.8737 89.7124C79.8737 89.204 80.0697 88.8281 80.4596 88.5543C80.8516 88.2805 81.3068 88.124 81.8164 88.0849L84.7109 87.785V88.1653Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M97.7935 80.0212C96.0076 80.0212 94.5201 81.036 93.9452 82.0116V74.9475H90.4758V93.6063H93.9452V91.8766C94.5201 92.8523 96.0055 93.867 97.7935 93.867C101.537 93.9322 103.765 90.5881 103.726 86.9441C103.765 83.3002 101.535 79.956 97.7935 80.0212ZM97.2055 91.0683H96.9964C95.4044 91.1074 93.919 89.3908 93.9452 86.9441C93.919 84.4974 95.4065 82.7808 96.9964 82.8199H97.2055C98.9522 82.8199 100.257 84.4192 100.257 86.9181C100.257 89.4169 98.9391 91.0683 97.2055 91.0683Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M108.931 74.9453H105.462V93.6041H108.931V74.9453Z"\n          fill="#F3F3F3"\n        />\n        <path\n          d="M117.057 80.0212C113.146 79.9691 110.667 82.9612 110.706 86.9441C110.641 91.1987 113.705 93.9192 117.057 93.867C120.33 93.867 122.443 92.0461 123.094 89.3908H119.651C119.403 90.3665 118.555 91.0683 117.303 91.0683H117.081C115.633 91.0683 114.2 89.8189 114.069 88.0371H123.094C123.133 87.4656 123.147 87.0484 123.147 86.7877C123.186 82.8982 120.956 79.9821 117.057 80.0212ZM114.071 85.3688C114.15 83.7934 115.363 82.8178 116.824 82.8178H117.033C118.495 82.8178 119.708 83.7934 119.784 85.3688H114.071Z"\n          fill="#F3F3F3"\n        />\n      </g>\n      <path\n        d="M30.4851 101.025V109H32.0581V106.195H33.2571C35.0941 106.195 36.7221 105.7 36.7221 103.665C36.7221 101.256 34.8521 101.025 33.2131 101.025H30.4851ZM33.2461 102.257C34.1041 102.257 35.1051 102.367 35.1051 103.676C35.1051 104.732 34.3351 104.974 33.3561 104.974H32.0581V102.257H33.2461Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M36.9683 109H38.5743L39.1353 107.383H42.2373L42.7983 109H44.5034L41.5224 101.025H39.9383L36.9683 109ZM40.6863 102.95L41.7863 106.096H39.5863L40.6863 102.95Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M49.1875 105.689C50.0345 105.843 50.6615 106.096 50.6615 106.778C50.6615 107.636 49.7705 107.889 49.0665 107.889C48.1205 107.889 47.3065 107.537 47.1305 106.371H45.6125C45.7555 108.087 47.0535 109.143 49.0115 109.143C50.6175 109.143 52.2455 108.34 52.2455 106.701C52.2455 105.051 50.8155 104.534 49.5175 104.303L48.4725 104.116C47.8345 103.995 47.3615 103.687 47.3615 103.126C47.3615 102.411 48.1755 102.136 48.9015 102.136C49.6495 102.136 50.4635 102.444 50.5845 103.379H52.1025C52.0255 101.85 50.6175 100.882 48.9675 100.882C47.4935 100.882 45.7885 101.586 45.7885 103.192C45.7885 104.578 46.8775 105.249 48.1755 105.502L49.1875 105.689Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M57.5244 105.689C58.3714 105.843 58.9984 106.096 58.9984 106.778C58.9984 107.636 58.1074 107.889 57.4034 107.889C56.4574 107.889 55.6434 107.537 55.4674 106.371H53.9494C54.0924 108.087 55.3904 109.143 57.3484 109.143C58.9544 109.143 60.5824 108.34 60.5824 106.701C60.5824 105.051 59.1524 104.534 57.8544 104.303L56.8094 104.116C56.1714 103.995 55.6984 103.687 55.6984 103.126C55.6984 102.411 56.5124 102.136 57.2384 102.136C57.9864 102.136 58.8004 102.444 58.9214 103.379H60.4394C60.3624 101.85 58.9544 100.882 57.3044 100.882C55.8304 100.882 54.1254 101.586 54.1254 103.192C54.1254 104.578 55.2144 105.249 56.5124 105.502L57.5244 105.689Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M62.5544 101.025V109H64.1274V106.195H65.3264C67.1634 106.195 68.7914 105.7 68.7914 103.665C68.7914 101.256 66.9214 101.025 65.2824 101.025H62.5544ZM65.3154 102.257C66.1734 102.257 67.1744 102.367 67.1744 103.676C67.1744 104.732 66.4044 104.974 65.4254 104.974H64.1274V102.257H65.3154Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M71.8888 105.007C71.8888 103.137 72.9228 102.136 74.1658 102.136C75.4088 102.136 76.4428 103.137 76.4428 105.007C76.4428 106.877 75.4088 107.889 74.1658 107.889C72.9228 107.889 71.8888 106.877 71.8888 105.007ZM78.0708 105.007C78.0708 102.532 76.5418 100.882 74.1658 100.882C71.7898 100.882 70.2608 102.532 70.2608 105.007C70.2608 107.482 71.7898 109.143 74.1658 109.143C76.5418 109.143 78.0708 107.482 78.0708 105.007Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M85.0133 109H86.7623L84.9913 105.546C85.9813 105.128 86.4323 104.358 86.4323 103.445C86.4323 101.773 85.4313 101.025 82.8023 101.025H80.1843V109H81.7573V105.876H83.0553H83.4293L85.0133 109ZM82.9783 102.257C84.0453 102.257 84.8153 102.532 84.8153 103.456C84.8153 104.237 84.2763 104.655 83.0553 104.655H81.7573V102.257H82.9783Z"\n        fill="#F3F3F3"\n      />\n      <path\n        d="M90.1424 109H91.7154V102.301H94.1794V101.025H87.6894V102.301H90.1424V109Z"\n        fill="#F3F3F3"\n      />\n      <g clip-path="url(#clip2_332_47939)">\n        <circle\n          cx="61.5"\n          cy="30"\n          r="28.125"\n          fill="url(#paint0_radial_332_47939)"\n        />\n        <circle\n          cx="61.5"\n          cy="30"\n          r="28.125"\n          fill="url(#paint1_radial_332_47939)"\n        />\n        <path\n          d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM60.3397 11.4576C61.1729 11.0494 62.0508 11.0774 62.8588 11.5359C65.6603 13.1323 68.4534 14.7428 71.2325 16.37C72.1272 16.8956 72.5857 17.7372 72.5885 18.7717C72.6053 22.3979 72.5997 26.0214 72.5885 29.6477C72.5885 29.7819 72.5019 29.9776 72.3928 30.0419C71.3164 30.685 70.226 31.3029 69.0433 31.9851V31.4147C69.0433 27.685 69.0322 23.9581 69.0517 20.2283C69.0545 19.5126 68.8085 19.0513 68.1738 18.6906C64.9222 16.8425 61.6873 14.9609 58.4469 13.0904C58.3071 13.0093 58.1701 12.9226 57.9576 12.794C58.7908 12.3215 59.5401 11.8462 60.3341 11.4576H60.3397ZM59.7442 48.5564C59.5624 48.4641 59.4282 48.3998 59.2968 48.3243C55.0051 45.8499 50.719 43.3588 46.4133 40.904C45.2055 40.2162 44.6547 39.2349 44.6687 37.8565C44.6938 34.9264 44.6855 31.9963 44.6715 29.0634C44.6659 27.7409 45.2027 26.7819 46.3658 26.1221C49.3882 24.4026 52.3938 22.658 55.3993 20.9105C55.6594 20.7596 55.8495 20.7344 56.1207 20.8966C57.158 21.52 58.2148 22.1156 59.3192 22.753C59.1095 22.8788 58.9501 22.9739 58.788 23.069C55.5335 24.9478 52.2847 26.8322 49.0219 28.6999C48.4879 29.0047 48.239 29.4017 48.2446 30.0224C48.2614 32.3318 48.2642 34.6412 48.2446 36.9506C48.239 37.5881 48.4935 37.9935 49.0415 38.3066C52.4832 40.2749 55.911 42.2656 59.35 44.2395C59.6407 44.4073 59.7637 44.5806 59.7582 44.9273C59.733 46.11 59.7498 47.2954 59.7498 48.5592L59.7442 48.5564ZM59.7442 41.9413C59.445 41.7707 59.2297 41.6505 59.0144 41.5247C56.2856 39.9506 53.5596 38.3709 50.8253 36.808C50.5289 36.6403 50.4199 36.4585 50.4226 36.1146C50.4422 34.3392 50.4338 32.5638 50.4282 30.7884C50.4282 30.548 50.4646 30.383 50.7022 30.2488C51.7088 29.6869 52.7041 29.0997 53.7022 28.5266C53.7749 28.4846 53.8532 28.4539 53.9846 28.3896V30.383C53.9846 31.4623 54.0014 32.5443 53.979 33.6235C53.9651 34.2386 54.2027 34.6552 54.7395 34.9571C56.2856 35.8294 57.8122 36.7353 59.3583 37.6048C59.6631 37.7754 59.7554 37.9655 59.7498 38.301C59.7302 39.4809 59.7414 40.6636 59.7414 41.9385L59.7442 41.9413ZM56.5932 18.6375C56.0144 18.2964 55.5196 18.2992 54.9408 18.6375C51.6976 20.5331 48.4404 22.4035 45.1859 24.2824C45.0489 24.3635 44.9063 24.4362 44.6631 24.5676C44.7498 23.3318 44.4842 22.1659 44.9063 21.0363C45.1356 20.4185 45.5662 19.9543 46.1365 19.6244C48.8514 18.0559 51.5634 16.4846 54.2838 14.9245C55.2763 14.3541 56.2884 14.3681 57.281 14.9413C60.3705 16.7195 63.4571 18.5033 66.5382 20.2926C66.6696 20.3681 66.8346 20.5387 66.8346 20.6673C66.8569 21.9366 66.8486 23.2088 66.8486 24.5704C65.7274 23.9245 64.6929 23.3262 63.6584 22.7279C61.3015 21.3663 58.939 20.0186 56.5932 18.6375ZM78.3033 38.5974C78.2223 39.5955 77.6379 40.3029 76.774 40.8006C73.4664 42.7018 70.1617 44.6142 66.8569 46.521C65.8197 47.1193 64.7824 47.7176 63.7423 48.3159C63.6165 48.3886 63.4879 48.4501 63.3173 48.5396C63.3061 48.3663 63.2922 48.2404 63.2922 48.1146C63.2922 47.0186 63.2978 45.9254 63.2866 44.8294C63.2866 44.5806 63.3453 44.4296 63.5746 44.2982C68.3947 41.5247 73.212 38.7428 78.0266 35.9637C78.0993 35.9217 78.1803 35.8882 78.3173 35.8239C78.3173 36.7968 78.3732 37.7027 78.3033 38.5974ZM78.3285 31.6971C78.3201 32.8322 77.7078 33.6291 76.7377 34.1883C72.9688 36.3551 69.2027 38.5331 65.4366 40.7083C64.7488 41.1053 64.0582 41.4995 63.3201 41.9245C63.3089 41.7372 63.295 41.6142 63.295 41.4883C63.295 40.4091 63.3062 39.3271 63.2866 38.2479C63.281 37.9404 63.3844 37.7782 63.65 37.6244C67.075 35.6589 70.4888 33.671 73.9194 31.7167C74.5289 31.37 74.7973 30.9422 74.7917 30.2265C74.7665 26.4967 74.7805 22.767 74.7805 19.0373V18.3858C75.6752 18.9254 76.514 19.37 77.2801 19.9124C77.979 20.4073 78.3313 21.1566 78.3341 22.0205C78.3453 25.247 78.3537 28.4734 78.3313 31.6999L78.3285 31.6971Z"\n          fill="#131313"\n        />\n        <path\n          fill-rule="evenodd"\n          clip-rule="evenodd"\n          d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"\n          fill="url(#paint2_radial_332_47939)"\n        />\n        <path\n          fill-rule="evenodd"\n          clip-rule="evenodd"\n          d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"\n          fill="url(#paint3_radial_332_47939)"\n        />\n      </g>\n    </g>\n    <defs>\n      <radialGradient\n        id="paint0_radial_332_47939"\n        cx="0"\n        cy="0"\n        r="1"\n        gradientUnits="userSpaceOnUse"\n        gradientTransform="translate(48.3053 16.7373) rotate(44.9817) scale(58.4359 123.929)"\n      >\n        <stop stop-color="#A3EEF8" />\n        <stop offset="0.177083" stop-color="#A4DCF5" />\n        <stop offset="0.380208" stop-color="#A6AEEC" />\n        <stop offset="1" stop-color="#ECBEE1" />\n      </radialGradient>\n      <radialGradient\n        id="paint1_radial_332_47939"\n        cx="0"\n        cy="0"\n        r="1"\n        gradientUnits="userSpaceOnUse"\n        gradientTransform="translate(63.9394 54.6335) rotate(84.265) scale(30.2672 57.9018)"\n      >\n        <stop stop-color="#FCF5EE" />\n        <stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />\n      </radialGradient>\n      <radialGradient\n        id="paint2_radial_332_47939"\n        cx="0"\n        cy="0"\n        r="1"\n        gradientUnits="userSpaceOnUse"\n        gradientTransform="translate(47.4257 15.8532) rotate(44.9817) scale(62.3316 132.191)"\n      >\n        <stop stop-color="#A3EEF8" />\n        <stop offset="0.177083" stop-color="#A4DCF5" />\n        <stop offset="0.380208" stop-color="#A6AEEC" />\n        <stop offset="1" stop-color="#ECBEE1" />\n      </radialGradient>\n      <radialGradient\n        id="paint3_radial_332_47939"\n        cx="0"\n        cy="0"\n        r="1"\n        gradientUnits="userSpaceOnUse"\n        gradientTransform="translate(64.102 56.2758) rotate(84.265) scale(32.2851 61.7619)"\n      >\n        <stop stop-color="#FCF5EE" />\n        <stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />\n      </radialGradient>\n      <clipPath id="clip0_332_47939">\n        <rect\n          width="123"\n          height="112"\n          fill="white"\n          transform="translate(0.5)"\n        />\n      </clipPath>\n      <clipPath id="clip1_332_47939">\n        <rect\n          width="123"\n          height="19"\n          fill="white"\n          transform="translate(0.5 75)"\n        />\n      </clipPath>\n      <clipPath id="clip2_332_47939">\n        <rect\n          width="60"\n          height="60"\n          fill="white"\n          transform="translate(31.5)"\n        />\n      </clipPath>\n    </defs>\n  </svg>\n\n        ${G}\n        \n    <button\n      id="${ME}"\n      style="\n        margin-top: 27px !important;\n        color: #f3f3f3 !important;\n        background: transparent !important;\n        padding: 12px 24px !important;\n        border-radius: 30px !important;\n        border: 2px solid #f3f3f3 !important;\n        font-size: 1em !important;\n        font-weight: 500 !important;\n        cursor: pointer !important;\n      "\n    >\n      Try again\n    </button>\n  \n      </div>\n    </div>\n  `;function addLink({id:G,href:K,rel:ne,crossOrigin:ue}){const pe=`${xE}-${G}`;if(!document.getElementById(pe)){const G=document.createElement("link");G.id=pe,G.href=K,ne&&(G.rel=ne),ue&&(G.crossOrigin=ue),document.head.appendChild(G)}}class Overlay{disableGenericPopupOverlay;disableBlockedPopupOverlay;overlay;isBlockedOverlay;tryAgainListener;onCloseListener;constructor(G,K=!1){this.disableBlockedPopupOverlay=G.disableBlockedPopupOverlay||!1,this.disableGenericPopupOverlay=G.disableGenericPopupOverlay||!1,this.isBlockedOverlay=K}append(G,K){this.shouldAppendOverlay()&&(this.appendOverlay(),this.updateTryAgainButton(G),this.updateCloseButton(K))}update(G){this.updateTryAgainButton(G)}remove(){this.overlay&&this.overlay.remove()}shouldAppendOverlay(){return(!this.disableGenericPopupOverlay||!this.disableBlockedPopupOverlay)&&(!(this.disableGenericPopupOverlay&&!this.isBlockedOverlay)&&(!this.disableBlockedPopupOverlay||!this.isBlockedOverlay))}appendOverlay(){if(!this.overlay){addLink({id:"link-googleapis",href:"https://fonts.googleapis.com"}),addLink({id:"link-gstatic",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),addLink({id:"link-roboto",href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap",rel:"stylesheet"});const G=document.createElement("div");G.innerHTML=this.isBlockedOverlay?getOverlay('\n    <div\n      style="\n        color: #e01a3d !important;\n        display: flex !important;\n        align-items: center !important;\n        gap: 4px !important;\n        margin-bottom: 10px !important;\n      "\n    >\n      \n  <svg\n  viewBox="0 0 17 16"\n  fill="none"\n  xmlns="http://www.w3.org/2000/svg"\n  style="width: 16px !important;"\n  >\n    <path\n      fill-rule="evenodd"\n      clip-rule="evenodd"\n      d="M0.5 14.3333L8.5 0.333336L16.5 14.3333H0.5ZM9.16667 10.6667V12H7.83333V10.6667H9.16667ZM9.16667 5.33334L9.16667 9.33334H7.83333L7.83333 5.33334H9.16667Z"\n      fill="#E01A3D"\n    />\n  </svg>\n\n      Pop-up blocked\n    </div>\n    <p style="\n        color: #b6b6b6 !important;\n        text-align: center !important;\n        margin: 0 !important;\n      "\n    >\n      Please try again below.<br />\n      If the problem continues, adjust your<br />\n      browser settings.\n    </p>\n  '):getOverlay('\n    <p style="\n        color: #b6b6b6 !important;\n        text-align: center !important;\n        margin: 0 !important;\n      "\n    >\n      Secure pop-up not showing?<br />We\'ll help you re-launch\n    </p>\n  '),document.body.insertAdjacentElement("beforeend",G),this.overlay=G}}updateTryAgainButton(G){const K=document.getElementById(ME);K&&(this.tryAgainListener&&K.removeEventListener("click",this.tryAgainListener),this.tryAgainListener=G,K.addEventListener("click",G))}updateCloseButton(G){const K=document.getElementById(NE);K&&(this.onCloseListener&&K.removeEventListener("click",this.onCloseListener),this.onCloseListener=G,K.addEventListener("click",G))}}class LocalForageAsyncStorage{storage;constructor(G,K){this.storage=Bw.createInstance({name:G,driver:K})}get length(){return this.storage.length()}clear(){return this.storage.clear()}getItem(G){return this.storage.getItem(G)}key(G){return this.storage.key(G)}async removeItem(G){await this.storage.removeItem(G)}async setItem(G,K){await this.storage.setItem(G,K)}}const BE={headers:{"Content-Type":"application/x-www-form-urlencoded"}},FE="/v2/logout";function wait$2(G){return new Promise((K=>{setTimeout(K,G)}))}function base64URLEncode(G){return G.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}class AuthManager{userManager;deviceCredentialsManager;config;logoutMode;refreshingPromise=null;constructor(G){this.config=G,this.userManager=new class{constructor(G,K,ne,ue){this._logger=new ew("UserManager"),this.settings=new Cw(G),this._client=new class{constructor(G,K){this._logger=new ew("OidcClient"),this.settings=G instanceof pw?G:new pw(G),this.metadataService=null!=K?K:new class{constructor(G){this._settings=G,this._logger=new ew("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new fw(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const G=this._logger.create("getMetadata");if(this._metadata)return G.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw G.throw(new Error("No authority or metadataUrl configured on settings")),null;G.debug("getting metadata from",this._metadataUrl);const K=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return G.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,K),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(G=!0){return this._getMetadataProperty("token_endpoint",G)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(G=!0){return this._getMetadataProperty("revocation_endpoint",G)}getKeysEndpoint(G=!0){return this._getMetadataProperty("jwks_uri",G)}async _getMetadataProperty(G,K=!1){const ne=this._logger.create(`_getMetadataProperty('${G}')`),ue=await this.getMetadata();if(ne.debug("resolved"),void 0===ue[G]){if(!0===K)return void ne.warn("Metadata does not contain optional property");ne.throw(new Error("Metadata does not contain property "+G))}return ue[G]}async getSigningKeys(){const G=this._logger.create("getSigningKeys");if(this._signingKeys)return G.debug("returning signingKeys from cache"),this._signingKeys;const K=await this.getKeysEndpoint(!1);G.debug("got jwks_uri",K);const ne=await this._jsonService.getJson(K);if(G.debug("got key set",ne),!Array.isArray(ne.keys))throw G.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=ne.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(G){this._settings=G,this._logger=new ew("ClaimsService")}filterProtocolClaims(G){const K={...G};if(this._settings.filterProtocolClaims){let G;G=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:gw;for(const ne of G)vw.includes(ne)||delete K[ne]}return K}mergeClaims(G,K){const ne={...G};for(const[G,ue]of Object.entries(K))for(const K of Array.isArray(ue)?ue:[ue]){const ue=ne[G];void 0===ue?ne[G]=K:Array.isArray(ue)?ue.includes(K)||ue.push(K):ne[G]!==K&&("object"==typeof K&&this._settings.mergeClaims?ne[G]=this.mergeClaims(ue,K):ne[G]=[ue,K])}return ne}}(this.settings),this._validator=new class{constructor(G,K,ne){this._settings=G,this._metadataService=K,this._claimsService=ne,this._logger=new ew("ResponseValidator"),this._userInfoService=new class{constructor(G,K){this._settings=G,this._metadataService=K,this._logger=new ew("UserInfoService"),this._getClaimsFromJwt=async G=>{const K=this._logger.create("_getClaimsFromJwt");try{const ne=nw.decode(G);return K.debug("JWT decoding successful"),ne}catch(G){throw K.error("Error parsing JWT response"),G}},this._jsonService=new fw(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(G){const K=this._logger.create("getClaims");G||this._logger.throw(new Error("No token passed"));const ne=await this._metadataService.getUserInfoEndpoint();K.debug("got userinfo url",ne);const ue=await this._jsonService.getJson(ne,{token:G,credentials:this._settings.fetchRequestCredentials});return K.debug("got claims",ue),ue}}(this._settings,this._metadataService),this._tokenClient=new hw(this._settings,this._metadataService)}async validateSigninResponse(G,K){const ne=this._logger.create("validateSigninResponse");this._processSigninState(G,K),ne.debug("state processed"),await this._processCode(G,K),ne.debug("code processed"),G.isOpenId&&this._validateIdTokenAttributes(G),ne.debug("tokens validated"),await this._processClaims(G,null==K?void 0:K.skipUserInfo,G.isOpenId),ne.debug("claims processed")}async validateCredentialsResponse(G,K){const ne=this._logger.create("validateCredentialsResponse");G.isOpenId&&G.id_token&&this._validateIdTokenAttributes(G),ne.debug("tokens validated"),await this._processClaims(G,K,G.isOpenId),ne.debug("claims processed")}async validateRefreshResponse(G,K){const ne=this._logger.create("validateRefreshResponse");G.userState=K.data,null!=G.session_state||(G.session_state=K.session_state),null!=G.scope||(G.scope=K.scope),G.isOpenId&&G.id_token&&(this._validateIdTokenAttributes(G,K.id_token),ne.debug("ID Token validated")),G.id_token||(G.id_token=K.id_token,G.profile=K.profile);const ue=G.isOpenId&&!!G.id_token;await this._processClaims(G,!1,ue),ne.debug("claims processed")}validateSignoutResponse(G,K){const ne=this._logger.create("validateSignoutResponse");if(K.id!==G.state&&ne.throw(new Error("State does not match")),ne.debug("state validated"),G.userState=K.data,G.error)throw ne.warn("Response was error",G.error),new ow(G)}_processSigninState(G,K){const ne=this._logger.create("_processSigninState");if(K.id!==G.state&&ne.throw(new Error("State does not match")),K.client_id||ne.throw(new Error("No client_id on state")),K.authority||ne.throw(new Error("No authority on state")),this._settings.authority!==K.authority&&ne.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==K.client_id&&ne.throw(new Error("client_id mismatch on settings vs. signin state")),ne.debug("state validated"),G.userState=K.data,G.url_state=K.url_state,null!=G.scope||(G.scope=K.scope),G.error)throw ne.warn("Response was error",G.error),new ow(G);K.code_verifier&&!G.code&&ne.throw(new Error("Expected code in response"))}async _processClaims(G,K=!1,ne=!0){const ue=this._logger.create("_processClaims");if(G.profile=this._claimsService.filterProtocolClaims(G.profile),K||!this._settings.loadUserInfo||!G.access_token)return void ue.debug("not loading user info");ue.debug("loading user info");const pe=await this._userInfoService.getClaims(G.access_token);ue.debug("user info claims received from user info endpoint"),ne&&pe.sub!==G.profile.sub&&ue.throw(new Error("subject from UserInfo response does not match subject in ID Token")),G.profile=this._claimsService.mergeClaims(G.profile,this._claimsService.filterProtocolClaims(pe)),ue.debug("user info claims received, updated profile:",G.profile)}async _processCode(G,K){const ne=this._logger.create("_processCode");if(G.code){ne.debug("Validating code");const ue=await this._tokenClient.exchangeCode({client_id:K.client_id,client_secret:K.client_secret,code:G.code,redirect_uri:K.redirect_uri,code_verifier:K.code_verifier,...K.extraTokenParams});Object.assign(G,ue)}else ne.debug("No code to undefined")}_validateIdTokenAttributes(G,K){var ne;const ue=this._logger.create("_validateIdTokenAttributes");ue.debug("decoding ID Token JWT");const pe=nw.decode(null!=(ne=G.id_token)?ne:"");if(pe.sub||ue.throw(new Error("ID Token is missing a subject claim")),K){const G=nw.decode(K);pe.sub!==G.sub&&ue.throw(new Error("sub in id_token does not match current sub")),pe.auth_time&&pe.auth_time!==G.auth_time&&ue.throw(new Error("auth_time in id_token does not match original auth_time")),pe.azp&&pe.azp!==G.azp&&ue.throw(new Error("azp in id_token does not match original azp")),!pe.azp&&G.azp&&ue.throw(new Error("azp not in id_token, but present in original id_token"))}G.profile=pe}}(this.settings,this.metadataService,this._claimsService),this._tokenClient=new hw(this.settings,this.metadataService)}async createSigninRequest({state:G,request:K,request_uri:ne,request_type:ue,id_token_hint:pe,login_hint:he,skipUserInfo:ye,nonce:me,url_state:be,response_type:ve=this.settings.response_type,scope:_e=this.settings.scope,redirect_uri:Te=this.settings.redirect_uri,prompt:Ee=this.settings.prompt,display:Pe=this.settings.display,max_age:Se=this.settings.max_age,ui_locales:Ce=this.settings.ui_locales,acr_values:ke=this.settings.acr_values,resource:Oe=this.settings.resource,response_mode:xe=this.settings.response_mode,extraQueryParams:Ne=this.settings.extraQueryParams,extraTokenParams:Me=this.settings.extraTokenParams}){const Be=this._logger.create("createSigninRequest");if("code"!==ve)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const Fe=await this.metadataService.getAuthorizationEndpoint();Be.debug("Received authorization endpoint",Fe);const De=new class{constructor({url:G,authority:K,client_id:ne,redirect_uri:ue,response_type:pe,scope:he,state_data:ye,response_mode:me,request_type:be,client_secret:ve,nonce:_e,url_state:Te,resource:Ee,skipUserInfo:Pe,extraQueryParams:Se,extraTokenParams:Ce,disablePKCE:ke,...Oe}){if(this._logger=new ew("SigninRequest"),!G)throw this._logger.error("ctor: No url passed"),new Error("url");if(!ne)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!ue)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!pe)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!he)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!K)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new mw({data:ye,request_type:be,url_state:Te,code_verifier:!ke,client_id:ne,authority:K,redirect_uri:ue,response_mode:me,client_secret:ve,scope:he,extraTokenParams:Ce,skipUserInfo:Pe});const xe=new URL(G);xe.searchParams.append("client_id",ne),xe.searchParams.append("redirect_uri",ue),xe.searchParams.append("response_type",pe),xe.searchParams.append("scope",he),_e&&xe.searchParams.append("nonce",_e);let Ne=this.state.id;Te&&(Ne=`${Ne};${Te}`),xe.searchParams.append("state",Ne),this.state.code_challenge&&(xe.searchParams.append("code_challenge",this.state.code_challenge),xe.searchParams.append("code_challenge_method","S256")),Ee&&(Array.isArray(Ee)?Ee:[Ee]).forEach((G=>xe.searchParams.append("resource",G)));for(const[G,K]of Object.entries({response_mode:me,...Oe,...Se}))null!=K&&xe.searchParams.append(G,K.toString());this.url=xe.href}}({url:Fe,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:Te,response_type:ve,scope:_e,state_data:G,url_state:be,prompt:Ee,display:Pe,max_age:Se,ui_locales:Ce,id_token_hint:pe,login_hint:he,acr_values:ke,resource:Oe,request:K,request_uri:ne,extraQueryParams:Ne,extraTokenParams:Me,request_type:ue,response_mode:xe,client_secret:this.settings.client_secret,skipUserInfo:ye,nonce:me,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const Le=De.state;return await this.settings.stateStore.set(Le.id,Le.toStorageString()),De}async readSigninResponseState(G,K=!1){const ne=this._logger.create("readSigninResponseState"),ue=new bw(sw.readParams(G,this.settings.response_mode));if(!ue.state)throw ne.throw(new Error("No state in response")),null;const pe=await this.settings.stateStore[K?"remove":"get"](ue.state);if(!pe)throw ne.throw(new Error("No matching state found in storage")),null;return{state:mw.fromStorageString(pe),response:ue}}async processSigninResponse(G){const K=this._logger.create("processSigninResponse"),{state:ne,response:ue}=await this.readSigninResponseState(G,!0);return K.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(ue,ne),ue}async processResourceOwnerPasswordCredentials({username:G,password:K,skipUserInfo:ne=!1,extraTokenParams:ue={}}){const pe=await this._tokenClient.exchangeCredentials({username:G,password:K,...ue}),he=new bw(new URLSearchParams);return Object.assign(he,pe),await this._validator.validateCredentialsResponse(he,ne),he}async useRefreshToken({state:G,timeoutInSeconds:K}){var ne;const ue=this._logger.create("useRefreshToken");let pe;if(void 0===this.settings.refreshTokenAllowedScope)pe=G.scope;else{const K=this.settings.refreshTokenAllowedScope.split(" ");pe=((null==(ne=G.scope)?void 0:ne.split(" "))||[]).filter((G=>K.includes(G))).join(" ")}const he=await this._tokenClient.exchangeRefreshToken({refresh_token:G.refresh_token,resource:G.resource,scope:pe,timeoutInSeconds:K}),ye=new bw(new URLSearchParams);return Object.assign(ye,he),ue.debug("validating response",ye),await this._validator.validateRefreshResponse(ye,{...G,scope:pe}),ye}async createSignoutRequest({state:G,id_token_hint:K,client_id:ne,request_type:ue,post_logout_redirect_uri:pe=this.settings.post_logout_redirect_uri,extraQueryParams:he=this.settings.extraQueryParams}={}){const ye=this._logger.create("createSignoutRequest"),me=await this.metadataService.getEndSessionEndpoint();if(!me)throw ye.throw(new Error("No end session endpoint")),null;ye.debug("Received end session endpoint",me),ne||!pe||K||(ne=this.settings.client_id);const be=new class{constructor({url:G,state_data:K,id_token_hint:ne,post_logout_redirect_uri:ue,extraQueryParams:pe,request_type:he,client_id:ye}){if(this._logger=new ew("SignoutRequest"),!G)throw this._logger.error("ctor: No url passed"),new Error("url");const me=new URL(G);ne&&me.searchParams.append("id_token_hint",ne),ye&&me.searchParams.append("client_id",ye),ue&&(me.searchParams.append("post_logout_redirect_uri",ue),K&&(this.state=new yw({data:K,request_type:he}),me.searchParams.append("state",this.state.id)));for(const[G,K]of Object.entries({...pe}))null!=K&&me.searchParams.append(G,K.toString());this.url=me.href}}({url:me,id_token_hint:K,client_id:ne,post_logout_redirect_uri:pe,state_data:G,extraQueryParams:he,request_type:ue});await this.clearStaleState();const ve=be.state;return ve&&(ye.debug("Signout request has state to persist"),await this.settings.stateStore.set(ve.id,ve.toStorageString())),be}async readSignoutResponseState(G,K=!1){const ne=this._logger.create("readSignoutResponseState"),ue=new class{constructor(G){this.state=G.get("state"),this.error=G.get("error"),this.error_description=G.get("error_description"),this.error_uri=G.get("error_uri")}}(sw.readParams(G,this.settings.response_mode));if(!ue.state){if(ne.debug("No state in response"),ue.error)throw ne.warn("Response was error:",ue.error),new ow(ue);return{state:void 0,response:ue}}const pe=await this.settings.stateStore[K?"remove":"get"](ue.state);if(!pe)throw ne.throw(new Error("No matching state found in storage")),null;return{state:yw.fromStorageString(pe),response:ue}}async processSignoutResponse(G){const K=this._logger.create("processSignoutResponse"),{state:ne,response:ue}=await this.readSignoutResponseState(G,!0);return ne?(K.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(ue,ne)):K.debug("No state from storage; skipping response validation"),ue}clearStaleState(){return this._logger.create("clearStaleState"),yw.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(G,K){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:G,token_type_hint:K})}}(G),this._redirectNavigator=null!=K?K:new class{constructor(G){this._settings=G,this._logger=new ew("RedirectNavigator")}async prepare({redirectMethod:G=this._settings.redirectMethod,redirectTarget:K=this._settings.redirectTarget}){var ne;this._logger.create("prepare");let ue=window.self;"top"===K&&(ue=null!=(ne=window.top)?ne:window.self);const pe=ue.location[G].bind(ue.location);let he;return{navigate:async G=>{this._logger.create("navigate");const K=new Promise(((G,K)=>{he=K}));return pe(G.url),await K},close:()=>{this._logger.create("close"),null==he||he(new Error("Redirect aborted")),ue.stop()}}}async callback(){}}(this.settings),this._popupNavigator=null!=ne?ne:new class{constructor(G){this._settings=G,this._logger=new ew("PopupNavigator")}async prepare({popupWindowFeatures:G=this._settings.popupWindowFeatures,popupWindowTarget:K=this._settings.popupWindowTarget}){return new kw({popupWindowFeatures:G,popupWindowTarget:K})}async callback(G,{keepOpen:K=!1}){this._logger.create("callback"),kw.notifyOpener(G,K)}}(this.settings),this._iframeNavigator=null!=ue?ue:new class{constructor(G){this._settings=G,this._logger=new ew("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:G=this._settings.silentRequestTimeoutInSeconds}){return new Rw({silentRequestTimeoutInSeconds:G})}async callback(G){this._logger.create("callback"),Rw.notifyParent(G,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new Ow(this.settings),this._silentRenewService=new class{constructor(G){this._userManager=G,this._logger=new ew("SilentRenewService"),this._isStarted=!1,this._retryTimer=new iw("Retry Silent Renew"),this._tokenExpiring=async()=>{const G=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),G.debug("silent token renewal successful")}catch(K){if(K instanceof cw)return G.warn("ErrorTimeout from signinSilent:",K,"retry in 5s"),void this._retryTimer.init(5);G.error("Error from signinSilent:",K),this._userManager.events._raiseSilentRenewError(K)}}}async start(){const G=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(K){G.error("getUser error",K)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}}(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new class{constructor(G){this._userManager=G,this._logger=new ew("SessionMonitor"),this._start=async G=>{const K=G.session_state;if(!K)return;const ne=this._logger.create("_start");if(G.profile?(this._sub=G.profile.sub,this._sid=G.profile.sid,ne.debug("session_state",K,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,ne.debug("session_state",K,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(K);else try{const G=await this._userManager.metadataService.getCheckSessionIframe();if(G){ne.debug("initializing check session iframe");const ue=this._userManager.settings.client_id,pe=this._userManager.settings.checkSessionIntervalInSeconds,he=this._userManager.settings.stopCheckSessionOnError,ye=new class{constructor(G,K,ne,ue,pe){this._callback=G,this._client_id=K,this._intervalInSeconds=ue,this._stopOnError=pe,this._logger=new ew("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=G=>{G.origin===this._frame_origin&&G.source===this._frame.contentWindow&&("error"===G.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===G.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(G.data+" message from check session op iframe"))};const he=new URL(ne);this._frame_origin=he.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=he.href}load(){return new Promise((G=>{this._frame.onload=()=>{G()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(G){if(this._session_state===G)return;this._logger.create("start"),this.stop(),this._session_state=G;const send=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};send(),this._timer=setInterval(send,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}}(this._callback,ue,G,pe,he);await ye.load(),this._checkSessionIFrame=ye,ye.start(K)}else ne.warn("no check session iframe found in the metadata")}catch(G){ne.error("Error from getCheckSessionIframe:",G instanceof Error?G.message:G)}},this._stop=()=>{const G=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const K=setInterval((async()=>{clearInterval(K);try{const G=await this._userManager.querySessionStatus();if(G){const K={session_state:G.session_state,profile:G.sub&&G.sid?{sub:G.sub,sid:G.sid}:null};this._start(K)}}catch(K){G.error("error from querySessionStatus",K instanceof Error?K.message:K)}}),1e3)}},this._callback=async()=>{const G=this._logger.create("_callback");try{const K=await this._userManager.querySessionStatus();let ne=!0;K&&this._checkSessionIFrame?K.sub===this._sub?(ne=!1,this._checkSessionIFrame.start(K.session_state),K.sid===this._sid?G.debug("same sub still logged in at OP, restarting check session iframe; session_state",K.session_state):(G.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",K.session_state),this._userManager.events._raiseUserSessionChanged())):G.debug("different subject signed into OP",K.sub):G.debug("subject no longer signed into OP"),ne?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():G.debug("no change in session detected, no event to raise")}catch(K){this._sub&&(G.debug("Error calling queryCurrentSigninSession; raising signed out event",K),this._userManager.events._raiseUserSignedOut())}},G||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((G=>{this._logger.error(G)}))}async _init(){this._logger.create("_init");const G=await this._userManager.getUser();if(G)this._start(G);else if(this._userManager.settings.monitorAnonymousSession){const G=await this._userManager.querySessionStatus();if(G){const K={session_state:G.session_state,profile:G.sub&&G.sid?{sub:G.sub,sid:G.sid}:null};this._start(K)}}}}(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const G=this._logger.create("getUser"),K=await this._loadUser();return K?(G.info("user loaded"),this._events.load(K,!1),K):(G.info("user not found in storage"),null)}async removeUser(){const G=this._logger.create("removeUser");await this.storeUser(null),G.info("user removed from storage"),this._events.unload()}async signinRedirect(G={}){this._logger.create("signinRedirect");const{redirectMethod:K,...ne}=G,ue=await this._redirectNavigator.prepare({redirectMethod:K});await this._signinStart({request_type:"si:r",...ne},ue)}async signinRedirectCallback(G=window.location.href){const K=this._logger.create("signinRedirectCallback"),ne=await this._signinEnd(G);return ne.profile&&ne.profile.sub?K.info("success, signed in subject",ne.profile.sub):K.info("no subject"),ne}async signinResourceOwnerCredentials({username:G,password:K,skipUserInfo:ne=!1}){const ue=this._logger.create("signinResourceOwnerCredential"),pe=await this._client.processResourceOwnerPasswordCredentials({username:G,password:K,skipUserInfo:ne,extraTokenParams:this.settings.extraTokenParams});ue.debug("got signin response");const he=await this._buildUser(pe);return he.profile&&he.profile.sub?ue.info("success, signed in subject",he.profile.sub):ue.info("no subject"),he}async signinPopup(G={}){const K=this._logger.create("signinPopup"),{popupWindowFeatures:ne,popupWindowTarget:ue,...pe}=G,he=this.settings.popup_redirect_uri;he||K.throw(new Error("No popup_redirect_uri configured"));const ye=await this._popupNavigator.prepare({popupWindowFeatures:ne,popupWindowTarget:ue}),me=await this._signin({request_type:"si:p",redirect_uri:he,display:"popup",...pe},ye);return me&&(me.profile&&me.profile.sub?K.info("success, signed in subject",me.profile.sub):K.info("no subject")),me}async signinPopupCallback(G=window.location.href,K=!1){const ne=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(G,{keepOpen:K}),ne.info("success")}async signinSilent(G={}){var K;const ne=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:ue,resource:pe,...he}=G;let ye=await this._loadUser();if(null==ye?void 0:ye.refresh_token){ne.debug("using refresh token");const G=new class{constructor(G,K){this.refresh_token=G.refresh_token,this.id_token=G.id_token,this.session_state=G.session_state,this.scope=G.scope,this.profile=G.profile,this.resource=K,this.data=G.state}}(ye,pe);return await this._useRefreshToken(G)}const me=this.settings.silent_redirect_uri;let be;me||ne.throw(new Error("No silent_redirect_uri configured")),ye&&this.settings.validateSubOnSilentRenew&&(ne.debug("subject prior to silent renew:",ye.profile.sub),be=ye.profile.sub);const ve=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:ue});return ye=await this._signin({request_type:"si:s",redirect_uri:me,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==ye?void 0:ye.id_token:void 0,...he},ve,be),ye&&((null==(K=ye.profile)?void 0:K.sub)?ne.info("success, signed in subject",ye.profile.sub):ne.info("no subject")),ye}async _useRefreshToken(G){const K=await this._client.useRefreshToken({state:G,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),ne=new ww({...G,...K});return await this.storeUser(ne),this._events.load(ne),ne}async signinSilentCallback(G=window.location.href){const K=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(G),K.info("success")}async signinCallback(G=window.location.href){const{state:K}=await this._client.readSigninResponseState(G);switch(K.request_type){case"si:r":return await this.signinRedirectCallback(G);case"si:p":return await this.signinPopupCallback(G);case"si:s":return await this.signinSilentCallback(G);default:throw new Error("invalid response_type in state")}}async signoutCallback(G=window.location.href,K=!1){const{state:ne}=await this._client.readSignoutResponseState(G);if(ne)switch(ne.request_type){case"so:r":await this.signoutRedirectCallback(G);break;case"so:p":await this.signoutPopupCallback(G,K);break;case"so:s":await this.signoutSilentCallback(G);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(G={}){const K=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:ne,...ue}=G,pe=this.settings.silent_redirect_uri;pe||K.throw(new Error("No silent_redirect_uri configured"));const he=await this._loadUser(),ye=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:ne}),me=await this._signinStart({request_type:"si:s",redirect_uri:pe,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==he?void 0:he.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...ue},ye);try{const G=await this._client.processSigninResponse(me.url);return K.debug("got signin response"),G.session_state&&G.profile.sub?(K.info("success for subject",G.profile.sub),{session_state:G.session_state,sub:G.profile.sub,sid:G.profile.sid}):(K.info("success, user not authenticated"),null)}catch(G){if(this.settings.monitorAnonymousSession&&G instanceof ow)switch(G.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return K.info("success for anonymous user"),{session_state:G.session_state}}throw G}}async _signin(G,K,ne){const ue=await this._signinStart(G,K);return await this._signinEnd(ue.url,ne)}async _signinStart(G,K){const ne=this._logger.create("_signinStart");try{const ue=await this._client.createSigninRequest(G);return ne.debug("got signin request"),await K.navigate({url:ue.url,state:ue.state.id,response_mode:ue.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(G){throw ne.debug("error after preparing navigator, closing navigator window"),K.close(),G}}async _signinEnd(G,K){const ne=this._logger.create("_signinEnd"),ue=await this._client.processSigninResponse(G);return ne.debug("got signin response"),await this._buildUser(ue,K)}async _buildUser(G,K){const ne=this._logger.create("_buildUser"),ue=new ww(G);if(K){if(K!==ue.profile.sub)throw ne.debug("current user does not match user returned from signin. sub from signin:",ue.profile.sub),new ow({...G,error:"login_required"});ne.debug("current user matches user returned from signin")}return await this.storeUser(ue),ne.debug("user stored"),this._events.load(ue),ue}async signoutRedirect(G={}){const K=this._logger.create("signoutRedirect"),{redirectMethod:ne,...ue}=G,pe=await this._redirectNavigator.prepare({redirectMethod:ne});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...ue},pe),K.info("success")}async signoutRedirectCallback(G=window.location.href){const K=this._logger.create("signoutRedirectCallback"),ne=await this._signoutEnd(G);return K.info("success"),ne}async signoutPopup(G={}){const K=this._logger.create("signoutPopup"),{popupWindowFeatures:ne,popupWindowTarget:ue,...pe}=G,he=this.settings.popup_post_logout_redirect_uri,ye=await this._popupNavigator.prepare({popupWindowFeatures:ne,popupWindowTarget:ue});await this._signout({request_type:"so:p",post_logout_redirect_uri:he,state:null==he?void 0:{},...pe},ye),K.info("success")}async signoutPopupCallback(G=window.location.href,K=!1){const ne=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(G,{keepOpen:K}),ne.info("success")}async _signout(G,K){const ne=await this._signoutStart(G,K);return await this._signoutEnd(ne.url)}async _signoutStart(G={},K){var ne;const ue=this._logger.create("_signoutStart");try{const pe=await this._loadUser();ue.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(pe);const he=G.id_token_hint||pe&&pe.id_token;he&&(ue.debug("setting id_token_hint in signout request"),G.id_token_hint=he),await this.removeUser(),ue.debug("user removed, creating signout request");const ye=await this._client.createSignoutRequest(G);return ue.debug("got signout request"),await K.navigate({url:ye.url,state:null==(ne=ye.state)?void 0:ne.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(G){throw ue.debug("error after preparing navigator, closing navigator window"),K.close(),G}}async _signoutEnd(G){const K=this._logger.create("_signoutEnd"),ne=await this._client.processSignoutResponse(G);return K.debug("got signout response"),ne}async signoutSilent(G={}){var K;const ne=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:ue,...pe}=G,he=this.settings.includeIdTokenInSilentSignout?null==(K=await this._loadUser())?void 0:K.id_token:void 0,ye=this.settings.popup_post_logout_redirect_uri,me=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:ue});await this._signout({request_type:"so:s",post_logout_redirect_uri:ye,id_token_hint:he,...pe},me),ne.info("success")}async signoutSilentCallback(G=window.location.href){const K=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(G),K.info("success")}async revokeTokens(G){const K=await this._loadUser();await this._revokeInternal(K,G)}async _revokeInternal(G,K=this.settings.revokeTokenTypes){const ne=this._logger.create("_revokeInternal");if(!G)return;const ue=K.filter((K=>"string"==typeof G[K]));if(ue.length){for(const K of ue)await this._client.revokeToken(G[K],K),ne.info(`${K} revoked successfully`),"access_token"!==K&&(G[K]=null);await this.storeUser(G),ne.debug("user stored"),this._events.load(G)}else ne.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const G=this._logger.create("_loadUser"),K=await this.settings.userStore.get(this._userStoreKey);return K?(G.debug("user storageString loaded"),ww.fromStorageString(K)):(G.debug("no user storageString"),null)}async storeUser(G){const K=this._logger.create("storeUser");if(G){K.debug("storing user");const ne=G.toStorageString();await this.settings.userStore.set(this._userStoreKey,ne)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((G=>{const{authenticationDomain:K,oidcConfiguration:ne}=G;let ue;ue=G.crossSdkBridgeEnabled?new LocalForageAsyncStorage("ImmutableSDKPassport",Bw.INDEXEDDB):"undefined"!=typeof window?window.localStorage:new uw;const pe=new lw({store:ue}),he=new URL(FE,K.replace(/^(?:https?:\/\/)?(.*)/,"https://$1"));he.searchParams.set("client_id",ne.clientId),ne.logoutRedirectUri&&he.searchParams.set("returnTo",ne.logoutRedirectUri);const ye={authority:K,redirect_uri:ne.redirectUri,popup_redirect_uri:ne.redirectUri,client_id:ne.clientId,metadata:{authorization_endpoint:`${K}/authorize`,token_endpoint:`${K}/oauth/token`,userinfo_endpoint:`${K}/userinfo`,end_session_endpoint:he.toString()},mergeClaims:!0,automaticSilentRenew:!1,scope:ne.scope,userStore:pe};return ne.audience&&(ye.extraQueryParams={audience:ne.audience}),ye})(G)),this.deviceCredentialsManager=new DeviceCredentialsManager,this.logoutMode=G.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=G=>{let K;G.id_token&&(K=o$1(G.id_token)?.passport);const ne={expired:G.expired,idToken:G.id_token,accessToken:G.access_token,refreshToken:G.refresh_token,profile:{sub:G.profile.sub,email:G.profile.email,nickname:G.profile.nickname}};return K?.imx_eth_address&&(ne.imx={ethAddress:K.imx_eth_address,starkAddress:K.imx_stark_address,userAdminAddress:K.imx_user_admin_address}),K?.zkevm_eth_address&&(ne.zkEvm={ethAddress:K?.zkevm_eth_address,userAdminAddress:K?.zkevm_user_admin_address}),ne};static mapDeviceTokenResponseToOidcUser=G=>{const K=o$1(G.id_token);return new ww({id_token:G.id_token,access_token:G.access_token,refresh_token:G.refresh_token,token_type:G.token_type,profile:{sub:K.sub,iss:K.iss,aud:K.aud,exp:K.exp,iat:K.iat,email:K.email,nickname:K.nickname,passport:K.passport}})};async login(G){return withPassportError((async()=>{const K="passportLoginPrompt",signinPopup=async()=>this.userManager.signinPopup({extraQueryParams:{...this.userManager.settings?.extraQueryParams??{},rid:Vn(vn.RUNTIME_ID)||"",third_party_a_id:G||""},popupWindowFeatures:{width:410,height:450},popupWindowTarget:K});return new Promise(((G,ne)=>{signinPopup().then((K=>{G(AuthManager.mapOidcUserToDomainModel(K))})).catch((ue=>{if(!(ue instanceof Error)||"Attempted to navigate on a disposed window"!==ue.message)return void ne(ue);let pe=!1;const he=new Overlay(this.config.popupOverlayOptions,!0);he.append((async()=>{try{if(pe)window.open("",K);else{pe=!0;const K=await signinPopup();he.remove(),G(AuthManager.mapOidcUserToDomainModel(K))}}catch(G){he.remove(),ne(G)}}),(()=>{he.remove(),ne(new Error("Popup closed by user"))}))}))}))}),IE.AUTHENTICATION_ERROR)}async getUserOrLogin(){let G=null;try{G=await this.getUser()}catch(G){}return G||this.login()}async loginCallback(){return withPassportError((async()=>{await this.userManager.signinCallback()}),IE.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(G){return withPassportError((async()=>{const K=await er.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},BE),ne=Vn(vn.RUNTIME_ID);return{code:K.data.user_code,deviceCode:K.data.device_code,url:`${K.data.verification_uri_complete}${ne?`&rid=${ne}`:""}${G?`&third_party_a_id=${G}`:""}`,interval:K.data.interval}}),IE.AUTHENTICATION_ERROR)}async loginWithDeviceFlowCallback(G,K,ne){return withPassportError((async()=>{const ue=Date.now();for(;;){if(null!=ne&&Date.now()-ue>ne)throw new Error("Timed out");await wait$2(1e3*K);try{const K=await this.getDeviceFlowToken(G),ne=AuthManager.mapDeviceTokenResponseToOidcUser(K),ue=AuthManager.mapOidcUserToDomainModel(ne);return await this.userManager.storeUser(ne),ue}catch(G){if(!er.isAxiosError(G))throw G;{const K=G.response?.data;switch(K.error){case"authorization_pending":case"slow_down":break;case"expired_token":throw new Error("Token expired, please log in again");case"access_denied":throw new Error("User denied access");default:throw new Error("Error getting token")}}}}throw new Error("Failed to get credentials")}),IE.AUTHENTICATION_ERROR)}async getDeviceFlowToken(G){return(await er.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:G},BE)).data}getPKCEAuthorizationUrl(){const G=base64URLEncode((void 0)(32)),K=base64URLEncode(function sha256$3(G){return(void 0)("sha256").update(G).digest()}(G)),ne=base64URLEncode((void 0)(32)),{redirectUri:ue,scope:pe,audience:he,clientId:ye}=this.config.oidcConfiguration;this.deviceCredentialsManager.savePKCEData({state:ne,verifier:G});const me=new URL("/authorize",this.config.authenticationDomain);return me.searchParams.set("response_type","code"),me.searchParams.set("code_challenge",K),me.searchParams.set("code_challenge_method","S256"),me.searchParams.set("client_id",ye),me.searchParams.set("redirect_uri",ue),me.searchParams.set("state",ne),pe&&me.searchParams.set("scope",pe),he&&me.searchParams.set("audience",he),me.toString()}async loginWithPKCEFlowCallback(G,K){return withPassportError((async()=>{const ne=this.deviceCredentialsManager.getPKCEData();if(!ne)throw new Error("No code verifier or state for PKCE");if(K!==ne.state)throw new Error("Provided state does not match stored state");const ue=await this.getPKCEToken(G,ne.verifier),pe=AuthManager.mapDeviceTokenResponseToOidcUser(ue),he=AuthManager.mapOidcUserToDomainModel(pe);return await this.userManager.storeUser(pe),he}),IE.AUTHENTICATION_ERROR)}async getPKCEToken(G,K){return(await er.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:K,code:G,redirect_uri:this.config.oidcConfiguration.redirectUri},BE)).data}async logout(){return withPassportError((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),IE.LOGOUT_ERROR)}async logoutSilentCallback(G){return this.userManager.signoutSilentCallback(G)}async removeUser(){return this.userManager.removeUser()}async getDeviceFlowEndSessionEndpoint(){const{authenticationDomain:G,oidcConfiguration:K}=this.config,ne=new URL(FE,G);return ne.searchParams.set("client_id",K.clientId),K.logoutRedirectUri&&ne.searchParams.set("returnTo",K.logoutRedirectUri),ne.toString()}forceUserRefreshInBackground(){this.refreshTokenAndUpdatePromise().catch((G=>{}))}async forceUserRefresh(){return this.refreshTokenAndUpdatePromise().catch((G=>null))}async refreshTokenAndUpdatePromise(){return this.refreshingPromise||(this.refreshingPromise=new Promise((async(G,K)=>{try{const K=await this.userManager.signinSilent();if(K)return void G(AuthManager.mapOidcUserToDomainModel(K));G(null)}catch(G){let ne=IE.AUTHENTICATION_ERROR,ue="Failed to refresh token",pe=!0;if(G instanceof cw?(ne=IE.SILENT_LOGIN_ERROR,ue=`${ue}: ${G.message}`,pe=!1):G instanceof ow?(ne=IE.NOT_LOGGED_IN_ERROR,ue=`${ue}: ${G.message||G.error_description}`):G instanceof Error?ue=`${ue}: ${G.message}`:"string"==typeof G&&(ue=`${ue}: ${G}`),pe)try{await this.userManager.removeUser()}catch(G){G instanceof Error&&(ue=`${ue}: Failed to remove user: ${G.message}`)}K(new PassportError(ue,ne))}finally{this.refreshingPromise=null}}))),this.refreshingPromise}async getUser(G=(G=>!0)){if(this.refreshingPromise){const K=await this.refreshingPromise;return K&&G(K)?K:null}const K=await this.userManager.getUser();if(!K)return null;if(!isTokenExpired(K)){const ne=AuthManager.mapOidcUserToDomainModel(K);if(ne&&G(ne))return ne}if(K.refresh_token){const K=await this.refreshTokenAndUpdatePromise();if(K&&G(K))return K}return null}async getUserZkEvm(){const G=await this.getUser(isUserZkEvm);if(!G)throw new Error("Failed to obtain a User with the required ZkEvm attributes");return G}async getUserImx(){const G=await this.getUser(isUserImx);if(!G)throw new Error("Failed to obtain a User with the required IMX attributes");return G}}const withMetrics=(G,K,ne=!0,ue=!0)=>{const pe=qn("passport",K,ne);try{return G(pe)}catch(G){throw G instanceof Error?Gn("passport",K,G,{flowId:pe.details.flowId}):pe.addEvent("errored"),G}finally{ue&&pe.addEvent("End")}},withMetricsAsync=async(G,K,ne=!0,ue=!0)=>{const pe=qn("passport",K,ne);try{return await G(pe)}catch(G){throw G instanceof Error?Gn("passport",K,G,{flowId:pe.details.flowId}):pe.addEvent("errored"),G}finally{ue&&pe.addEvent("End")}};class MagicAdapter{config;magicProviderProxyFactory;magicClient;constructor(G,K){this.config=G,this.magicProviderProxyFactory=K,"undefined"!=typeof window&&(this.magicClient=new JA(this.config.magicPublishableApiKey,{extensions:[new hE],network:"mainnet"}))}getMagicClient(){if(!this.magicClient)throw new Error("Cannot perform this action outside of the browser");return this.magicClient}async login(G){return withPassportError((async()=>withMetricsAsync((async K=>{const ne=performance.now(),ue=this.getMagicClient();return K.addEvent("endMagicClientInit"),await ue.openid.loginWithOIDC({jwt:G,providerId:this.config.magicProviderId}),K.addEvent("endLoginWithOIDC"),trackDuration("passport",K.details.flowName,Math.round(performance.now()-ne)),this.magicProviderProxyFactory.createProxy(ue)}),"magicLogin")),IE.WALLET_CONNECTION_ERROR)}async logout(){const G=this.getMagicClient();G.user&&await G.user.logout()}}const DE="ERC721";const LE="ERC721";const UE=1e3,$E=3,retryWithDelay=async(G,K)=>{const{retries:ne=$E,interval:ue=UE,finalErr:pe=Error("Retry failed"),finallyFn:he=(()=>{})}=K||{};try{return await G()}catch(K){return ne<=0?Promise.reject(pe):(await(ye=ue,new Promise((G=>{setTimeout((()=>G()),ye)}))),retryWithDelay(G,{retries:ne-1,finalErr:pe,finallyFn:he}))}finally{ne<=0&&he()}var ye};async function forceUserRefresh(G){await retryWithDelay((async()=>{const K=await G.forceUserRefresh();return K?.imx?K:Promise.reject(new Error("user wallet addresses not exist"))}))}async function registerOffchain$1(G,K,ne,ue,pe){return withPassportError((async()=>{try{const he=await async function registerPassport({ethSigner:G,starkSigner:K,imxApiClients:ne},ue){return withPassportError((async()=>{const[pe,he]=await Promise.all([G.getAddress(),K.getAddress()]),ye=await ne.usersApi.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:pe,stark_key:he}}),{signable_message:me,payload_hash:be}=ye.data,[ve,_e]=await Promise.all([signRaw(me,G),K.signMessage(be)]);return(await ne.usersApi.registerPassportUserV2({authorization:`Bearer ${ue}`,registerPassportUserRequest:{eth_signature:ve,ether_key:pe,stark_signature:_e,stark_key:he}})).data}),IE.USER_REGISTRATION_ERROR)}({ethSigner:G,starkSigner:K,imxApiClients:pe},ne.accessToken);return await forceUserRefresh(ue),he}catch(G){if(er.isAxiosError(G)&&409===G.response?.status)return await forceUserRefresh(ue),{tx_hash:""};throw G}}),IE.USER_REGISTRATION_ERROR)}class PassportImxProvider{authManager;immutableXClient;guardianClient;imxApiClients;magicAdapter;signers;signerInitialisationError;constructor({authManager:G,immutableXClient:K,passportEventEmitter:ne,magicAdapter:ue,imxApiClients:pe,guardianClient:he}){this.authManager=G,this.immutableXClient=K,this.magicAdapter=ue,this.imxApiClients=pe,this.guardianClient=he,this.#e(),ne.on(OE.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{this.signers=void 0};#e(){const generateSigners=async()=>{const G=await this.authManager.getUser(),K=await this.magicAdapter.login(G.idToken),ne=new Web3Provider(K).getSigner();return{ethSigner:ne,starkSigner:await(async G=>withPassportError((async()=>createStarkSigner(await generateLegacyStarkPrivateKey(G))),IE.WALLET_CONNECTION_ERROR))(ne)}};this.signers=new Promise((async G=>{try{G(await generateSigners())}catch(K){this.signerInitialisationError=K,G(void 0)}}))}async#t(){const G=await this.authManager.getUser();if(!G||!this.signers)throw new PassportError("User has been logged out",IE.NOT_LOGGED_IN_ERROR);return G}async#r(){const G=await this.signers;if(void 0===G){if(void 0!==this.signerInitialisationError)throw this.signerInitialisationError;throw new Error("Signers failed to initialise")}return G}async#n(){const[G,K]=await Promise.all([this.#t(),this.#r()]);if(!isUserImx(G))throw new PassportError("User has not been registered with StarkEx",IE.USER_NOT_REGISTERED_ERROR);return{user:G,starkSigner:K.starkSigner,ethSigner:K.ethSigner}}async transfer(G){return withMetricsAsync((()=>this.guardianClient.withDefaultConfirmationScreenTask((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function transfer$1({request:G,transfersApi:K,starkSigner:ne,user:ue,guardianClient:pe}){return withPassportError((async()=>{const he=G.type===LE?"1":G.amount,ye={sender:ue.imx.ethAddress,token:convertToSignableToken(G),amount:he,receiver:G.receiver},me={Authorization:`Bearer ${ue.accessToken}`},be=await K.getSignableTransferV1({getSignableTransferRequest:ye},{headers:me});await pe.evaluateImxTransaction({payloadHash:be.data.payload_hash});const ve=be.data,{payload_hash:_e}=ve,Te=await ne.signMessage(_e),Ee=await ne.getAddress(),Pe={createTransferRequest:{sender_stark_key:ve.sender_stark_key||Ee,sender_vault_id:ve.sender_vault_id,receiver_stark_key:ve.receiver_stark_key,receiver_vault_id:ve.receiver_vault_id,asset_id:ve.asset_id,amount:ve.amount,nonce:ve.nonce,expiration_timestamp:ve.expiration_timestamp,stark_signature:Te}},{data:Se}=await K.createTransferV1(Pe,{headers:me});return{sent_signature:Se.sent_signature,status:Se.status?.toString(),time:Se.time,transfer_id:Se.transfer_id}}),IE.TRANSFER_ERROR)}({request:G,user:K,starkSigner:ne,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}))()),"imxTransfer")}async registerOffchain(){return withMetricsAsync((async()=>{const[G,K]=await Promise.all([this.#t(),this.#r()]);return await registerOffchain$1(K.ethSigner,K.starkSigner,G,this.authManager,this.imxApiClients)}),"imxRegisterOffchain")}async isRegisteredOffchain(){return withMetricsAsync((async()=>!!(await this.#t()).imx),"imxIsRegisteredOffchain")}isRegisteredOnchain(){throw new PassportError("Operation not supported",IE.OPERATION_NOT_SUPPORTED_ERROR)}async createOrder(G){return withMetricsAsync((()=>this.guardianClient.withDefaultConfirmationScreenTask((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function createOrder$1({starkSigner:G,user:K,request:ne,ordersApi:ue,guardianClient:pe}){return withPassportError((async()=>{const{ethAddress:he}=K.imx,ye=ne.sell.type===DE?"1":ne.sell.amount,me=ne.buy.type===DE?"1":ne.buy.amount,be={Authorization:`Bearer ${K.accessToken}`},ve={user:he,amount_buy:me,token_buy:convertToSignableToken(ne.buy),amount_sell:ye,token_sell:convertToSignableToken(ne.sell),fees:ne.fees,split_fees:!0,expiration_timestamp:ne.expiration_timestamp},_e=await ue.getSignableOrder({getSignableOrderRequestV3:ve},{headers:be});await pe.evaluateImxTransaction({payloadHash:_e.data.payload_hash});const{payload_hash:Te}=_e.data,Ee=await G.signMessage(Te),Pe=_e.data,Se={createOrderRequest:{include_fees:!0,fees:ne.fees,stark_signature:Ee,amount_buy:Pe.amount_buy,amount_sell:Pe.amount_sell,asset_id_buy:Pe.asset_id_buy,asset_id_sell:Pe.asset_id_sell,expiration_timestamp:Pe.expiration_timestamp,nonce:Pe.nonce,stark_key:Pe.stark_key,vault_id_buy:Pe.vault_id_buy,vault_id_sell:Pe.vault_id_sell}};return{...(await ue.createOrderV3(Se,{headers:be})).data}}),IE.CREATE_ORDER_ERROR)}({request:G,user:K,starkSigner:ne,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}))()),"imxCreateOrder")}async cancelOrder(G){return withMetricsAsync((()=>this.guardianClient.withDefaultConfirmationScreenTask((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function cancelOrder$1({user:G,starkSigner:K,request:ne,ordersApi:ue,guardianClient:pe}){return withPassportError((async()=>{const he={order_id:ne.order_id},ye={Authorization:`Bearer ${G.accessToken}`},me=await ue.getSignableCancelOrderV3({getSignableCancelOrderRequest:he},{headers:ye});await pe.evaluateImxTransaction({payloadHash:me.data.payload_hash});const{payload_hash:be}=me.data,ve=await K.signMessage(be),_e=await ue.cancelOrderV3({id:ne.order_id.toString(),cancelOrderRequest:{order_id:ne.order_id,stark_signature:ve}},{headers:ye});return{order_id:_e.data.order_id,status:_e.data.status}}),IE.CANCEL_ORDER_ERROR)}({request:G,user:K,starkSigner:ne,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}))()),"imxCancelOrder")}async createTrade(G){return withMetricsAsync((()=>this.guardianClient.withDefaultConfirmationScreenTask((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function createTrade$1({request:G,tradesApi:K,user:ne,starkSigner:ue,guardianClient:pe}){return withPassportError((async()=>{const{ethAddress:he}=ne.imx,ye={expiration_timestamp:G.expiration_timestamp,fees:G.fees,order_id:G.order_id,user:he},me={Authorization:`Bearer ${ne.accessToken}`},be=await K.getSignableTrade({getSignableTradeRequest:ye},{headers:me});await pe.evaluateImxTransaction({payloadHash:be.data.payload_hash});const{payload_hash:ve}=be.data,_e=await ue.signMessage(ve),{data:Te}=be,Ee={createTradeRequest:{include_fees:!0,fees:G?.fees,stark_signature:_e,order_id:G?.order_id,fee_info:Te.fee_info,amount_buy:Te.amount_buy,amount_sell:Te.amount_sell,asset_id_buy:Te.asset_id_buy,asset_id_sell:Te.asset_id_sell,expiration_timestamp:Te.expiration_timestamp,nonce:Te.nonce,stark_key:Te.stark_key,vault_id_buy:Te.vault_id_buy,vault_id_sell:Te.vault_id_sell}},{data:Pe}=await K.createTradeV3(Ee,{headers:me});return Pe}),IE.CREATE_TRADE_ERROR)}({request:G,user:K,starkSigner:ne,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}))()),"imxCreateTrade")}async batchNftTransfer(G){return withMetricsAsync((()=>this.guardianClient.withConfirmationScreenTask({width:480,height:784})((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function batchNftTransfer({user:G,starkSigner:K,request:ne,transfersApi:ue,guardianClient:pe}){return withPassportError((async()=>{const{ethAddress:he}=G.imx,ye=ne.map((G=>({amount:"1",token:convertToSignableToken({type:LE,tokenId:G.tokenId,tokenAddress:G.tokenAddress}),receiver:G.receiver}))),me={Authorization:`Bearer ${G.accessToken}`},be=await ue.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:he,signable_requests:ye}},{headers:me});await pe.evaluateImxTransaction({payloadHash:be.data.signable_responses[0]?.payload_hash});const ve=await Promise.all(be.data.signable_responses.map((async G=>{const ne=await K.signMessage(G.payload_hash);return{sender_vault_id:G.sender_vault_id,receiver_stark_key:G.receiver_stark_key,receiver_vault_id:G.receiver_vault_id,asset_id:G.asset_id,amount:G.amount,nonce:G.nonce,expiration_timestamp:G.expiration_timestamp,stark_signature:ne}}))),_e={sender_stark_key:be.data.sender_stark_key,requests:ve},Te=await ue.createTransfer({createTransferRequestV2:_e},{headers:me});return{transfer_ids:Te?.data.transfer_ids}}),IE.TRANSFER_ERROR)}({request:G,user:K,starkSigner:ne,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}))()),"imxBatchNftTransfer")}async exchangeTransfer(G){return withMetricsAsync((async()=>{const{user:K,starkSigner:ne}=await this.#n();return async function exchangeTransfer$1({user:G,starkSigner:K,request:ne,exchangesApi:ue}){return withPassportError((async()=>{const{ethAddress:pe}=G.imx,he=ne.amount,ye=await ue.getExchangeSignableTransfer({id:ne.transactionID,getSignableTransferRequest:{sender:pe,token:convertToSignableToken(ne),amount:he,receiver:ne.receiver}}),me=await K.getAddress(),{payload_hash:be}=ye.data,ve=await K.signMessage(be),_e={sender_stark_key:ye.data.sender_stark_key||me,sender_vault_id:ye.data.sender_vault_id,receiver_stark_key:ye.data.receiver_stark_key,receiver_vault_id:ye.data.receiver_vault_id,asset_id:ye.data.asset_id,amount:ye.data.amount,nonce:ye.data.nonce,expiration_timestamp:ye.data.expiration_timestamp,stark_signature:ve},Te={Authorization:`Bearer ${G.accessToken}`},Ee=await ue.createExchangeTransfer({id:ne.transactionID,createTransferRequest:_e},{headers:Te});return{sent_signature:Ee?.data.sent_signature,status:Ee?.data.status?.toString(),time:Ee?.data.time,transfer_id:Ee?.data.transfer_id}}),IE.EXCHANGE_TRANSFER_ERROR)}({request:G,user:K,starkSigner:ne,exchangesApi:this.immutableXClient.exchangeApi})}),"imxExchangeTransfer")}deposit(G){throw new PassportError("Operation not supported",IE.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(G){throw new PassportError("Operation not supported",IE.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(G,K){throw new PassportError("Operation not supported",IE.OPERATION_NOT_SUPPORTED_ERROR)}async getAddress(){return withMetricsAsync((async()=>{const G=await this.#t();if(!isUserImx(G))throw new PassportError("User has not been registered with StarkEx",IE.USER_NOT_REGISTERED_ERROR);return Promise.resolve(G.imx.ethAddress)}),"imxGetAddress")}}class PassportImxProviderFactory{authManager;immutableXClient;magicAdapter;passportEventEmitter;imxApiClients;guardianClient;constructor({authManager:G,immutableXClient:K,magicAdapter:ne,passportEventEmitter:ue,imxApiClients:pe,guardianClient:he}){this.authManager=G,this.immutableXClient=K,this.magicAdapter=ne,this.passportEventEmitter=ue,this.imxApiClients=pe,this.guardianClient=he}async getProvider(){const G=await this.authManager.getUserOrLogin();return this.createProviderInstance(G)}async getProviderSilent(){const G=await this.authManager.getUser();return G?this.createProviderInstance(G):null}async createProviderInstance(G){if(!G.idToken)throw new PassportError("Failed to initialise",IE.WALLET_CONNECTION_ERROR);return new PassportImxProvider({authManager:this.authManager,immutableXClient:this.immutableXClient,passportEventEmitter:this.passportEventEmitter,magicAdapter:this.magicAdapter,imxApiClients:this.imxApiClients,guardianClient:this.guardianClient})}}const validateConfiguration=(G,K,ne)=>{const ue=K.map((K=>!G[K]&&K)).filter((G=>G)).join(", ");if(""!==ue){throw new PassportError(ne?`${ne} - ${ue} cannot be null`:`${ue} cannot be null`,IE.INVALID_CONFIGURATION)}};class PassportConfiguration{authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmRpcUrl;relayerUrl;multiRollupConfig;crossSdkBridgeEnabled;jsonRpcReferrer;forceScwDeployBeforeMessageSignature;popupOverlayOptions;constructor({baseConfig:G,overrides:K,crossSdkBridgeEnabled:ne,jsonRpcReferrer:ue,forceScwDeployBeforeMessageSignature:pe,popupOverlayOptions:he,...ye}){if(validateConfiguration(ye,["clientId","redirectUri"]),this.oidcConfiguration=ye,this.baseConfig=G,this.crossSdkBridgeEnabled=ne||!1,this.jsonRpcReferrer=ue||"",this.forceScwDeployBeforeMessageSignature=pe||!1,this.popupOverlayOptions=he||{disableGenericPopupOverlay:!1,disableBlockedPopupOverlay:!1},K)validateConfiguration(K,["authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.authenticationDomain=K.authenticationDomain,this.passportDomain=K.passportDomain,this.imxPublicApiDomain=K.imxPublicApiDomain,this.magicPublishableApiKey=K.magicPublishableApiKey,this.magicProviderId=K.magicProviderId,this.zkEvmRpcUrl=K.zkEvmRpcUrl,this.relayerUrl=K.relayerUrl,this.multiRollupConfig={indexer:createConfig$1({basePath:K.indexerMrBasePath}),orderBook:createConfig$1({basePath:K.orderBookMrBasePath}),passport:createConfig$1({basePath:K.passportMrBasePath})};else switch(G.environment){case Jn.PRODUCTION:this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.immutable.com",this.imxPublicApiDomain="https://api.immutable.com",this.zkEvmRpcUrl="https://rpc.immutable.com",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=multiRollupConfig_getProduction();break;case Jn.SANDBOX:default:this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.sandbox.immutable.com",this.imxPublicApiDomain="https://api.sandbox.immutable.com",this.zkEvmRpcUrl="https://rpc.testnet.immutable.com",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=multiRollupConfig_getSandbox()}}}var qE,GE;!function(G){G.CONFIRMATION_START="confirmation_start"}(qE||(qE={})),function(G){G.CONFIRMATION_WINDOW_READY="confirmation_window_ready",G.TRANSACTION_CONFIRMED="transaction_confirmed",G.TRANSACTION_ERROR="transaction_error",G.TRANSACTION_REJECTED="transaction_rejected",G.MESSAGE_CONFIRMED="message_confirmed",G.MESSAGE_ERROR="message_error",G.MESSAGE_REJECTED="message_rejected"}(GE||(GE={}));const jE="imx_passport_confirmation",openPopupCenter=({url:G,title:K,width:ne,height:ue})=>{const pe=Math.max(0,Math.round(window.screenX+(window.outerWidth-ne)/2)),he=Math.max(0,Math.round(window.screenY+(window.outerHeight-ue)/2)),ye=window.open(G,K,`\n      scrollbars=yes,\n      width=${ne}, \n      height=${ue}, \n      top=${he}, \n      left=${pe}\n     `);if(!ye)throw new Error("Failed to open confirmation screen");return ye.focus(),ye},HE="Confirm this transaction";class ConfirmationScreen{config;confirmationWindow;popupOptions;overlay;overlayClosed;timer;constructor(G){this.config=G,this.overlayClosed=!1}getHref(G,K){let ne=`${this.config.passportDomain}/transaction-confirmation/${G}`;if(K){const G=K?Object.keys(K).map((G=>`${G}=${K[G]}`)).join("&"):"";ne=`${ne}?${G}`}return ne}requestConfirmation(G,K,ne,ue){return new Promise(((pe,he)=>{const messageHandler=({data:G,origin:K})=>{if(K===this.config.passportDomain&&G.eventType===jE)switch(G.messageType){case GE.CONFIRMATION_WINDOW_READY:this.confirmationWindow?.postMessage({eventType:jE,messageType:qE.CONFIRMATION_START},this.config.passportDomain);break;case GE.TRANSACTION_CONFIRMED:this.closeWindow(),pe({confirmed:!0});break;case GE.TRANSACTION_REJECTED:this.closeWindow(),pe({confirmed:!1});break;case GE.TRANSACTION_ERROR:this.closeWindow(),he(new Error("Error during transaction confirmation"));break;default:this.closeWindow(),he(new Error("Unsupported message type"))}};let ye="";ye=ne===Wa.TransactionApprovalRequestChainTypeEnum.Starkex?this.getHref("transaction",{transactionId:G,etherAddress:K,chainType:ne}):this.getHref("zkevm/transaction",{transactionID:G,etherAddress:K,chainType:ne,chainID:ue}),window.addEventListener("message",messageHandler),this.showConfirmationScreen(ye,messageHandler,pe)}))}requestMessageConfirmation(G,K,ne){return new Promise(((ue,pe)=>{const messageHandler=({data:G,origin:K})=>{if(K===this.config.passportDomain&&G.eventType===jE)switch(G.messageType){case GE.CONFIRMATION_WINDOW_READY:this.confirmationWindow?.postMessage({eventType:jE,messageType:qE.CONFIRMATION_START},this.config.passportDomain);break;case GE.MESSAGE_CONFIRMED:this.closeWindow(),ue({confirmed:!0});break;case GE.MESSAGE_REJECTED:this.closeWindow(),ue({confirmed:!1});break;case GE.MESSAGE_ERROR:this.closeWindow(),pe(new Error("Error during message confirmation"));break;default:this.closeWindow(),pe(new Error("Unsupported message type"))}};window.addEventListener("message",messageHandler);const he=this.getHref("zkevm/message",{messageID:G,etherAddress:K,...ne?{messageType:ne}:{}});this.showConfirmationScreen(he,messageHandler,ue)}))}showServiceUnavailable(){return new Promise(((G,K)=>{this.showConfirmationScreen(this.getHref("unavailable"),(()=>{}),(()=>{this.closeWindow(),K(new Error("Service unavailable"))}))}))}loading(G){if(!this.config.crossSdkBridgeEnabled){this.popupOptions=G;try{this.confirmationWindow=openPopupCenter({url:this.getHref("loading"),title:HE,width:G?.width||480,height:G?.height||720}),this.overlay=new Overlay(this.config.popupOverlayOptions)}catch(G){const K=G instanceof Error?G.message:String(G);Gn("passport","confirmationPopupDenied",new Error(K)),this.overlay=new Overlay(this.config.popupOverlayOptions,!0)}this.overlay.append((()=>{try{this.confirmationWindow?.close(),this.confirmationWindow=openPopupCenter({url:this.getHref("loading"),title:HE,width:this.popupOptions?.width||480,height:this.popupOptions?.height||720})}catch{}}),(()=>{this.overlayClosed=!0,this.closeWindow()}))}}closeWindow(){this.confirmationWindow?.close(),this.overlay?.remove(),this.overlay=void 0}showConfirmationScreen(G,K,ne){if(this.confirmationWindow&&(this.confirmationWindow.location.href=G),!this.overlay)return this.overlayClosed=!1,void ne({confirmed:!1});const timerCallback=()=>{(this.confirmationWindow?.closed||this.overlayClosed)&&(clearInterval(this.timer),window.removeEventListener("message",K),ne({confirmed:!1}),this.overlayClosed=!1,this.confirmationWindow=void 0)};this.timer=setInterval(timerCallback,1e3),this.overlay.update((()=>this.recreateConfirmationWindow(G,timerCallback)))}recreateConfirmationWindow(G,K){try{clearInterval(this.timer),this.confirmationWindow?.close(),this.confirmationWindow=openPopupCenter({url:G,title:HE,width:this.popupOptions?.width||480,height:this.popupOptions?.height||720}),this.timer=setInterval(K,1e3)}catch{}}}var WE,zE;!function(G){G.PENDING="PENDING",G.SUBMITTED="SUBMITTED",G.SUCCESSFUL="SUCCESSFUL",G.REVERTED="REVERTED",G.FAILED="FAILED",G.CANCELLED="CANCELLED"}(WE||(WE={})),function(G){G.ACCOUNTS_CHANGED="accountsChanged"}(zE||(zE={}));class TypedEventEmitter{emitter=new EventEmitter;emit(G,...K){this.emitter.emit(G,...K)}on(G,K){this.emitter.on(G,K)}removeListener(G,K){this.emitter.removeListener(G,K)}}const VE="tuple(\n  bool delegateCall,\n  bool revertOnError,\n  uint256 gasLimit,\n  address target,\n  uint256 value,\n  bytes data\n)[]",getNormalisedTransactions=G=>G.map((G=>({delegateCall:!0===G.delegateCall,revertOnError:!0===G.revertOnError,gasLimit:G.gasLimit??$i,target:G.to??ui,value:G.value??$i,data:G.data??[]}))),getNonce=async(G,K,ne)=>{try{const ue=new iu(K,bE.mainModule.abi,G),pe=(G=>G||Oi.from(0))(ne),he=await ue.readNonce(pe);if(he instanceof Oi)return((G,K)=>{const ne=Oi.from(G).mul(Gi.pow(96));return Oi.from(K).add(ne)})(pe,he)}catch(G){if(G instanceof Error&&"code"in G&&G.code===ii.CALL_EXCEPTION)return Oi.from(0);throw G}throw new Error("Unexpected result from contract.nonce() call.")},encodeMessageSubDigest=(G,K,ne)=>pack$2(["string","uint256","address","bytes32"],["",G,K,ne]),signMetaTransactions=async(G,K,ne,ue,pe)=>{const he=getNormalisedTransactions(G),ye=((G,K)=>keccak256$3(po.encode(["uint256",VE],[G,K])))(K,he),me=arrayify$1(keccak256$3(encodeMessageSubDigest(ne,ue,ye))),be=performance.now(),ve=await pe.signMessage(me);trackDuration("passport","magicSignMessageGetSignedMetaTransactions",Math.round(performance.now()-be));const _e=`${ve}02`,Te=CE.signature.encodeSignature({version:1,threshold:1,signers:[{isDynamic:!1,unrecovered:!0,weight:1,signature:_e}]}),Ee=new Ho(bE.mainModule.abi);return Ee.encodeFunctionData(Ee.getFunction("execute"),[he,K,Te])},packSignatures=(G,K,ne)=>{const ue=`${G}02`,{signers:pe}=(G=>{const K=`0x0000${G}`;return CE.signature.decodeSignature(K)})(ne),he=[...pe,{isDynamic:!1,unrecovered:!0,weight:1,signature:ue,address:K}].sort(((G,K)=>{const ne=Oi.from(G.address),ue=Oi.from(K.address);return ne.lte(ue)?-1:ne.eq(ue)?0:1}));return CE.signature.encodeSignature({version:1,threshold:2,signers:he})},getEip155ChainId=G=>`eip155:${G}`;class RelayerClient{config;rpcProvider;authManager;constructor({config:G,rpcProvider:K,authManager:ne}){this.config=G,this.rpcProvider=K,this.authManager=ne}async postToRelayer(G){const K={id:1,jsonrpc:"2.0",...G},ne=await this.authManager.getUserZkEvm(),ue=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{Authorization:`Bearer ${ne.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(K)}),pe=await ue.json();if(pe.error)throw pe.error;return pe}async ethSendTransaction(G,K){const{chainId:ne}=await this.rpcProvider.detectNetwork(),ue={method:"eth_sendTransaction",params:[{to:G,data:K,chainId:getEip155ChainId(ne)}]},{result:pe}=await this.postToRelayer(ue);return pe}async imGetTransactionByHash(G){const K={method:"im_getTransactionByHash",params:[G]},{result:ne}=await this.postToRelayer(K);return ne}async imGetFeeOptions(G,K){const{chainId:ne}=await this.rpcProvider.detectNetwork(),ue={method:"im_getFeeOptions",params:[{userAddress:G,data:K,chainId:getEip155ChainId(ne)}]},{result:pe}=await this.postToRelayer(ue);return pe}async imSignTypedData(G,K){const{chainId:ne}=await this.rpcProvider.detectNetwork(),ue={method:"im_signTypedData",params:[{address:G,eip712Payload:K,chainId:getEip155ChainId(ne)}]},{result:pe}=await this.postToRelayer(ue);return pe}async imSign(G,K){const{chainId:ne}=await this.rpcProvider.detectNetwork(),ue={method:"im_sign",params:[{address:G,message:K,chainId:getEip155ChainId(ne)}]},{result:pe}=await this.postToRelayer(ue);return pe}}var KE,JE;!function(G){G[G.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",G[G.UNAUTHORIZED=4100]="UNAUTHORIZED",G[G.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",G[G.DISCONNECTED=4900]="DISCONNECTED"}(KE||(KE={})),function(G){G[G.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",G[G.INVALID_REQUEST=-32600]="INVALID_REQUEST",G[G.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",G[G.INVALID_PARAMS=-32602]="INVALID_PARAMS",G[G.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",G[G.PARSE_ERROR=-32700]="PARSE_ERROR",G[G.TRANSACTION_REJECTED=-32003]="TRANSACTION_REJECTED"}(JE||(JE={}));class JsonRpcError extends Error{message;code;constructor(G,K){super(K),this.message=K,this.code=G}}const XE="Transaction requires confirmation but this functionality is not supported in this environment. Please contact Immutable support if you need to enable this feature.",convertBigNumberishToString=G=>Oi.from(G).toString();class GuardianClient{guardianApi;confirmationScreen;crossSdkBridgeEnabled;authManager;constructor({confirmationScreen:G,config:K,authManager:ne,guardianApi:ue}){this.confirmationScreen=G,this.crossSdkBridgeEnabled=K.crossSdkBridgeEnabled,this.guardianApi=ue,this.authManager=ne}withConfirmationScreen(G){return K=>this.withConfirmationScreenTask(G)(K)()}withConfirmationScreenTask(G){return K=>async()=>{this.confirmationScreen.loading(G);try{return await K()}catch(G){if(G instanceof PassportError&&G.type===IE.SERVICE_UNAVAILABLE_ERROR)throw await this.confirmationScreen.showServiceUnavailable(),G;throw this.confirmationScreen.closeWindow(),G}}}withDefaultConfirmationScreenTask(G){return this.withConfirmationScreenTask()(G)}async evaluateImxTransaction({payloadHash:G}){try{const finallyFn=()=>{this.confirmationScreen.closeWindow()},K=await this.authManager.getUserImx(),ne={Authorization:`Bearer ${K.accessToken}`};if(!(await retryWithDelay((async()=>this.guardianApi.getTransactionByID({transactionID:G,chainType:"starkex"},{headers:ne})),{finallyFn:finallyFn})).data.id)throw new Error("Transaction doesn't exists");const ue=await this.guardianApi.evaluateTransaction({id:G,transactionEvaluationRequest:{chainType:"starkex"}},{headers:ne}),{confirmationRequired:pe}=ue.data;if(pe){if(this.crossSdkBridgeEnabled)throw new Error(XE);if(!(await this.confirmationScreen.requestConfirmation(G,K.imx.ethAddress,Wa.TransactionApprovalRequestChainTypeEnum.Starkex)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}catch(G){if(er.isAxiosError(G)&&403===G.response?.status)throw new PassportError("Service unavailable",IE.SERVICE_UNAVAILABLE_ERROR);throw G}}async evaluateEVMTransaction({chainId:G,nonce:K,metaTransactions:ne}){const ue=await this.authManager.getUserZkEvm(),pe={Authorization:`Bearer ${ue.accessToken}`},he=(G=>{try{return G.map((G=>({delegateCall:!0===G.delegateCall,revertOnError:!0===G.revertOnError,gasLimit:G.gasLimit?convertBigNumberishToString(G.gasLimit):"0",target:G.to??ui,value:G.value?convertBigNumberishToString(G.value):"0",data:G.data?G.data.toString():"0x"})))}catch(G){const K=G instanceof Error?G.message:String(G);throw new JsonRpcError(JE.INVALID_PARAMS,`Transaction failed to parsing: ${K}`)}})(ne);try{return(await this.guardianApi.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:G,transactionData:{nonce:K,userAddress:ue.zkEvm.ethAddress,metaTransactions:he}}},{headers:pe})).data}catch(G){if(er.isAxiosError(G)&&403===G.response?.status)throw new PassportError("Service unavailable",IE.SERVICE_UNAVAILABLE_ERROR);const K=G instanceof Error?G.message:String(G);throw new JsonRpcError(JE.INTERNAL_ERROR,`Transaction failed to validate with error: ${K}`)}}async validateEVMTransaction({chainId:G,nonce:K,metaTransactions:ne,isBackgroundTransaction:ue}){const pe=await this.evaluateEVMTransaction({chainId:G,nonce:K,metaTransactions:ne}),{confirmationRequired:he,transactionId:ye}=pe;if(he&&this.crossSdkBridgeEnabled)throw new JsonRpcError(JE.TRANSACTION_REJECTED,XE);if(he&&ye){const K=await this.authManager.getUserZkEvm();if(!(await this.confirmationScreen.requestConfirmation(ye,K.zkEvm.ethAddress,Wa.TransactionApprovalRequestChainTypeEnum.Evm,G)).confirmed)throw new JsonRpcError(JE.TRANSACTION_REJECTED,"Transaction rejected by user")}else ue||this.confirmationScreen.closeWindow()}async handleEIP712MessageEvaluation({chainID:G,payload:K}){try{const ne=await this.authManager.getUserZkEvm();if(null===ne)throw new JsonRpcError(KE.UNAUTHORIZED,"User not logged in. Please log in first.");return(await this.guardianApi.evaluateMessage({messageEvaluationRequest:{chainID:G,payload:K}},{headers:{Authorization:`Bearer ${ne.accessToken}`}})).data}catch(G){const K=G instanceof Error?G.message:String(G);throw new JsonRpcError(JE.INTERNAL_ERROR,`Message failed to validate with error: ${K}`)}}async evaluateEIP712Message({chainID:G,payload:K}){const{messageId:ne,confirmationRequired:ue}=await this.handleEIP712MessageEvaluation({chainID:G,payload:K});if(ue&&this.crossSdkBridgeEnabled)throw new JsonRpcError(JE.TRANSACTION_REJECTED,XE);if(ue&&ne){const G=await this.authManager.getUserZkEvm();if(!(await this.confirmationScreen.requestMessageConfirmation(ne,G.zkEvm.ethAddress,"eip712")).confirmed)throw new JsonRpcError(JE.TRANSACTION_REJECTED,"Signature rejected by user")}else this.confirmationScreen.closeWindow()}async handleERC191MessageEvaluation({chainID:G,payload:K}){try{const ne=await this.authManager.getUserZkEvm();if(null===ne)throw new JsonRpcError(KE.UNAUTHORIZED,"User not logged in. Please log in first.");return(await this.guardianApi.evaluateErc191Message({eRC191MessageEvaluationRequest:{chainID:getEip155ChainId(G),payload:K}},{headers:{Authorization:`Bearer ${ne.accessToken}`}})).data}catch(G){const K=G instanceof Error?G.message:String(G);throw new JsonRpcError(JE.INTERNAL_ERROR,`Message failed to validate with error: ${K}`)}}async evaluateERC191Message({chainID:G,payload:K}){const{messageId:ne,confirmationRequired:ue}=await this.handleERC191MessageEvaluation({chainID:G,payload:K});if(ue&&this.crossSdkBridgeEnabled)throw new JsonRpcError(JE.TRANSACTION_REJECTED,XE);if(ue&&ne){const G=await this.authManager.getUserZkEvm();if(!(await this.confirmationScreen.requestMessageConfirmation(ne,G.zkEvm.ethAddress,"erc191")).confirmed)throw new JsonRpcError(JE.TRANSACTION_REJECTED,"Signature rejected by user")}else this.confirmationScreen.closeWindow()}}const getFeeOption=async(G,K,ne)=>{const ue=getNormalisedTransactions([G]),pe=(he=ue,po.encode([VE],[he]));var he;const ye=(await ne.imGetFeeOptions(K,pe)).find((G=>"IMX"===G.tokenSymbol));if(!ye)throw new Error("Failed to retrieve fees for IMX token");return ye},pollRelayerTransaction=async(G,K,ne)=>{const ue=await retryWithDelay((async()=>{const ne=await G.imGetTransactionByHash(K);if(ne.status===WE.PENDING)throw new Error;return ne}),{retries:30,interval:1e3,finalErr:new JsonRpcError(JE.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(ne.addEvent("endRetrieveRelayerTransaction"),![WE.SUBMITTED,WE.SUCCESSFUL].includes(ue.status)){let G=`Transaction failed to submit with status ${ue.status}.`;throw ue.statusMessage&&(G+=` Error message: ${ue.statusMessage}`),new JsonRpcError(JE.RPC_SERVER_ERROR,G)}return ue},prepareAndSignTransaction=async({transactionRequest:G,ethSigner:K,rpcProvider:ne,guardianClient:ue,relayerClient:pe,zkEvmAddress:he,flow:ye,nonceSpace:me,isBackgroundTransaction:be})=>{const{chainId:ve}=await ne.detectNetwork(),_e=Oi.from(ve);ye.addEvent("endDetectNetwork");const Te=await(async(G,K,ne,ue,pe)=>{if(!G.to)throw new JsonRpcError(JE.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const he={to:G.to,data:G.data,nonce:Oi.from(0),value:G.value,revertOnError:!0},[ye,me]=await Promise.all([getNonce(K,ue,pe),getFeeOption(he,ue,ne)]),be=[{...he,nonce:ye}],ve=Oi.from(me.tokenPrice);return ve.isZero()||be.push({nonce:ye,to:me.recipientAddress,value:ve,revertOnError:!0}),be})(G,ne,pe,he,me);ye.addEvent("endBuildMetaTransactions");const{nonce:Ee}=Te[0];if(!Ee)throw new Error("Failed to retrieve nonce from the smart wallet");const[,Pe]=await Promise.all([(async()=>{await ue.validateEVMTransaction({chainId:getEip155ChainId(ve),nonce:convertBigNumberishToString(Ee),metaTransactions:Te,isBackgroundTransaction:be}),ye.addEvent("endValidateEVMTransaction")})(),(async()=>{const G=await signMetaTransactions(Te,Ee,_e,he,K);return ye.addEvent("endGetSignedMetaTransactions"),G})()]),Se=await pe.ethSendTransaction(he,Pe);return ye.addEvent("endRelayerSendTransaction"),{signedTransactions:Pe,relayerId:Se,nonce:Ee}},prepareAndSignEjectionTransaction=async({transactionRequest:G,ethSigner:K,zkEvmAddress:ne,flow:ue})=>{const pe=await(async G=>{if(!G.to)throw new JsonRpcError(JE.INVALID_PARAMS,'im_signEjectionTransaction requires a "to" field');if(void 0===G.nonce)throw new JsonRpcError(JE.INVALID_PARAMS,'im_signEjectionTransaction requires a "nonce" field');if(!G.chainId)throw new JsonRpcError(JE.INVALID_PARAMS,'im_signEjectionTransaction requires a "chainId" field');return[{to:G.to,data:G.data,nonce:G.nonce,value:G.value,revertOnError:!0}]})(G);ue.addEvent("endBuildMetaTransactions");const he=await signMetaTransactions(pe,G.nonce,Oi.from(G.chainId),ne,K);return ue.addEvent("endGetSignedMetaTransactions"),{to:ne,data:he,chainId:getEip155ChainId(G.chainId)}},sendTransaction$1=async({params:G,ethSigner:K,rpcProvider:ne,relayerClient:ue,guardianClient:pe,zkEvmAddress:he,flow:ye,nonceSpace:me,isBackgroundTransaction:be=!1})=>{const ve=G[0],{relayerId:_e}=await prepareAndSignTransaction({transactionRequest:ve,ethSigner:K,rpcProvider:ne,guardianClient:pe,relayerClient:ue,zkEvmAddress:he,flow:ye,nonceSpace:me,isBackgroundTransaction:be}),{hash:Te}=await pollRelayerTransaction(ue,_e,ye);return Te},QE=["types","domain","primaryType","message"],transformTypedData=(G,K)=>{let ne;if("string"==typeof G)try{ne=JSON.parse(G)}catch(G){throw new JsonRpcError(JE.INVALID_PARAMS,`Failed to parse typed data JSON: ${G}`)}else{if("object"!=typeof G)throw new JsonRpcError(JE.INVALID_PARAMS,`Invalid typed data argument: ${G}`);ne=G}if(!(G=>QE.every((K=>K in G)))(ne))throw new JsonRpcError(JE.INVALID_PARAMS,`Invalid typed data argument. The following properties are required: ${QE.join(", ")}`);const ue=ne.domain?.chainId;if(ue&&("string"==typeof ue&&(ue.startsWith("0x")?ne.domain.chainId=parseInt(ue,16):ne.domain.chainId=parseInt(ue,10)),ne.domain.chainId!==K))throw new JsonRpcError(JE.INVALID_PARAMS,`Invalid chainId, expected ${K}`);return ne},signTypedDataV4=async({params:G,method:K,ethSigner:ne,rpcProvider:ue,relayerClient:pe,guardianClient:he,flow:ye})=>{const me=G[0],be=G[1];if(!me||!be)throw new JsonRpcError(JE.INVALID_PARAMS,`${K} requires an address and a typed data JSON`);const{chainId:ve}=await ue.detectNetwork(),_e=transformTypedData(be,ve);ye.addEvent("endDetectNetwork"),await he.evaluateEIP712Message({chainID:String(ve),payload:_e}),ye.addEvent("endValidateMessage");const Te=await pe.imSignTypedData(me,_e);ye.addEvent("endRelayerSignTypedData");const Ee=await(async(G,K,ne,ue,pe)=>{const he={...G.types};delete he.EIP712Domain;const{_TypedDataEncoder:ye}=cf,me=ye.hash(G.domain,he,G.message),be=arrayify$1(keccak256$3(encodeMessageSubDigest(ne,ue,me))),ve=performance.now(),_e=await pe.signMessage(be);trackDuration("passport","magicSignMessageTypedData",Math.round(performance.now()-ve));const Te=await pe.getAddress();return packSignatures(_e,Te,K)})(_e,Te,Oi.from(ve),me,ne);return ye.addEvent("getSignedTypedData"),Ee},personalSign=async({params:G,ethSigner:K,zkEvmAddress:ne,rpcProvider:ue,guardianClient:pe,relayerClient:he,flow:ye})=>{const me=G[0],be=G[1];if(!be||!me)throw new JsonRpcError(JE.INVALID_PARAMS,"personal_sign requires an address and a message");if(be.toLowerCase()!==ne.toLowerCase())throw new JsonRpcError(JE.INVALID_PARAMS,"personal_sign requires the signer to be the from address");const ve=(G=>{if(!G)return G;try{return toUtf8String$2(stripZeros$1(arrayify$1(G)))}catch(K){return G}})(me),{chainId:_e}=await ue.detectNetwork();ye.addEvent("endDetectNetwork");const Te=(async(G,K,ne,ue)=>{const pe=hashMessage(K),he=arrayify$1(keccak256$3(encodeMessageSubDigest(G,ue,pe)));return ne.signMessage(he)})(Oi.from(_e),ve,K,be);Te.then((()=>ye.addEvent("endEOASignature"))),await pe.evaluateERC191Message({chainID:_e,payload:ve}),ye.addEvent("endEvaluateERC191Message");const[Ee,Pe]=await Promise.all([Te,he.imSign(be,ve)]);ye.addEvent("endRelayerSign");const Se=await K.getAddress();return ye.addEvent("endGetEOAAddress"),packSignatures(Ee,Se,Pe)},getBaseUrl=G=>{switch(G){case Jn.SANDBOX:return"https://api.sandbox.immutable.com";case Jn.PRODUCTION:return"https://api.immutable.com";default:throw new Error("Environment not supported")}};let ZE;const{getItem:YE,setItem:eP}=Kn.localStorage,tP="sessionActivitySendCount",rP="sessionActivityDate",nP={};let aP={};const iP={},syncSendCount=()=>{aP=YE(tP)||{};const G=YE(rP),K=new Date,ne=`${K.getFullYear()}-${`${K.getMonth()+1}`.padStart(2,"0")}-${`${K.getDate()}`.padStart(2,"0")}`;G&&G===ne||(aP={}),eP(rP,ne),eP(tP,aP)};syncSendCount();const trackSessionActivityFn=async G=>{const K=G.flow||qn("passport","sendSessionActivity"),ne=G.passportClient;if(!ne)throw K.addEvent("No Passport Client ID"),new Error("No Passport Client ID provided");if(iP[ne])return;iP[ne]=!0;const{sendTransaction:ue,environment:pe}=G;if(!ue)throw new Error("No sendTransaction function provided");if(!pe)throw new Error("No environment provided");(G=>{ZE||(ZE=er.create({baseURL:getBaseUrl(G)}))})(pe);const he=G.walletAddress;if(!he)throw K.addEvent("No Passport Wallet Address"),new Error("No wallet address");let ye;try{if(ye=await async function get(G){if(!ZE)throw new Error("Client not initialised");return ZE.get("/v1/sdk/session-activity/check",{params:G}).then((G=>G.data)).catch((G=>{if(404!==G.response.status)throw G}))}({clientId:ne,wallet:he,checkCount:nP[ne]||0,sendCount:aP[ne]||0}),nP[ne]++,!ye)return}catch(G){throw K.addEvent("Failed to fetch details"),new Error("Failed to get details",{cause:G})}if(ye&&ye.contractAddress&&ye.functionName){const ue=(()=>new Ho([`function ${ye.functionName}()`]))().encodeFunctionData(ye.functionName),pe=ye.contractAddress;try{K.addEvent("Start Sending Transaction");const ye=await G.sendTransaction([{to:pe,from:he,data:ue}],K);(G=>{syncSendCount(),aP[G]||(aP[G]=0),aP[G]++,eP(tP,aP),nP[G]=0})(ne),K.addEvent("Transaction Sent",{tx:ye})}catch(G){K.addEvent("Failed to send Transaction");const ne=new Error("Failed to send transaction",{cause:G});Gn("passport","sessionActivityError",ne,{flowId:K.details.flowId})}}ye&&ye.delay&&ye.delay>0&&(K.addEvent("Delaying Transaction",{delay:ye.delay}),await(async G=>new Promise((K=>{setTimeout(K,1e3*G)})))(ye.delay),setTimeout((()=>{K.addEvent("Retrying after Delay"),iP[ne]=!1,trackSessionWrapper({...G,flow:K})}),0))},trackSessionWrapper=G=>function errorBoundary$1(G,K){return(...ne)=>{try{const ue=G(...ne);return ue instanceof Promise?ue.catch((G=>(G instanceof Error&&Gn("passport","sessionActivityError",G),K))):ue}catch(G){return G instanceof Error&&Gn("passport","sessionActivityError",G),K}}}(trackSessionActivityFn)(G).then((()=>{iP[G.passportClient]=!1})),sP=trackSessionWrapper,isZkEvmUser=G=>"zkEvm"in G;class ZkEvmProvider{#a;#i;#s;#o;#c;#d;#u;#f;#l;#p;#h;isPassport=!0;constructor({authManager:G,magicAdapter:K,config:ne,multiRollupApiClients:ue,passportEventEmitter:pe,guardianClient:he}){this.#a=G,this.#u=K,this.#i=ne,this.#c=he,this.#o=pe,ne.jsonRpcReferrer?this.#d=new StaticJsonRpcProvider({url:this.#i.zkEvmRpcUrl,fetchOptions:{referrer:ne.jsonRpcReferrer}}):this.#d=new StaticJsonRpcProvider(this.#i.zkEvmRpcUrl),this.#l=new RelayerClient({config:this.#i,rpcProvider:this.#d,authManager:this.#a}),this.#f=ue,this.#s=new TypedEventEmitter,this.#a.getUser().then((G=>{G&&(this.#y(G),isZkEvmUser(G)&&this.#m(G.zkEvm.ethAddress))})).catch((()=>{})),pe.on(OE.LOGGED_IN,(G=>{this.#y(G),isZkEvmUser(G)&&this.#m(G.zkEvm.ethAddress)})),pe.on(OE.LOGGED_OUT,this.#b),pe.on(OE.ACCOUNTS_REQUESTED,sP)}#b=()=>{this.#p=void 0,this.#s.emit(zE.ACCOUNTS_CHANGED,[])};#y(G){const generateSigner=async()=>{const K=await this.#u.login(G.idToken);return new Web3Provider(K).getSigner()};this.#h=void 0,this.#p=new Promise((async G=>{try{G(await generateSigner())}catch(K){this.#h=K,G(void 0)}}))}async#g(){const G=await this.#p;if(void 0===G){if(void 0!==this.#h)throw this.#h;throw new Error("Signer failed to initialise")}return G}async#m(G,K){const ne=Oi.from(1);this.#o.emit(OE.ACCOUNTS_REQUESTED,{environment:this.#i.baseConfig.environment,sendTransaction:async(K,ue)=>{const pe=await this.#g();return await sendTransaction$1({params:K,ethSigner:pe,guardianClient:this.#c,rpcProvider:this.#d,relayerClient:this.#l,zkEvmAddress:G,flow:ue,nonceSpace:ne,isBackgroundTransaction:!0})},walletAddress:G,passportClient:K||this.#i.oidcConfiguration.clientId})}async#v(){try{const G=await this.#a.getUser();return G&&isZkEvmUser(G)?G.zkEvm.ethAddress:void 0}catch{return}}async#w(G){switch(G.method){case"eth_requestAccounts":{const G=await this.#v();if(G)return[G];const K=qn("passport","ethRequestAccounts");try{const G=await this.#a.getUserOrLogin();let ne;if(K.addEvent("endGetUserOrLogin"),this.#p||this.#y(G),isZkEvmUser(G))ne=G.zkEvm.ethAddress;else{K.addEvent("startUserRegistration");const ue=await this.#g();K.addEvent("ethSignerResolved"),ne=await async function registerZkEvmUser({authManager:G,ethSigner:K,multiRollupApiClients:ne,accessToken:ue,rpcProvider:pe,flow:he}){const ye=K.getAddress();ye.then((()=>he.addEvent("endGetAddress")));const me=signRaw("Only sign this message from Immutable Passport",K);me.then((()=>he.addEvent("endSignRaw")));const be=pe.detectNetwork();be.then((()=>he.addEvent("endDetectNetwork")));const ve=ne.chainsApi.listChains();ve.then((()=>he.addEvent("endListChains")));const[_e,Te,Ee,Pe]=await Promise.all([ye,me,be,ve]),Se=getEip155ChainId(Ee.chainId),Ce=Pe.data?.result?.find((G=>G.id===Se))?.name;if(!Ce)throw new JsonRpcError(JE.INTERNAL_ERROR,`Chain name does not exist on for chain id ${Ee.chainId}`);try{const K=await ne.passportApi.createCounterfactualAddressV2({chainName:Ce,createCounterfactualAddressRequest:{ethereum_address:_e,ethereum_signature:Te}},{headers:{Authorization:`Bearer ${ue}`}});return he.addEvent("endCreateCounterfactualAddress"),G.forceUserRefreshInBackground(),K.data.counterfactual_address}catch(G){throw new JsonRpcError(JE.INTERNAL_ERROR,`Failed to create counterfactual address: ${G}`)}}({ethSigner:ue,authManager:this.#a,multiRollupApiClients:this.#f,accessToken:G.accessToken,rpcProvider:this.#d,flow:K}),K.addEvent("endUserRegistration")}return this.#s.emit(zE.ACCOUNTS_CHANGED,[ne]),jn({passportId:G.profile.sub}),this.#m(ne),[ne]}catch(G){throw G instanceof Error?Gn("passport","ethRequestAccounts",G,{flowId:K.details.flowId}):K.addEvent("errored"),G}finally{K.addEvent("End")}}case"eth_sendTransaction":{const K=await this.#v();if(!K)throw new JsonRpcError(KE.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");const ne=qn("passport","ethSendTransaction");try{return await this.#c.withConfirmationScreen({width:480,height:720})((async()=>{const ue=await this.#g();return ne.addEvent("endGetSigner"),await sendTransaction$1({params:G.params||[],ethSigner:ue,guardianClient:this.#c,rpcProvider:this.#d,relayerClient:this.#l,zkEvmAddress:K,flow:ne})}))}catch(G){throw G instanceof Error?Gn("passport","eth_sendTransaction",G,{flowId:ne.details.flowId}):ne.addEvent("errored"),G}finally{ne.addEvent("End")}}case"eth_accounts":{const G=await this.#v();return G?[G]:[]}case"personal_sign":{const K=await this.#v();if(!K)throw new JsonRpcError(KE.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");const ne=qn("passport","personalSign");try{return await this.#c.withConfirmationScreen({width:480,height:720})((async()=>{const ue=await this.#g();if(ne.addEvent("endGetSigner"),this.#i.forceScwDeployBeforeMessageSignature){if(!(await getNonce(this.#d,K)).gt(0))return await(async({params:G,ethSigner:K,rpcProvider:ne,relayerClient:ue,guardianClient:pe,zkEvmAddress:he,flow:ye})=>{const me={to:he,value:0},{relayerId:be}=await prepareAndSignTransaction({transactionRequest:me,ethSigner:K,rpcProvider:ne,guardianClient:pe,relayerClient:ue,zkEvmAddress:he,flow:ye});return pe.withConfirmationScreen()((async()=>{const me=await personalSign({params:G,ethSigner:K,zkEvmAddress:he,rpcProvider:ne,guardianClient:pe,relayerClient:ue,flow:ye});return await pollRelayerTransaction(ue,be,ye),me}))})({params:G.params||[],ethSigner:ue,zkEvmAddress:K,rpcProvider:this.#d,guardianClient:this.#c,relayerClient:this.#l,flow:ne})}return await personalSign({params:G.params||[],ethSigner:ue,zkEvmAddress:K,rpcProvider:this.#d,guardianClient:this.#c,relayerClient:this.#l,flow:ne})}))}catch(G){throw G instanceof Error?Gn("passport","personal_sign",G,{flowId:ne.details.flowId}):ne.addEvent("errored"),G}finally{ne.addEvent("End")}}case"eth_signTypedData":case"eth_signTypedData_v4":{if(!await this.#v())throw new JsonRpcError(KE.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");const K=qn("passport","ethSignTypedDataV4");try{return await this.#c.withConfirmationScreen({width:480,height:720})((async()=>{const ne=await this.#g();return K.addEvent("endGetSigner"),await signTypedDataV4({method:G.method,params:G.params||[],ethSigner:ne,rpcProvider:this.#d,relayerClient:this.#l,guardianClient:this.#c,flow:K})}))}catch(G){throw G instanceof Error?Gn("passport","eth_signTypedData",G,{flowId:K.details.flowId}):K.addEvent("errored"),G}finally{K.addEvent("End")}}case"eth_chainId":{const{chainId:G}=await this.#d.detectNetwork();return hexlify$2(G)}case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":{const[K,ne]=G.params||[];return this.#d.send(G.method,[K,ne||"latest"])}case"eth_getStorageAt":{const[K,ne,ue]=G.params||[];return this.#d.send(G.method,[K,ne,ue||"latest"])}case"eth_call":case"eth_estimateGas":{const[K,ne]=G.params||[];return this.#d.send(G.method,[K,ne||"latest"])}case"eth_gasPrice":case"eth_blockNumber":case"eth_getBlockByHash":case"eth_getBlockByNumber":case"eth_getTransactionByHash":case"eth_getTransactionReceipt":return this.#d.send(G.method,G.params||[]);case"im_signEjectionTransaction":{const K=await this.#v();if(!K)throw new JsonRpcError(KE.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");const ne=qn("passport","imSignEjectionTransaction");try{const ue=await this.#g();return ne.addEvent("endGetSigner"),await(async({params:G,ethSigner:K,zkEvmAddress:ne,flow:ue})=>{if(!G||1!==G.length)throw new JsonRpcError(JE.INVALID_PARAMS,"im_signEjectionTransaction requires a singular param (hash)");const pe=G[0];return await prepareAndSignEjectionTransaction({transactionRequest:pe,ethSigner:K,zkEvmAddress:ne,flow:ue})})({params:G.params||[],ethSigner:ue,zkEvmAddress:K,flow:ne})}catch(G){throw G instanceof Error?Gn("passport","imSignEjectionTransaction",G,{flowId:ne.details.flowId}):ne.addEvent("errored"),G}finally{ne.addEvent("End")}}case"im_addSessionActivity":{const[K]=G.params||[],ne=await this.#v();return ne&&this.#m(ne,K),null}default:throw new JsonRpcError(KE.UNSUPPORTED_METHOD,"Method not supported")}}async#_(G){const{id:K,jsonrpc:ne}=G;try{return{id:K,jsonrpc:ne,result:await this.#w(G)}}catch(G){let ue;return ue=G instanceof JsonRpcError?G:G instanceof Error?new JsonRpcError(JE.INTERNAL_ERROR,G.message):new JsonRpcError(JE.INTERNAL_ERROR,"Internal error"),{id:K,jsonrpc:ne,error:ue}}}async request(G){try{return this.#w(G)}catch(G){if(G instanceof JsonRpcError)throw G;if(G instanceof Error)throw new JsonRpcError(JE.INTERNAL_ERROR,G.message);throw new JsonRpcError(JE.INTERNAL_ERROR,"Internal error")}}sendAsync(G,K){if(!K)throw new Error("No callback provided");Array.isArray(G)?Promise.all(G.map(this.#_)).then((G=>{K(null,G)})).catch((G=>{K(G,[])})):this.#_(G).then((G=>{K(null,G)})).catch((G=>{K(G,null)}))}async send(G,K,ne){if("string"==typeof G)return"function"==typeof K?this.sendAsync({method:G,params:[]},K):ne?this.sendAsync({method:G,params:Array.isArray(K)?K:[]},ne):this.request({method:G,params:Array.isArray(K)?K:[]});if("function"==typeof K)return this.sendAsync(G,K);if(!Array.isArray(G)&&"object"==typeof G)return this.#_(G);throw new JsonRpcError(JE.INVALID_REQUEST,"Invalid request")}on(G,K){this.#s.on(G,K)}removeListener(G,K){this.#s.removeListener(G,K)}}const oP={icon:'data:image/svg+xml,<svg viewBox="0 0 48 48" class="SvgIcon undefined Logo Logo--PassportSymbolOutlined css-1dn9atd" xmlns="http://www.w3.org/2000/svg"><g data-testid="undefined__g"><circle cx="24" cy="24" r="22.5" fill="url(%23paint0_radial_6324_83922)"></circle><circle cx="24" cy="24" r="22.5" fill="url(%23paint1_radial_6324_83922)"></circle><path d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM23.0718 9.16608C23.7383 8.83951 24.4406 8.86188 25.087 9.2287C27.3282 10.5059 29.5627 11.7942 31.786 13.096C32.5018 13.5165 32.8686 14.1897 32.8708 15.0173C32.8843 17.9184 32.8798 20.8171 32.8708 23.7182C32.8708 23.8255 32.8015 23.9821 32.7143 24.0335C31.8531 24.548 30.9808 25.0423 30.0347 25.5881V25.1318C30.0347 22.148 30.0257 19.1664 30.0414 16.1827C30.0436 15.6101 29.8468 15.241 29.339 14.9525C26.7377 13.474 24.1499 11.9687 21.5575 10.4723C21.4457 10.4075 21.3361 10.3381 21.1661 10.2352C21.8326 9.85722 22.4321 9.47698 23.0673 9.16608H23.0718ZM22.5953 38.8451C22.45 38.7713 22.3426 38.7198 22.2375 38.6595C18.8041 36.68 15.3752 34.687 11.9307 32.7232C10.9644 32.173 10.5238 31.3879 10.5349 30.2852C10.5551 27.9411 10.5484 25.597 10.5372 23.2507C10.5327 22.1927 10.9622 21.4255 11.8926 20.8977C14.3105 19.5221 16.715 18.1264 19.1195 16.7284C19.3275 16.6076 19.4796 16.5875 19.6965 16.7172C20.5264 17.216 21.3719 17.6924 22.2554 18.2024C22.0876 18.3031 21.9601 18.3791 21.8304 18.4552C19.2268 19.9582 16.6278 21.4658 14.0175 22.9599C13.5903 23.2037 13.3912 23.5213 13.3957 24.0179C13.4091 25.8654 13.4114 27.713 13.3957 29.5605C13.3912 30.0705 13.5948 30.3948 14.0332 30.6453C16.7866 32.2199 19.5288 33.8125 22.28 35.3916C22.5126 35.5258 22.611 35.6645 22.6065 35.9418C22.5864 36.888 22.5998 37.8363 22.5998 38.8473L22.5953 38.8451ZM22.5953 33.553C22.356 33.4166 22.1838 33.3204 22.0116 33.2198C19.8285 31.9605 17.6477 30.6967 15.4602 29.4464C15.2231 29.3122 15.1359 29.1668 15.1381 28.8917C15.1538 27.4714 15.1471 26.0511 15.1426 24.6308C15.1426 24.4384 15.1717 24.3064 15.3618 24.1991C16.167 23.7495 16.9633 23.2798 17.7618 22.8212C17.8199 22.7877 17.8826 22.7631 17.9877 22.7116V24.3064C17.9877 25.1698 18.0011 26.0354 17.9832 26.8988C17.972 27.3909 18.1622 27.7241 18.5916 27.9657C19.8285 28.6636 21.0498 29.3883 22.2867 30.0839C22.5305 30.2203 22.6043 30.3724 22.5998 30.6408C22.5842 31.5847 22.5931 32.5308 22.5931 33.5508L22.5953 33.553ZM20.0746 14.91C19.6116 14.6371 19.2157 14.6393 18.7527 14.91C16.1581 16.4265 13.5523 17.9228 10.9487 19.4259C10.8391 19.4908 10.7251 19.5489 10.5305 19.6541C10.5998 18.6654 10.3873 17.7327 10.7251 16.8291C10.9085 16.3348 11.2529 15.9635 11.7092 15.6995C13.8811 14.4447 16.0507 13.1877 18.227 11.9396C19.0211 11.4833 19.8308 11.4945 20.6248 11.953C23.0964 13.3756 25.5657 14.8026 28.0306 16.2341C28.1357 16.2945 28.2677 16.4309 28.2677 16.5338C28.2856 17.5493 28.2788 18.567 28.2788 19.6563C27.3819 19.1396 26.5543 18.6609 25.7267 18.1823C23.8412 17.093 21.9512 16.0149 20.0746 14.91ZM37.4427 30.8779C37.3778 31.6764 36.9103 32.2423 36.2192 32.6404C33.5732 34.1614 30.9294 35.6913 28.2856 37.2168C27.4557 37.6954 26.6259 38.1741 25.7938 38.6527C25.6932 38.7109 25.5903 38.7601 25.4539 38.8317C25.4449 38.693 25.4337 38.5924 25.4337 38.4917C25.4337 37.6149 25.4382 36.7404 25.4293 35.8636C25.4293 35.6645 25.4762 35.5437 25.6596 35.4386C29.5157 33.2198 33.3696 30.9942 37.2212 28.7709C37.2794 28.7374 37.3443 28.7105 37.4539 28.6591C37.4539 29.4375 37.4986 30.1622 37.4427 30.8779ZM37.4628 25.3577C37.4561 26.2658 36.9663 26.9033 36.1901 27.3506C33.175 29.0841 30.1622 30.8265 27.1493 32.5666C26.5991 32.8842 26.0466 33.1996 25.4561 33.5396C25.4472 33.3897 25.436 33.2913 25.436 33.1907C25.436 32.3273 25.4449 31.4617 25.4293 30.5983C25.4248 30.3523 25.5075 30.2226 25.72 30.0995C28.46 28.5271 31.1911 26.9368 33.9355 25.3733C34.4231 25.096 34.6378 24.7538 34.6334 24.1812C34.6132 21.1974 34.6244 18.2136 34.6244 15.2298V14.7087C35.3402 15.1404 36.0112 15.496 36.624 15.9299C37.1832 16.3258 37.465 16.9253 37.4673 17.6164C37.4762 20.1976 37.4829 22.7788 37.465 25.3599L37.4628 25.3577Z" fill="%230D0D0D"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint2_radial_6324_83922)"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint3_radial_6324_83922)"></path><defs><radialGradient id="paint0_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(13.4442 13.3899) rotate(44.9817) scale(46.7487 99.1435)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint1_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(25.9515 43.7068) rotate(84.265) scale(24.2138 46.3215)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient><radialGradient id="paint2_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(12.7405 12.6825) rotate(44.9817) scale(49.8653 105.753)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint3_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26.0816 45.0206) rotate(84.265) scale(25.828 49.4096)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient></defs></g></svg>',name:"Immutable Passport",rdns:"com.immutable.passport",uuid:v4()};class MagicProviderProxyFactory{authManager;config;constructor(G,K){this.authManager=G,this.config=K}createProxy(G){const K=G.rpcProvider;return new Proxy(K,{get:(K,ne,ue)=>"request"===ne?async(...ne)=>{try{if((G=>G?.length>0&&"object"==typeof G[0]&&"method"in G[0]&&"string"==typeof G[0].method&&["personal_sign","eth_accounts"].includes(G[0].method))(ne)){if(!await G.user.isLoggedIn()){const K=await this.authManager.getUser(),ne=K?.idToken;if(!ne)throw new Error("failed to obtain ID token");await G.openid.loginWithOIDC({jwt:ne,providerId:this.config.magicProviderId})}}return K.request(...ne)}catch(G){if(G instanceof Error)throw new Error(`ProviderProxy: ${G.message}`);throw new Error(`ProviderProxy: ${G}`)}}:Reflect.get(K,ne,ue)})}}const buildImxApiClients=G=>{if(G.overrides?.imxApiClients)return G.overrides.imxApiClients;const K=(G=>G.overrides?createConfig$1({basePath:G.overrides.imxPublicApiDomain}):G.baseConfig.environment===Jn.SANDBOX?imxApiConfig_getSandbox():imxApiConfig_getProduction())(G);return new ImxApiClients(K)};var cP=Object.freeze({__proto__:null,JsonRpcError:JsonRpcError,Passport:class Passport{authManager;config;confirmationScreen;immutableXClient;magicAdapter;multiRollupApiClients;passportImxProviderFactory;passportEventEmitter;guardianClient;constructor(G){const K=(G=>{const K=new PassportConfiguration(G),ne=new AuthManager(K),ue=new MagicProviderProxyFactory(ne,K),pe=new MagicAdapter(K,ue),he=new ConfirmationScreen(K),ye=new MultiRollupApiClients(K.multiRollupConfig),me=new TypedEventEmitter,be=G.overrides?G.overrides.immutableXClient:new IMXClient({baseConfig:G.baseConfig}),ve=new GuardianClient({confirmationScreen:he,config:K,authManager:ne,guardianApi:ye.guardianApi}),_e=buildImxApiClients(G);return{config:K,authManager:ne,magicAdapter:pe,confirmationScreen:he,immutableXClient:be,multiRollupApiClients:ye,passportEventEmitter:me,passportImxProviderFactory:new PassportImxProviderFactory({authManager:ne,immutableXClient:be,magicAdapter:pe,passportEventEmitter:me,imxApiClients:_e,guardianClient:ve}),guardianClient:ve}})(G);this.config=K.config,this.authManager=K.authManager,this.magicAdapter=K.magicAdapter,this.confirmationScreen=K.confirmationScreen,this.immutableXClient=K.immutableXClient,this.multiRollupApiClients=K.multiRollupApiClients,this.passportEventEmitter=K.passportEventEmitter,this.passportImxProviderFactory=K.passportImxProviderFactory,this.guardianClient=K.guardianClient,Wn(G.clientId),Dn("passport","initialise")}async connectImxSilent(){return withMetricsAsync((()=>this.passportImxProviderFactory.getProviderSilent()),"connectImxSilent",!1)}async connectImx(){return withMetricsAsync((()=>this.passportImxProviderFactory.getProvider()),"connectImx",!1)}connectEvm(G={announceProvider:!0}){return withMetrics((()=>{const K=new ZkEvmProvider({passportEventEmitter:this.passportEventEmitter,authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,multiRollupApiClients:this.multiRollupApiClients,guardianClient:this.guardianClient});return G?.announceProvider&&function announceProvider(G){if("undefined"==typeof window)return;const K=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(G)});window.dispatchEvent(K),window.addEventListener("eip6963:requestProvider",(()=>window.dispatchEvent(K)))}({info:oP,provider:K}),K}),"connectEvm",!1)}async login(G){return withMetricsAsync((async()=>{const{useCachedSession:K=!1,useSilentLogin:ne}=G||{};let ue=null;try{ue=await this.authManager.getUser()}catch(G){if(G instanceof Error&&!G.message.includes("Unknown or invalid refresh token")&&Gn("passport","login",G),K)throw G;logger$f_warn("Failed to retrieve a cached user session",G)}return!ue&&ne?ue=await this.authManager.forceUserRefresh():ue||K||(ue=await this.authManager.login(G?.anonymousId)),ue&&(jn({passportId:ue.profile.sub}),this.passportEventEmitter.emit(OE.LOGGED_IN,ue)),ue?ue.profile:null}),"login")}async loginCallback(){return withMetricsAsync((()=>this.authManager.loginCallback()),"loginCallback")}async loginWithDeviceFlow(G){return withMetricsAsync((()=>this.authManager.loginWithDeviceFlow(G?.anonymousId)),"loginWithDeviceFlow")}async loginWithDeviceFlowCallback(G,K,ne){return withMetricsAsync((async()=>{const ue=await this.authManager.loginWithDeviceFlowCallback(G,K,ne);return this.passportEventEmitter.emit(OE.LOGGED_IN,ue),ue.profile}),"loginWithDeviceFlowCallback")}loginWithPKCEFlow(){return withMetrics((()=>this.authManager.getPKCEAuthorizationUrl()),"loginWithPKCEFlow")}async loginWithPKCEFlowCallback(G,K){return withMetricsAsync((async()=>{const ne=await this.authManager.loginWithPKCEFlowCallback(G,K);return this.passportEventEmitter.emit(OE.LOGGED_IN,ne),ne.profile}),"loginWithPKCEFlowCallback")}async logout(){return withMetricsAsync((async()=>{"silent"===this.config.oidcConfiguration.logoutMode?await Promise.allSettled([this.authManager.logout(),this.magicAdapter.logout()]):(await this.magicAdapter.logout(),await this.authManager.logout()),this.passportEventEmitter.emit(OE.LOGGED_OUT)}),"logout")}async logoutDeviceFlow(){return withMetricsAsync((async()=>(await this.authManager.removeUser(),await this.magicAdapter.logout(),this.passportEventEmitter.emit(OE.LOGGED_OUT),await this.authManager.getDeviceFlowEndSessionEndpoint())),"logoutDeviceFlow")}async logoutSilentCallback(G){return withMetricsAsync((()=>this.authManager.logoutSilentCallback(G)),"logoutSilentCallback")}async getUserInfo(){return withMetricsAsync((async()=>{const G=await this.authManager.getUser();return G?.profile}),"getUserInfo",!1)}async getIdToken(){return withMetricsAsync((async()=>{const G=await this.authManager.getUser();return G?.idToken}),"getIdToken",!1)}async getAccessToken(){return withMetricsAsync((async()=>{const G=await this.authManager.getUser();return G?.accessToken}),"getAccessToken",!1,!1)}async getLinkedAddresses(){return withMetricsAsync((async()=>{const G=await this.authManager.getUser();if(!G?.profile.sub)return[];const K={Authorization:`Bearer ${G.accessToken}`};return(await this.multiRollupApiClients.passportProfileApi.getUserInfo({headers:K})).data.linked_addresses}),"getLinkedAddresses",!1)}async linkExternalWallet(G){const K=qn("passport","linkExternalWallet",!1),ne=await this.authManager.getUser();if(!ne)throw new PassportError("User is not logged in",IE.NOT_LOGGED_IN_ERROR);const ue=isUserImx(ne),pe=isUserZkEvm(ne);if(!ue&&!pe)throw new PassportError("User has not been registered",IE.USER_NOT_REGISTERED_ERROR);const he={Authorization:`Bearer ${ne.accessToken}`},ye={type:G.type,wallet_address:G.walletAddress,signature:G.signature,nonce:G.nonce};try{return{...(await this.multiRollupApiClients.passportProfileApi.linkWalletV2({linkWalletV2Request:ye},{headers:he})).data}}catch(G){if(G instanceof Error?Gn("passport","linkExternalWallet",G):K.addEvent("errored"),Hr(G)&&G.response)if(G.response.data&&isAPIError(G.response.data)){const{code:K,message:ne}=G.response.data;switch(K){case"ALREADY_LINKED":throw new PassportError(ne,IE.LINK_WALLET_ALREADY_LINKED_ERROR);case"MAX_WALLETS_LINKED":throw new PassportError(ne,IE.LINK_WALLET_MAX_WALLETS_LINKED_ERROR);case"DUPLICATE_NONCE":throw new PassportError(ne,IE.LINK_WALLET_DUPLICATE_NONCE_ERROR);case"VALIDATION_ERROR":throw new PassportError(ne,IE.LINK_WALLET_VALIDATION_ERROR);default:throw new PassportError(ne,IE.LINK_WALLET_GENERIC_ERROR)}}else if(G.response.status)throw new PassportError(`Link wallet request failed with status code ${G.response.status}`,IE.LINK_WALLET_GENERIC_ERROR);let ne="Link wallet request failed";throw G instanceof Error&&(ne+=`: ${G.message}`),new PassportError(ne,IE.LINK_WALLET_GENERIC_ERROR)}finally{K.addEvent("End")}}},PassportError:PassportError,get ProviderErrorCode(){return KE},get ProviderEvent(){return zE},get RpcErrorCode(){return JE}}),dP=getDefaultExportFromCjs$1("object"==typeof self?self.FormData:window.FormData);const uP="6.11.1";function _assertClassBrand(G,K,ne){if("function"==typeof G?G===K:G.has(K))return arguments.length<3?K:ne;throw new TypeError("Private element is not present on this object")}function _classPrivateFieldGet2(G,K){return G.get(_assertClassBrand(G,K))}function _classPrivateFieldSet2(G,K,ne){return G.set(_assertClassBrand(G,K),ne),ne}function _toPropertyKey(G){var K=function _toPrimitive(G,K){if("object"!=typeof G||!G)return G;var ne=G[Symbol.toPrimitive];if(void 0!==ne){var ue=ne.call(G,K||"default");if("object"!=typeof ue)return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===K?String:Number)(G)}(G,"string");return"symbol"==typeof K?K:K+""}function _defineProperty(G,K,ne){return(K=_toPropertyKey(K))in G?Object.defineProperty(G,K,{value:ne,enumerable:!0,configurable:!0,writable:!0}):G[K]=ne,G}function _checkPrivateRedeclaration(G,K){if(K.has(G))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldInitSpec(G,K,ne){_checkPrivateRedeclaration(G,K),K.set(G,ne)}function _classPrivateMethodInitSpec(G,K){_checkPrivateRedeclaration(G,K),K.add(G)}function checkType(G,K,ne){const ue=K.split("|").map((G=>G.trim()));for(let ne=0;ne<ue.length;ne++)switch(K){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof G===K)return}const pe=new Error(`invalid value for type ${K}`);throw pe.code="INVALID_ARGUMENT",pe.argument=`value.${ne}`,pe.value=G,pe}async function resolveProperties$1(G){const K=Object.keys(G),ne=await Promise.all(K.map((K=>Promise.resolve(G[K]))));return ne.reduce(((G,ne,ue)=>(G[K[ue]]=ne,G)),{})}function defineProperties(G,K,ne){for(let ue in K){let pe=K[ue];const he=ne?ne[ue]:null;he&&checkType(pe,he,ue),Object.defineProperty(G,ue,{enumerable:!0,value:pe,writable:!1})}}function stringify(G){if(null==G)return"null";if(Array.isArray(G))return"[ "+G.map(stringify).join(", ")+" ]";if(G instanceof Uint8Array){const K="0123456789abcdef";let ne="0x";for(let ue=0;ue<G.length;ue++)ne+=K[G[ue]>>4],ne+=K[15&G[ue]];return ne}if("object"==typeof G&&"function"==typeof G.toJSON)return stringify(G.toJSON());switch(typeof G){case"boolean":case"symbol":case"number":return G.toString();case"bigint":return BigInt(G).toString();case"string":return JSON.stringify(G);case"object":{const K=Object.keys(G);return K.sort(),"{ "+K.map((K=>`${stringify(K)}: ${stringify(G[K])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function isError(G,K){return G&&G.code===K}function isCallException(G){return isError(G,"CALL_EXCEPTION")}function makeError(G,K,ne){let ue,pe=G;{const ue=[];if(ne){if("message"in ne||"code"in ne||"name"in ne)throw new Error(`value will overwrite populated values: ${stringify(ne)}`);for(const G in ne){if("shortMessage"===G)continue;const K=ne[G];ue.push(G+"="+stringify(K))}}ue.push(`code=${K}`),ue.push(`version=${uP}`),ue.length&&(G+=" ("+ue.join(", ")+")")}switch(K){case"INVALID_ARGUMENT":ue=new TypeError(G);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":ue=new RangeError(G);break;default:ue=new Error(G)}return defineProperties(ue,{code:K}),ne&&Object.assign(ue,ne),null==ue.shortMessage&&defineProperties(ue,{shortMessage:pe}),ue}function assert(G,K,ne,ue){if(!G)throw makeError(K,ne,ue)}function assertArgument(G,K,ne,ue){assert(G,K,"INVALID_ARGUMENT",{argument:ne,value:ue})}function assertArgumentCount(G,K,ne){null==ne&&(ne=""),ne&&(ne=": "+ne),assert(G>=K,"missing arguemnt"+ne,"MISSING_ARGUMENT",{count:G,expectedCount:K}),assert(G<=K,"too many arguments"+ne,"UNEXPECTED_ARGUMENT",{count:G,expectedCount:K})}function assertPrivate(G,K,ne){if(null==ne&&(ne=""),G!==K){let G=ne,K="new";ne&&(G+=".",K+=" "+ne),assert(!1,`private constructor; use ${G}from* methods`,"UNSUPPORTED_OPERATION",{operation:K})}}function _getBytes(G,K,ne){if(G instanceof Uint8Array)return ne?new Uint8Array(G):G;if("string"==typeof G&&G.match(/^0x([0-9a-f][0-9a-f])*$/i)){const K=new Uint8Array((G.length-2)/2);let ne=2;for(let ue=0;ue<K.length;ue++)K[ue]=parseInt(G.substring(ne,ne+2),16),ne+=2;return K}assertArgument(!1,"invalid BytesLike value",K||"value",G)}function getBytes(G,K){return _getBytes(G,K,!1)}function getBytesCopy(G,K){return _getBytes(G,K,!0)}function isHexString$1(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof K||G.length===2+2*K)&&(!0!==K||G.length%2==0))}["NFD","NFC","NFKD","NFKC"].reduce(((G,K)=>{try{if("test"!=="test".normalize(K))throw new Error("bad");if("NFD"===K){const G=String.fromCharCode(233).normalize("NFD");if(G!==String.fromCharCode(101,769))throw new Error("broken")}G.push(K)}catch(G){}return G}),[]);const fP="0123456789abcdef";function hexlify$1(G){const K=getBytes(G);let ne="0x";for(let G=0;G<K.length;G++){const ue=K[G];ne+=fP[(240&ue)>>4]+fP[15&ue]}return ne}function concat$1(G){return"0x"+G.map((G=>hexlify$1(G).substring(2))).join("")}function dataLength(G){return isHexString$1(G,!0)?(G.length-2)/2:getBytes(G).length}function dataSlice(G,K,ne){const ue=getBytes(G);return null!=ne&&ne>ue.length&&assert(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:ue,length:ue.length,offset:ne}),hexlify$1(ue.slice(null==K?0:K,null==ne?ue.length:ne))}function zeroPad$1(G,K,ne){const ue=getBytes(G);assert(K>=ue.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(ue),length:K,offset:K+1});const pe=new Uint8Array(K);return pe.fill(0),ne?pe.set(ue,K-ue.length):pe.set(ue,0),hexlify$1(pe)}function zeroPadValue(G,K){return zeroPad$1(G,K,!0)}const lP=BigInt(0),pP=BigInt(1),hP=9007199254740991;function toTwos(G,K){let ne=getBigInt(G,"value");const ue=BigInt(getNumber(K,"width")),pe=pP<<ue-pP;if(ne<lP){ne=-ne,assert(ne<=pe,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:G});return(~ne&(pP<<ue)-pP)+pP}return assert(ne<pe,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:G}),ne}function mask(G,K){const ne=getUint(G,"value"),ue=BigInt(getNumber(K,"bits"));return ne&(pP<<ue)-pP}function getBigInt(G,K){switch(typeof G){case"bigint":return G;case"number":return assertArgument(Number.isInteger(G),"underflow",K||"value",G),assertArgument(G>=-hP&&G<=hP,"overflow",K||"value",G),BigInt(G);case"string":try{if(""===G)throw new Error("empty string");return"-"===G[0]&&"-"!==G[1]?-BigInt(G.substring(1)):BigInt(G)}catch(ne){assertArgument(!1,`invalid BigNumberish string: ${ne.message}`,K||"value",G)}}assertArgument(!1,"invalid BigNumberish value",K||"value",G)}function getUint(G,K){const ne=getBigInt(G,K);return assert(ne>=lP,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:G}),ne}const yP="0123456789abcdef";function toBigInt(G){if(G instanceof Uint8Array){let K="0x0";for(const ne of G)K+=yP[ne>>4],K+=yP[15&ne];return BigInt(K)}return getBigInt(G)}function getNumber(G,K){switch(typeof G){case"bigint":return assertArgument(G>=-hP&&G<=hP,"overflow",K||"value",G),Number(G);case"number":return assertArgument(Number.isInteger(G),"underflow",K||"value",G),assertArgument(G>=-hP&&G<=hP,"overflow",K||"value",G),G;case"string":try{if(""===G)throw new Error("empty string");return getNumber(BigInt(G),K)}catch(ne){assertArgument(!1,`invalid numeric string: ${ne.message}`,K||"value",G)}}assertArgument(!1,"invalid numeric value",K||"value",G)}function toBeHex(G,K){let ne=getUint(G,"value").toString(16);if(null==K)ne.length%2&&(ne="0"+ne);else{const ue=getNumber(K,"width");for(assert(2*ue>=ne.length,`value exceeds width (${ue} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:G});ne.length<2*ue;)ne="0"+ne}return"0x"+ne}function toBeArray(G){const K=getUint(G,"value");if(K===lP)return new Uint8Array([]);let ne=K.toString(16);ne.length%2&&(ne="0"+ne);const ue=new Uint8Array(ne.length/2);for(let G=0;G<ue.length;G++){const K=2*G;ue[G]=parseInt(ne.substring(K,K+2),16)}return ue}function toQuantity(G){let K=hexlify$1(function isBytesLike$1(G){return isHexString$1(G,!0)||G instanceof Uint8Array}(G)?G:toBeArray(G)).substring(2);for(;K.startsWith("0");)K=K.substring(1);return""===K&&(K="0"),"0x"+K}const mP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const bP=BigInt(58);var gP=new WeakMap;class EventPayload{constructor(G,K,ne){_defineProperty(this,"filter",void 0),_defineProperty(this,"emitter",void 0),_classPrivateFieldInitSpec(this,gP,void 0),_classPrivateFieldSet2(gP,this,K),defineProperties(this,{emitter:G,filter:ne})}async removeListener(){null!=_classPrivateFieldGet2(gP,this)&&await this.emitter.off(this.filter,_classPrivateFieldGet2(gP,this))}}function ignoreFunc$1(G,K,ne,ue,pe){if("BAD_PREFIX"===G||"UNEXPECTED_CONTINUE"===G){let G=0;for(let ue=K+1;ue<ne.length&&ne[ue]>>6==2;ue++)G++;return G}return"OVERRUN"===G?ne.length-K-1:0}const vP=Object.freeze({error:function errorFunc$1(G,K,ne,ue,pe){assertArgument(!1,`invalid codepoint at offset ${K}; ${G}`,"bytes",ne)},ignore:ignoreFunc$1,replace:function replaceFunc$1(G,K,ne,ue,pe){return"OVERLONG"===G?(assertArgument("number"==typeof pe,"invalid bad code point for replacement","badCodepoint",pe),ue.push(pe),0):(ue.push(65533),ignoreFunc$1(G,K,ne))}});function toUtf8Bytes$1(G,K){assertArgument("string"==typeof G,"invalid string value","str",G);let ne=[];for(let K=0;K<G.length;K++){const ue=G.charCodeAt(K);if(ue<128)ne.push(ue);else if(ue<2048)ne.push(ue>>6|192),ne.push(63&ue|128);else if(55296==(64512&ue)){K++;const pe=G.charCodeAt(K);assertArgument(K<G.length&&56320==(64512&pe),"invalid surrogate pair","str",G);const he=65536+((1023&ue)<<10)+(1023&pe);ne.push(he>>18|240),ne.push(he>>12&63|128),ne.push(he>>6&63|128),ne.push(63&he|128)}else ne.push(ue>>12|224),ne.push(ue>>6&63|128),ne.push(63&ue|128)}return new Uint8Array(ne)}function toUtf8String$1(G,K){return function _toUtf8String$1(G){return G.map((G=>G<=65535?String.fromCharCode(G):(G-=65536,String.fromCharCode(55296+(G>>10&1023),56320+(1023&G))))).join("")}(function getUtf8CodePoints$1(G,K){null==K&&(K=vP.error);const ne=getBytes(G,"bytes"),ue=[];let pe=0;for(;pe<ne.length;){const G=ne[pe++];if(G>>7==0){ue.push(G);continue}let he=null,ye=null;if(192==(224&G))he=1,ye=127;else if(224==(240&G))he=2,ye=2047;else{if(240!=(248&G)){pe+=K(128==(192&G)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",pe-1,ne,ue);continue}he=3,ye=65535}if(pe-1+he>=ne.length){pe+=K("OVERRUN",pe-1,ne,ue);continue}let me=G&(1<<8-he-1)-1;for(let G=0;G<he;G++){let G=ne[pe];if(128!=(192&G)){pe+=K("MISSING_CONTINUE",pe,ne,ue),me=null;break}me=me<<6|63&G,pe++}null!==me&&(me>1114111?pe+=K("OUT_OF_RANGE",pe-1-he,ne,ue,me):me>=55296&&me<=57343?pe+=K("UTF16_SURROGATE",pe-1-he,ne,ue,me):me<=ye?pe+=K("OVERLONG",pe-1-he,ne,ue,me):ue.push(me))}return ue}(G,K))}function createGetUrl(G){return async function getUrl(G,K){const ne=G.url.split(":")[0].toLowerCase();let ue;if(assert("http"===ne||"https"===ne,`unsupported protocol ${ne}`,"UNSUPPORTED_OPERATION",{info:{protocol:ne},operation:"request"}),assert("https"===ne||!G.credentials||G.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"}),K){const G=new AbortController;ue=G.signal,K.addListener((()=>{G.abort()}))}const pe={method:G.method,headers:new Headers(Array.from(G)),body:G.body||void 0,signal:ue},he=await fetch(G.url,pe),ye={};he.headers.forEach(((G,K)=>{ye[K.toLowerCase()]=G}));const me=await he.arrayBuffer(),be=null==me?null:new Uint8Array(me);return{statusCode:he.status,statusMessage:he.statusText,headers:ye,body:be}}}let wP=createGetUrl();const _P=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),TP=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let AP=!1;async function dataGatewayFunc(G,K){try{const K=G.match(_P);if(!K)throw new Error("invalid data");return new FetchResponse(200,"OK",{"content-type":K[1]||"text/plain"},K[2]?function decodeBase64(G){G=atob(G);const K=new Uint8Array(G.length);for(let ne=0;ne<G.length;ne++)K[ne]=G.charCodeAt(ne);return getBytes(K)}(K[3]):function unpercent(G){return toUtf8Bytes$1(G.replace(/%([0-9a-f][0-9a-f])/gi,((G,K)=>String.fromCharCode(parseInt(K,16)))))}(K[3]))}catch(K){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(G))}}function getIpfsGatewayFunc(G){return async function gatewayIpfs(K,ne){try{const ne=K.match(TP);if(!ne)throw new Error("invalid link");return new FetchRequest(`${G}${ne[2]}`)}catch(G){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(K))}}}const EP={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")},PP=new WeakMap;var SP=new WeakMap,IP=new WeakMap;class FetchCancelSignal{constructor(G){_classPrivateFieldInitSpec(this,SP,void 0),_classPrivateFieldInitSpec(this,IP,void 0),_classPrivateFieldSet2(SP,this,[]),_classPrivateFieldSet2(IP,this,!1),PP.set(G,(()=>{if(!_classPrivateFieldGet2(IP,this)){_classPrivateFieldSet2(IP,this,!0);for(const G of _classPrivateFieldGet2(SP,this))setTimeout((()=>{G()}),0);_classPrivateFieldSet2(SP,this,[])}}))}addListener(G){assert(!_classPrivateFieldGet2(IP,this),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),_classPrivateFieldGet2(SP,this).push(G)}get cancelled(){return _classPrivateFieldGet2(IP,this)}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(G){if(null==G)throw new Error("missing signal; should not happen");return G.checkSignal(),G}var CP=new WeakMap,RP=new WeakMap,kP=new WeakMap,OP=new WeakMap,xP=new WeakMap,NP=new WeakMap,MP=new WeakMap,BP=new WeakMap,FP=new WeakMap,DP=new WeakMap,LP=new WeakMap,UP=new WeakMap,$P=new WeakMap,qP=new WeakMap,GP=new WeakMap,jP=new WeakSet;class FetchRequest{get url(){return _classPrivateFieldGet2(NP,this)}set url(G){_classPrivateFieldSet2(NP,this,String(G))}get body(){return null==_classPrivateFieldGet2(MP,this)?null:new Uint8Array(_classPrivateFieldGet2(MP,this))}set body(G){if(null==G)_classPrivateFieldSet2(MP,this,void 0),_classPrivateFieldSet2(BP,this,void 0);else if("string"==typeof G)_classPrivateFieldSet2(MP,this,toUtf8Bytes$1(G)),_classPrivateFieldSet2(BP,this,"text/plain");else if(G instanceof Uint8Array)_classPrivateFieldSet2(MP,this,G),_classPrivateFieldSet2(BP,this,"application/octet-stream");else{if("object"!=typeof G)throw new Error("invalid body");_classPrivateFieldSet2(MP,this,toUtf8Bytes$1(JSON.stringify(G))),_classPrivateFieldSet2(BP,this,"application/json")}}hasBody(){return null!=_classPrivateFieldGet2(MP,this)}get method(){return _classPrivateFieldGet2(OP,this)?_classPrivateFieldGet2(OP,this):this.hasBody()?"POST":"GET"}set method(G){null==G&&(G=""),_classPrivateFieldSet2(OP,this,String(G).toUpperCase())}get headers(){const G=Object.assign({},_classPrivateFieldGet2(kP,this));return _classPrivateFieldGet2(FP,this)&&(G.authorization=`Basic ${function encodeBase64(G){const K=getBytes(G);let ne="";for(let G=0;G<K.length;G++)ne+=String.fromCharCode(K[G]);return btoa(ne)}(toUtf8Bytes$1(_classPrivateFieldGet2(FP,this)))}`),this.allowGzip&&(G["accept-encoding"]="gzip"),null==G["content-type"]&&_classPrivateFieldGet2(BP,this)&&(G["content-type"]=_classPrivateFieldGet2(BP,this)),this.body&&(G["content-length"]=String(this.body.length)),G}getHeader(G){return this.headers[G.toLowerCase()]}setHeader(G,K){_classPrivateFieldGet2(kP,this)[String(G).toLowerCase()]=String(K)}clearHeaders(){_classPrivateFieldSet2(kP,this,{})}[Symbol.iterator](){const G=this.headers,K=Object.keys(G);let ne=0;return{next:()=>{if(ne<K.length){const ue=K[ne++];return{value:[ue,G[ue]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return _classPrivateFieldGet2(FP,this)||null}setCredentials(G,K){assertArgument(!G.match(/:/),"invalid basic authentication username","username","[REDACTED]"),_classPrivateFieldSet2(FP,this,`${G}:${K}`)}get allowGzip(){return _classPrivateFieldGet2(RP,this)}set allowGzip(G){_classPrivateFieldSet2(RP,this,!!G)}get allowInsecureAuthentication(){return!!_classPrivateFieldGet2(CP,this)}set allowInsecureAuthentication(G){_classPrivateFieldSet2(CP,this,!!G)}get timeout(){return _classPrivateFieldGet2(xP,this)}set timeout(G){assertArgument(G>=0,"timeout must be non-zero","timeout",G),_classPrivateFieldSet2(xP,this,G)}get preflightFunc(){return _classPrivateFieldGet2(DP,this)||null}set preflightFunc(G){_classPrivateFieldSet2(DP,this,G)}get processFunc(){return _classPrivateFieldGet2(LP,this)||null}set processFunc(G){_classPrivateFieldSet2(LP,this,G)}get retryFunc(){return _classPrivateFieldGet2(UP,this)||null}set retryFunc(G){_classPrivateFieldSet2(UP,this,G)}get getUrlFunc(){return _classPrivateFieldGet2(GP,this)||wP}set getUrlFunc(G){_classPrivateFieldSet2(GP,this,G)}constructor(G){_classPrivateMethodInitSpec(this,jP),_classPrivateFieldInitSpec(this,CP,void 0),_classPrivateFieldInitSpec(this,RP,void 0),_classPrivateFieldInitSpec(this,kP,void 0),_classPrivateFieldInitSpec(this,OP,void 0),_classPrivateFieldInitSpec(this,xP,void 0),_classPrivateFieldInitSpec(this,NP,void 0),_classPrivateFieldInitSpec(this,MP,void 0),_classPrivateFieldInitSpec(this,BP,void 0),_classPrivateFieldInitSpec(this,FP,void 0),_classPrivateFieldInitSpec(this,DP,void 0),_classPrivateFieldInitSpec(this,LP,void 0),_classPrivateFieldInitSpec(this,UP,void 0),_classPrivateFieldInitSpec(this,$P,void 0),_classPrivateFieldInitSpec(this,qP,void 0),_classPrivateFieldInitSpec(this,GP,void 0),_classPrivateFieldSet2(NP,this,String(G)),_classPrivateFieldSet2(CP,this,!1),_classPrivateFieldSet2(RP,this,!0),_classPrivateFieldSet2(kP,this,{}),_classPrivateFieldSet2(OP,this,""),_classPrivateFieldSet2(xP,this,3e5),_classPrivateFieldSet2(qP,this,{slotInterval:250,maxAttempts:12}),_classPrivateFieldSet2(GP,this,null)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${_classPrivateFieldGet2(MP,this)?hexlify$1(_classPrivateFieldGet2(MP,this)):"null"}>`}setThrottleParams(G){null!=G.slotInterval&&(_classPrivateFieldGet2(qP,this).slotInterval=G.slotInterval),null!=G.maxAttempts&&(_classPrivateFieldGet2(qP,this).maxAttempts=G.maxAttempts)}send(){return assert(null==_classPrivateFieldGet2($P,this),"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),_classPrivateFieldSet2($P,this,new FetchCancelSignal(this)),_assertClassBrand(jP,this,_send).call(this,0,getTime$1()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(null!=_classPrivateFieldGet2($P,this),"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const G=PP.get(this);if(!G)throw new Error("missing signal; should not happen");G()}redirect(G){const K=this.url.split(":")[0].toLowerCase(),ne=G.split(":")[0].toLowerCase();assert("GET"===this.method&&("https"!==K||"http"!==ne)&&G.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(G)})`});const ue=new FetchRequest(G);return ue.method="GET",ue.allowGzip=this.allowGzip,ue.timeout=this.timeout,_classPrivateFieldSet2(kP,ue,Object.assign({},_classPrivateFieldGet2(kP,this))),_classPrivateFieldGet2(MP,this)&&_classPrivateFieldSet2(MP,ue,new Uint8Array(_classPrivateFieldGet2(MP,this))),_classPrivateFieldSet2(BP,ue,_classPrivateFieldGet2(BP,this)),ue}clone(){const G=new FetchRequest(this.url);return _classPrivateFieldSet2(OP,G,_classPrivateFieldGet2(OP,this)),_classPrivateFieldGet2(MP,this)&&_classPrivateFieldSet2(MP,G,_classPrivateFieldGet2(MP,this)),_classPrivateFieldSet2(BP,G,_classPrivateFieldGet2(BP,this)),_classPrivateFieldSet2(kP,G,Object.assign({},_classPrivateFieldGet2(kP,this))),_classPrivateFieldSet2(FP,G,_classPrivateFieldGet2(FP,this)),this.allowGzip&&(G.allowGzip=!0),G.timeout=this.timeout,this.allowInsecureAuthentication&&(G.allowInsecureAuthentication=!0),_classPrivateFieldSet2(DP,G,_classPrivateFieldGet2(DP,this)),_classPrivateFieldSet2(LP,G,_classPrivateFieldGet2(LP,this)),_classPrivateFieldSet2(UP,G,_classPrivateFieldGet2(UP,this)),_classPrivateFieldSet2(GP,G,_classPrivateFieldGet2(GP,this)),G}static lockConfig(){AP=!0}static getGateway(G){return EP[G.toLowerCase()]||null}static registerGateway(G,K){if("http"===(G=G.toLowerCase())||"https"===G)throw new Error(`cannot intercept ${G}; use registerGetUrl`);if(AP)throw new Error("gateways locked");EP[G]=K}static registerGetUrl(G){if(AP)throw new Error("gateways locked");wP=G}static createGetUrlFunc(G){return createGetUrl()}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(G){return getIpfsGatewayFunc(G)}}async function _send(G,K,ne,ue,pe){if(G>=_classPrivateFieldGet2(qP,this).maxAttempts)return pe.makeServerError("exceeded maximum retry limit");assert(getTime$1()<=K,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:ue}),ne>0&&await function wait(G){return new Promise((K=>setTimeout(K,G)))}(ne);let he=this.clone();const ye=(he.url.split(":")[0]||"").toLowerCase();if(ye in EP){const G=await EP[ye](he.url,checkSignal(_classPrivateFieldGet2($P,ue)));if(G instanceof FetchResponse){let K=G;if(this.processFunc){checkSignal(_classPrivateFieldGet2($P,ue));try{K=await this.processFunc(he,K)}catch(G){null!=G.throttle&&"number"==typeof G.stall||K.makeServerError("error in post-processing function",G).assertOk()}}return K}he=G}this.preflightFunc&&(he=await this.preflightFunc(he));const me=await this.getUrlFunc(he,checkSignal(_classPrivateFieldGet2($P,ue)));let be=new FetchResponse(me.statusCode,me.statusMessage,me.headers,me.body,ue);if(301===be.statusCode||302===be.statusCode){try{var ve;const ne=be.headers.location||"";return _assertClassBrand(jP,ve=he.redirect(ne),_send).call(ve,G+1,K,0,ue,be)}catch(G){}return be}if(429===be.statusCode&&(null==this.retryFunc||await this.retryFunc(he,be,G))){var _e;const ne=be.headers["retry-after"];let pe=_classPrivateFieldGet2(qP,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,G));return"string"==typeof ne&&ne.match(/^[1-9][0-9]*$/)&&(pe=parseInt(ne)),_assertClassBrand(jP,_e=he.clone(),_send).call(_e,G+1,K,pe,ue,be)}if(this.processFunc){checkSignal(_classPrivateFieldGet2($P,ue));try{be=await this.processFunc(he,be)}catch(ne){var Te;null!=ne.throttle&&"number"==typeof ne.stall||be.makeServerError("error in post-processing function",ne).assertOk();let pe=_classPrivateFieldGet2(qP,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,G));return ne.stall>=0&&(pe=ne.stall),_assertClassBrand(jP,Te=he.clone(),_send).call(Te,G+1,K,pe,ue,be)}}return be}var HP=new WeakMap,WP=new WeakMap,zP=new WeakMap,VP=new WeakMap,KP=new WeakMap,JP=new WeakMap;class FetchResponse{toString(){return`<FetchResponse status=${this.statusCode} body=${_classPrivateFieldGet2(VP,this)?hexlify$1(_classPrivateFieldGet2(VP,this)):"null"}>`}get statusCode(){return _classPrivateFieldGet2(HP,this)}get statusMessage(){return _classPrivateFieldGet2(WP,this)}get headers(){return Object.assign({},_classPrivateFieldGet2(zP,this))}get body(){return null==_classPrivateFieldGet2(VP,this)?null:new Uint8Array(_classPrivateFieldGet2(VP,this))}get bodyText(){try{return null==_classPrivateFieldGet2(VP,this)?"":toUtf8String$1(_classPrivateFieldGet2(VP,this))}catch(G){assert(!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(G){assert(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const G=this.headers,K=Object.keys(G);let ne=0;return{next:()=>{if(ne<K.length){const ue=K[ne++];return{value:[ue,G[ue]],done:!1}}return{value:void 0,done:!0}}}}constructor(G,K,ne,ue,pe){_classPrivateFieldInitSpec(this,HP,void 0),_classPrivateFieldInitSpec(this,WP,void 0),_classPrivateFieldInitSpec(this,zP,void 0),_classPrivateFieldInitSpec(this,VP,void 0),_classPrivateFieldInitSpec(this,KP,void 0),_classPrivateFieldInitSpec(this,JP,void 0),_classPrivateFieldSet2(HP,this,G),_classPrivateFieldSet2(WP,this,K),_classPrivateFieldSet2(zP,this,Object.keys(ne).reduce(((G,K)=>(G[K.toLowerCase()]=String(ne[K]),G)),{})),_classPrivateFieldSet2(VP,this,null==ue?null:new Uint8Array(ue)),_classPrivateFieldSet2(KP,this,pe||null),_classPrivateFieldSet2(JP,this,{message:""})}makeServerError(G,K){let ne;ne=G?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${G})`:`CLIENT ESCALATED SERVER ERROR (${G=`${this.statusCode} ${this.statusMessage}`})`;const ue=new FetchResponse(599,ne,this.headers,this.body,_classPrivateFieldGet2(KP,this)||void 0);return _classPrivateFieldSet2(JP,ue,{message:G,error:K}),ue}throwThrottleError(G,K){null==K?K=-1:assertArgument(Number.isInteger(K)&&K>=0,"invalid stall timeout","stall",K);const ne=new Error(G||"throttling requests");throw defineProperties(ne,{stall:K,throttle:!0}),ne}getHeader(G){return this.headers[G.toLowerCase()]}hasBody(){return null!=_classPrivateFieldGet2(VP,this)}get request(){return _classPrivateFieldGet2(KP,this)}ok(){return""===_classPrivateFieldGet2(JP,this).message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:G,error:K}=_classPrivateFieldGet2(JP,this);""===G&&(G=`server response ${this.statusCode} ${this.statusMessage}`);let ne=null;this.request&&(ne=this.request.url);let ue=null;try{_classPrivateFieldGet2(VP,this)&&(ue=toUtf8String$1(_classPrivateFieldGet2(VP,this)))}catch(G){}assert(!1,G,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:K,info:{requestUrl:ne,responseBody:ue,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function getTime$1(){return(new Date).getTime()}function hexlifyByte(G){let K=G.toString(16);for(;K.length<2;)K="0"+K;return"0x"+K}function unarrayifyInteger(G,K,ne){let ue=0;for(let pe=0;pe<ne;pe++)ue=256*ue+G[K+pe];return ue}function _decodeChildren(G,K,ne,ue){const pe=[];for(;ne<K+1+ue;){const he=_decode(G,ne);pe.push(he.result),assert((ne+=he.consumed)<=K+1+ue,"child data too short","BUFFER_OVERRUN",{buffer:G,length:ue,offset:K})}return{consumed:1+ue,result:pe}}function _decode(G,K){assert(0!==G.length,"data too short","BUFFER_OVERRUN",{buffer:G,length:0,offset:1});const checkOffset=K=>{assert(K<=G.length,"data short segment too short","BUFFER_OVERRUN",{buffer:G,length:G.length,offset:K})};if(G[K]>=248){const ne=G[K]-247;checkOffset(K+1+ne);const ue=unarrayifyInteger(G,K+1,ne);return checkOffset(K+1+ne+ue),_decodeChildren(G,K,K+1+ne,ne+ue)}if(G[K]>=192){const ne=G[K]-192;return checkOffset(K+1+ne),_decodeChildren(G,K,K+1,ne)}if(G[K]>=184){const ne=G[K]-183;checkOffset(K+1+ne);const ue=unarrayifyInteger(G,K+1,ne);checkOffset(K+1+ne+ue);return{consumed:1+ne+ue,result:hexlify$1(G.slice(K+1+ne,K+1+ne+ue))}}if(G[K]>=128){const ne=G[K]-128;checkOffset(K+1+ne);return{consumed:1+ne,result:hexlify$1(G.slice(K+1,K+1+ne))}}return{consumed:1,result:hexlifyByte(G[K])}}function decodeRlp(G){const K=getBytes(G,"data"),ne=_decode(K,0);return assertArgument(ne.consumed===K.length,"unexpected junk after rlp payload","data",G),ne.result}function arrayifyInteger$1(G){const K=[];for(;G;)K.unshift(255&G),G>>=8;return K}function _encode$1(G){if(Array.isArray(G)){let K=[];if(G.forEach((function(G){K=K.concat(_encode$1(G))})),K.length<=55)return K.unshift(192+K.length),K;const ne=arrayifyInteger$1(K.length);return ne.unshift(247+ne.length),ne.concat(K)}const K=Array.prototype.slice.call(getBytes(G,"object"));if(1===K.length&&K[0]<=127)return K;if(K.length<=55)return K.unshift(128+K.length),K;const ne=arrayifyInteger$1(K.length);return ne.unshift(183+ne.length),ne.concat(K)}const XP="0123456789abcdef";function encodeRlp(G){let K="0x";for(const ne of _encode$1(G))K+=XP[ne>>4],K+=XP[15&ne];return K}const QP=32,ZP=new Uint8Array(QP),YP=["then"],eS={};function throwError(G,K){const ne=new Error(`deferred error during ABI decoding triggered accessing ${G}`);throw ne.error=K,ne}var tS=new WeakMap;class Result extends Array{constructor(...G){const K=G[0];let ne=G[1],ue=(G[2]||[]).slice(),pe=!0;K!==eS&&(ne=G,ue=[],pe=!1),super(ne.length),_classPrivateFieldInitSpec(this,tS,void 0),ne.forEach(((G,K)=>{this[K]=G}));const he=ue.reduce(((G,K)=>("string"==typeof K&&G.set(K,(G.get(K)||0)+1),G)),new Map);if(_classPrivateFieldSet2(tS,this,Object.freeze(ne.map(((G,K)=>{const ne=ue[K];return null!=ne&&1===he.get(ne)?ne:null})))),pe)return Object.freeze(this),new Proxy(this,{get:(G,K,ne)=>{if("string"==typeof K){if(K.match(/^[0-9]+$/)){const ne=getNumber(K,"%index");if(ne<0||ne>=this.length)throw new RangeError("out of result range");const ue=G[ne];return ue instanceof Error&&throwError(`index ${ne}`,ue),ue}if(YP.indexOf(K)>=0)return Reflect.get(G,K,ne);const ue=G[K];if(ue instanceof Function)return function(...K){return ue.apply(this===ne?G:this,K)};if(!(K in G))return G.getValue.apply(this===ne?G:this,[K])}return Reflect.get(G,K,ne)}})}toArray(){const G=[];return this.forEach(((K,ne)=>{K instanceof Error&&throwError(`index ${ne}`,K),G.push(K)})),G}toObject(){return _classPrivateFieldGet2(tS,this).reduce(((G,K,ne)=>(assert(null!=K,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),K in G||(G[K]=this.getValue(K)),G)),{})}slice(G,K){null==G&&(G=0),G<0&&(G+=this.length)<0&&(G=0),null==K&&(K=this.length),K<0&&(K+=this.length)<0&&(K=0),K>this.length&&(K=this.length);const ne=[],ue=[];for(let pe=G;pe<K;pe++)ne.push(this[pe]),ue.push(_classPrivateFieldGet2(tS,this)[pe]);return new Result(eS,ne,ue)}filter(G,K){const ne=[],ue=[];for(let pe=0;pe<this.length;pe++){const he=this[pe];he instanceof Error&&throwError(`index ${pe}`,he),G.call(K,he,pe,this)&&(ne.push(he),ue.push(_classPrivateFieldGet2(tS,this)[pe]))}return new Result(eS,ne,ue)}map(G,K){const ne=[];for(let ue=0;ue<this.length;ue++){const pe=this[ue];pe instanceof Error&&throwError(`index ${ue}`,pe),ne.push(G.call(K,pe,ue,this))}return ne}getValue(G){const K=_classPrivateFieldGet2(tS,this).indexOf(G);if(-1===K)return;const ne=this[K];return ne instanceof Error&&throwError(`property ${JSON.stringify(G)}`,ne.error),ne}static fromItems(G,K){return new Result(eS,G,K)}}function getValue$1(G){let K=toBeArray(G);return assert(K.length<=QP,"value out-of-bounds","BUFFER_OVERRUN",{buffer:K,length:QP,offset:K.length}),K.length!==QP&&(K=getBytesCopy(concat$1([ZP.slice(K.length%QP),K]))),K}let rS=class Coder{constructor(G,K,ne,ue){_defineProperty(this,"name",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"localName",void 0),_defineProperty(this,"dynamic",void 0),defineProperties(this,{name:G,type:K,localName:ne,dynamic:ue},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(G,K){assertArgument(!1,G,this.localName,K)}};var nS=new WeakMap,aS=new WeakMap,iS=new WeakSet;let sS=class Writer{constructor(){_classPrivateMethodInitSpec(this,iS),_classPrivateFieldInitSpec(this,nS,void 0),_classPrivateFieldInitSpec(this,aS,void 0),_classPrivateFieldSet2(nS,this,[]),_classPrivateFieldSet2(aS,this,0)}get data(){return concat$1(_classPrivateFieldGet2(nS,this))}get length(){return _classPrivateFieldGet2(aS,this)}appendWriter(G){return _assertClassBrand(iS,this,_writeData).call(this,getBytesCopy(G.data))}writeBytes(G){let K=getBytesCopy(G);const ne=K.length%QP;return ne&&(K=getBytesCopy(concat$1([K,ZP.slice(ne)]))),_assertClassBrand(iS,this,_writeData).call(this,K)}writeValue(G){return _assertClassBrand(iS,this,_writeData).call(this,getValue$1(G))}writeUpdatableValue(){const G=_classPrivateFieldGet2(nS,this).length;return _classPrivateFieldGet2(nS,this).push(ZP),_classPrivateFieldSet2(aS,this,_classPrivateFieldGet2(aS,this)+QP),K=>{_classPrivateFieldGet2(nS,this)[G]=getValue$1(K)}}};function _writeData(G){return _classPrivateFieldGet2(nS,this).push(G),_classPrivateFieldSet2(aS,this,_classPrivateFieldGet2(aS,this)+G.length),G.length}var oS=new WeakMap,cS=new WeakMap,dS=new WeakMap,uS=new WeakMap,fS=new WeakMap,lS=new WeakSet;function _incrementBytesRead(G){var K;if(_classPrivateFieldGet2(uS,this))return _assertClassBrand(lS,K=_classPrivateFieldGet2(uS,this),_incrementBytesRead).call(K,G);_classPrivateFieldSet2(dS,this,_classPrivateFieldGet2(dS,this)+G),assert(_classPrivateFieldGet2(fS,this)<1||_classPrivateFieldGet2(dS,this)<=_classPrivateFieldGet2(fS,this)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${_classPrivateFieldGet2(fS,this)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:getBytesCopy(_classPrivateFieldGet2(oS,this)),offset:_classPrivateFieldGet2(cS,this),length:G,info:{bytesRead:_classPrivateFieldGet2(dS,this),dataLength:this.dataLength}})}function _peekBytes(G,K,ne){let ue=Math.ceil(K/QP)*QP;return _classPrivateFieldGet2(cS,this)+ue>_classPrivateFieldGet2(oS,this).length&&(this.allowLoose&&ne&&_classPrivateFieldGet2(cS,this)+K<=_classPrivateFieldGet2(oS,this).length?ue=K:assert(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(_classPrivateFieldGet2(oS,this)),length:_classPrivateFieldGet2(oS,this).length,offset:_classPrivateFieldGet2(cS,this)+ue})),_classPrivateFieldGet2(oS,this).slice(_classPrivateFieldGet2(cS,this),_classPrivateFieldGet2(cS,this)+ue)}function number$2(G){if(!Number.isSafeInteger(G)||G<0)throw new Error(`Wrong positive integer: ${G}`)}function bytes$2(G,...K){if(!(G instanceof Uint8Array))throw new Error("Expected Uint8Array");if(K.length>0&&!K.includes(G.length))throw new Error(`Expected Uint8Array of length ${K}, not of length=${G.length}`)}function exists$1(G,K=!0){if(G.destroyed)throw new Error("Hash instance has been destroyed");if(K&&G.finished)throw new Error("Hash#digest() has already been called")}
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const u8a$2=G=>G instanceof Uint8Array;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function toBytes$1(G){if("string"==typeof G&&(G=function utf8ToBytes$2(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))}(G)),!u8a$2(G))throw new Error("expected Uint8Array, got "+typeof G);return G}let pS=class Hash{clone(){return this._cloneInto()}};const hS=BigInt(2**32-1),yS=BigInt(32);function fromBig(G,K=!1){return K?{h:Number(G&hS),l:Number(G>>yS&hS)}:{h:0|Number(G>>yS&hS),l:0|Number(G&hS)}}function split$1(G,K=!1){let ne=new Uint32Array(G.length),ue=new Uint32Array(G.length);for(let pe=0;pe<G.length;pe++){const{h:he,l:ye}=fromBig(G[pe],K);[ne[pe],ue[pe]]=[he,ye]}return[ne,ue]}const[mS,bS,gS]=[[],[],[]],vS=BigInt(0),wS=BigInt(1),_S=BigInt(2),TS=BigInt(7),AS=BigInt(256),ES=BigInt(113);for(let G=0,K=wS,ne=1,ue=0;G<24;G++){[ne,ue]=[ue,(2*ne+3*ue)%5],mS.push(2*(5*ue+ne)),bS.push((G+1)*(G+2)/2%64);let pe=vS;for(let G=0;G<7;G++)K=(K<<wS^(K>>TS)*ES)%AS,K&_S&&(pe^=wS<<(wS<<BigInt(G))-wS);gS.push(pe)}const[PS,SS]=split$1(gS,!0),rotlH=(G,K,ne)=>ne>32?((G,K,ne)=>K<<ne-32|G>>>64-ne)(G,K,ne):((G,K,ne)=>G<<ne|K>>>32-ne)(G,K,ne),rotlL=(G,K,ne)=>ne>32?((G,K,ne)=>G<<ne-32|K>>>64-ne)(G,K,ne):((G,K,ne)=>K<<ne|G>>>32-ne)(G,K,ne);class Keccak extends pS{constructor(G,K,ne,ue=!1,pe=24){if(super(),this.blockLen=G,this.suffix=K,this.outputLen=ne,this.enableXOF=ue,this.rounds=pe,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$2(ne),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var he;this.state=new Uint8Array(200),this.state32=(he=this.state,new Uint32Array(he.buffer,he.byteOffset,Math.floor(he.byteLength/4)))}keccak(){!function keccakP(G,K=24){const ne=new Uint32Array(10);for(let ue=24-K;ue<24;ue++){for(let K=0;K<10;K++)ne[K]=G[K]^G[K+10]^G[K+20]^G[K+30]^G[K+40];for(let K=0;K<10;K+=2){const ue=(K+8)%10,pe=(K+2)%10,he=ne[pe],ye=ne[pe+1],me=rotlH(he,ye,1)^ne[ue],be=rotlL(he,ye,1)^ne[ue+1];for(let ne=0;ne<50;ne+=10)G[K+ne]^=me,G[K+ne+1]^=be}let K=G[2],pe=G[3];for(let ne=0;ne<24;ne++){const ue=bS[ne],he=rotlH(K,pe,ue),ye=rotlL(K,pe,ue),me=mS[ne];K=G[me],pe=G[me+1],G[me]=he,G[me+1]=ye}for(let K=0;K<50;K+=10){for(let ue=0;ue<10;ue++)ne[ue]=G[K+ue];for(let ue=0;ue<10;ue++)G[K+ue]^=~ne[(ue+2)%10]&ne[(ue+4)%10]}G[0]^=PS[ue],G[1]^=SS[ue]}ne.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(G){exists$1(this);const{blockLen:K,state:ne}=this,ue=(G=toBytes$1(G)).length;for(let pe=0;pe<ue;){const he=Math.min(K-this.pos,ue-pe);for(let K=0;K<he;K++)ne[this.pos++]^=G[pe++];this.pos===K&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:G,suffix:K,pos:ne,blockLen:ue}=this;G[ne]^=K,0!=(128&K)&&ne===ue-1&&this.keccak(),G[ue-1]^=128,this.keccak()}writeInto(G){exists$1(this,!1),bytes$2(G),this.finish();const K=this.state,{blockLen:ne}=this;for(let ue=0,pe=G.length;ue<pe;){this.posOut>=ne&&this.keccak();const he=Math.min(ne-this.posOut,pe-ue);G.set(K.subarray(this.posOut,this.posOut+he),ue),this.posOut+=he,ue+=he}return G}xofInto(G){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(G)}xof(G){return number$2(G),this.xofInto(new Uint8Array(G))}digestInto(G){if(function output$1(G,K){bytes$2(G);const ne=K.outputLen;if(G.length<ne)throw new Error(`digestInto() expects output buffer of length at least ${ne}`)}(G,this),this.finished)throw new Error("digest() was already called");return this.writeInto(G),this.destroy(),G}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(G){const{blockLen:K,suffix:ne,outputLen:ue,rounds:pe,enableXOF:he}=this;return G||(G=new Keccak(K,ne,ue,he,pe)),G.state32.set(this.state32),G.pos=this.pos,G.posOut=this.posOut,G.finished=this.finished,G.rounds=pe,G.suffix=ne,G.outputLen=ue,G.enableXOF=he,G.destroyed=this.destroyed,G}}const IS=((G,K,ne)=>function wrapConstructor$1(G){const hashC=K=>G().update(toBytes$1(K)).digest(),K=G();return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=()=>G(),hashC}((()=>new Keccak(K,G,ne))))(1,136,32);let CS=!1;const _keccak256=function(G){return IS(G)};let RS=_keccak256;function keccak256$1(G){const K=getBytes(G,"data");return hexlify$1(RS(K))}function number$1(G){if(!Number.isSafeInteger(G)||G<0)throw new Error(`Wrong positive integer: ${G}`)}function bytes$1(G,...K){if(!(G instanceof Uint8Array))throw new Error("Expected Uint8Array");if(K.length>0&&!K.includes(G.length))throw new Error(`Expected Uint8Array of length ${K}, not of length=${G.length}`)}function exists(G,K=!0){if(G.destroyed)throw new Error("Hash instance has been destroyed");if(K&&G.finished)throw new Error("Hash#digest() has already been called")}keccak256$1._=_keccak256,keccak256$1.lock=function(){CS=!0},keccak256$1.register=function(G){if(CS)throw new TypeError("keccak256 is locked");RS=G},Object.freeze(keccak256$1);const kS="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,u8a$1=G=>G instanceof Uint8Array,createView=G=>new DataView(G.buffer,G.byteOffset,G.byteLength),rotr=(G,K)=>G<<32-K|G>>>K;
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function toBytes(G){if("string"==typeof G&&(G=function utf8ToBytes$1(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))}(G)),!u8a$1(G))throw new Error("expected Uint8Array, got "+typeof G);return G}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(G){const hashC=K=>G().update(toBytes(K)).digest(),K=G();return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=()=>G(),hashC}function randomBytes(G=32){if(kS&&"function"==typeof kS.getRandomValues)return kS.getRandomValues(new Uint8Array(G));throw new Error("crypto.getRandomValues must be defined")}class SHA2 extends Hash{constructor(G,K,ne,ue){super(),this.blockLen=G,this.outputLen=K,this.padOffset=ne,this.isLE=ue,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(G),this.view=createView(this.buffer)}update(G){exists(this);const{view:K,buffer:ne,blockLen:ue}=this,pe=(G=toBytes(G)).length;for(let he=0;he<pe;){const ye=Math.min(ue-this.pos,pe-he);if(ye!==ue)ne.set(G.subarray(he,he+ye),this.pos),this.pos+=ye,he+=ye,this.pos===ue&&(this.undefined(K,0),this.pos=0);else{const K=createView(G);for(;ue<=pe-he;he+=ue)this.undefined(K,he)}}return this.length+=G.length,this.roundClean(),this}digestInto(G){exists(this),function output(G,K){bytes$1(G);const ne=K.outputLen;if(G.length<ne)throw new Error(`digestInto() expects output buffer of length at least ${ne}`)}(G,this),this.finished=!0;const{buffer:K,view:ne,blockLen:ue,isLE:pe}=this;let{pos:he}=this;K[he++]=128,this.buffer.subarray(he).fill(0),this.padOffset>ue-he&&(this.undefined(ne,0),he=0);for(let G=he;G<ue;G++)K[G]=0;!function setBigUint64(G,K,ne,ue){if("function"==typeof G.setBigUint64)return G.setBigUint64(K,ne,ue);const pe=BigInt(32),he=BigInt(4294967295),ye=Number(ne>>pe&he),me=Number(ne&he),be=ue?4:0,ve=ue?0:4;G.setUint32(K+be,ye,ue),G.setUint32(K+ve,me,ue)}(ne,ue-8,BigInt(8*this.length),pe),this.undefined(ne,0);const ye=createView(G),me=this.outputLen;if(me%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const be=me/4,ve=this.get();if(be>ve.length)throw new Error("_sha2: outputLen bigger than state");for(let G=0;G<be;G++)ye.setUint32(4*G,ve[G],pe)}digest(){const{buffer:G,outputLen:K}=this;this.digestInto(G);const ne=G.slice(0,K);return this.destroy(),ne}_cloneInto(G){G||(G=new this.constructor),G.set(...this.get());const{blockLen:K,buffer:ne,length:ue,finished:pe,destroyed:he,pos:ye}=this;return G.length=ue,G.pos=ye,G.finished=pe,G.destroyed=he,ue%K&&G.buffer.set(ne),G}}const Chi=(G,K,ne)=>G&K^~G&ne,Maj=(G,K,ne)=>G&K^G&ne^K&ne,OS=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]),xS=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),NS=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=0|xS[0],this.B=0|xS[1],this.C=0|xS[2],this.D=0|xS[3],this.E=0|xS[4],this.F=0|xS[5],this.G=0|xS[6],this.H=0|xS[7]}get(){const{A:G,B:K,C:ne,D:ue,E:pe,F:he,G:ye,H:me}=this;return[G,K,ne,ue,pe,he,ye,me]}set(G,K,ne,ue,pe,he,ye,me){this.A=0|G,this.B=0|K,this.C=0|ne,this.D=0|ue,this.E=0|pe,this.F=0|he,this.G=0|ye,this.H=0|me}undefined(G,K){for(let ne=0;ne<16;ne++,K+=4)NS[ne]=G.getUint32(K,!1);for(let G=16;G<64;G++){const K=NS[G-15],ne=NS[G-2],ue=rotr(K,7)^rotr(K,18)^K>>>3,pe=rotr(ne,17)^rotr(ne,19)^ne>>>10;NS[G]=pe+NS[G-7]+ue+NS[G-16]|0}let{A:ne,B:ue,C:pe,D:he,E:ye,F:me,G:be,H:ve}=this;for(let G=0;G<64;G++){const K=ve+(rotr(ye,6)^rotr(ye,11)^rotr(ye,25))+Chi(ye,me,be)+OS[G]+NS[G]|0,_e=(rotr(ne,2)^rotr(ne,13)^rotr(ne,22))+Maj(ne,ue,pe)|0;ve=be,be=me,me=ye,ye=he+K|0,he=pe,pe=ue,ue=ne,ne=K+_e|0}ne=ne+this.A|0,ue=ue+this.B|0,pe=pe+this.C|0,he=he+this.D|0,ye=ye+this.E|0,me=me+this.F|0,be=be+this.G|0,ve=ve+this.H|0,this.set(ne,ue,pe,he,ye,me,be,ve)}roundClean(){NS.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const MS=wrapConstructor((()=>new SHA256)),BS=BigInt(0),FS=BigInt(1),DS=BigInt(2),u8a=G=>G instanceof Uint8Array,LS=Array.from({length:256},((G,K)=>K.toString(16).padStart(2,"0")));
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function bytesToHex(G){if(!u8a(G))throw new Error("Uint8Array expected");let K="";for(let ne=0;ne<G.length;ne++)K+=LS[G[ne]];return K}function numberToHexUnpadded(G){const K=G.toString(16);return 1&K.length?`0${K}`:K}function hexToNumber(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);return BigInt(""===G?"0":`0x${G}`)}function hexToBytes(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);const K=G.length;if(K%2)throw new Error("padded hex string expected, got unpadded hex of length "+K);const ne=new Uint8Array(K/2);for(let K=0;K<ne.length;K++){const ue=2*K,pe=G.slice(ue,ue+2),he=Number.parseInt(pe,16);if(Number.isNaN(he)||he<0)throw new Error("Invalid byte sequence");ne[K]=he}return ne}function bytesToNumberBE(G){return hexToNumber(bytesToHex(G))}function bytesToNumberLE(G){if(!u8a(G))throw new Error("Uint8Array expected");return hexToNumber(bytesToHex(Uint8Array.from(G).reverse()))}function numberToBytesBE(G,K){return hexToBytes(G.toString(16).padStart(2*K,"0"))}function numberToBytesLE(G,K){return numberToBytesBE(G,K).reverse()}function ensureBytes(G,K,ne){let ue;if("string"==typeof K)try{ue=hexToBytes(K)}catch(ne){throw new Error(`${G} must be valid hex string, got "${K}". Cause: ${ne}`)}else{if(!u8a(K))throw new Error(`${G} must be hex string or Uint8Array`);ue=Uint8Array.from(K)}const pe=ue.length;if("number"==typeof ne&&pe!==ne)throw new Error(`${G} expected ${ne} bytes, got ${pe}`);return ue}function concatBytes(...G){const K=new Uint8Array(G.reduce(((G,K)=>G+K.length),0));let ne=0;return G.forEach((G=>{if(!u8a(G))throw new Error("Uint8Array expected");K.set(G,ne),ne+=G.length})),K}const bitMask=G=>(DS<<BigInt(G-1))-FS,u8n=G=>new Uint8Array(G),u8fr=G=>Uint8Array.from(G);function createHmacDrbg(G,K,ne){if("number"!=typeof G||G<2)throw new Error("hashLen must be a number");if("number"!=typeof K||K<2)throw new Error("qByteLen must be a number");if("function"!=typeof ne)throw new Error("hmacFn must be a function");let ue=u8n(G),pe=u8n(G),he=0;const reset=()=>{ue.fill(1),pe.fill(0),he=0},h=(...G)=>ne(pe,ue,...G),reseed=(G=u8n())=>{pe=h(u8fr([0]),G),ue=h(),0!==G.length&&(pe=h(u8fr([1]),G),ue=h())},gen=()=>{if(he++>=1e3)throw new Error("drbg: tried 1000 values");let G=0;const ne=[];for(;G<K;){ue=h();const K=ue.slice();ne.push(K),G+=ue.length}return concatBytes(...ne)};return(G,K)=>{let ne;for(reset(),reseed(G);!(ne=K(gen()));)reseed();return reset(),ne}}const US={bigint:G=>"bigint"==typeof G,function:G=>"function"==typeof G,boolean:G=>"boolean"==typeof G,string:G=>"string"==typeof G,stringOrUint8Array:G=>"string"==typeof G||G instanceof Uint8Array,isSafeInteger:G=>Number.isSafeInteger(G),array:G=>Array.isArray(G),field:(G,K)=>K.Fp.isValid(G),hash:G=>"function"==typeof G&&Number.isSafeInteger(G.outputLen)};function validateObject(G,K,ne={}){const checkField=(K,ne,ue)=>{const pe=US[ne];if("function"!=typeof pe)throw new Error(`Invalid validator "${ne}", expected function`);const he=G[K];if(!(ue&&void 0===he||pe(he,G)))throw new Error(`Invalid param ${String(K)}=${he} (${typeof he}), expected ${ne}`)};for(const[G,ne]of Object.entries(K))checkField(G,ne,!1);for(const[G,K]of Object.entries(ne))checkField(G,K,!0);return G}var $S=Object.freeze({__proto__:null,bitGet:function bitGet(G,K){return G>>BigInt(K)&FS},bitLen:function bitLen(G){let K;for(K=0;G>BS;G>>=FS,K+=1);return K},bitMask:bitMask,bitSet:(G,K,ne)=>G|(ne?FS:BS)<<BigInt(K),bytesToHex:bytesToHex,bytesToNumberBE:bytesToNumberBE,bytesToNumberLE:bytesToNumberLE,concatBytes:concatBytes,createHmacDrbg:createHmacDrbg,ensureBytes:ensureBytes,equalBytes:function equalBytes(G,K){if(G.length!==K.length)return!1;for(let ne=0;ne<G.length;ne++)if(G[ne]!==K[ne])return!1;return!0},hexToBytes:hexToBytes,hexToNumber:hexToNumber,numberToBytesBE:numberToBytesBE,numberToBytesLE:numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded,numberToVarBytesBE:function numberToVarBytesBE(G){return hexToBytes(numberToHexUnpadded(G))},utf8ToBytes:function utf8ToBytes(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))},validateObject:validateObject});
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qS=BigInt(0),GS=BigInt(1),jS=BigInt(2),HS=BigInt(3),WS=BigInt(4),zS=BigInt(5),VS=BigInt(8);function mod(G,K){const ne=G%K;return ne>=qS?ne:K+ne}function pow(G,K,ne){if(ne<=qS||K<qS)throw new Error("Expected power/modulo > 0");if(ne===GS)return qS;let ue=GS;for(;K>qS;)K&GS&&(ue=ue*G%ne),G=G*G%ne,K>>=GS;return ue}function pow2(G,K,ne){let ue=G;for(;K-- >qS;)ue*=ue,ue%=ne;return ue}function invert(G,K){if(G===qS||K<=qS)throw new Error(`invert: expected positive integers, got n=${G} mod=${K}`);let ne=mod(G,K),ue=K,pe=qS,he=GS;for(;ne!==qS;){const G=ue%ne,K=pe-he*(ue/ne);ue=ne,ne=G,pe=he,he=K}if(ue!==GS)throw new Error("invert: does not exist");return mod(pe,K)}function FpSqrt(G){if(G%WS===HS){const K=(G+GS)/WS;return function sqrt3mod4(G,ne){const ue=G.pow(ne,K);if(!G.eql(G.sqr(ue),ne))throw new Error("Cannot find square root");return ue}}if(G%VS===zS){const K=(G-zS)/VS;return function sqrt5mod8(G,ne){const ue=G.mul(ne,jS),pe=G.pow(ue,K),he=G.mul(ne,pe),ye=G.mul(G.mul(he,jS),pe),me=G.mul(he,G.sub(ye,G.ONE));if(!G.eql(G.sqr(me),ne))throw new Error("Cannot find square root");return me}}return function tonelliShanks(G){const K=(G-GS)/jS;let ne,ue,pe;for(ne=G-GS,ue=0;ne%jS===qS;ne/=jS,ue++);for(pe=jS;pe<G&&pow(pe,K,G)!==G-GS;pe++);if(1===ue){const K=(G+GS)/WS;return function tonelliFast(G,ne){const ue=G.pow(ne,K);if(!G.eql(G.sqr(ue),ne))throw new Error("Cannot find square root");return ue}}const he=(ne+GS)/jS;return function tonelliSlow(G,ye){if(G.pow(ye,K)===G.neg(G.ONE))throw new Error("Cannot find square root");let me=ue,be=G.pow(G.mul(G.ONE,pe),ne),ve=G.pow(ye,he),_e=G.pow(ye,ne);for(;!G.eql(_e,G.ONE);){if(G.eql(_e,G.ZERO))return G.ZERO;let K=1;for(let ne=G.sqr(_e);K<me&&!G.eql(ne,G.ONE);K++)ne=G.sqr(ne);const ne=G.pow(be,GS<<BigInt(me-K-1));be=G.sqr(ne),ve=G.mul(ve,ne),_e=G.mul(_e,be),me=K}return ve}}(G)}BigInt(9),BigInt(16);const KS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function nLength(G,K){const ne=void 0!==K?K:G.toString(2).length;return{nBitLength:ne,nByteLength:Math.ceil(ne/8)}}function getFieldBytesLength(G){if("bigint"!=typeof G)throw new Error("field order must be bigint");const K=G.toString(2).length;return Math.ceil(K/8)}function getMinHashLength(G){const K=getFieldBytesLength(G);return K+Math.ceil(K/2)}
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const JS=BigInt(0),XS=BigInt(1);function validateBasic(G){return function validateField(G){return validateObject(G,KS.reduce(((G,K)=>(G[K]="function",G)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(G.Fp),validateObject(G,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(G.n,G.nBitLength),...G,p:G.Fp.ORDER})}
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const{bytesToNumberBE:QS,hexToBytes:ZS}=$S,YS={Err:class DERErr extends Error{constructor(G=""){super(G)}},_parseInt(G){const{Err:K}=YS;if(G.length<2||2!==G[0])throw new K("Invalid signature integer tag");const ne=G[1],ue=G.subarray(2,ne+2);if(!ne||ue.length!==ne)throw new K("Invalid signature integer: wrong length");if(128&ue[0])throw new K("Invalid signature integer: negative");if(0===ue[0]&&!(128&ue[1]))throw new K("Invalid signature integer: unnecessary leading zero");return{d:QS(ue),l:G.subarray(ne+2)}},toSig(G){const{Err:K}=YS,ne="string"==typeof G?ZS(G):G;if(!(ne instanceof Uint8Array))throw new Error("ui8a expected");let ue=ne.length;if(ue<2||48!=ne[0])throw new K("Invalid signature tag");if(ne[1]!==ue-2)throw new K("Invalid signature: incorrect length");const{d:pe,l:he}=YS._parseInt(ne.subarray(2)),{d:ye,l:me}=YS._parseInt(he);if(me.length)throw new K("Invalid signature: left bytes after parsing");return{r:pe,s:ye}},hexFromSig(G){const slice=G=>8&Number.parseInt(G[0],16)?"00"+G:G,h=G=>{const K=G.toString(16);return 1&K.length?`0${K}`:K},K=slice(h(G.s)),ne=slice(h(G.r)),ue=K.length/2,pe=ne.length/2,he=h(ue),ye=h(pe);return`30${h(pe+ue+4)}02${ye}${ne}02${he}${K}`}},eI=BigInt(0),tI=BigInt(1);BigInt(2);const rI=BigInt(3);function weierstrassPoints(G){const K=function validatePointOpts(G){const K=validateBasic(G);validateObject(K,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:ne,Fp:ue,a:pe}=K;if(ne){if(!ue.eql(pe,ue.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof ne||"bigint"!=typeof ne.beta||"function"!=typeof ne.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...K})}(G),{Fp:ne}=K,ue=K.toBytes||((G,K,ue)=>{const pe=K.toAffine();return concatBytes(Uint8Array.from([4]),ne.toBytes(pe.x),ne.toBytes(pe.y))}),pe=K.fromBytes||(G=>{const K=G.subarray(1);return{x:ne.fromBytes(K.subarray(0,ne.BYTES)),y:ne.fromBytes(K.subarray(ne.BYTES,2*ne.BYTES))}});function weierstrassEquation(G){const{a:ue,b:pe}=K,he=ne.sqr(G),ye=ne.mul(he,G);return ne.add(ne.add(ye,ne.mul(G,ue)),pe)}if(!ne.eql(ne.sqr(K.Gy),weierstrassEquation(K.Gx)))throw new Error("bad generator point: equation left != right");function isWithinCurveOrder(G){return"bigint"==typeof G&&eI<G&&G<K.n}function assertGE(G){if(!isWithinCurveOrder(G))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function normPrivateKeyToScalar(G){const{allowedPrivateKeyLengths:ne,nByteLength:ue,wrapPrivateKey:pe,n:he}=K;if(ne&&"bigint"!=typeof G){if(G instanceof Uint8Array&&(G=bytesToHex(G)),"string"!=typeof G||!ne.includes(G.length))throw new Error("Invalid key");G=G.padStart(2*ue,"0")}let ye;try{ye="bigint"==typeof G?G:bytesToNumberBE(ensureBytes("private key",G,ue))}catch(K){throw new Error(`private key must be ${ue} bytes, hex or bigint, not ${typeof G}`)}return pe&&(ye=mod(ye,he)),assertGE(ye),ye}const he=new Map;function assertPrjPoint(G){if(!(G instanceof Point))throw new Error("ProjectivePoint expected")}class Point{constructor(G,K,ue){if(this.px=G,this.py=K,this.pz=ue,null==G||!ne.isValid(G))throw new Error("x required");if(null==K||!ne.isValid(K))throw new Error("y required");if(null==ue||!ne.isValid(ue))throw new Error("z required")}static fromAffine(G){const{x:K,y:ue}=G||{};if(!G||!ne.isValid(K)||!ne.isValid(ue))throw new Error("invalid affine point");if(G instanceof Point)throw new Error("projective point not allowed");const is0=G=>ne.eql(G,ne.ZERO);return is0(K)&&is0(ue)?Point.ZERO:new Point(K,ue,ne.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(G){const K=ne.invertBatch(G.map((G=>G.pz)));return G.map(((G,ne)=>G.toAffine(K[ne]))).map(Point.fromAffine)}static fromHex(G){const K=Point.fromAffine(pe(ensureBytes("pointHex",G)));return K.assertValidity(),K}static fromPrivateKey(G){return Point.BASE.multiply(normPrivateKeyToScalar(G))}_setWindowSize(G){this._WINDOW_SIZE=G,he.delete(this)}assertValidity(){if(this.is0()){if(K.allowInfinityPoint&&!ne.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:G,y:ue}=this.toAffine();if(!ne.isValid(G)||!ne.isValid(ue))throw new Error("bad point: x or y not FE");const pe=ne.sqr(ue),he=weierstrassEquation(G);if(!ne.eql(pe,he))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:G}=this.toAffine();if(ne.isOdd)return!ne.isOdd(G);throw new Error("Field doesn't support isOdd")}equals(G){assertPrjPoint(G);const{px:K,py:ue,pz:pe}=this,{px:he,py:ye,pz:me}=G,be=ne.eql(ne.mul(K,me),ne.mul(he,pe)),ve=ne.eql(ne.mul(ue,me),ne.mul(ye,pe));return be&&ve}negate(){return new Point(this.px,ne.neg(this.py),this.pz)}double(){const{a:G,b:ue}=K,pe=ne.mul(ue,rI),{px:he,py:ye,pz:me}=this;let be=ne.ZERO,ve=ne.ZERO,_e=ne.ZERO,Te=ne.mul(he,he),Ee=ne.mul(ye,ye),Pe=ne.mul(me,me),Se=ne.mul(he,ye);return Se=ne.add(Se,Se),_e=ne.mul(he,me),_e=ne.add(_e,_e),be=ne.mul(G,_e),ve=ne.mul(pe,Pe),ve=ne.add(be,ve),be=ne.sub(Ee,ve),ve=ne.add(Ee,ve),ve=ne.mul(be,ve),be=ne.mul(Se,be),_e=ne.mul(pe,_e),Pe=ne.mul(G,Pe),Se=ne.sub(Te,Pe),Se=ne.mul(G,Se),Se=ne.add(Se,_e),_e=ne.add(Te,Te),Te=ne.add(_e,Te),Te=ne.add(Te,Pe),Te=ne.mul(Te,Se),ve=ne.add(ve,Te),Pe=ne.mul(ye,me),Pe=ne.add(Pe,Pe),Te=ne.mul(Pe,Se),be=ne.sub(be,Te),_e=ne.mul(Pe,Ee),_e=ne.add(_e,_e),_e=ne.add(_e,_e),new Point(be,ve,_e)}add(G){assertPrjPoint(G);const{px:ue,py:pe,pz:he}=this,{px:ye,py:me,pz:be}=G;let ve=ne.ZERO,_e=ne.ZERO,Te=ne.ZERO;const Ee=K.a,Pe=ne.mul(K.b,rI);let Se=ne.mul(ue,ye),Ce=ne.mul(pe,me),ke=ne.mul(he,be),Oe=ne.add(ue,pe),xe=ne.add(ye,me);Oe=ne.mul(Oe,xe),xe=ne.add(Se,Ce),Oe=ne.sub(Oe,xe),xe=ne.add(ue,he);let Ne=ne.add(ye,be);return xe=ne.mul(xe,Ne),Ne=ne.add(Se,ke),xe=ne.sub(xe,Ne),Ne=ne.add(pe,he),ve=ne.add(me,be),Ne=ne.mul(Ne,ve),ve=ne.add(Ce,ke),Ne=ne.sub(Ne,ve),Te=ne.mul(Ee,xe),ve=ne.mul(Pe,ke),Te=ne.add(ve,Te),ve=ne.sub(Ce,Te),Te=ne.add(Ce,Te),_e=ne.mul(ve,Te),Ce=ne.add(Se,Se),Ce=ne.add(Ce,Se),ke=ne.mul(Ee,ke),xe=ne.mul(Pe,xe),Ce=ne.add(Ce,ke),ke=ne.sub(Se,ke),ke=ne.mul(Ee,ke),xe=ne.add(xe,ke),Se=ne.mul(Ce,xe),_e=ne.add(_e,Se),Se=ne.mul(Ne,xe),ve=ne.mul(Oe,ve),ve=ne.sub(ve,Se),Se=ne.mul(Oe,Ce),Te=ne.mul(Ne,Te),Te=ne.add(Te,Se),new Point(ve,_e,Te)}subtract(G){return this.add(G.negate())}is0(){return this.equals(Point.ZERO)}wNAF(G){return me.wNAFCached(this,he,G,(G=>{const K=ne.invertBatch(G.map((G=>G.pz)));return G.map(((G,ne)=>G.toAffine(K[ne]))).map(Point.fromAffine)}))}multiplyUnsafe(G){const ue=Point.ZERO;if(G===eI)return ue;if(assertGE(G),G===tI)return this;const{endo:pe}=K;if(!pe)return me.unsafeLadder(this,G);let{k1neg:he,k1:ye,k2neg:be,k2:ve}=pe.splitScalar(G),_e=ue,Te=ue,Ee=this;for(;ye>eI||ve>eI;)ye&tI&&(_e=_e.add(Ee)),ve&tI&&(Te=Te.add(Ee)),Ee=Ee.double(),ye>>=tI,ve>>=tI;return he&&(_e=_e.negate()),be&&(Te=Te.negate()),Te=new Point(ne.mul(Te.px,pe.beta),Te.py,Te.pz),_e.add(Te)}multiply(G){assertGE(G);let ue,pe,he=G;const{endo:ye}=K;if(ye){const{k1neg:G,k1:K,k2neg:be,k2:ve}=ye.splitScalar(he);let{p:_e,f:Te}=this.wNAF(K),{p:Ee,f:Pe}=this.wNAF(ve);_e=me.constTimeNegate(G,_e),Ee=me.constTimeNegate(be,Ee),Ee=new Point(ne.mul(Ee.px,ye.beta),Ee.py,Ee.pz),ue=_e.add(Ee),pe=Te.add(Pe)}else{const{p:G,f:K}=this.wNAF(he);ue=G,pe=K}return Point.normalizeZ([ue,pe])[0]}multiplyAndAddUnsafe(G,K,ne){const ue=Point.BASE,mul=(G,K)=>K!==eI&&K!==tI&&G.equals(ue)?G.multiply(K):G.multiplyUnsafe(K),pe=mul(this,K).add(mul(G,ne));return pe.is0()?void 0:pe}toAffine(G){const{px:K,py:ue,pz:pe}=this,he=this.is0();null==G&&(G=he?ne.ONE:ne.inv(pe));const ye=ne.mul(K,G),me=ne.mul(ue,G),be=ne.mul(pe,G);if(he)return{x:ne.ZERO,y:ne.ZERO};if(!ne.eql(be,ne.ONE))throw new Error("invZ was invalid");return{x:ye,y:me}}isTorsionFree(){const{h:G,isTorsionFree:ne}=K;if(G===tI)return!0;if(ne)return ne(Point,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:G,clearCofactor:ne}=K;return G===tI?this:ne?ne(Point,this):this.multiplyUnsafe(K.h)}toRawBytes(G=!0){return this.assertValidity(),ue(Point,this,G)}toHex(G=!0){return bytesToHex(this.toRawBytes(G))}}Point.BASE=new Point(K.Gx,K.Gy,ne.ONE),Point.ZERO=new Point(ne.ZERO,ne.ONE,ne.ZERO);const ye=K.nBitLength,me=function wNAF(G,K){const constTimeNegate=(G,K)=>{const ne=K.negate();return G?ne:K},opts=G=>({windows:Math.ceil(K/G)+1,windowSize:2**(G-1)});return{constTimeNegate:constTimeNegate,unsafeLadder(K,ne){let ue=G.ZERO,pe=K;for(;ne>JS;)ne&XS&&(ue=ue.add(pe)),pe=pe.double(),ne>>=XS;return ue},precomputeWindow(G,K){const{windows:ne,windowSize:ue}=opts(K),pe=[];let he=G,ye=he;for(let G=0;G<ne;G++){ye=he,pe.push(ye);for(let G=1;G<ue;G++)ye=ye.add(he),pe.push(ye);he=ye.double()}return pe},wNAF(K,ne,ue){const{windows:pe,windowSize:he}=opts(K);let ye=G.ZERO,me=G.BASE;const be=BigInt(2**K-1),ve=2**K,_e=BigInt(K);for(let G=0;G<pe;G++){const K=G*he;let pe=Number(ue&be);ue>>=_e,pe>he&&(pe-=ve,ue+=XS);const Te=K,Ee=K+Math.abs(pe)-1,Pe=G%2!=0,Se=pe<0;0===pe?me=me.add(constTimeNegate(Pe,ne[Te])):ye=ye.add(constTimeNegate(Se,ne[Ee]))}return{p:ye,f:me}},wNAFCached(G,K,ne,ue){const pe=G._WINDOW_SIZE||1;let he=K.get(G);return he||(he=this.precomputeWindow(G,pe),1!==pe&&K.set(G,ue(he))),this.wNAF(pe,he,ne)}}}(Point,K.endo?Math.ceil(ye/2):ye);return{CURVE:K,ProjectivePoint:Point,normPrivateKeyToScalar:normPrivateKeyToScalar,weierstrassEquation:weierstrassEquation,isWithinCurveOrder:isWithinCurveOrder}}function weierstrass$1(G){const K=function validateOpts(G){const K=validateBasic(G);return validateObject(K,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...K})}(G),{Fp:ne,n:ue}=K,pe=ne.BYTES+1,he=2*ne.BYTES+1;function modN(G){return mod(G,ue)}function invN(G){return invert(G,ue)}const{ProjectivePoint:ye,normPrivateKeyToScalar:me,weierstrassEquation:be,isWithinCurveOrder:ve}=weierstrassPoints({...K,toBytes(G,K,ue){const pe=K.toAffine(),he=ne.toBytes(pe.x),ye=concatBytes;return ue?ye(Uint8Array.from([K.hasEvenY()?2:3]),he):ye(Uint8Array.from([4]),he,ne.toBytes(pe.y))},fromBytes(G){const K=G.length,ue=G[0],ye=G.subarray(1);if(K!==pe||2!==ue&&3!==ue){if(K===he&&4===ue){return{x:ne.fromBytes(ye.subarray(0,ne.BYTES)),y:ne.fromBytes(ye.subarray(ne.BYTES,2*ne.BYTES))}}throw new Error(`Point of length ${K} was invalid. Expected ${pe} compressed bytes or ${he} uncompressed bytes`)}{const G=bytesToNumberBE(ye);if(!function isValidFieldElement(G){return eI<G&&G<ne.ORDER}(G))throw new Error("Point is not on curve");const K=be(G);let pe=ne.sqrt(K);return 1==(1&ue)!==((pe&tI)===tI)&&(pe=ne.neg(pe)),{x:G,y:pe}}}}),numToNByteStr=G=>bytesToHex(numberToBytesBE(G,K.nByteLength));function isBiggerThanHalfOrder(G){return G>ue>>tI}const slcNum=(G,K,ne)=>bytesToNumberBE(G.slice(K,ne));class Signature{constructor(G,K,ne){this.r=G,this.s=K,this.recovery=ne,this.assertValidity()}static fromCompact(G){const ne=K.nByteLength;return G=ensureBytes("compactSignature",G,2*ne),new Signature(slcNum(G,0,ne),slcNum(G,ne,2*ne))}static fromDER(G){const{r:K,s:ne}=YS.toSig(ensureBytes("DER",G));return new Signature(K,ne)}assertValidity(){if(!ve(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ve(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(G){return new Signature(this.r,this.s,G)}recoverPublicKey(G){const{r:ue,s:pe,recovery:he}=this,me=Ee(ensureBytes("msgHash",G));if(null==he||![0,1,2,3].includes(he))throw new Error("recovery id invalid");const be=2===he||3===he?ue+K.n:ue;if(be>=ne.ORDER)throw new Error("recovery id 2 or 3 invalid");const ve=0==(1&he)?"02":"03",_e=ye.fromHex(ve+numToNByteStr(be)),Te=invN(be),Pe=modN(-me*Te),Se=modN(pe*Te),Ce=ye.BASE.multiplyAndAddUnsafe(_e,Pe,Se);if(!Ce)throw new Error("point at infinify");return Ce.assertValidity(),Ce}hasHighS(){return isBiggerThanHalfOrder(this.s)}normalizeS(){return this.hasHighS()?new Signature(this.r,modN(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return YS.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numToNByteStr(this.r)+numToNByteStr(this.s)}}const _e={isValidPrivateKey(G){try{return me(G),!0}catch(G){return!1}},normPrivateKeyToScalar:me,randomPrivateKey:()=>{const G=getMinHashLength(K.n);return function mapHashToField(G,K,ne=!1){const ue=G.length,pe=getFieldBytesLength(K),he=getMinHashLength(K);if(ue<16||ue<he||ue>1024)throw new Error(`expected ${he}-1024 bytes of input, got ${ue}`);const ye=mod(ne?bytesToNumberBE(G):bytesToNumberLE(G),K-GS)+GS;return ne?numberToBytesLE(ye,pe):numberToBytesBE(ye,pe)}(K.randomBytes(G),K.n)},precompute:(G=8,K=ye.BASE)=>(K._setWindowSize(G),K.multiply(BigInt(3)),K)};function isProbPub(G){const K=G instanceof Uint8Array,ne="string"==typeof G,ue=(K||ne)&&G.length;return K?ue===pe||ue===he:ne?ue===2*pe||ue===2*he:G instanceof ye}const Te=K.bits2int||function(G){const ne=bytesToNumberBE(G),ue=8*G.length-K.nBitLength;return ue>0?ne>>BigInt(ue):ne},Ee=K.bits2int_modN||function(G){return modN(Te(G))},Pe=bitMask(K.nBitLength);function int2octets(G){if("bigint"!=typeof G)throw new Error("bigint expected");if(!(eI<=G&&G<Pe))throw new Error(`bigint expected < 2^${K.nBitLength}`);return numberToBytesBE(G,K.nByteLength)}function prepSig(G,ue,pe=Se){if(["recovered","canonical"].some((G=>G in pe)))throw new Error("sign() legacy options not supported");const{hash:he,randomBytes:be}=K;let{lowS:_e,prehash:Pe,extraEntropy:Ce}=pe;null==_e&&(_e=!0),G=ensureBytes("msgHash",G),Pe&&(G=ensureBytes("prehashed msgHash",he(G)));const ke=Ee(G),Oe=me(ue),xe=[int2octets(Oe),int2octets(ke)];if(null!=Ce){const G=!0===Ce?be(ne.BYTES):Ce;xe.push(ensureBytes("extraEntropy",G))}const Ne=concatBytes(...xe),Me=ke;return{seed:Ne,k2sig:function k2sig(G){const K=Te(G);if(!ve(K))return;const ne=invN(K),ue=ye.BASE.multiply(K).toAffine(),pe=modN(ue.x);if(pe===eI)return;const he=modN(ne*modN(Me+pe*Oe));if(he===eI)return;let me=(ue.x===pe?0:2)|Number(ue.y&tI),be=he;return _e&&isBiggerThanHalfOrder(he)&&(be=function normalizeS(G){return isBiggerThanHalfOrder(G)?modN(-G):G}(he),me^=1),new Signature(pe,be,me)}}}const Se={lowS:K.lowS,prehash:!1},Ce={lowS:K.lowS,prehash:!1};return ye.BASE._setWindowSize(8),{CURVE:K,getPublicKey:function getPublicKey(G,K=!0){return ye.fromPrivateKey(G).toRawBytes(K)},getSharedSecret:function getSharedSecret(G,K,ne=!0){if(isProbPub(G))throw new Error("first arg must be private key");if(!isProbPub(K))throw new Error("second arg must be public key");return ye.fromHex(K).multiply(me(G)).toRawBytes(ne)},sign:function sign(G,ne,ue=Se){const{seed:pe,k2sig:he}=prepSig(G,ne,ue),ye=K;return createHmacDrbg(ye.hash.outputLen,ye.nByteLength,ye.hmac)(pe,he)},verify:function verify(G,ne,ue,pe=Ce){const he=G;if(ne=ensureBytes("msgHash",ne),ue=ensureBytes("publicKey",ue),"strict"in pe)throw new Error("options.strict was renamed to lowS");const{lowS:me,prehash:be}=pe;let ve,_e;try{if("string"==typeof he||he instanceof Uint8Array)try{ve=Signature.fromDER(he)}catch(G){if(!(G instanceof YS.Err))throw G;ve=Signature.fromCompact(he)}else{if("object"!=typeof he||"bigint"!=typeof he.r||"bigint"!=typeof he.s)throw new Error("PARSE");{const{r:G,s:K}=he;ve=new Signature(G,K)}}_e=ye.fromHex(ue)}catch(G){if("PARSE"===G.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(me&&ve.hasHighS())return!1;be&&(ne=K.hash(ne));const{r:Te,s:Pe}=ve,Se=Ee(ne),ke=invN(Pe),Oe=modN(Se*ke),xe=modN(Te*ke),Ne=ye.BASE.multiplyAndAddUnsafe(_e,Oe,xe)?.toAffine();return!!Ne&&modN(Ne.x)===Te},ProjectivePoint:ye,Signature:Signature,utils:_e}}BigInt(4);class HMAC extends Hash{constructor(G,K){super(),this.finished=!1,this.destroyed=!1,function hash$1(G){if("function"!=typeof G||"function"!=typeof G.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(G.outputLen),number$1(G.blockLen)}(G);const ne=toBytes(K);if(this.iHash=G.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const ue=this.blockLen,pe=new Uint8Array(ue);pe.set(ne.length>ue?G.create().update(ne).digest():ne);for(let G=0;G<pe.length;G++)pe[G]^=54;this.iHash.update(pe),this.oHash=G.create();for(let G=0;G<pe.length;G++)pe[G]^=106;this.oHash.update(pe),pe.fill(0)}update(G){return exists(this),this.iHash.update(G),this}digestInto(G){exists(this),bytes$1(G,this.outputLen),this.finished=!0,this.iHash.digestInto(G),this.oHash.update(G),this.oHash.digestInto(G),this.destroy()}digest(){const G=new Uint8Array(this.oHash.outputLen);return this.digestInto(G),G}_cloneInto(G){G||(G=Object.create(Object.getPrototypeOf(this),{}));const{oHash:K,iHash:ne,finished:ue,destroyed:pe,blockLen:he,outputLen:ye}=this;return G.finished=ue,G.destroyed=pe,G.blockLen=he,G.outputLen=ye,G.oHash=K._cloneInto(G.oHash),G.iHash=ne._cloneInto(G.iHash),G}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hmac$4=(G,K,ne)=>new HMAC(G,K).update(ne).digest();
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
function getHash(G){return{hash:G,hmac:(K,...ne)=>hmac$4(G,K,function concatBytes$1(...G){const K=new Uint8Array(G.reduce(((G,K)=>G+K.length),0));let ne=0;return G.forEach((G=>{if(!u8a$1(G))throw new Error("Uint8Array expected");K.set(G,ne),ne+=G.length})),K}(...ne)),randomBytes:randomBytes}}hmac$4.create=(G,K)=>new HMAC(G,K);
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const nI=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),aI=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),iI=BigInt(1),sI=BigInt(2),divNearest=(G,K)=>(G+K/sI)/K;const oI=function Field(G,K,ne=!1,ue={}){if(G<=qS)throw new Error(`Expected Field ORDER > 0, got ${G}`);const{nBitLength:pe,nByteLength:he}=nLength(G,K);if(he>2048)throw new Error("Field lengths over 2048 bytes are not supported");const ye=FpSqrt(G),me=Object.freeze({ORDER:G,BITS:pe,BYTES:he,MASK:bitMask(pe),ZERO:qS,ONE:GS,create:K=>mod(K,G),isValid:K=>{if("bigint"!=typeof K)throw new Error("Invalid field element: expected bigint, got "+typeof K);return qS<=K&&K<G},is0:G=>G===qS,isOdd:G=>(G&GS)===GS,neg:K=>mod(-K,G),eql:(G,K)=>G===K,sqr:K=>mod(K*K,G),add:(K,ne)=>mod(K+ne,G),sub:(K,ne)=>mod(K-ne,G),mul:(K,ne)=>mod(K*ne,G),pow:(G,K)=>function FpPow(G,K,ne){if(ne<qS)throw new Error("Expected power > 0");if(ne===qS)return G.ONE;if(ne===GS)return K;let ue=G.ONE,pe=K;for(;ne>qS;)ne&GS&&(ue=G.mul(ue,pe)),pe=G.sqr(pe),ne>>=GS;return ue}(me,G,K),div:(K,ne)=>mod(K*invert(ne,G),G),sqrN:G=>G*G,addN:(G,K)=>G+K,subN:(G,K)=>G-K,mulN:(G,K)=>G*K,inv:K=>invert(K,G),sqrt:ue.sqrt||(G=>ye(me,G)),invertBatch:G=>function FpInvertBatch(G,K){const ne=new Array(K.length),ue=K.reduce(((K,ue,pe)=>G.is0(ue)?K:(ne[pe]=K,G.mul(K,ue))),G.ONE),pe=G.inv(ue);return K.reduceRight(((K,ue,pe)=>G.is0(ue)?K:(ne[pe]=G.mul(K,ne[pe]),G.mul(K,ue))),pe),ne}(me,G),cmov:(G,K,ne)=>ne?K:G,toBytes:G=>ne?numberToBytesLE(G,he):numberToBytesBE(G,he),fromBytes:G=>{if(G.length!==he)throw new Error(`Fp.fromBytes: expected ${he}, got ${G.length}`);return ne?bytesToNumberLE(G):bytesToNumberBE(G)}});return Object.freeze(me)}(nI,void 0,void 0,{sqrt:function sqrtMod(G){const K=nI,ne=BigInt(3),ue=BigInt(6),pe=BigInt(11),he=BigInt(22),ye=BigInt(23),me=BigInt(44),be=BigInt(88),ve=G*G*G%K,_e=ve*ve*G%K,Te=pow2(_e,ne,K)*_e%K,Ee=pow2(Te,ne,K)*_e%K,Pe=pow2(Ee,sI,K)*ve%K,Se=pow2(Pe,pe,K)*Pe%K,Ce=pow2(Se,he,K)*Se%K,ke=pow2(Ce,me,K)*Ce%K,Oe=pow2(ke,be,K)*ke%K,xe=pow2(Oe,me,K)*Ce%K,Ne=pow2(xe,ne,K)*_e%K,Me=pow2(Ne,ye,K)*Se%K,Be=pow2(Me,ue,K)*ve%K,Fe=pow2(Be,sI,K);if(!oI.eql(oI.sqr(Fe),G))throw new Error("Cannot find square root");return Fe}}),cI=function createCurve(G,K){const create=K=>weierstrass$1({...G,...getHash(K)});return Object.freeze({...create(K),create:create})}({a:BigInt(0),b:BigInt(7),Fp:oI,n:aI,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:G=>{const K=aI,ne=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),ue=-iI*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),pe=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),he=ne,ye=BigInt("0x100000000000000000000000000000000"),me=divNearest(he*G,K),be=divNearest(-ue*G,K);let ve=mod(G-me*ne-be*pe,K),_e=mod(-me*ue-be*he,K);const Te=ve>ye,Ee=_e>ye;if(Te&&(ve=K-ve),Ee&&(_e=K-_e),ve>ye||_e>ye)throw new Error("splitScalar: Endomorphism failed, k="+G);return{k1neg:Te,k1:ve,k2neg:Ee,k2:_e}}}},MS);BigInt(0),cI.ProjectivePoint;const dI="0x0000000000000000000000000000000000000000",uI="0x0000000000000000000000000000000000000000000000000000000000000000",fI=BigInt(0),lI=BigInt(1),pI=BigInt(2),hI=BigInt(27),yI=BigInt(28),mI=BigInt(35),bI={};function toUint256(G){return zeroPadValue(toBeArray(G),32)}var gI=new WeakMap,vI=new WeakMap,wI=new WeakMap,_I=new WeakMap;class Signature{get r(){return _classPrivateFieldGet2(gI,this)}set r(G){assertArgument(32===dataLength(G),"invalid r","value",G),_classPrivateFieldSet2(gI,this,hexlify$1(G))}get s(){return _classPrivateFieldGet2(vI,this)}set s(G){assertArgument(32===dataLength(G),"invalid s","value",G);const K=hexlify$1(G);assertArgument(parseInt(K.substring(0,3))<8,"non-canonical s","value",K),_classPrivateFieldSet2(vI,this,K)}get v(){return _classPrivateFieldGet2(wI,this)}set v(G){const K=getNumber(G,"value");assertArgument(27===K||28===K,"invalid v","v",G),_classPrivateFieldSet2(wI,this,K)}get networkV(){return _classPrivateFieldGet2(_I,this)}get legacyChainId(){const G=this.networkV;return null==G?null:Signature.getChainId(G)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const G=getBytes(this.s);return this.yParity&&(G[0]|=128),hexlify$1(G)}get compactSerialized(){return concat$1([this.r,this.yParityAndS])}get serialized(){return concat$1([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(G,K,ne,ue){_classPrivateFieldInitSpec(this,gI,void 0),_classPrivateFieldInitSpec(this,vI,void 0),_classPrivateFieldInitSpec(this,wI,void 0),_classPrivateFieldInitSpec(this,_I,void 0),assertPrivate(G,bI,"Signature"),_classPrivateFieldSet2(gI,this,K),_classPrivateFieldSet2(vI,this,ne),_classPrivateFieldSet2(wI,this,ue),_classPrivateFieldSet2(_I,this,null)}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const G=new Signature(bI,this.r,this.s,this.v);return this.networkV&&_classPrivateFieldSet2(_I,G,this.networkV),G}toJSON(){const G=this.networkV;return{_type:"signature",networkV:null!=G?G.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(G){const K=getBigInt(G,"v");return K==hI||K==yI?fI:(assertArgument(K>=mI,"invalid EIP-155 v","v",G),(K-mI)/pI)}static getChainIdV(G,K){return getBigInt(G)*pI+BigInt(35+K-27)}static getNormalizedV(G){const K=getBigInt(G);return K===fI||K===hI?27:K===lI||K===yI?28:(assertArgument(K>=mI,"invalid v","v",G),K&lI?27:28)}static from(G){function assertError(K,ne){assertArgument(K,ne,"signature",G)}if(null==G)return new Signature(bI,uI,uI,27);if("string"==typeof G){const K=getBytes(G,"signature");if(64===K.length){const G=hexlify$1(K.slice(0,32)),ne=K.slice(32,64),ue=128&ne[0]?28:27;return ne[0]&=127,new Signature(bI,G,hexlify$1(ne),ue)}if(65===K.length){const G=hexlify$1(K.slice(0,32)),ne=K.slice(32,64);assertError(0==(128&ne[0]),"non-canonical s");const ue=Signature.getNormalizedV(K[64]);return new Signature(bI,G,hexlify$1(ne),ue)}assertError(!1,"invalid raw signature length")}if(G instanceof Signature)return G.clone();const K=G.r;assertError(null!=K,"missing r");const ne=toUint256(K),ue=function(G,K){if(null!=G)return toUint256(G);if(null!=K){assertError(isHexString$1(K,32),"invalid yParityAndS");const G=getBytes(K);return G[0]&=127,hexlify$1(G)}assertError(!1,"missing s")}(G.s,G.yParityAndS);assertError(0==(128&getBytes(ue)[0]),"non-canonical s");const{networkV:pe,v:he}=function(G,K,ne){if(null!=G){const K=getBigInt(G);return{networkV:K>=mI?K:void 0,v:Signature.getNormalizedV(K)}}if(null!=K)return assertError(isHexString$1(K,32),"invalid yParityAndS"),{v:128&getBytes(K)[0]?28:27};if(null!=ne){switch(getNumber(ne,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}assertError(!1,"invalid yParity")}assertError(!1,"missing v")}(G.v,G.yParityAndS,G.yParity),ye=new Signature(bI,ne,ue,he);return pe&&_classPrivateFieldSet2(_I,ye,pe),assertError(null==G.yParity||getNumber(G.yParity,"sig.yParity")===ye.yParity,"yParity mismatch"),assertError(null==G.yParityAndS||G.yParityAndS===ye.yParityAndS,"yParityAndS mismatch"),ye}}var TI=new WeakMap;class SigningKey{constructor(G){_classPrivateFieldInitSpec(this,TI,void 0),assertArgument(32===dataLength(G),"invalid private key","privateKey","[REDACTED]"),_classPrivateFieldSet2(TI,this,hexlify$1(G))}get privateKey(){return _classPrivateFieldGet2(TI,this)}get publicKey(){return SigningKey.computePublicKey(_classPrivateFieldGet2(TI,this))}get compressedPublicKey(){return SigningKey.computePublicKey(_classPrivateFieldGet2(TI,this),!0)}sign(G){assertArgument(32===dataLength(G),"invalid digest length","digest",G);const K=cI.sign(getBytesCopy(G),getBytesCopy(_classPrivateFieldGet2(TI,this)),{lowS:!0});return Signature.from({r:toBeHex(K.r,32),s:toBeHex(K.s,32),v:K.recovery?28:27})}computeSharedSecret(G){const K=SigningKey.computePublicKey(G);return hexlify$1(cI.getSharedSecret(getBytesCopy(_classPrivateFieldGet2(TI,this)),getBytes(K),!1))}static computePublicKey(G,K){let ne=getBytes(G,"key");if(32===ne.length){return hexlify$1(cI.getPublicKey(ne,!!K))}if(64===ne.length){const G=new Uint8Array(65);G[0]=4,G.set(ne,1),ne=G}return hexlify$1(cI.ProjectivePoint.fromHex(ne).toRawBytes(K))}static recoverPublicKey(G,K){assertArgument(32===dataLength(G),"invalid digest length","digest",G);const ne=Signature.from(K);let ue=cI.Signature.fromCompact(getBytesCopy(concat$1([ne.r,ne.s])));ue=ue.addRecoveryBit(ne.yParity);const pe=ue.recoverPublicKey(getBytesCopy(G));return assertArgument(null!=pe,"invalid signautre for digest","signature",K),"0x"+pe.toHex(!1)}static addPoints(G,K,ne){const ue=cI.ProjectivePoint.fromHex(SigningKey.computePublicKey(G).substring(2)),pe=cI.ProjectivePoint.fromHex(SigningKey.computePublicKey(K).substring(2));return"0x"+ue.add(pe).toHex(!!ne)}}const AI=BigInt(0),EI=BigInt(36);function getChecksumAddress$1(G){const K=(G=G.toLowerCase()).substring(2).split(""),ne=new Uint8Array(40);for(let G=0;G<40;G++)ne[G]=K[G].charCodeAt(0);const ue=getBytes(keccak256$1(ne));for(let G=0;G<40;G+=2)ue[G>>1]>>4>=8&&(K[G]=K[G].toUpperCase()),(15&ue[G>>1])>=8&&(K[G+1]=K[G+1].toUpperCase());return"0x"+K.join("")}const PI={};for(let G=0;G<10;G++)PI[String(G)]=String(G);for(let G=0;G<26;G++)PI[String.fromCharCode(65+G)]=String(10+G);const SI=15;const CI=function(){const G={};for(let K=0;K<36;K++){G["0123456789abcdefghijklmnopqrstuvwxyz"[K]]=BigInt(K)}return G}();function getAddress$1(G){if(assertArgument("string"==typeof G,"invalid address","address",G),G.match(/^(0x)?[0-9a-fA-F]{40}$/)){G.startsWith("0x")||(G="0x"+G);const K=getChecksumAddress$1(G);return assertArgument(!G.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||K===G,"bad address checksum","address",G),K}if(G.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){assertArgument(G.substring(2,4)===function ibanChecksum$1(G){let K=(G=(G=G.toUpperCase()).substring(4)+G.substring(0,2)+"00").split("").map((G=>PI[G])).join("");for(;K.length>=SI;){let G=K.substring(0,SI);K=parseInt(G,10)%97+K.substring(G.length)}let ne=String(98-parseInt(K,10)%97);for(;ne.length<2;)ne="0"+ne;return ne}(G),"bad icap checksum","address",G);let K=function fromBase36(G){G=G.toLowerCase();let K=AI;for(let ne=0;ne<G.length;ne++)K=K*EI+CI[G[ne]];return K}(G.substring(4)).toString(16);for(;K.length<40;)K="0"+K;return getChecksumAddress$1("0x"+K)}assertArgument(!1,"invalid address","address",G)}function isAddressable(G){return G&&"function"==typeof G.getAddress}async function checkAddress(G,K){const ne=await K;return null!=ne&&"0x0000000000000000000000000000000000000000"!==ne||(assert("string"!=typeof G,"unconfigured name","UNCONFIGURED_NAME",{value:G}),assertArgument(!1,"invalid AddressLike value; did not resolve to a value address","target",G)),getAddress$1(ne)}function resolveAddress(G,K){return"string"==typeof G?G.match(/^0x[0-9a-f]{40}$/i)?getAddress$1(G):(assert(null!=K,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),checkAddress(G,K.resolveName(G))):isAddressable(G)?checkAddress(G,G.getAddress()):G&&"function"==typeof G.then?checkAddress(G,G):void assertArgument(!1,"unsupported addressable value","target",G)}const RI={};function n(G,K){let ne=!1;return K<0&&(ne=!0,K*=-1),new Typed(RI,`${ne?"":"u"}int${K}`,G,{signed:ne,width:K})}function b(G,K){return new Typed(RI,`bytes${K||""}`,G,{size:K})}const kI=Symbol.for("_ethers_typed");var OI=new WeakMap;class Typed{constructor(G,K,ne,ue){_defineProperty(this,"type",void 0),_defineProperty(this,"value",void 0),_classPrivateFieldInitSpec(this,OI,void 0),_defineProperty(this,"_typedSymbol",void 0),null==ue&&(ue=null),assertPrivate(RI,G,"Typed"),defineProperties(this,{_typedSymbol:kI,type:K,value:ne}),_classPrivateFieldSet2(OI,this,ue),this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((G=>G.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"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return _classPrivateFieldGet2(OI,this)}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===_classPrivateFieldGet2(OI,this)?-1:!1===_classPrivateFieldGet2(OI,this)?this.value.length:null}static from(G,K){return new Typed(RI,G,K)}static uint8(G){return n(G,8)}static uint16(G){return n(G,16)}static uint24(G){return n(G,24)}static uint32(G){return n(G,32)}static uint40(G){return n(G,40)}static uint48(G){return n(G,48)}static uint56(G){return n(G,56)}static uint64(G){return n(G,64)}static uint72(G){return n(G,72)}static uint80(G){return n(G,80)}static uint88(G){return n(G,88)}static uint96(G){return n(G,96)}static uint104(G){return n(G,104)}static uint112(G){return n(G,112)}static uint120(G){return n(G,120)}static uint128(G){return n(G,128)}static uint136(G){return n(G,136)}static uint144(G){return n(G,144)}static uint152(G){return n(G,152)}static uint160(G){return n(G,160)}static uint168(G){return n(G,168)}static uint176(G){return n(G,176)}static uint184(G){return n(G,184)}static uint192(G){return n(G,192)}static uint200(G){return n(G,200)}static uint208(G){return n(G,208)}static uint216(G){return n(G,216)}static uint224(G){return n(G,224)}static uint232(G){return n(G,232)}static uint240(G){return n(G,240)}static uint248(G){return n(G,248)}static uint256(G){return n(G,256)}static uint(G){return n(G,256)}static int8(G){return n(G,-8)}static int16(G){return n(G,-16)}static int24(G){return n(G,-24)}static int32(G){return n(G,-32)}static int40(G){return n(G,-40)}static int48(G){return n(G,-48)}static int56(G){return n(G,-56)}static int64(G){return n(G,-64)}static int72(G){return n(G,-72)}static int80(G){return n(G,-80)}static int88(G){return n(G,-88)}static int96(G){return n(G,-96)}static int104(G){return n(G,-104)}static int112(G){return n(G,-112)}static int120(G){return n(G,-120)}static int128(G){return n(G,-128)}static int136(G){return n(G,-136)}static int144(G){return n(G,-144)}static int152(G){return n(G,-152)}static int160(G){return n(G,-160)}static int168(G){return n(G,-168)}static int176(G){return n(G,-176)}static int184(G){return n(G,-184)}static int192(G){return n(G,-192)}static int200(G){return n(G,-200)}static int208(G){return n(G,-208)}static int216(G){return n(G,-216)}static int224(G){return n(G,-224)}static int232(G){return n(G,-232)}static int240(G){return n(G,-240)}static int248(G){return n(G,-248)}static int256(G){return n(G,-256)}static int(G){return n(G,-256)}static bytes1(G){return b(G,1)}static bytes2(G){return b(G,2)}static bytes3(G){return b(G,3)}static bytes4(G){return b(G,4)}static bytes5(G){return b(G,5)}static bytes6(G){return b(G,6)}static bytes7(G){return b(G,7)}static bytes8(G){return b(G,8)}static bytes9(G){return b(G,9)}static bytes10(G){return b(G,10)}static bytes11(G){return b(G,11)}static bytes12(G){return b(G,12)}static bytes13(G){return b(G,13)}static bytes14(G){return b(G,14)}static bytes15(G){return b(G,15)}static bytes16(G){return b(G,16)}static bytes17(G){return b(G,17)}static bytes18(G){return b(G,18)}static bytes19(G){return b(G,19)}static bytes20(G){return b(G,20)}static bytes21(G){return b(G,21)}static bytes22(G){return b(G,22)}static bytes23(G){return b(G,23)}static bytes24(G){return b(G,24)}static bytes25(G){return b(G,25)}static bytes26(G){return b(G,26)}static bytes27(G){return b(G,27)}static bytes28(G){return b(G,28)}static bytes29(G){return b(G,29)}static bytes30(G){return b(G,30)}static bytes31(G){return b(G,31)}static bytes32(G){return b(G,32)}static address(G){return new Typed(RI,"address",G)}static bool(G){return new Typed(RI,"bool",!!G)}static bytes(G){return new Typed(RI,"bytes",G)}static string(G){return new Typed(RI,"string",G)}static array(G,K){throw new Error("not implemented yet")}static tuple(G,K){throw new Error("not implemented yet")}static overrides(G){return new Typed(RI,"overrides",Object.assign({},G))}static isTyped(G){return G&&"object"==typeof G&&"_typedSymbol"in G&&G._typedSymbol===kI}static dereference(G,K){if(Typed.isTyped(G)){if(G.type!==K)throw new Error(`invalid type: expecetd ${K}, got ${G.type}`);return G.value}return G}}let xI=class AddressCoder extends rS{constructor(G){super("address","address",G,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(G,K){let ne=Typed.dereference(K,"string");try{ne=getAddress$1(ne)}catch(G){return this._throwError(G.message,K)}return G.writeValue(ne)}decode(G){return getAddress$1(toBeHex(G.readValue(),20))}},NI=class AnonymousCoder extends rS{constructor(G){super(G.name,G.type,"_",G.dynamic),_defineProperty(this,"coder",void 0),this.coder=G}defaultValue(){return this.coder.defaultValue()}encode(G,K){return this.coder.encode(G,K)}decode(G){return this.coder.decode(G)}};function pack$1(G,K,ne){let ue=[];if(Array.isArray(ne))ue=ne;else if(ne&&"object"==typeof ne){let G={};ue=K.map((K=>{const ue=K.localName;return assert(ue,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:K},value:ne}),assert(!G[ue],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:K},value:ne}),G[ue]=!0,ne[ue]}))}else assertArgument(!1,"invalid tuple value","tuple",ne);assertArgument(K.length===ue.length,"types/value length mismatch","tuple",ne);let pe=new sS,he=new sS,ye=[];K.forEach(((G,K)=>{let ne=ue[K];if(G.dynamic){let K=he.length;G.encode(he,ne);let ue=pe.writeUpdatableValue();ye.push((G=>{ue(G+K)}))}else G.encode(pe,ne)})),ye.forEach((G=>{G(pe.length)}));let me=G.appendWriter(pe);return me+=G.appendWriter(he),me}function unpack$1(G,K){let ne=[],ue=[],pe=G.subReader(0);return K.forEach((K=>{let he=null;if(K.dynamic){let ne=G.readIndex(),ue=pe.subReader(ne);try{he=K.decode(ue)}catch(G){if(isError(G,"BUFFER_OVERRUN"))throw G;he=G,he.baseType=K.name,he.name=K.localName,he.type=K.type}}else try{he=K.decode(G)}catch(G){if(isError(G,"BUFFER_OVERRUN"))throw G;he=G,he.baseType=K.name,he.name=K.localName,he.type=K.type}if(null==he)throw new Error("investigate");ne.push(he),ue.push(K.localName||null)})),Result.fromItems(ne,ue)}let MI=class ArrayCoder extends rS{constructor(G,K,ne){super("array",G.type+"["+(K>=0?K:"")+"]",ne,-1===K||G.dynamic),_defineProperty(this,"coder",void 0),_defineProperty(this,"length",void 0),defineProperties(this,{coder:G,length:K})}defaultValue(){const G=this.coder.defaultValue(),K=[];for(let ne=0;ne<this.length;ne++)K.push(G);return K}encode(G,K){const ne=Typed.dereference(K,"array");Array.isArray(ne)||this._throwError("expected array value",ne);let ue=this.length;-1===ue&&(ue=ne.length,G.writeValue(ne.length)),assertArgumentCount(ne.length,ue,"coder array"+(this.localName?" "+this.localName:""));let pe=[];for(let G=0;G<ne.length;G++)pe.push(this.coder);return pack$1(G,pe,ne)}decode(G){let K=this.length;-1===K&&(K=G.readIndex(),assert(K*QP<=G.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:G.bytes,offset:K*QP,length:G.dataLength}));let ne=[];for(let G=0;G<K;G++)ne.push(new NI(this.coder));return unpack$1(G,ne)}},BI=class BooleanCoder extends rS{constructor(G){super("bool","bool",G,!1)}defaultValue(){return!1}encode(G,K){const ne=Typed.dereference(K,"bool");return G.writeValue(ne?1:0)}decode(G){return!!G.readValue()}},FI=class DynamicBytesCoder extends rS{constructor(G,K){super(G,G,K,!0)}defaultValue(){return"0x"}encode(G,K){K=getBytesCopy(K);let ne=G.writeValue(K.length);return ne+=G.writeBytes(K),ne}decode(G){return G.readBytes(G.readIndex(),!0)}},DI=class BytesCoder extends FI{constructor(G){super("bytes",G)}decode(G){return hexlify$1(super.decode(G))}},LI=class FixedBytesCoder extends rS{constructor(G,K){let ne="bytes"+String(G);super(ne,ne,K,!1),_defineProperty(this,"size",void 0),defineProperties(this,{size:G},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(G,K){let ne=getBytesCopy(Typed.dereference(K,this.type));return ne.length!==this.size&&this._throwError("incorrect data length",K),G.writeBytes(ne)}decode(G){return hexlify$1(G.readBytes(this.size))}};const UI=new Uint8Array([]);let $I=class NullCoder extends rS{constructor(G){super("null","",G,!1)}defaultValue(){return null}encode(G,K){return null!=K&&this._throwError("not null",K),G.writeBytes(UI)}decode(G){return G.readBytes(0),null}};const qI=BigInt(0),GI=BigInt(1),jI=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");let HI=class NumberCoder extends rS{constructor(G,K,ne){const ue=(K?"int":"uint")+8*G;super(ue,ue,ne,!1),_defineProperty(this,"size",void 0),_defineProperty(this,"signed",void 0),defineProperties(this,{size:G,signed:K},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(G,K){let ne=getBigInt(Typed.dereference(K,this.type)),ue=mask(jI,256);if(this.signed){let G=mask(ue,8*this.size-1);(ne>G||ne<-(G+GI))&&this._throwError("value out-of-bounds",K),ne=toTwos(ne,256)}else(ne<qI||ne>mask(ue,8*this.size))&&this._throwError("value out-of-bounds",K);return G.writeValue(ne)}decode(G){let K=mask(G.readValue(),8*this.size);return this.signed&&(K=function fromTwos(G,K){const ne=getUint(G,"value"),ue=BigInt(getNumber(K,"width"));if(assert(ne>>ue===lP,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:G}),ne>>ue-pP)return-((~ne&(pP<<ue)-pP)+pP);return ne}(K,8*this.size)),K}},WI=class StringCoder extends FI{constructor(G){super("string",G)}defaultValue(){return""}encode(G,K){return super.encode(G,toUtf8Bytes$1(Typed.dereference(K,"string")))}decode(G){return toUtf8String$1(super.decode(G))}},zI=class TupleCoder extends rS{constructor(G,K){let ne=!1;const ue=[];G.forEach((G=>{G.dynamic&&(ne=!0),ue.push(G.type)}));super("tuple","tuple("+ue.join(",")+")",K,ne),_defineProperty(this,"coders",void 0),defineProperties(this,{coders:Object.freeze(G.slice())})}defaultValue(){const G=[];this.coders.forEach((K=>{G.push(K.defaultValue())}));const K=this.coders.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});return this.coders.forEach(((ne,ue)=>{let pe=ne.localName;pe&&1===K[pe]&&("length"===pe&&(pe="_length"),null==G[pe]&&(G[pe]=G[ue]))})),Object.freeze(G)}encode(G,K){const ne=Typed.dereference(K,"tuple");return pack$1(G,this.coders,ne)}decode(G){return unpack$1(G,this.coders)}};function id$2(G){return keccak256$1(toUtf8Bytes$1(G))}var VI="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const KI=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),JI=4;function read_compressed_payload(G){return function read_payload(G){let K=0;return()=>G[K++]}(function decode_arithmetic(G){let K=0;function u16(){return G[K++]<<8|G[K++]}let ne=u16(),ue=1,pe=[0,1];for(let G=1;G<ne;G++)pe.push(ue+=u16());let he=u16(),ye=K;K+=he;let me=0,be=0;function read_bit(){return 0==me&&(be=be<<8|G[K++],me=8),be>>--me&1}const ve=2**31,_e=ve>>>1,Te=ve-1;let Ee=0;for(let G=0;G<31;G++)Ee=Ee<<1|read_bit();let Pe=[],Se=0,Ce=ve;for(;;){let G=Math.floor(((Ee-Se+1)*ue-1)/Ce),K=0,he=ne;for(;he-K>1;){let ne=K+he>>>1;G<pe[ne]?he=ne:K=ne}if(0==K)break;Pe.push(K);let ye=Se+Math.floor(Ce*pe[K]/ue),me=Se+Math.floor(Ce*pe[K+1]/ue)-1;for(;0==((ye^me)&_e);)Ee=Ee<<1&Te|read_bit(),ye=ye<<1&Te,me=me<<1&Te|1;for(;ye&~me&536870912;)Ee=Ee&_e|Ee<<1&Te>>>1|read_bit(),ye=ye<<1^_e,me=(me^_e)<<1|_e|1;Se=ye,Ce=1+me-ye}let ke=ne-4;return Pe.map((K=>{switch(K-ke){case 3:return ke+65792+(G[ye++]<<16|G[ye++]<<8|G[ye++]);case 2:return ke+256+(G[ye++]<<8|G[ye++]);case 1:return ke+G[ye++];default:return K-1}}))}(function unsafe_atob(G){let K=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((G,ne)=>K[G.charCodeAt(0)]=ne));let ne=G.length,ue=new Uint8Array(6*ne>>3);for(let pe=0,he=0,ye=0,me=0;pe<ne;pe++)me=me<<6|K[G.charCodeAt(pe)],ye+=6,ye>=8&&(ue[he++]=me>>(ye-=8));return ue}(G)))}function signed(G){return 1&G?~G>>1:G>>1}function read_deltas(G,K){let ne=Array(G);for(let ue=0,pe=0;ue<G;ue++)ne[ue]=pe+=signed(K());return ne}function read_sorted(G,K=0){let ne=[];for(;;){let ue=G(),pe=G();if(!pe)break;K+=ue;for(let G=0;G<pe;G++)ne.push(K+G);K+=pe+1}return ne}function read_sorted_arrays(G){return read_array_while((()=>{let K=read_sorted(G);if(K.length)return K}))}function read_mapped(G){let K=[];for(;;){let ne=G();if(0==ne)break;K.push(read_linear_table(ne,G))}for(;;){let ne=G()-1;if(ne<0)break;K.push(read_replacement_table(ne,G))}return K.flat()}function read_array_while(G){let K=[];for(;;){let ne=G(K.length);if(!ne)break;K.push(ne)}return K}function read_transposed(G,K,ne){let ue=Array(G).fill().map((()=>[]));for(let pe=0;pe<K;pe++)read_deltas(G,ne).forEach(((G,K)=>ue[K].push(G)));return ue}function read_linear_table(G,K){let ne=1+K(),ue=K(),pe=read_array_while(K);return read_transposed(pe.length,1+G,K).flatMap(((G,K)=>{let[he,...ye]=G;return Array(pe[K]).fill().map(((G,K)=>{let pe=K*ue;return[he+K*ne,ye.map((G=>G+pe))]}))}))}function read_replacement_table(G,K){return read_transposed(1+K(),1+G,K).map((G=>[G[0],G.slice(1)]))}function quote_cp(G){return`{${function hex_cp(G){return G.toString(16).toUpperCase().padStart(2,"0")}(G)}}`}function str_from_cps(G){let K=G.length;if(K<4096)return String.fromCodePoint(...G);let ne=[];for(let ue=0;ue<K;)ne.push(String.fromCodePoint(...G.slice(ue,ue+=4096)));return ne.join("")}function compare_arrays(G,K){let ne=G.length,ue=ne-K.length;for(let pe=0;0==ue&&pe<ne;pe++)ue=G[pe]-K[pe];return ue}var XI="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const QI=44032,ZI=4352,YI=4449,eC=4519,tC=28,rC=21*tC,nC=QI+19*rC,aC=ZI+19,iC=YI+21,sC=eC+tC;function unpack_cc(G){return G>>24&255}function unpack_cp(G){return 16777215&G}let oC,cC,dC,uC;function is_hangul(G){return G>=QI&&G<nC}function compose_pair(G,K){if(G>=ZI&&G<aC&&K>=YI&&K<iC)return QI+(G-ZI)*rC+(K-YI)*tC;if(is_hangul(G)&&K>eC&&K<sC&&(G-QI)%tC==0)return G+(K-eC);{let ne=uC.get(G);return ne&&(ne=ne.get(K),ne)?ne:-1}}function decomposed(G){oC||function init$1(){let G=read_compressed_payload(XI);oC=new Map(read_sorted_arrays(G).flatMap(((G,K)=>G.map((G=>[G,K+1<<24]))))),cC=new Set(read_sorted(G)),dC=new Map,uC=new Map;for(let[K,ne]of read_mapped(G)){if(!cC.has(K)&&2==ne.length){let[G,ue]=ne,pe=uC.get(G);pe||(pe=new Map,uC.set(G,pe)),pe.set(ue,K)}dC.set(K,ne.reverse())}}();let K=[],ne=[],ue=!1;function add(G){let ne=oC.get(G);ne&&(ue=!0,G|=ne),K.push(G)}for(let ue of G)for(;;){if(ue<128)K.push(ue);else if(is_hangul(ue)){let G=ue-QI,K=G%rC/tC|0,ne=G%tC;add(ZI+(G/rC|0)),add(YI+K),ne>0&&add(eC+ne)}else{let G=dC.get(ue);G?ne.push(...G):add(ue)}if(!ne.length)break;ue=ne.pop()}if(ue&&K.length>1){let G=unpack_cc(K[0]);for(let ne=1;ne<K.length;ne++){let ue=unpack_cc(K[ne]);if(0==ue||G<=ue){G=ue;continue}let pe=ne-1;for(;;){let ne=K[pe+1];if(K[pe+1]=K[pe],K[pe]=ne,!pe)break;if(G=unpack_cc(K[--pe]),G<=ue)break}G=unpack_cc(K[ne])}}return K}function nfd(G){return decomposed(G).map(unpack_cp)}function nfc(G){return function composed_from_decomposed(G){let K=[],ne=[],ue=-1,pe=0;for(let he of G){let G=unpack_cc(he),ye=unpack_cp(he);if(-1==ue)0==G?ue=ye:K.push(ye);else if(pe>0&&pe>=G)0==G?(K.push(ue,...ne),ne.length=0,ue=ye):ne.push(ye),pe=G;else{let he=compose_pair(ue,ye);he>=0?ue=he:0==pe&&0==G?(K.push(ue),ue=ye):(ne.push(ye),pe=G)}}return ue>=0&&K.push(ue,...ne),K}(decomposed(G))}const fC=45,lC=".",pC=65039,hC=1,Array_from=G=>Array.from(G);function group_has_cp(G,K){return G.P.has(K)||G.Q.has(K)}class Emoji extends Array{get is_emoji(){return!0}}let yC,mC,bC,gC,vC,wC,_C,TC,AC,EC,PC;function init(){if(yC)return;let G=read_compressed_payload(VI);const read_sorted_array=()=>read_sorted(G),read_sorted_set=()=>new Set(read_sorted_array()),set_add_many=(G,K)=>K.forEach((K=>G.add(K)));yC=new Map(read_mapped(G)),mC=read_sorted_set(),bC=read_sorted_array(),gC=new Set(read_sorted_array().map((G=>bC[G]))),bC=new Set(bC),vC=read_sorted_set(),read_sorted_set();let K=read_sorted_arrays(G),ne=G();const read_chunked=()=>{let G=new Set;return read_sorted_array().forEach((ne=>set_add_many(G,K[ne]))),set_add_many(G,read_sorted_array()),G};wC=read_array_while((K=>{let ue=read_array_while(G).map((G=>G+96));if(ue.length){let pe=K>=ne;return ue[0]-=32,ue=str_from_cps(ue),pe&&(ue=`Restricted[${ue}]`),{N:ue,P:read_chunked(),Q:read_chunked(),M:!G(),R:pe}}})),_C=read_sorted_set(),TC=new Map;let ue=read_sorted_array().concat(Array_from(_C)).sort(((G,K)=>G-K));ue.forEach(((K,ne)=>{let pe=G(),he=ue[ne]=pe?ue[ne-pe]:{V:[],M:new Map};he.V.push(K),_C.has(K)||TC.set(K,he)}));for(let{V:G,M:K}of new Set(TC.values())){let ne=[];for(let K of G){let G=wC.filter((G=>group_has_cp(G,K))),ue=ne.find((({G:K})=>G.some((G=>K.has(G)))));ue||(ue={G:new Set,V:[]},ne.push(ue)),ue.V.push(K),set_add_many(ue.G,G)}let ue=ne.flatMap((G=>Array_from(G.G)));for(let{G:G,V:pe}of ne){let ne=new Set(ue.filter((K=>!G.has(K))));for(let G of pe)K.set(G,ne)}}AC=new Set;let pe=new Set;const add_to_union=G=>AC.has(G)?pe.add(G):AC.add(G);for(let G of wC){for(let K of G.P)add_to_union(K);for(let K of G.Q)add_to_union(K)}for(let G of AC)TC.has(G)||pe.has(G)||TC.set(G,hC);set_add_many(AC,nfd(AC)),EC=function read_trie(G){let K=[],ne=read_sorted(G);return function expand({S:G,B:ne},ue,pe){if(!(4&G&&pe===ue[ue.length-1])){2&G&&(pe=ue[ue.length-1]),1&G&&K.push(ue);for(let G of ne)for(let K of G.Q)expand(G,[...ue,K],pe)}}(function decode(K){let ue=G(),pe=read_array_while((()=>{let K=read_sorted(G).map((G=>ne[G]));if(K.length)return decode(K)}));return{S:ue,B:pe,Q:K}}([]),[]),K}(G).map((G=>Emoji.from(G))).sort(compare_arrays),PC=new Map;for(let G of EC){let K=[PC];for(let ne of G){let G=K.map((G=>{let K=G.get(ne);return K||(K=new Map,G.set(ne,K)),K}));ne===pC?K.push(...G):K=G}for(let ne of K)ne.V=G}}function quoted_cp(G){return(should_escape(G)?"":`${bidi_qq(safe_str_from_cps([G]))} `)+quote_cp(G)}function bidi_qq(G){return`"${G}"‎`}function safe_str_from_cps(G,K=1/0,ne=quote_cp){let ue=[];(function is_combining_mark(G){return init(),bC.has(G)})(G[0])&&ue.push("◌"),G.length>K&&(K>>=1,G=[...G.slice(0,K),8230,...G.slice(-K)]);let pe=0,he=G.length;for(let K=0;K<he;K++){let he=G[K];should_escape(he)&&(ue.push(str_from_cps(G.slice(pe,K))),ue.push(ne(he)),pe=K+1)}return ue.push(str_from_cps(G.slice(pe,he))),ue.join("")}function should_escape(G){return init(),vC.has(G)}function ens_normalize(G){return function flatten(G){return G.map((({input:K,error:ne,output:ue})=>{if(ne){let ue=ne.message;throw new Error(1==G.length?ue:`Invalid label ${bidi_qq(safe_str_from_cps(K,63))}: ${ue}`)}return str_from_cps(ue)})).join(lC)}(function split(G,K,ne){if(!G)return[];init();let ue=0;return G.split(lC).map((G=>{let pe=function explode_cp(G){let K=[];for(let ne=0,ue=G.length;ne<ue;){let ue=G.codePointAt(ne);ne+=ue<65536?1:2,K.push(ue)}return K}(G),he={input:pe,offset:ue};ue+=pe.length+1;try{let G,ue=he.tokens=function tokens_from_str(G,K,ne){let ue=[],pe=[];G=G.slice().reverse();for(;G.length;){let he=consume_emoji_reversed(G);if(he)pe.length&&(ue.push(K(pe)),pe=[]),ue.push(ne(he));else{let K=G.pop();if(AC.has(K))pe.push(K);else{let G=yC.get(K);if(G)pe.push(...G);else if(!mC.has(K))throw error_disallowed(K)}}}pe.length&&ue.push(K(pe));return ue}(pe,K,ne),ye=ue.length;if(!ye)throw new Error("empty label");let me=he.output=ue.flat();if(function check_leading_underscore(G){for(let K=G.lastIndexOf(95);K>0;)if(95!==G[--K])throw new Error("underscore allowed only at start")}(me),!(he.emoji=ye>1||ue[0].is_emoji)&&me.every((G=>G<128)))!function check_label_extension(G){if(G.length>=4&&G[2]==fC&&G[3]==fC)throw new Error(`invalid label extension: "${str_from_cps(G.slice(0,4))}"`)}(me),G="ASCII";else{let K=ue.flatMap((G=>G.is_emoji?[]:G));if(K.length){if(bC.has(me[0]))throw error_placement("leading combining mark");for(let G=1;G<ye;G++){let K=ue[G];if(!K.is_emoji&&bC.has(K[0]))throw error_placement(`emoji + combining mark: "${str_from_cps(ue[G-1])} + ${safe_str_from_cps([K[0]])}"`)}!function check_fenced(G){let K=G[0],ne=KI.get(K);if(ne)throw error_placement(`leading ${ne}`);let ue=G.length,pe=-1;for(let he=1;he<ue;he++){K=G[he];let ue=KI.get(K);if(ue){if(pe==he)throw error_placement(`${ne} + ${ue}`);pe=he+1,ne=ue}}if(pe==ue)throw error_placement(`trailing ${ne}`)}(me);let ne=Array_from(new Set(K)),[pe]=function determine_group(G){let K=wC;for(let ne of G){let G=K.filter((G=>group_has_cp(G,ne)));if(!G.length)throw wC.some((G=>group_has_cp(G,ne)))?error_group_member(K[0],ne):error_disallowed(ne);if(K=G,1==G.length)break}return K}(ne);!function check_group(G,K){for(let ne of K)if(!group_has_cp(G,ne))throw error_group_member(G,ne);if(G.M){let G=nfd(K);for(let K=1,ne=G.length;K<ne;K++)if(gC.has(G[K])){let ue=K+1;for(let pe;ue<ne&&gC.has(pe=G[ue]);ue++)for(let ne=K;ne<ue;ne++)if(G[ne]==pe)throw new Error(`duplicate non-spacing marks: ${quoted_cp(pe)}`);if(ue-K>JI)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(G.slice(K-1,ue)))} (${ue-K}/${JI})`);K=ue}}}(pe,K),function check_whole(G,K){let ne,ue=[];for(let G of K){let K=TC.get(G);if(K===hC)return;if(K){let ue=K.M.get(G);if(ne=ne?ne.filter((G=>ue.has(G))):Array_from(ue),!ne.length)return}else ue.push(G)}if(ne)for(let K of ne)if(ue.every((G=>group_has_cp(K,G))))throw new Error(`whole-script confusable: ${G.N}/${K.N}`)}(pe,ne),G=pe.N}else G="Emoji"}he.type=G}catch(G){he.error=G}return he}))}(G,nfc,filter_fe0f))}function error_disallowed(G){return new Error(`disallowed character: ${quoted_cp(G)}`)}function error_group_member(G,K){let ne=quoted_cp(K),ue=wC.find((G=>G.P.has(K)));return ue&&(ne=`${ue.N} ${ne}`),new Error(`illegal mixture: ${G.N} + ${ne}`)}function error_placement(G){return new Error(`illegal placement: ${G}`)}function filter_fe0f(G){return G.filter((G=>G!=pC))}function consume_emoji_reversed(G,K){let ne,ue=PC,pe=G.length;for(;pe&&(ue=ue.get(G[--pe]),ue);){let{V:K}=ue;K&&(ne=K,G.length=pe)}return ne}const SC=new Uint8Array(32);function checkComponent(G){return assertArgument(0!==G.length,"invalid ENS name; empty component","comp",G),G}function ensNameSplit(G){const K=toUtf8Bytes$1(function ensNormalize(G){try{if(0===G.length)throw new Error("empty label");return ens_normalize(G)}catch(K){assertArgument(!1,`invalid ENS name (${K.message})`,"name",G)}}(G)),ne=[];if(0===G.length)return ne;let ue=0;for(let G=0;G<K.length;G++){46===K[G]&&(ne.push(checkComponent(K.slice(ue,G))),ue=G+1)}return assertArgument(ue<K.length,"invalid ENS name; empty component","name",G),ne.push(checkComponent(K.slice(ue))),ne}function namehash$1(G){assertArgument("string"==typeof G,"invalid ENS name; not a string","name",G),assertArgument(G.length,"invalid ENS name (empty label)","name",G);let K=SC;const ne=ensNameSplit(G);for(;ne.length;)K=keccak256$1(concat$1([K,keccak256$1(ne.pop())]));return hexlify$1(K)}function dnsEncode(G,K){const ne=K;return assertArgument(ne<=255,"DNS encoded label cannot exceed 255","length",ne),hexlify$1(concat$1(ensNameSplit(G).map((K=>{assertArgument(K.length<=ne,`label ${JSON.stringify(G)} exceeds ${ne} bytes`,"name",G);const ue=new Uint8Array(K.length+1);return ue.set(K,1),ue[0]=ue.length-1,ue}))))+"00"}function accessSetify$1(G,K){return{address:getAddress$1(G),storageKeys:K.map(((G,K)=>(assertArgument(isHexString$1(G,32),"invalid slot",`storageKeys[${K}]`,G),G.toLowerCase())))}}function accessListify$1(G){if(Array.isArray(G))return G.map(((K,ne)=>Array.isArray(K)?(assertArgument(2===K.length,"invalid slot set",`value[${ne}]`,K),accessSetify$1(K[0],K[1])):(assertArgument(null!=K&&"object"==typeof K,"invalid address-slot set","value",G),accessSetify$1(K.address,K.storageKeys))));assertArgument(null!=G&&"object"==typeof G,"invalid access list","value",G);const K=Object.keys(G).map((K=>{const ne=G[K].reduce(((G,K)=>(G[K]=!0,G)),{});return accessSetify$1(K,Object.keys(ne).sort())}));return K.sort(((G,K)=>G.address.localeCompare(K.address))),K}function recoverAddress(G,K){return function computeAddress(G){let K;return K="string"==typeof G?SigningKey.computePublicKey(G,!1):G.publicKey,getAddress$1(keccak256$1("0x"+K.substring(4)).substring(26))}(SigningKey.recoverPublicKey(G,K))}SC.fill(0);const IC=BigInt(0),CC=BigInt(2),RC=BigInt(27),kC=BigInt(28),OC=BigInt(35),xC=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function handleAddress(G){return"0x"===G?null:getAddress$1(G)}function handleAccessList(G,K){try{return accessListify$1(G)}catch(ne){assertArgument(!1,ne.message,K,G)}}function handleNumber(G,K){return"0x"===G?0:getNumber(G,K)}function handleUint(G,K){if("0x"===G)return IC;const ne=getBigInt(G,K);return assertArgument(ne<=xC,"value exceeds uint size",K,ne),ne}function formatNumber(G,K){const ne=getBigInt(G,"value"),ue=toBeArray(ne);return assertArgument(ue.length<=32,"value too large",`tx.${K}`,ne),ue}function formatAccessList(G){return accessListify$1(G).map((G=>[G.address,G.storageKeys]))}function formatHashes(G,K){assertArgument(Array.isArray(G),`invalid ${K}`,"value",G);for(let K=0;K<G.length;K++)assertArgument(isHexString$1(G[K],32),"invalid ${ param } hash",`value[${K}]`,G[K]);return G}function _serializeLegacy(G,K){const ne=[formatNumber(G.nonce,"nonce"),formatNumber(G.gasPrice||0,"gasPrice"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data];let ue=IC;if(G.chainId!=IC)ue=getBigInt(G.chainId,"tx.chainId"),assertArgument(!K||null==K.networkV||K.legacyChainId===ue,"tx.chainId/sig.v mismatch","sig",K);else if(G.signature){const K=G.signature.legacyChainId;null!=K&&(ue=K)}if(!K)return ue!==IC&&(ne.push(toBeArray(ue)),ne.push("0x"),ne.push("0x")),encodeRlp(ne);let pe=BigInt(27+K.yParity);return ue!==IC?pe=Signature.getChainIdV(ue,K.v):BigInt(K.v)!==pe&&assertArgument(!1,"tx.chainId/sig.v mismatch","sig",K),ne.push(toBeArray(pe)),ne.push(toBeArray(K.r)),ne.push(toBeArray(K.s)),encodeRlp(ne)}function _parseEipSignature(G,K){let ne;try{if(ne=handleNumber(K[0],"yParity"),0!==ne&&1!==ne)throw new Error("bad yParity")}catch(G){assertArgument(!1,"invalid yParity","yParity",K[0])}const ue=zeroPadValue(K[1],32),pe=zeroPadValue(K[2],32),he=Signature.from({r:ue,s:pe,yParity:ne});G.signature=he}function _serializeEip1559(G,K){const ne=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(G.maxFeePerGas||0,"maxFeePerGas"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[])];return K&&(ne.push(formatNumber(K.yParity,"yParity")),ne.push(toBeArray(K.r)),ne.push(toBeArray(K.s))),concat$1(["0x02",encodeRlp(ne)])}function _serializeEip2930(G,K){const ne=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.gasPrice||0,"gasPrice"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[])];return K&&(ne.push(formatNumber(K.yParity,"recoveryParam")),ne.push(toBeArray(K.r)),ne.push(toBeArray(K.s))),concat$1(["0x01",encodeRlp(ne)])}function _serializeEip4844(G,K){const ne=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(G.maxFeePerGas||0,"maxFeePerGas"),formatNumber(G.gasLimit,"gasLimit"),G.to||dI,formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[]),formatNumber(G.maxFeePerBlobGas||0,"maxFeePerBlobGas"),formatHashes(G.blobVersionedHashes||[],"blobVersionedHashes")];return K&&(ne.push(formatNumber(K.yParity,"yParity")),ne.push(toBeArray(K.r)),ne.push(toBeArray(K.s))),concat$1(["0x03",encodeRlp(ne)])}var NC=new WeakMap,MC=new WeakMap,BC=new WeakMap,FC=new WeakMap,DC=new WeakMap,LC=new WeakMap,UC=new WeakMap,$C=new WeakMap,qC=new WeakMap,GC=new WeakMap,jC=new WeakMap,HC=new WeakMap,WC=new WeakMap,zC=new WeakMap;class Transaction{get type(){return _classPrivateFieldGet2(NC,this)}set type(G){switch(G){case null:_classPrivateFieldSet2(NC,this,null);break;case 0:case"legacy":_classPrivateFieldSet2(NC,this,0);break;case 1:case"berlin":case"eip-2930":_classPrivateFieldSet2(NC,this,1);break;case 2:case"london":case"eip-1559":_classPrivateFieldSet2(NC,this,2);break;case 3:case"cancun":case"eip-4844":_classPrivateFieldSet2(NC,this,3);break;default:assertArgument(!1,"unsupported transaction type","type",G)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const G=_classPrivateFieldGet2(MC,this);return null==G&&3===this.type?dI:G}set to(G){_classPrivateFieldSet2(MC,this,null==G?null:getAddress$1(G))}get nonce(){return _classPrivateFieldGet2(FC,this)}set nonce(G){_classPrivateFieldSet2(FC,this,getNumber(G,"value"))}get gasLimit(){return _classPrivateFieldGet2(DC,this)}set gasLimit(G){_classPrivateFieldSet2(DC,this,getBigInt(G))}get gasPrice(){const G=_classPrivateFieldGet2(LC,this);return null!=G||0!==this.type&&1!==this.type?G:IC}set gasPrice(G){_classPrivateFieldSet2(LC,this,null==G?null:getBigInt(G,"gasPrice"))}get maxPriorityFeePerGas(){const G=_classPrivateFieldGet2(UC,this);return null==G?2===this.type||3===this.type?IC:null:G}set maxPriorityFeePerGas(G){_classPrivateFieldSet2(UC,this,null==G?null:getBigInt(G,"maxPriorityFeePerGas"))}get maxFeePerGas(){const G=_classPrivateFieldGet2($C,this);return null==G?2===this.type||3===this.type?IC:null:G}set maxFeePerGas(G){_classPrivateFieldSet2($C,this,null==G?null:getBigInt(G,"maxFeePerGas"))}get data(){return _classPrivateFieldGet2(BC,this)}set data(G){_classPrivateFieldSet2(BC,this,hexlify$1(G))}get value(){return _classPrivateFieldGet2(qC,this)}set value(G){_classPrivateFieldSet2(qC,this,getBigInt(G,"value"))}get chainId(){return _classPrivateFieldGet2(GC,this)}set chainId(G){_classPrivateFieldSet2(GC,this,getBigInt(G))}get signature(){return _classPrivateFieldGet2(jC,this)||null}set signature(G){_classPrivateFieldSet2(jC,this,null==G?null:Signature.from(G))}get accessList(){const G=_classPrivateFieldGet2(HC,this)||null;return null==G?1===this.type||2===this.type||3===this.type?[]:null:G}set accessList(G){_classPrivateFieldSet2(HC,this,null==G?null:accessListify$1(G))}get maxFeePerBlobGas(){const G=_classPrivateFieldGet2(WC,this);return null==G&&3===this.type?IC:G}set maxFeePerBlobGas(G){_classPrivateFieldSet2(WC,this,null==G?null:getBigInt(G,"maxFeePerBlobGas"))}get blobVersionedHashes(){let G=_classPrivateFieldGet2(zC,this);return null==G&&3===this.type?[]:G}set blobVersionedHashes(G){if(null!=G){assertArgument(Array.isArray(G),"blobVersionedHashes must be an Array","value",G),G=G.slice();for(let K=0;K<G.length;K++)assertArgument(isHexString$1(G[K],32),"invalid blobVersionedHash",`value[${K}]`,G[K])}_classPrivateFieldSet2(zC,this,G)}constructor(){_classPrivateFieldInitSpec(this,NC,void 0),_classPrivateFieldInitSpec(this,MC,void 0),_classPrivateFieldInitSpec(this,BC,void 0),_classPrivateFieldInitSpec(this,FC,void 0),_classPrivateFieldInitSpec(this,DC,void 0),_classPrivateFieldInitSpec(this,LC,void 0),_classPrivateFieldInitSpec(this,UC,void 0),_classPrivateFieldInitSpec(this,$C,void 0),_classPrivateFieldInitSpec(this,qC,void 0),_classPrivateFieldInitSpec(this,GC,void 0),_classPrivateFieldInitSpec(this,jC,void 0),_classPrivateFieldInitSpec(this,HC,void 0),_classPrivateFieldInitSpec(this,WC,void 0),_classPrivateFieldInitSpec(this,zC,void 0),_classPrivateFieldSet2(NC,this,null),_classPrivateFieldSet2(MC,this,null),_classPrivateFieldSet2(FC,this,0),_classPrivateFieldSet2(DC,this,IC),_classPrivateFieldSet2(LC,this,null),_classPrivateFieldSet2(UC,this,null),_classPrivateFieldSet2($C,this,null),_classPrivateFieldSet2(BC,this,"0x"),_classPrivateFieldSet2(qC,this,IC),_classPrivateFieldSet2(GC,this,IC),_classPrivateFieldSet2(jC,this,null),_classPrivateFieldSet2(HC,this,null),_classPrivateFieldSet2(WC,this,null),_classPrivateFieldSet2(zC,this,null)}get hash(){return null==this.signature?null:keccak256$1(this.serialized)}get unsignedHash(){return keccak256$1(this.unsignedSerialized)}get from(){return null==this.signature?null:recoverAddress(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}get serialized(){switch(assert(null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return _serializeLegacy(this,this.signature);case 1:return _serializeEip2930(this,this.signature);case 2:return _serializeEip1559(this,this.signature);case 3:return _serializeEip4844(this,this.signature)}assert(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return _serializeLegacy(this);case 1:return _serializeEip2930(this);case 2:return _serializeEip1559(this);case 3:return _serializeEip4844(this)}assert(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){const G=this.inferTypes();return G.indexOf(2)>=0?2:G.pop()}inferTypes(){const G=null!=this.gasPrice,K=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,ne=null!=this.accessList,ue=null!=_classPrivateFieldGet2(WC,this)||_classPrivateFieldGet2(zC,this);null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&assert(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),assert(!K||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),assert(0!==this.type||!ne,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const pe=[];return null!=this.type?pe.push(this.type):K?pe.push(2):G?(pe.push(1),ne||pe.push(0)):ne?(pe.push(1),pe.push(2)):(ue&&this.to||(pe.push(0),pe.push(1),pe.push(2)),pe.push(3)),pe.sort(),pe}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return Transaction.from(this)}toJSON(){const s=G=>null==G?null:G.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:s(this.gasLimit),gasPrice:s(this.gasPrice),maxPriorityFeePerGas:s(this.maxPriorityFeePerGas),maxFeePerGas:s(this.maxFeePerGas),value:s(this.value),chainId:s(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(G){if(null==G)return new Transaction;if("string"==typeof G){const K=getBytes(G);if(K[0]>=127)return Transaction.from(function _parseLegacy(G){const K=decodeRlp(G);assertArgument(Array.isArray(K)&&(9===K.length||6===K.length),"invalid field count for legacy transaction","data",G);const ne={type:0,nonce:handleNumber(K[0],"nonce"),gasPrice:handleUint(K[1],"gasPrice"),gasLimit:handleUint(K[2],"gasLimit"),to:handleAddress(K[3]),value:handleUint(K[4],"value"),data:hexlify$1(K[5]),chainId:IC};if(6===K.length)return ne;const ue=handleUint(K[6],"v"),pe=handleUint(K[7],"r"),he=handleUint(K[8],"s");if(pe===IC&&he===IC)ne.chainId=ue;else{let pe=(ue-OC)/CC;pe<IC&&(pe=IC),ne.chainId=pe,assertArgument(pe!==IC||ue===RC||ue===kC,"non-canonical legacy v","v",K[6]),ne.signature=Signature.from({r:zeroPadValue(K[7],32),s:zeroPadValue(K[8],32),v:ue}),ne.hash=keccak256$1(G)}return ne}(K));switch(K[0]){case 1:return Transaction.from(function _parseEip2930(G){const K=decodeRlp(getBytes(G).slice(1));assertArgument(Array.isArray(K)&&(8===K.length||11===K.length),"invalid field count for transaction type: 1","data",hexlify$1(G));const ne={type:1,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),gasPrice:handleUint(K[2],"gasPrice"),gasLimit:handleUint(K[3],"gasLimit"),to:handleAddress(K[4]),value:handleUint(K[5],"value"),data:hexlify$1(K[6]),accessList:handleAccessList(K[7],"accessList")};return 8===K.length||(ne.hash=keccak256$1(G),_parseEipSignature(ne,K.slice(8))),ne}(K));case 2:return Transaction.from(function _parseEip1559(G){const K=decodeRlp(getBytes(G).slice(1));assertArgument(Array.isArray(K)&&(9===K.length||12===K.length),"invalid field count for transaction type: 2","data",hexlify$1(G));const ne={type:2,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),maxPriorityFeePerGas:handleUint(K[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(K[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(K[4],"gasLimit"),to:handleAddress(K[5]),value:handleUint(K[6],"value"),data:hexlify$1(K[7]),accessList:handleAccessList(K[8],"accessList")};return 9===K.length||(ne.hash=keccak256$1(G),_parseEipSignature(ne,K.slice(9))),ne}(K));case 3:return Transaction.from(function _parseEip4844(G){const K=decodeRlp(getBytes(G).slice(1));assertArgument(Array.isArray(K)&&(11===K.length||14===K.length),"invalid field count for transaction type: 3","data",hexlify$1(G));const ne={type:3,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),maxPriorityFeePerGas:handleUint(K[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(K[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(K[4],"gasLimit"),to:handleAddress(K[5]),value:handleUint(K[6],"value"),data:hexlify$1(K[7]),accessList:handleAccessList(K[8],"accessList"),maxFeePerBlobGas:handleUint(K[9],"maxFeePerBlobGas"),blobVersionedHashes:K[10]};assertArgument(null!=ne.to,"invalid address for transaction type: 3","data",G),assertArgument(Array.isArray(ne.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",G);for(let K=0;K<ne.blobVersionedHashes.length;K++)assertArgument(isHexString$1(ne.blobVersionedHashes[K],32),`invalid blobVersionedHash at index ${K}: must be length 32`,"data",G);return 11===K.length||(ne.hash=keccak256$1(G),_parseEipSignature(ne,K.slice(11))),ne}(K))}assert(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const K=new Transaction;return null!=G.type&&(K.type=G.type),null!=G.to&&(K.to=G.to),null!=G.nonce&&(K.nonce=G.nonce),null!=G.gasLimit&&(K.gasLimit=G.gasLimit),null!=G.gasPrice&&(K.gasPrice=G.gasPrice),null!=G.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas),null!=G.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null!=G.maxFeePerBlobGas&&(K.maxFeePerBlobGas=G.maxFeePerBlobGas),null!=G.data&&(K.data=G.data),null!=G.value&&(K.value=G.value),null!=G.chainId&&(K.chainId=G.chainId),null!=G.signature&&(K.signature=Signature.from(G.signature)),null!=G.accessList&&(K.accessList=G.accessList),null!=G.blobVersionedHashes&&(K.blobVersionedHashes=G.blobVersionedHashes),null!=G.hash&&(assertArgument(K.isSigned(),"unsigned transaction cannot define hash","tx",G),assertArgument(K.hash===G.hash,"hash mismatch","tx",G)),null!=G.from&&(assertArgument(K.isSigned(),"unsigned transaction cannot define from","tx",G),assertArgument(K.from.toLowerCase()===(G.from||"").toLowerCase(),"from mismatch","tx",G)),K}}const VC=new Uint8Array(32);VC.fill(0);const KC=BigInt(-1),JC=BigInt(0),XC=BigInt(1),QC=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const ZC=toBeHex(XC,32),YC=toBeHex(JC,32),eR={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},tR=["name","version","chainId","verifyingContract","salt"];function checkString(G){return function(K){return assertArgument("string"==typeof K,`invalid domain value for ${JSON.stringify(G)}`,`domain.${G}`,K),K}}const rR={name:checkString("name"),version:checkString("version"),chainId:function(G){const K=getBigInt(G,"domain.chainId");return assertArgument(K>=0,"invalid chain ID","domain.chainId",G),Number.isSafeInteger(K)?Number(K):toQuantity(K)},verifyingContract:function(G){try{return getAddress$1(G).toLowerCase()}catch(G){}assertArgument(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",G)},salt:function(G){const K=getBytes(G,"domain.salt");return assertArgument(32===K.length,'invalid domain value "salt"',"domain.salt",G),hexlify$1(K)}};function getBaseEncoder(G){{const K=G.match(/^(u?)int(\d+)$/);if(K){const ne=""===K[1],ue=parseInt(K[2]);assertArgument(ue%8==0&&0!==ue&&ue<=256&&K[2]===String(ue),"invalid numeric width","type",G);const pe=mask(QC,ne?ue-1:ue),he=ne?(pe+XC)*KC:JC;return function(K){const ue=getBigInt(K,"value");return assertArgument(ue>=he&&ue<=pe,`value out-of-bounds for ${G}`,"value",ue),toBeHex(ne?toTwos(ue,256):ue,32)}}}{const K=G.match(/^bytes(\d+)$/);if(K){const ne=parseInt(K[1]);return assertArgument(0!==ne&&ne<=32&&K[1]===String(ne),"invalid bytes width","type",G),function(K){return assertArgument(getBytes(K).length===ne,`invalid length for ${G}`,"value",K),function hexPadRight(G){const K=getBytes(G),ne=K.length%32;return ne?concat$1([K,VC.slice(ne)]):hexlify$1(K)}(K)}}}switch(G){case"address":return function(G){return zeroPadValue(getAddress$1(G),32)};case"bool":return function(G){return G?ZC:YC};case"bytes":return function(G){return keccak256$1(G)};case"string":return function(G){return id$2(G)}}return null}function encodeType(G,K){return`${G}(${K.map((({name:G,type:K})=>K+" "+G)).join(",")})`}function splitArray(G){const K=G.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return K?{base:K[1],index:K[2]+K[4],array:{base:K[1],prefix:K[1]+K[2],count:K[5]?parseInt(K[5]):-1}}:{base:G}}var nR,aR=new WeakMap,iR=new WeakMap,sR=new WeakMap,oR=new WeakSet;class TypedDataEncoder{get types(){return JSON.parse(_classPrivateFieldGet2(aR,this))}constructor(G){_classPrivateMethodInitSpec(this,oR),_defineProperty(this,"primaryType",void 0),_classPrivateFieldInitSpec(this,aR,void 0),_classPrivateFieldInitSpec(this,iR,void 0),_classPrivateFieldInitSpec(this,sR,void 0),_classPrivateFieldSet2(iR,this,new Map),_classPrivateFieldSet2(sR,this,new Map);const K=new Map,ne=new Map,ue=new Map,pe={};Object.keys(G).forEach((he=>{pe[he]=G[he].map((({name:K,type:ne})=>{let{base:ue,index:pe}=splitArray(ne);return"int"!==ue||G.int||(ue="int256"),"uint"!==ue||G.uint||(ue="uint256"),{name:K,type:ue+(pe||"")}})),K.set(he,new Set),ne.set(he,[]),ue.set(he,new Set)})),_classPrivateFieldSet2(aR,this,JSON.stringify(pe));for(const ue in pe){const he=new Set;for(const ye of pe[ue]){assertArgument(!he.has(ye.name),`duplicate variable name ${JSON.stringify(ye.name)} in ${JSON.stringify(ue)}`,"types",G),he.add(ye.name);const pe=splitArray(ye.type).base;assertArgument(pe!==ue,`circular type reference to ${JSON.stringify(pe)}`,"types",G);getBaseEncoder(pe)||(assertArgument(ne.has(pe),`unknown type ${JSON.stringify(pe)}`,"types",G),ne.get(pe).push(ue),K.get(ue).add(pe))}}const he=Array.from(ne.keys()).filter((G=>0===ne.get(G).length));assertArgument(0!==he.length,"missing primary type","types",G),assertArgument(1===he.length,`ambiguous primary types or unused types: ${he.map((G=>JSON.stringify(G))).join(", ")}`,"types",G),defineProperties(this,{primaryType:he[0]}),function checkCircular(pe,he){assertArgument(!he.has(pe),`circular type reference to ${JSON.stringify(pe)}`,"types",G),he.add(pe);for(const G of K.get(pe))if(ne.has(G)){checkCircular(G,he);for(const K of he)ue.get(K).add(G)}he.delete(pe)}(this.primaryType,new Set);for(const[G,K]of ue){const ne=Array.from(K);ne.sort(),_classPrivateFieldGet2(iR,this).set(G,encodeType(G,pe[G])+ne.map((G=>encodeType(G,pe[G]))).join(""))}}getEncoder(G){let K=_classPrivateFieldGet2(sR,this).get(G);return K||(K=_assertClassBrand(oR,this,_getEncoder).call(this,G),_classPrivateFieldGet2(sR,this).set(G,K)),K}encodeType(G){const K=_classPrivateFieldGet2(iR,this).get(G);return assertArgument(K,`unknown type: ${JSON.stringify(G)}`,"name",G),K}encodeData(G,K){return this.getEncoder(G)(K)}hashStruct(G,K){return keccak256$1(this.encodeData(G,K))}encode(G){return this.encodeData(this.primaryType,G)}hash(G){return this.hashStruct(this.primaryType,G)}_visit(G,K,ne){if(getBaseEncoder(G))return ne(G,K);const ue=splitArray(G).array;if(ue)return assertArgument(-1===ue.count||ue.count===K.length,`array length mismatch; expected length ${ue.count}`,"value",K),K.map((G=>this._visit(ue.prefix,G,ne)));const pe=this.types[G];if(pe)return pe.reduce(((G,{name:ue,type:pe})=>(G[ue]=this._visit(pe,K[ue],ne),G)),{});assertArgument(!1,`unknown type: ${G}`,"type",G)}visit(G,K){return this._visit(this.primaryType,G,K)}static from(G){return new TypedDataEncoder(G)}static getPrimaryType(G){return TypedDataEncoder.from(G).primaryType}static hashStruct(G,K,ne){return TypedDataEncoder.from(K).hashStruct(G,ne)}static hashDomain(G){const K=[];for(const ne in G){if(null==G[ne])continue;const ue=eR[ne];assertArgument(ue,`invalid typed-data domain key: ${JSON.stringify(ne)}`,"domain",G),K.push({name:ne,type:ue})}return K.sort(((G,K)=>tR.indexOf(G.name)-tR.indexOf(K.name))),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:K},G)}static encode(G,K,ne){return concat$1(["0x1901",TypedDataEncoder.hashDomain(G),TypedDataEncoder.from(K).hash(ne)])}static hash(G,K,ne){return keccak256$1(TypedDataEncoder.encode(G,K,ne))}static async resolveNames(G,K,ne,ue){G=Object.assign({},G);for(const K in G)null==G[K]&&delete G[K];const pe={};G.verifyingContract&&!isHexString$1(G.verifyingContract,20)&&(pe[G.verifyingContract]="0x");const he=TypedDataEncoder.from(K);he.visit(ne,((G,K)=>("address"!==G||isHexString$1(K,20)||(pe[K]="0x"),K)));for(const G in pe)pe[G]=await ue(G);return G.verifyingContract&&pe[G.verifyingContract]&&(G.verifyingContract=pe[G.verifyingContract]),{domain:G,value:ne=he.visit(ne,((G,K)=>"address"===G&&pe[K]?pe[K]:K))}}static getPayload(G,K,ne){TypedDataEncoder.hashDomain(G);const ue={},pe=[];tR.forEach((K=>{const ne=G[K];null!=ne&&(ue[K]=rR[K](ne),pe.push({name:K,type:eR[K]}))}));const he=TypedDataEncoder.from(K);K=he.types;const ye=Object.assign({},K);return assertArgument(null==ye.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",K),ye.EIP712Domain=pe,he.encode(ne),{types:ye,domain:ue,primaryType:he.primaryType,message:he.visit(ne,((G,K)=>{if(G.match(/^bytes(\d*)/))return hexlify$1(getBytes(K));if(G.match(/^u?int/))return getBigInt(K).toString();switch(G){case"address":return K.toLowerCase();case"bool":return!!K;case"string":return assertArgument("string"==typeof K,"invalid string","value",K),K}assertArgument(!1,"unsupported type","type",G)}))}}}function _getEncoder(G){{const K=getBaseEncoder(G);if(K)return K}const K=splitArray(G).array;if(K){const G=K.prefix,ne=this.getEncoder(G);return ue=>{assertArgument(-1===K.count||K.count===ue.length,`array length mismatch; expected length ${K.count}`,"value",ue);let pe=ue.map(ne);return _classPrivateFieldGet2(iR,this).has(G)&&(pe=pe.map(keccak256$1)),keccak256$1(concat$1(pe))}}const ne=this.types[G];if(ne){const K=id$2(_classPrivateFieldGet2(iR,this).get(G));return G=>{const ue=ne.map((({name:K,type:ne})=>{const ue=this.getEncoder(ne)(G[K]);return _classPrivateFieldGet2(iR,this).has(ne)?keccak256$1(ue):ue}));return ue.unshift(K),concat$1(ue)}}assertArgument(!1,`unknown type: ${G}`,"type",G)}function setify(G){const K=new Set;return G.forEach((G=>K.add(G))),Object.freeze(K)}const cR=setify("external public payable override".split(" ")),dR="constant external internal payable private public pure view override",uR=setify(dR.split(" ")),fR="constructor error event fallback function receive struct",lR=setify(fR.split(" ")),pR="calldata memory storage payable indexed",hR=setify(pR.split(" ")),yR=setify([fR,pR,"tuple returns",dR].join(" ").split(" ")),mR={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},bR=new RegExp("^(\\s*)"),gR=new RegExp("^([0-9]+)"),vR=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),wR=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),_R=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var TR=new WeakMap,AR=new WeakMap,ER=new WeakSet;class TokenString{get offset(){return _classPrivateFieldGet2(TR,this)}get length(){return _classPrivateFieldGet2(AR,this).length-_classPrivateFieldGet2(TR,this)}constructor(G){_classPrivateMethodInitSpec(this,ER),_classPrivateFieldInitSpec(this,TR,void 0),_classPrivateFieldInitSpec(this,AR,void 0),_classPrivateFieldSet2(TR,this,0),_classPrivateFieldSet2(AR,this,G.slice())}clone(){return new TokenString(_classPrivateFieldGet2(AR,this))}reset(){_classPrivateFieldSet2(TR,this,0)}popKeyword(G){const K=this.peek();if("KEYWORD"!==K.type||!G.has(K.text))throw new Error(`expected keyword ${K.text}`);return this.pop().text}popType(G){if(this.peek().type!==G){const K=this.peek();throw new Error(`expected ${G}; got ${K.type} ${JSON.stringify(K.text)}`)}return this.pop().text}popParen(){const G=this.peek();if("OPEN_PAREN"!==G.type)throw new Error("bad start");const K=_assertClassBrand(ER,this,_subTokenString).call(this,_classPrivateFieldGet2(TR,this)+1,G.match+1);return _classPrivateFieldSet2(TR,this,G.match+1),K}popParams(){const G=this.peek();if("OPEN_PAREN"!==G.type)throw new Error("bad start");const K=[];for(;_classPrivateFieldGet2(TR,this)<G.match-1;){const G=this.peek().linkNext;K.push(_assertClassBrand(ER,this,_subTokenString).call(this,_classPrivateFieldGet2(TR,this)+1,G)),_classPrivateFieldSet2(TR,this,G)}return _classPrivateFieldSet2(TR,this,G.match+1),K}peek(){if(_classPrivateFieldGet2(TR,this)>=_classPrivateFieldGet2(AR,this).length)throw new Error("out-of-bounds");return _classPrivateFieldGet2(AR,this)[_classPrivateFieldGet2(TR,this)]}peekKeyword(G){const K=this.peekType("KEYWORD");return null!=K&&G.has(K)?K:null}peekType(G){if(0===this.length)return null;const K=this.peek();return K.type===G?K.text:null}pop(){var G;const K=this.peek();return _classPrivateFieldSet2(TR,this,(G=_classPrivateFieldGet2(TR,this),++G)),K}toString(){const G=[];for(let K=_classPrivateFieldGet2(TR,this);K<_classPrivateFieldGet2(AR,this).length;K++){const ne=_classPrivateFieldGet2(AR,this)[K];G.push(`${ne.type}:${ne.text}`)}return`<TokenString ${G.join(" ")}>`}}function _subTokenString(G=0,K=0){return new nR(_classPrivateFieldGet2(AR,this).slice(G,K).map((K=>Object.freeze(Object.assign({},K,{match:K.match-G,linkBack:K.linkBack-G,linkNext:K.linkNext-G})))))}function lex(G){const K=[],throwError=K=>{const ne=pe<G.length?JSON.stringify(G[pe]):"$EOI";throw new Error(`invalid token ${ne} at ${pe}: ${K}`)};let ne=[],ue=[],pe=0;for(;pe<G.length;){let he=G.substring(pe),ye=he.match(bR);ye&&(pe+=ye[1].length,he=G.substring(pe));const me={depth:ne.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:pe,value:-1};K.push(me);let be=mR[he[0]]||"";if(be){if(me.type=be,me.text=he[0],pe++,"OPEN_PAREN"===be)ne.push(K.length-1),ue.push(K.length-1);else if("CLOSE_PAREN"==be)0===ne.length&&throwError("no matching open bracket"),me.match=ne.pop(),K[me.match].match=K.length-1,me.depth--,me.linkBack=ue.pop(),K[me.linkBack].linkNext=K.length-1;else if("COMMA"===be)me.linkBack=ue.pop(),K[me.linkBack].linkNext=K.length-1,ue.push(K.length-1);else if("OPEN_BRACKET"===be)me.type="BRACKET";else if("CLOSE_BRACKET"===be){let G=K.pop().text;if(K.length>0&&"NUMBER"===K[K.length-1].type){const ne=K.pop().text;G=ne+G,K[K.length-1].value=getNumber(ne)}if(0===K.length||"BRACKET"!==K[K.length-1].type)throw new Error("missing opening bracket");K[K.length-1].text+=G}}else if(ye=he.match(vR),ye){if(me.text=ye[1],pe+=me.text.length,yR.has(me.text)){me.type="KEYWORD";continue}if(me.text.match(_R)){me.type="TYPE";continue}me.type="ID"}else{if(ye=he.match(gR),!ye)throw new Error(`unexpected token ${JSON.stringify(he[0])} at position ${pe}`);me.text=ye[1],me.type="NUMBER",pe+=me.text.length}}return new TokenString(K.map((G=>Object.freeze(G))))}function allowSingle(G,K){let ne=[];for(const ue in K.keys())G.has(ue)&&ne.push(ue);if(ne.length>1)throw new Error(`conflicting types: ${ne.join(", ")}`)}function consumeName(G,K){if(K.peekKeyword(lR)){const ne=K.pop().text;if(ne!==G)throw new Error(`expected ${G}, got ${ne}`)}return K.popType("ID")}function consumeKeywords(G,K){const ne=new Set;for(;;){const ue=G.peekType("KEYWORD");if(null==ue||K&&!K.has(ue))break;if(G.pop(),ne.has(ue))throw new Error(`duplicate keywords: ${JSON.stringify(ue)}`);ne.add(ue)}return Object.freeze(ne)}function consumeMutability(G){let K=consumeKeywords(G,uR);return allowSingle(K,setify("constant payable nonpayable".split(" "))),allowSingle(K,setify("pure view payable nonpayable".split(" "))),K.has("view")?"view":K.has("pure")?"pure":K.has("payable")?"payable":K.has("nonpayable")?"nonpayable":K.has("constant")?"view":"nonpayable"}function consumeParams(G,K){return G.popParams().map((G=>FR.from(G,K)))}function consumeGas(G){if(G.peekType("AT")){if(G.pop(),G.peekType("NUMBER"))return getBigInt(G.pop().text);throw new Error("invalid gas")}return null}function consumeEoi(G){if(G.length)throw new Error(`unexpected tokens at offset ${G.offset}: ${G.toString()}`)}nR=TokenString;const PR=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(G){const K=G.match(_R);if(assertArgument(K,"invalid type","type",G),"uint"===G)return"uint256";if("int"===G)return"int256";if(K[2]){const ne=parseInt(K[2]);assertArgument(0!==ne&&ne<=32,"invalid bytes length","type",G)}else if(K[3]){const ne=parseInt(K[3]);assertArgument(0!==ne&&ne<=256&&ne%8==0,"invalid numeric width","type",G)}return G}const SR={},IR=Symbol.for("_ethers_internal"),CR="_ParamTypeInternal",RR="_ErrorInternal",kR="_EventInternal",OR="_ConstructorInternal",xR="_FallbackInternal",NR="_FunctionInternal",MR="_StructInternal";var BR=new WeakSet;let FR=class ParamType{constructor(G,K,ne,ue,pe,he,ye,me){if(_classPrivateMethodInitSpec(this,BR),_defineProperty(this,"name",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"baseType",void 0),_defineProperty(this,"indexed",void 0),_defineProperty(this,"components",void 0),_defineProperty(this,"arrayLength",void 0),_defineProperty(this,"arrayChildren",void 0),assertPrivate(G,SR,"ParamType"),Object.defineProperty(this,IR,{value:CR}),he&&(he=Object.freeze(he.slice())),"array"===ue){if(null==ye||null==me)throw new Error("")}else if(null!=ye||null!=me)throw new Error("");if("tuple"===ue){if(null==he)throw new Error("")}else if(null!=he)throw new Error("");defineProperties(this,{name:K,type:ne,baseType:ue,indexed:pe,components:he,arrayLength:ye,arrayChildren:me})}format(G){if(null==G&&(G="sighash"),"json"===G){const K=this.name||"";if(this.isArray()){const G=JSON.parse(this.arrayChildren.format("json"));return G.name=K,G.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(G)}const ne={type:"tuple"===this.baseType?"tuple":this.type,name:K};return"boolean"==typeof this.indexed&&(ne.indexed=this.indexed),this.isTuple()&&(ne.components=this.components.map((K=>JSON.parse(K.format(G))))),JSON.stringify(ne)}let K="";return this.isArray()?(K+=this.arrayChildren.format(G),K+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?K+="("+this.components.map((K=>K.format(G))).join("full"===G?", ":",")+")":K+=this.type,"sighash"!==G&&(!0===this.indexed&&(K+=" indexed"),"full"===G&&this.name&&(K+=" "+this.name)),K}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(G,K){if(this.isArray()){if(!Array.isArray(G))throw new Error("invalid array value");if(-1!==this.arrayLength&&G.length!==this.arrayLength)throw new Error("array is wrong length");const ne=this;return G.map((G=>ne.arrayChildren.walk(G,K)))}if(this.isTuple()){if(!Array.isArray(G))throw new Error("invalid tuple value");if(G.length!==this.components.length)throw new Error("array is wrong length");const ne=this;return G.map(((G,ue)=>ne.components[ue].walk(G,K)))}return K(this.type,G)}async walkAsync(G,K){const ne=[],ue=[G];return _assertClassBrand(BR,this,_walkAsync).call(this,ne,G,K,(G=>{ue[0]=G})),ne.length&&await Promise.all(ne),ue[0]}static from(G,K){if(ParamType.isParamType(G))return G;if("string"==typeof G)try{return ParamType.from(lex(G),K)}catch(K){assertArgument(!1,"invalid param type","obj",G)}else if(G instanceof TokenString){let ne="",ue="",pe=null;consumeKeywords(G,setify(["tuple"])).has("tuple")||G.peekType("OPEN_PAREN")?(ue="tuple",pe=G.popParams().map((G=>ParamType.from(G))),ne=`tuple(${pe.map((G=>G.format())).join(",")})`):(ne=verifyBasicType(G.popType("TYPE")),ue=ne);let he=null,ye=null;for(;G.length&&G.peekType("BRACKET");){const K=G.pop();he=new ParamType(SR,"",ne,ue,null,pe,ye,he),ye=K.value,ne+=K.text,ue="array",pe=null}let me=null;if(consumeKeywords(G,hR).has("indexed")){if(!K)throw new Error("");me=!0}const be=G.peekType("ID")?G.pop().text:"";if(G.length)throw new Error("leftover tokens");return new ParamType(SR,be,ne,ue,me,pe,ye,he)}const ne=G.name;assertArgument(!ne||"string"==typeof ne&&ne.match(wR),"invalid name","obj.name",ne);let ue=G.indexed;null!=ue&&(assertArgument(K,"parameter cannot be indexed","obj.indexed",G.indexed),ue=!!ue);let pe=G.type,he=pe.match(PR);if(he){const K=parseInt(he[2]||"-1"),ye=ParamType.from({type:he[1],components:G.components});return new ParamType(SR,ne||"",pe,"array",ue,null,K,ye)}if("tuple"===pe||pe.startsWith("tuple(")||pe.startsWith("(")){const K=null!=G.components?G.components.map((G=>ParamType.from(G))):null;return new ParamType(SR,ne||"",pe,"tuple",ue,K,null,null)}return pe=verifyBasicType(G.type),new ParamType(SR,ne||"",pe,pe,ue,null,null,null)}static isParamType(G){return G&&G[IR]===CR}};function _walkAsync(G,K,ne,ue){if(this.isArray()){if(!Array.isArray(K))throw new Error("invalid array value");if(-1!==this.arrayLength&&K.length!==this.arrayLength)throw new Error("array is wrong length");const pe=this.arrayChildren,he=K.slice();return he.forEach(((K,ue)=>{_assertClassBrand(BR,pe,_walkAsync).call(pe,G,K,ne,(G=>{he[ue]=G}))})),void ue(he)}if(this.isTuple()){const pe=this.components;let he;if(Array.isArray(K))he=K.slice();else{if(null==K||"object"!=typeof K)throw new Error("invalid tuple value");he=pe.map((G=>{if(!G.name)throw new Error("cannot use object value with unnamed components");if(!(G.name in K))throw new Error(`missing value for component ${G.name}`);return K[G.name]}))}if(he.length!==this.components.length)throw new Error("array is wrong length");return he.forEach(((K,ue)=>{var ye;_assertClassBrand(BR,ye=pe[ue],_walkAsync).call(ye,G,K,ne,(G=>{he[ue]=G}))})),void ue(he)}const pe=ne(this.type,K);pe.then?G.push(async function(){ue(await pe)}()):ue(pe)}let DR=class Fragment{constructor(G,K,ne){_defineProperty(this,"type",void 0),_defineProperty(this,"inputs",void 0),assertPrivate(G,SR,"Fragment"),defineProperties(this,{type:K,inputs:ne=Object.freeze(ne.slice())})}static from(G){if("string"==typeof G){try{Fragment.from(JSON.parse(G))}catch(G){}return Fragment.from(lex(G))}if(G instanceof TokenString){switch(G.peekKeyword(lR)){case"constructor":return $R.from(G);case"error":return LR.from(G);case"event":return UR.from(G);case"fallback":case"receive":return FallbackFragment.from(G);case"function":return qR.from(G);case"struct":return StructFragment.from(G)}}else if("object"==typeof G){switch(G.type){case"constructor":return $R.from(G);case"error":return LR.from(G);case"event":return UR.from(G);case"fallback":case"receive":return FallbackFragment.from(G);case"function":return qR.from(G);case"struct":return StructFragment.from(G)}assert(!1,`unsupported type: ${G.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(!1,"unsupported frgament object","obj",G)}static isConstructor(G){return $R.isFragment(G)}static isError(G){return LR.isFragment(G)}static isEvent(G){return UR.isFragment(G)}static isFunction(G){return qR.isFragment(G)}static isStruct(G){return StructFragment.isFragment(G)}};class NamedFragment extends DR{constructor(G,K,ne,ue){super(G,K,ue),_defineProperty(this,"name",void 0),assertArgument("string"==typeof ne&&ne.match(wR),"invalid identifier","name",ne),ue=Object.freeze(ue.slice()),defineProperties(this,{name:ne})}}function joinParams(G,K){return"("+K.map((K=>K.format(G))).join("full"===G?", ":",")+")"}let LR=class ErrorFragment extends NamedFragment{constructor(G,K,ne){super(G,"error",K,ne),Object.defineProperty(this,IR,{value:RR})}get selector(){return id$2(this.format("sighash")).substring(0,10)}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("error"),K.push(this.name+joinParams(G,this.inputs)),K.join(" ")}static from(G){if(ErrorFragment.isFragment(G))return G;if("string"==typeof G)return ErrorFragment.from(lex(G));if(G instanceof TokenString){const K=consumeName("error",G),ne=consumeParams(G);return consumeEoi(G),new ErrorFragment(SR,K,ne)}return new ErrorFragment(SR,G.name,G.inputs?G.inputs.map(FR.from):[])}static isFragment(G){return G&&G[IR]===RR}},UR=class EventFragment extends NamedFragment{constructor(G,K,ne,ue){super(G,"event",K,ne),_defineProperty(this,"anonymous",void 0),Object.defineProperty(this,IR,{value:kR}),defineProperties(this,{anonymous:ue})}get topicHash(){return id$2(this.format("sighash"))}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("event"),K.push(this.name+joinParams(G,this.inputs)),"sighash"!==G&&this.anonymous&&K.push("anonymous"),K.join(" ")}static getTopicHash(G,K){K=(K||[]).map((G=>FR.from(G)));return new EventFragment(SR,G,K,!1).topicHash}static from(G){if(EventFragment.isFragment(G))return G;if("string"==typeof G)try{return EventFragment.from(lex(G))}catch(K){assertArgument(!1,"invalid event fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("event",G),ne=consumeParams(G,!0),ue=!!consumeKeywords(G,setify(["anonymous"])).has("anonymous");return consumeEoi(G),new EventFragment(SR,K,ne,ue)}return new EventFragment(SR,G.name,G.inputs?G.inputs.map((G=>FR.from(G,!0))):[],!!G.anonymous)}static isFragment(G){return G&&G[IR]===kR}},$R=class ConstructorFragment extends DR{constructor(G,K,ne,ue,pe){super(G,K,ne),_defineProperty(this,"payable",void 0),_defineProperty(this,"gas",void 0),Object.defineProperty(this,IR,{value:OR}),defineProperties(this,{payable:ue,gas:pe})}format(G){if(assert(null!=G&&"sighash"!==G,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===G)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const K=[`constructor${joinParams(G,this.inputs)}`];return this.payable&&K.push("payable"),null!=this.gas&&K.push(`@${this.gas.toString()}`),K.join(" ")}static from(G){if(ConstructorFragment.isFragment(G))return G;if("string"==typeof G)try{return ConstructorFragment.from(lex(G))}catch(K){assertArgument(!1,"invalid constuctor fragment","obj",G)}else if(G instanceof TokenString){consumeKeywords(G,setify(["constructor"]));const K=consumeParams(G),ne=!!consumeKeywords(G,cR).has("payable"),ue=consumeGas(G);return consumeEoi(G),new ConstructorFragment(SR,"constructor",K,ne,ue)}return new ConstructorFragment(SR,"constructor",G.inputs?G.inputs.map(FR.from):[],!!G.payable,null!=G.gas?G.gas:null)}static isFragment(G){return G&&G[IR]===OR}};class FallbackFragment extends DR{constructor(G,K,ne){super(G,"fallback",K),_defineProperty(this,"payable",void 0),Object.defineProperty(this,IR,{value:xR}),defineProperties(this,{payable:ne})}format(G){const K=0===this.inputs.length?"receive":"fallback";if("json"===G){const G=this.payable?"payable":"nonpayable";return JSON.stringify({type:K,stateMutability:G})}return`${K}()${this.payable?" payable":""}`}static from(G){if(FallbackFragment.isFragment(G))return G;if("string"==typeof G)try{return FallbackFragment.from(lex(G))}catch(K){assertArgument(!1,"invalid fallback fragment","obj",G)}else if(G instanceof TokenString){const K=G.toString();assertArgument(G.peekKeyword(setify(["fallback","receive"])),"type must be fallback or receive","obj",K);if("receive"===G.popKeyword(setify(["fallback","receive"]))){const K=consumeParams(G);return assertArgument(0===K.length,"receive cannot have arguments","obj.inputs",K),consumeKeywords(G,setify(["payable"])),consumeEoi(G),new FallbackFragment(SR,[],!0)}let ne=consumeParams(G);ne.length?assertArgument(1===ne.length&&"bytes"===ne[0].type,"invalid fallback inputs","obj.inputs",ne.map((G=>G.format("minimal"))).join(", ")):ne=[FR.from("bytes")];const ue=consumeMutability(G);if(assertArgument("nonpayable"===ue||"payable"===ue,"fallback cannot be constants","obj.stateMutability",ue),consumeKeywords(G,setify(["returns"])).has("returns")){const K=consumeParams(G);assertArgument(1===K.length&&"bytes"===K[0].type,"invalid fallback outputs","obj.outputs",K.map((G=>G.format("minimal"))).join(", "))}return consumeEoi(G),new FallbackFragment(SR,ne,"payable"===ue)}if("receive"===G.type)return new FallbackFragment(SR,[],!0);if("fallback"===G.type){const K=[FR.from("bytes")],ne="payable"===G.stateMutability;return new FallbackFragment(SR,K,ne)}assertArgument(!1,"invalid fallback description","obj",G)}static isFragment(G){return G&&G[IR]===xR}}let qR=class FunctionFragment extends NamedFragment{constructor(G,K,ne,ue,pe,he){super(G,"function",K,ue),_defineProperty(this,"constant",void 0),_defineProperty(this,"outputs",void 0),_defineProperty(this,"stateMutability",void 0),_defineProperty(this,"payable",void 0),_defineProperty(this,"gas",void 0),Object.defineProperty(this,IR,{value:NR});defineProperties(this,{constant:"view"===ne||"pure"===ne,gas:he,outputs:pe=Object.freeze(pe.slice()),payable:"payable"===ne,stateMutability:ne})}get selector(){return id$2(this.format("sighash")).substring(0,10)}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G)))),outputs:this.outputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("function"),K.push(this.name+joinParams(G,this.inputs)),"sighash"!==G&&("nonpayable"!==this.stateMutability&&K.push(this.stateMutability),this.outputs&&this.outputs.length&&(K.push("returns"),K.push(joinParams(G,this.outputs))),null!=this.gas&&K.push(`@${this.gas.toString()}`)),K.join(" ")}static getSelector(G,K){K=(K||[]).map((G=>FR.from(G)));return new FunctionFragment(SR,G,"view",K,[],null).selector}static from(G){if(FunctionFragment.isFragment(G))return G;if("string"==typeof G)try{return FunctionFragment.from(lex(G))}catch(K){assertArgument(!1,"invalid function fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("function",G),ne=consumeParams(G),ue=consumeMutability(G);let pe=[];consumeKeywords(G,setify(["returns"])).has("returns")&&(pe=consumeParams(G));const he=consumeGas(G);return consumeEoi(G),new FunctionFragment(SR,K,ue,ne,pe,he)}let K=G.stateMutability;return null==K&&(K="payable","boolean"==typeof G.constant?(K="view",G.constant||(K="payable","boolean"!=typeof G.payable||G.payable||(K="nonpayable"))):"boolean"!=typeof G.payable||G.payable||(K="nonpayable")),new FunctionFragment(SR,G.name,K,G.inputs?G.inputs.map(FR.from):[],G.outputs?G.outputs.map(FR.from):[],null!=G.gas?G.gas:null)}static isFragment(G){return G&&G[IR]===NR}};class StructFragment extends NamedFragment{constructor(G,K,ne){super(G,"struct",K,ne),Object.defineProperty(this,IR,{value:MR})}format(){throw new Error("@TODO")}static from(G){if("string"==typeof G)try{return StructFragment.from(lex(G))}catch(K){assertArgument(!1,"invalid struct fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("struct",G),ne=consumeParams(G);return consumeEoi(G),new StructFragment(SR,K,ne)}return new StructFragment(SR,G.name,G.inputs?G.inputs.map(FR.from):[])}static isFragment(G){return G&&G[IR]===MR}}const GR=new Map;GR.set(0,"GENERIC_PANIC"),GR.set(1,"ASSERT_FALSE"),GR.set(17,"OVERFLOW"),GR.set(18,"DIVIDE_BY_ZERO"),GR.set(33,"ENUM_RANGE_ERROR"),GR.set(34,"BAD_STORAGE_DATA"),GR.set(49,"STACK_UNDERFLOW"),GR.set(50,"ARRAY_RANGE_ERROR"),GR.set(65,"OUT_OF_MEMORY"),GR.set(81,"UNINITIALIZED_FUNCTION_CALL");const jR=new RegExp(/^bytes([0-9]*)$/),HR=new RegExp(/^(u?int)([0-9]*)$/);let WR=null,zR=1024;var VR=new WeakSet;let KR=class AbiCoder{constructor(){_classPrivateMethodInitSpec(this,VR)}getDefaultValue(G){const K=G.map((G=>_assertClassBrand(VR,this,_getCoder).call(this,FR.from(G))));return new zI(K,"_").defaultValue()}encode(G,K){assertArgumentCount(K.length,G.length,"types/values length mismatch");const ne=G.map((G=>_assertClassBrand(VR,this,_getCoder).call(this,FR.from(G)))),ue=new zI(ne,"_"),pe=new sS;return ue.encode(pe,K),pe.data}decode(G,K,ne){const ue=G.map((G=>_assertClassBrand(VR,this,_getCoder).call(this,FR.from(G))));return new zI(ue,"_").decode(new class Reader{constructor(G,K,ne){_classPrivateMethodInitSpec(this,lS),_defineProperty(this,"allowLoose",void 0),_classPrivateFieldInitSpec(this,oS,void 0),_classPrivateFieldInitSpec(this,cS,void 0),_classPrivateFieldInitSpec(this,dS,void 0),_classPrivateFieldInitSpec(this,uS,void 0),_classPrivateFieldInitSpec(this,fS,void 0),defineProperties(this,{allowLoose:!!K}),_classPrivateFieldSet2(oS,this,getBytesCopy(G)),_classPrivateFieldSet2(dS,this,0),_classPrivateFieldSet2(uS,this,null),_classPrivateFieldSet2(fS,this,null!=ne?ne:1024),_classPrivateFieldSet2(cS,this,0)}get data(){return hexlify$1(_classPrivateFieldGet2(oS,this))}get dataLength(){return _classPrivateFieldGet2(oS,this).length}get consumed(){return _classPrivateFieldGet2(cS,this)}get bytes(){return new Uint8Array(_classPrivateFieldGet2(oS,this))}subReader(G){const K=new Reader(_classPrivateFieldGet2(oS,this).slice(_classPrivateFieldGet2(cS,this)+G),this.allowLoose,_classPrivateFieldGet2(fS,this));return _classPrivateFieldSet2(uS,K,this),K}readBytes(G,K){let ne=_assertClassBrand(lS,this,_peekBytes).call(this,0,G,!!K);return _assertClassBrand(lS,this,_incrementBytesRead).call(this,G),_classPrivateFieldSet2(cS,this,_classPrivateFieldGet2(cS,this)+ne.length),ne.slice(0,G)}readValue(){return toBigInt(this.readBytes(QP))}readIndex(){return function toNumber(G){return getNumber(toBigInt(G))}(this.readBytes(QP))}}(K,ne,zR))}static _setDefaultMaxInflation(G){assertArgument("number"==typeof G&&Number.isInteger(G),"invalid defaultMaxInflation factor","value",G),zR=G}static defaultAbiCoder(){return null==WR&&(WR=new AbiCoder),WR}static getBuiltinCallException(G,K,ne){return function getBuiltinCallException(G,K,ne,ue){let pe="missing revert data",he=null,ye=null;if(ne){pe="execution reverted";const G=getBytes(ne);if(ne=hexlify$1(ne),0===G.length)pe+=" (no data present; likely require(false) occurred",he="require(false)";else if(G.length%32!=4)pe+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===hexlify$1(G.slice(0,4)))try{he=ue.decode(["string"],G.slice(4))[0],ye={signature:"Error(string)",name:"Error",args:[he]},pe+=`: ${JSON.stringify(he)}`}catch(G){pe+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===hexlify$1(G.slice(0,4)))try{const K=Number(ue.decode(["uint256"],G.slice(4))[0]);ye={signature:"Panic(uint256)",name:"Panic",args:[K]},he=`Panic due to ${GR.get(K)||"UNKNOWN"}(${K})`,pe+=`: ${he}`}catch(G){pe+=" (could not decode panic code)"}else pe+=" (unknown custom error)"}const me={to:K.to?getAddress$1(K.to):null,data:K.data||"0x"};return K.from&&(me.from=getAddress$1(K.from)),makeError(pe,"CALL_EXCEPTION",{action:G,data:ne,reason:he,transaction:me,invocation:null,revert:ye})}(G,K,ne,AbiCoder.defaultAbiCoder())}};function _getCoder(G){if(G.isArray())return new MI(_assertClassBrand(VR,this,_getCoder).call(this,G.arrayChildren),G.arrayLength,G.name);if(G.isTuple())return new zI(G.components.map((G=>_assertClassBrand(VR,this,_getCoder).call(this,G))),G.name);switch(G.baseType){case"address":return new xI(G.name);case"bool":return new BI(G.name);case"string":return new WI(G.name);case"bytes":return new DI(G.name);case"":return new $I(G.name)}let K=G.type.match(HR);if(K){let ne=parseInt(K[2]||"256");return assertArgument(0!==ne&&ne<=256&&ne%8==0,"invalid "+K[1]+" bit length","param",G),new HI(ne/8,"int"===K[1],G.name)}if(K=G.type.match(jR),K){let ne=parseInt(K[1]);return assertArgument(0!==ne&&ne<=32,"invalid bytes length","param",G),new LI(ne,G.name)}assertArgument(!1,"invalid type","type",G.type)}let JR=class Indexed{static isIndexed(G){return!(!G||!G._isIndexed)}constructor(G){_defineProperty(this,"hash",void 0),_defineProperty(this,"_isIndexed",void 0),defineProperties(this,{hash:G,_isIndexed:!0})}};const XR={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"},QR={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:G=>`reverted with reason string ${JSON.stringify(G)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:G=>{let K="unknown panic code";return G>=0&&G<=255&&XR[G.toString()]&&(K=XR[G.toString()]),`reverted with panic code 0x${G.toString(16)} (${K})`}}};var ZR=new WeakMap,YR=new WeakMap,ek=new WeakMap,tk=new WeakMap,rk=new WeakSet;let nk=class Interface{constructor(G){_classPrivateMethodInitSpec(this,rk),_defineProperty(this,"fragments",void 0),_defineProperty(this,"deploy",void 0),_defineProperty(this,"fallback",void 0),_defineProperty(this,"receive",void 0),_classPrivateFieldInitSpec(this,ZR,void 0),_classPrivateFieldInitSpec(this,YR,void 0),_classPrivateFieldInitSpec(this,ek,void 0),_classPrivateFieldInitSpec(this,tk,void 0);let K=[];K="string"==typeof G?JSON.parse(G):G,_classPrivateFieldSet2(ek,this,new Map),_classPrivateFieldSet2(ZR,this,new Map),_classPrivateFieldSet2(YR,this,new Map);const ne=[];for(const G of K)try{ne.push(DR.from(G))}catch(K){console.log(`[Warning] Invalid Fragment ${JSON.stringify(G)}:`,K.message)}defineProperties(this,{fragments:Object.freeze(ne)});let ue=null,pe=!1;_classPrivateFieldSet2(tk,this,this.getAbiCoder()),this.fragments.forEach(((G,K)=>{let ne;switch(G.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void defineProperties(this,{deploy:G});case"fallback":return void(0===G.inputs.length?pe=!0:(assertArgument(!ue||G.payable!==ue.payable,"conflicting fallback fragments",`fragments[${K}]`,G),ue=G,pe=ue.payable));case"function":ne=_classPrivateFieldGet2(ek,this);break;case"event":ne=_classPrivateFieldGet2(YR,this);break;case"error":ne=_classPrivateFieldGet2(ZR,this);break;default:return}const he=G.format();ne.has(he)||ne.set(he,G)})),this.deploy||defineProperties(this,{deploy:$R.from("constructor()")}),defineProperties(this,{fallback:ue,receive:pe})}format(G){const K=G?"minimal":"full",ne=this.fragments.map((G=>G.format(K)));return ne}formatJson(){const G=this.fragments.map((G=>G.format("json")));return JSON.stringify(G.map((G=>JSON.parse(G))))}getAbiCoder(){return KR.defaultAbiCoder()}getFunctionName(G){const K=_assertClassBrand(rk,this,_getFunction).call(this,G,null,!1);return assertArgument(K,"no matching function","key",G),K.name}hasFunction(G){return!!_assertClassBrand(rk,this,_getFunction).call(this,G,null,!1)}getFunction(G,K){return _assertClassBrand(rk,this,_getFunction).call(this,G,K||null,!0)}forEachFunction(G){const K=Array.from(_classPrivateFieldGet2(ek,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(ek,this).get(ue),ne)}}getEventName(G){const K=_assertClassBrand(rk,this,_getEvent).call(this,G,null,!1);return assertArgument(K,"no matching event","key",G),K.name}hasEvent(G){return!!_assertClassBrand(rk,this,_getEvent).call(this,G,null,!1)}getEvent(G,K){return _assertClassBrand(rk,this,_getEvent).call(this,G,K||null,!0)}forEachEvent(G){const K=Array.from(_classPrivateFieldGet2(YR,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(YR,this).get(ue),ne)}}getError(G,K){if(isHexString$1(G)){const K=G.toLowerCase();if(QR[K])return LR.from(QR[K].signature);for(const G of _classPrivateFieldGet2(ZR,this).values())if(K===G.selector)return G;return null}if(-1===G.indexOf("(")){const K=[];for(const[ne,ue]of _classPrivateFieldGet2(ZR,this))ne.split("(")[0]===G&&K.push(ue);if(0===K.length)return"Error"===G?LR.from("error Error(string)"):"Panic"===G?LR.from("error Panic(uint256)"):null;if(K.length>1){const ne=K.map((G=>JSON.stringify(G.format()))).join(", ");assertArgument(!1,`ambiguous error description (i.e. ${ne})`,"name",G)}return K[0]}if("Error(string)"===(G=LR.from(G).format()))return LR.from("error Error(string)");if("Panic(uint256)"===G)return LR.from("error Panic(uint256)");const ne=_classPrivateFieldGet2(ZR,this).get(G);return ne||null}forEachError(G){const K=Array.from(_classPrivateFieldGet2(ZR,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(ZR,this).get(ue),ne)}}_decodeParams(G,K){return _classPrivateFieldGet2(tk,this).decode(G,K)}_encodeParams(G,K){return _classPrivateFieldGet2(tk,this).encode(G,K)}encodeDeploy(G){return this._encodeParams(this.deploy.inputs,G||[])}decodeErrorResult(G,K){if("string"==typeof G){const K=this.getError(G);assertArgument(K,"unknown error","fragment",G),G=K}return assertArgument(dataSlice(K,0,4)===G.selector,`data signature does not match error ${G.name}.`,"data",K),this._decodeParams(G.inputs,dataSlice(K,4))}encodeErrorResult(G,K){if("string"==typeof G){const K=this.getError(G);assertArgument(K,"unknown error","fragment",G),G=K}return concat$1([G.selector,this._encodeParams(G.inputs,K||[])])}decodeFunctionData(G,K){if("string"==typeof G){const K=this.getFunction(G);assertArgument(K,"unknown function","fragment",G),G=K}return assertArgument(dataSlice(K,0,4)===G.selector,`data signature does not match function ${G.name}.`,"data",K),this._decodeParams(G.inputs,dataSlice(K,4))}encodeFunctionData(G,K){if("string"==typeof G){const K=this.getFunction(G);assertArgument(K,"unknown function","fragment",G),G=K}return concat$1([G.selector,this._encodeParams(G.inputs,K||[])])}decodeFunctionResult(G,K){if("string"==typeof G){const K=this.getFunction(G);assertArgument(K,"unknown function","fragment",G),G=K}let ne="invalid length for result data";const ue=getBytesCopy(K);if(ue.length%32==0)try{return _classPrivateFieldGet2(tk,this).decode(G.outputs,ue)}catch(G){ne="could not decode result data"}assert(!1,ne,"BAD_DATA",{value:hexlify$1(ue),info:{method:G.name,signature:G.format()}})}makeError(G,K){const ne=getBytes(G,"data"),ue=KR.getBuiltinCallException("call",K,ne);if(ue.message.startsWith("execution reverted (unknown custom error)")){const G=hexlify$1(ne.slice(0,4)),K=this.getError(G);if(K)try{const G=_classPrivateFieldGet2(tk,this).decode(K.inputs,ne.slice(4));ue.revert={name:K.name,signature:K.format(),args:G},ue.reason=ue.revert.signature,ue.message=`execution reverted: ${ue.reason}`}catch(G){ue.message="execution reverted (coult not decode custom error)"}}const pe=this.parseTransaction(K);return pe&&(ue.invocation={method:pe.name,signature:pe.signature,args:pe.args}),ue}encodeFunctionResult(G,K){if("string"==typeof G){const K=this.getFunction(G);assertArgument(K,"unknown function","fragment",G),G=K}return hexlify$1(_classPrivateFieldGet2(tk,this).encode(G.outputs,K||[]))}encodeFilterTopics(G,K){if("string"==typeof G){const K=this.getEvent(G);assertArgument(K,"unknown event","eventFragment",G),G=K}assert(K.length<=G.inputs.length,`too many arguments for ${G.format()}`,"UNEXPECTED_ARGUMENT",{count:K.length,expectedCount:G.inputs.length});const ne=[];G.anonymous||ne.push(G.topicHash);const encodeTopic=(G,K)=>"string"===G.type?id$2(K):"bytes"===G.type?keccak256$1(hexlify$1(K)):("bool"===G.type&&"boolean"==typeof K?K=K?"0x01":"0x00":G.type.match(/^u?int/)?K=toBeHex(K):G.type.match(/^bytes/)?K=function zeroPadBytes(G,K){return zeroPad$1(G,K,!1)}(K,32):"address"===G.type&&_classPrivateFieldGet2(tk,this).encode(["address"],[K]),zeroPadValue(hexlify$1(K),32));for(K.forEach(((K,ue)=>{const pe=G.inputs[ue];pe.indexed?null==K?ne.push(null):"array"===pe.baseType||"tuple"===pe.baseType?assertArgument(!1,"filtering with tuples or arrays not supported","contract."+pe.name,K):Array.isArray(K)?ne.push(K.map((G=>encodeTopic(pe,G)))):ne.push(encodeTopic(pe,K)):assertArgument(null==K,"cannot filter non-indexed parameters; must be null","contract."+pe.name,K)}));ne.length&&null===ne[ne.length-1];)ne.pop();return ne}encodeEventLog(G,K){if("string"==typeof G){const K=this.getEvent(G);assertArgument(K,"unknown event","eventFragment",G),G=K}const ne=[],ue=[],pe=[];return G.anonymous||ne.push(G.topicHash),assertArgument(K.length===G.inputs.length,"event arguments/values mismatch","values",K),G.inputs.forEach(((G,he)=>{const ye=K[he];if(G.indexed)if("string"===G.type)ne.push(id$2(ye));else if("bytes"===G.type)ne.push(keccak256$1(ye));else{if("tuple"===G.baseType||"array"===G.baseType)throw new Error("not implemented");ne.push(_classPrivateFieldGet2(tk,this).encode([G.type],[ye]))}else ue.push(G),pe.push(ye)})),{data:_classPrivateFieldGet2(tk,this).encode(ue,pe),topics:ne}}decodeEventLog(G,K,ne){if("string"==typeof G){const K=this.getEvent(G);assertArgument(K,"unknown event","eventFragment",G),G=K}if(null!=ne&&!G.anonymous){const K=G.topicHash;assertArgument(isHexString$1(ne[0],32)&&ne[0].toLowerCase()===K,"fragment/topic mismatch","topics[0]",ne[0]),ne=ne.slice(1)}const ue=[],pe=[],he=[];G.inputs.forEach(((G,K)=>{G.indexed?"string"===G.type||"bytes"===G.type||"tuple"===G.baseType||"array"===G.baseType?(ue.push(FR.from({type:"bytes32",name:G.name})),he.push(!0)):(ue.push(G),he.push(!1)):(pe.push(G),he.push(!1))}));const ye=null!=ne?_classPrivateFieldGet2(tk,this).decode(ue,concat$1(ne)):null,me=_classPrivateFieldGet2(tk,this).decode(pe,K,!0),be=[],ve=[];let _e=0,Te=0;return G.inputs.forEach(((G,K)=>{let ne=null;if(G.indexed)if(null==ye)ne=new JR(null);else if(he[K])ne=new JR(ye[Te++]);else try{ne=ye[Te++]}catch(G){ne=G}else try{ne=me[_e++]}catch(G){ne=G}be.push(ne),ve.push(G.name||null)})),Result.fromItems(be,ve)}parseTransaction(G){const K=getBytes(G.data,"tx.data"),ne=getBigInt(null!=G.value?G.value:0,"tx.value"),ue=this.getFunction(hexlify$1(K.slice(0,4)));if(!ue)return null;const pe=_classPrivateFieldGet2(tk,this).decode(ue.inputs,K.slice(4));return new class TransactionDescription{constructor(G,K,ne,ue){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"args",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"selector",void 0),_defineProperty(this,"value",void 0);const pe=G.name,he=G.format();defineProperties(this,{fragment:G,name:pe,args:ne,signature:he,selector:K,value:ue})}}(ue,ue.selector,pe,ne)}parseCallResult(G){throw new Error("@TODO")}parseLog(G){const K=this.getEvent(G.topics[0]);return!K||K.anonymous?null:new class LogDescription{constructor(G,K,ne){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"topic",void 0),_defineProperty(this,"args",void 0);const ue=G.name,pe=G.format();defineProperties(this,{fragment:G,name:ue,signature:pe,topic:K,args:ne})}}(K,K.topicHash,this.decodeEventLog(K,G.data,G.topics))}parseError(G){const K=hexlify$1(G),ne=this.getError(dataSlice(K,0,4));if(!ne)return null;const ue=_classPrivateFieldGet2(tk,this).decode(ne.inputs,dataSlice(K,4));return new class ErrorDescription{constructor(G,K,ne){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"args",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"selector",void 0);const ue=G.name,pe=G.format();defineProperties(this,{fragment:G,name:ue,args:ne,signature:pe,selector:K})}}(ne,ne.selector,ue)}static from(G){return G instanceof Interface?G:"string"==typeof G?new Interface(JSON.parse(G)):"function"==typeof G.format?new Interface(G.format("json")):new Interface(G)}};function _getFunction(G,K,ne){if(isHexString$1(G)){const K=G.toLowerCase();for(const G of _classPrivateFieldGet2(ek,this).values())if(K===G.selector)return G;return null}if(-1===G.indexOf("(")){const ue=[];for(const[K,ne]of _classPrivateFieldGet2(ek,this))K.split("(")[0]===G&&ue.push(ne);if(K){const G=K.length>0?K[K.length-1]:null;let ne=K.length,pe=!0;Typed.isTyped(G)&&"overrides"===G.type&&(pe=!1,ne--);for(let G=ue.length-1;G>=0;G--){const K=ue[G].inputs.length;K===ne||pe&&K===ne-1||ue.splice(G,1)}for(let G=ue.length-1;G>=0;G--){const ne=ue[G].inputs;for(let pe=0;pe<K.length;pe++)if(Typed.isTyped(K[pe])){if(pe>=ne.length){if("overrides"===K[pe].type)continue;ue.splice(G,1);break}if(K[pe].type!==ne[pe].baseType){ue.splice(G,1);break}}}}if(1===ue.length&&K&&K.length!==ue[0].inputs.length){const G=K[K.length-1];(null==G||Array.isArray(G)||"object"!=typeof G)&&ue.splice(0,1)}if(0===ue.length)return null;if(ue.length>1&&ne){const K=ue.map((G=>JSON.stringify(G.format()))).join(", ");assertArgument(!1,`ambiguous function description (i.e. matches ${K})`,"key",G)}return ue[0]}const ue=_classPrivateFieldGet2(ek,this).get(qR.from(G).format());return ue||null}function _getEvent(G,K,ne){if(isHexString$1(G)){const K=G.toLowerCase();for(const G of _classPrivateFieldGet2(YR,this).values())if(K===G.topicHash)return G;return null}if(-1===G.indexOf("(")){const ue=[];for(const[K,ne]of _classPrivateFieldGet2(YR,this))K.split("(")[0]===G&&ue.push(ne);if(K){for(let G=ue.length-1;G>=0;G--)ue[G].inputs.length<K.length&&ue.splice(G,1);for(let G=ue.length-1;G>=0;G--){const ne=ue[G].inputs;for(let pe=0;pe<K.length;pe++)if(Typed.isTyped(K[pe])&&K[pe].type!==ne[pe].baseType){ue.splice(G,1);break}}}if(0===ue.length)return null;if(ue.length>1&&ne){const K=ue.map((G=>JSON.stringify(G.format()))).join(", ");assertArgument(!1,`ambiguous event description (i.e. matches ${K})`,"key",G)}return ue[0]}const ue=_classPrivateFieldGet2(YR,this).get(UR.from(G).format());return ue||null}const ak=BigInt(0);function getValue(G){return null==G?null:G}function toJson(G){return null==G?null:G.toString()}class FeeData{constructor(G,K,ne){_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"maxFeePerGas",void 0),_defineProperty(this,"maxPriorityFeePerGas",void 0),defineProperties(this,{gasPrice:getValue(G),maxFeePerGas:getValue(K),maxPriorityFeePerGas:getValue(ne)})}toJSON(){const{gasPrice:G,maxFeePerGas:K,maxPriorityFeePerGas:ne}=this;return{_type:"FeeData",gasPrice:toJson(G),maxFeePerGas:toJson(K),maxPriorityFeePerGas:toJson(ne)}}}function copyRequest(G){const K={};G.to&&(K.to=G.to),G.from&&(K.from=G.from),G.data&&(K.data=hexlify$1(G.data));const ne="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const ue of ne)ue in G&&null!=G[ue]&&(K[ue]=getBigInt(G[ue],`request.${ue}`));const ue="type,nonce".split(/,/);for(const ne of ue)ne in G&&null!=G[ne]&&(K[ne]=getNumber(G[ne],`request.${ne}`));return G.accessList&&(K.accessList=accessListify$1(G.accessList)),"blockTag"in G&&(K.blockTag=G.blockTag),"enableCcipRead"in G&&(K.enableCcipRead=!!G.enableCcipRead),"customData"in G&&(K.customData=G.customData),K}var ik=new WeakMap;class Block{constructor(G,K){_defineProperty(this,"provider",void 0),_defineProperty(this,"number",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"timestamp",void 0),_defineProperty(this,"parentHash",void 0),_defineProperty(this,"parentBeaconBlockRoot",void 0),_defineProperty(this,"nonce",void 0),_defineProperty(this,"difficulty",void 0),_defineProperty(this,"gasLimit",void 0),_defineProperty(this,"gasUsed",void 0),_defineProperty(this,"stateRoot",void 0),_defineProperty(this,"receiptsRoot",void 0),_defineProperty(this,"blobGasUsed",void 0),_defineProperty(this,"excessBlobGas",void 0),_defineProperty(this,"miner",void 0),_defineProperty(this,"extraData",void 0),_defineProperty(this,"baseFeePerGas",void 0),_classPrivateFieldInitSpec(this,ik,void 0),_classPrivateFieldSet2(ik,this,G.transactions.map((G=>"string"!=typeof G?new TransactionResponse(G,K):G))),defineProperties(this,{provider:K,hash:getValue(G.hash),number:G.number,timestamp:G.timestamp,parentHash:G.parentHash,parentBeaconBlockRoot:G.parentBeaconBlockRoot,nonce:G.nonce,difficulty:G.difficulty,gasLimit:G.gasLimit,gasUsed:G.gasUsed,blobGasUsed:G.blobGasUsed,excessBlobGas:G.excessBlobGas,miner:G.miner,extraData:G.extraData,baseFeePerGas:getValue(G.baseFeePerGas),stateRoot:G.stateRoot,receiptsRoot:G.receiptsRoot})}get transactions(){return _classPrivateFieldGet2(ik,this).map((G=>"string"==typeof G?G:G.hash))}get prefetchedTransactions(){const G=_classPrivateFieldGet2(ik,this).slice();return 0===G.length?[]:(assert("object"==typeof G[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),G)}toJSON(){const{baseFeePerGas:G,difficulty:K,extraData:ne,gasLimit:ue,gasUsed:pe,hash:he,miner:ye,nonce:me,number:be,parentHash:ve,parentBeaconBlockRoot:_e,stateRoot:Te,receiptsRoot:Ee,timestamp:Pe,transactions:Se}=this;return{_type:"Block",baseFeePerGas:toJson(G),difficulty:toJson(K),extraData:ne,gasLimit:toJson(ue),gasUsed:toJson(pe),blobGasUsed:toJson(this.blobGasUsed),excessBlobGas:toJson(this.excessBlobGas),hash:he,miner:ye,nonce:me,number:be,parentHash:ve,timestamp:Pe,parentBeaconBlockRoot:_e,stateRoot:Te,receiptsRoot:Ee,transactions:Se}}[Symbol.iterator](){let G=0;const K=this.transactions;return{next:()=>G<this.length?{value:K[G++],done:!1}:{value:void 0,done:!0}}}get length(){return _classPrivateFieldGet2(ik,this).length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(G){let K;if("number"==typeof G)K=_classPrivateFieldGet2(ik,this)[G];else{const ne=G.toLowerCase();for(const G of _classPrivateFieldGet2(ik,this)){if("string"==typeof G){if(G!==ne)continue;K=G;break}if(G.hash!==ne){K=G;break}}}if(null==K)throw new Error("no such tx");return"string"==typeof K?await this.provider.getTransaction(K):K}getPrefetchedTransaction(G){const K=this.prefetchedTransactions;if("number"==typeof G)return K[G];G=G.toLowerCase();for(const ne of K)if(ne.hash===G)return ne;assertArgument(!1,"no matching transaction","indexOrHash",G)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return function createOrphanedBlockFilter(G){return{orphan:"drop-block",hash:G.hash,number:G.number}}(this)}}class Log{constructor(G,K){_defineProperty(this,"provider",void 0),_defineProperty(this,"transactionHash",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"removed",void 0),_defineProperty(this,"address",void 0),_defineProperty(this,"data",void 0),_defineProperty(this,"topics",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"transactionIndex",void 0),this.provider=K;const ne=Object.freeze(G.topics.slice());defineProperties(this,{transactionHash:G.transactionHash,blockHash:G.blockHash,blockNumber:G.blockNumber,removed:G.removed,address:G.address,data:G.data,topics:ne,index:G.index,transactionIndex:G.transactionIndex})}toJSON(){const{address:G,blockHash:K,blockNumber:ne,data:ue,index:pe,removed:he,topics:ye,transactionHash:me,transactionIndex:be}=this;return{_type:"log",address:G,blockHash:K,blockNumber:ne,data:ue,index:pe,removed:he,topics:ye,transactionHash:me,transactionIndex:be}}async getBlock(){const G=await this.provider.getBlock(this.blockHash);return assert(!!G,"failed to find transaction","UNKNOWN_ERROR",{}),G}async getTransaction(){const G=await this.provider.getTransaction(this.transactionHash);return assert(!!G,"failed to find transaction","UNKNOWN_ERROR",{}),G}async getTransactionReceipt(){const G=await this.provider.getTransactionReceipt(this.transactionHash);return assert(!!G,"failed to find transaction receipt","UNKNOWN_ERROR",{}),G}removedEvent(){return function createRemovedLogFilter(G){return{orphan:"drop-log",log:{transactionHash:G.transactionHash,blockHash:G.blockHash,blockNumber:G.blockNumber,address:G.address,data:G.data,topics:Object.freeze(G.topics.slice()),index:G.index}}}(this)}}var sk=new WeakMap;class TransactionReceipt{constructor(G,K){_defineProperty(this,"provider",void 0),_defineProperty(this,"to",void 0),_defineProperty(this,"from",void 0),_defineProperty(this,"contractAddress",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"logsBloom",void 0),_defineProperty(this,"gasUsed",void 0),_defineProperty(this,"blobGasUsed",void 0),_defineProperty(this,"cumulativeGasUsed",void 0),_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"blobGasPrice",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"status",void 0),_defineProperty(this,"root",void 0),_classPrivateFieldInitSpec(this,sk,void 0),_classPrivateFieldSet2(sk,this,Object.freeze(G.logs.map((G=>new Log(G,K)))));let ne=ak;null!=G.effectiveGasPrice?ne=G.effectiveGasPrice:null!=G.gasPrice&&(ne=G.gasPrice),defineProperties(this,{provider:K,to:G.to,from:G.from,contractAddress:G.contractAddress,hash:G.hash,index:G.index,blockHash:G.blockHash,blockNumber:G.blockNumber,logsBloom:G.logsBloom,gasUsed:G.gasUsed,cumulativeGasUsed:G.cumulativeGasUsed,blobGasUsed:G.blobGasUsed,gasPrice:ne,blobGasPrice:G.blobGasPrice,type:G.type,status:G.status,root:G.root})}get logs(){return _classPrivateFieldGet2(sk,this)}toJSON(){const{to:G,from:K,contractAddress:ne,hash:ue,index:pe,blockHash:he,blockNumber:ye,logsBloom:me,logs:be,status:ve,root:_e}=this;return{_type:"TransactionReceipt",blockHash:he,blockNumber:ye,contractAddress:ne,cumulativeGasUsed:toJson(this.cumulativeGasUsed),from:K,gasPrice:toJson(this.gasPrice),blobGasUsed:toJson(this.blobGasUsed),blobGasPrice:toJson(this.blobGasPrice),gasUsed:toJson(this.gasUsed),hash:ue,index:pe,logs:be,logsBloom:me,root:_e,status:ve,to:G}}get length(){return this.logs.length}[Symbol.iterator](){let G=0;return{next:()=>G<this.length?{value:this.logs[G++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const G=await this.provider.getBlock(this.blockHash);if(null==G)throw new Error("TODO");return G}async getTransaction(){const G=await this.provider.getTransaction(this.hash);if(null==G)throw new Error("TODO");return G}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return createRemovedTransactionFilter(this)}reorderedEvent(G){return assert(!G||G.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),createReorderedTransactionFilter(this,G)}}var ck=new WeakMap;class TransactionResponse{constructor(G,K){_defineProperty(this,"provider",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"to",void 0),_defineProperty(this,"from",void 0),_defineProperty(this,"nonce",void 0),_defineProperty(this,"gasLimit",void 0),_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"maxPriorityFeePerGas",void 0),_defineProperty(this,"maxFeePerGas",void 0),_defineProperty(this,"maxFeePerBlobGas",void 0),_defineProperty(this,"data",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"chainId",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"accessList",void 0),_defineProperty(this,"blobVersionedHashes",void 0),_classPrivateFieldInitSpec(this,ck,void 0),this.provider=K,this.blockNumber=null!=G.blockNumber?G.blockNumber:null,this.blockHash=null!=G.blockHash?G.blockHash:null,this.hash=G.hash,this.index=G.index,this.type=G.type,this.from=G.from,this.to=G.to||null,this.gasLimit=G.gasLimit,this.nonce=G.nonce,this.data=G.data,this.value=G.value,this.gasPrice=G.gasPrice,this.maxPriorityFeePerGas=null!=G.maxPriorityFeePerGas?G.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=G.maxFeePerGas?G.maxFeePerGas:null,this.maxFeePerBlobGas=null!=G.maxFeePerBlobGas?G.maxFeePerBlobGas:null,this.chainId=G.chainId,this.signature=G.signature,this.accessList=null!=G.accessList?G.accessList:null,this.blobVersionedHashes=null!=G.blobVersionedHashes?G.blobVersionedHashes:null,_classPrivateFieldSet2(ck,this,-1)}toJSON(){const{blockNumber:G,blockHash:K,index:ne,hash:ue,type:pe,to:he,from:ye,nonce:me,data:be,signature:ve,accessList:_e,blobVersionedHashes:Te}=this;return{_type:"TransactionResponse",accessList:_e,blockNumber:G,blockHash:K,blobVersionedHashes:Te,chainId:toJson(this.chainId),data:be,from:ye,gasLimit:toJson(this.gasLimit),gasPrice:toJson(this.gasPrice),hash:ue,maxFeePerGas:toJson(this.maxFeePerGas),maxPriorityFeePerGas:toJson(this.maxPriorityFeePerGas),maxFeePerBlobGas:toJson(this.maxFeePerBlobGas),nonce:me,signature:ve,to:he,index:ne,type:pe,value:toJson(this.value)}}async getBlock(){let G=this.blockNumber;if(null==G){const K=await this.getTransaction();K&&(G=K.blockNumber)}if(null==G)return null;const K=this.provider.getBlock(G);if(null==K)throw new Error("TODO");return K}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:G,blockNumber:K}=await resolveProperties$1({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==G||null==G.blockNumber?0:K-G.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(G,K){const ne=null==G?1:G,ue=null==K?0:K;let pe=_classPrivateFieldGet2(ck,this),he=-1,ye=-1===pe;const checkReplacement=async()=>{if(ye)return null;const{blockNumber:G,nonce:K}=await resolveProperties$1({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(K<this.nonce)return void(pe=G);if(ye)return null;const ue=await this.getTransaction();if(!ue||null==ue.blockNumber)for(-1===he&&(he=pe-3,he<_classPrivateFieldGet2(ck,this)&&(he=_classPrivateFieldGet2(ck,this)));he<=G;){if(ye)return null;const K=await this.provider.getBlock(he,!0);if(null==K)return;for(const G of K)if(G===this.hash)return;for(let ue=0;ue<K.length;ue++){const he=await K.getTransaction(ue);if(he.from===this.from&&he.nonce===this.nonce){if(ye)return null;const K=await this.provider.getTransactionReceipt(he.hash);if(null==K)return;if(G-K.blockNumber+1<ne)return;let ue="replaced";he.data===this.data&&he.to===this.to&&he.value===this.value?ue="repriced":"0x"===he.data&&he.from===he.to&&he.value===ak&&(ue="cancelled"),assert(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===ue||"cancelled"===ue,reason:ue,replacement:he.replaceableTransaction(pe),hash:he.hash,receipt:K})}}he++}},checkReceipt=G=>{if(null==G||0!==G.status)return G;assert(!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})},me=await this.provider.getTransactionReceipt(this.hash);if(0===ne)return checkReceipt(me);if(me){if(await me.confirmations()>=ne)return checkReceipt(me)}else if(await checkReplacement(),0===ne)return null;const be=new Promise(((G,K)=>{const he=[],cancel=()=>{he.forEach((G=>G()))};if(he.push((()=>{ye=!0})),ue>0){const G=setTimeout((()=>{cancel(),K(makeError("wait for transaction timeout","TIMEOUT"))}),ue);he.push((()=>{clearTimeout(G)}))}const txListener=async ue=>{if(await ue.confirmations()>=ne){cancel();try{G(checkReceipt(ue))}catch(G){K(G)}}};if(he.push((()=>{this.provider.off(this.hash,txListener)})),this.provider.on(this.hash,txListener),pe>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(G){if(isError(G,"TRANSACTION_REPLACED"))return cancel(),void K(G)}ye||this.provider.once("block",replaceListener)};he.push((()=>{this.provider.off("block",replaceListener)})),this.provider.once("block",replaceListener)}}));return await be}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),createRemovedTransactionFilter(this)}reorderedEvent(G){return assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),assert(!G||G.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),createReorderedTransactionFilter(this,G)}replaceableTransaction(G){assertArgument(Number.isInteger(G)&&G>=0,"invalid startBlock","startBlock",G);const K=new TransactionResponse(this,this.provider);return _classPrivateFieldSet2(ck,K,G),K}}function createReorderedTransactionFilter(G,K){return{orphan:"reorder-transaction",tx:G,other:K}}function createRemovedTransactionFilter(G){return{orphan:"drop-transaction",tx:G}}class EventLog extends Log{constructor(G,K,ne){super(G,G.provider),_defineProperty(this,"interface",void 0),_defineProperty(this,"fragment",void 0),_defineProperty(this,"args",void 0);defineProperties(this,{args:K.decodeEventLog(ne,G.data,G.topics),fragment:ne,interface:K})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class UndecodedEventLog extends Log{constructor(G,K){super(G,G.provider),_defineProperty(this,"error",void 0),defineProperties(this,{error:K})}}var dk=new WeakMap;class ContractTransactionReceipt extends TransactionReceipt{constructor(G,K,ne){super(ne,K),_classPrivateFieldInitSpec(this,dk,void 0),_classPrivateFieldSet2(dk,this,G)}get logs(){return super.logs.map((G=>{const K=G.topics.length?_classPrivateFieldGet2(dk,this).getEvent(G.topics[0]):null;if(K)try{return new EventLog(G,_classPrivateFieldGet2(dk,this),K)}catch(K){return new UndecodedEventLog(G,K)}return G}))}}var uk=new WeakMap;class ContractTransactionResponse extends TransactionResponse{constructor(G,K,ne){super(ne,K),_classPrivateFieldInitSpec(this,uk,void 0),_classPrivateFieldSet2(uk,this,G)}async wait(G,K){const ne=await super.wait(G,K);return null==ne?null:new ContractTransactionReceipt(_classPrivateFieldGet2(uk,this),this.provider,ne)}}class ContractUnknownEventPayload extends EventPayload{constructor(G,K,ne,ue){super(G,K,ne),_defineProperty(this,"log",void 0),defineProperties(this,{log:ue})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(G,K,ne,ue,pe){super(G,K,ne,new EventLog(pe,G.interface,ue));defineProperties(this,{args:G.interface.decodeEventLog(ue,this.log.data,this.log.topics),fragment:ue})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const fk=BigInt(0);function canCall(G){return G&&"function"==typeof G.call}function canEstimate(G){return G&&"function"==typeof G.estimateGas}function canResolve(G){return G&&"function"==typeof G.resolveName}function canSend(G){return G&&"function"==typeof G.sendTransaction}function getResolver(G){if(null!=G){if(canResolve(G))return G;if(G.provider)return G.provider}}var lk=new WeakMap;class PreparedTopicFilter{constructor(G,K,ne){if(_classPrivateFieldInitSpec(this,lk,void 0),_defineProperty(this,"fragment",void 0),defineProperties(this,{fragment:K}),K.inputs.length<ne.length)throw new Error("too many arguments");const ue=getRunner(G.runner,"resolveName"),pe=canResolve(ue)?ue:null;_classPrivateFieldSet2(lk,this,async function(){const ue=await Promise.all(K.inputs.map(((G,K)=>null==ne[K]?null:G.walkAsync(ne[K],((G,K)=>"address"===G?Array.isArray(K)?Promise.all(K.map((G=>resolveAddress(G,pe)))):resolveAddress(K,pe):K)))));return G.interface.encodeFilterTopics(K,ue)}())}getTopicFilter(){return _classPrivateFieldGet2(lk,this)}}function getRunner(G,K){return null==G?null:"function"==typeof G[K]?G:G.provider&&"function"==typeof G.provider[K]?G.provider:null}function getProvider(G){return null==G?null:G.provider||null}async function copyOverrides(G,K){const ne=Typed.dereference(G,"overrides");assertArgument("object"==typeof ne,"invalid overrides parameter","overrides",G);const ue=copyRequest(ne);return assertArgument(null==ue.to||(K||[]).indexOf("to")>=0,"cannot override to","overrides.to",ue.to),assertArgument(null==ue.data||(K||[]).indexOf("data")>=0,"cannot override data","overrides.data",ue.data),ue.from&&(ue.from=ue.from),ue}function buildWrappedFallback(G){const populateTransaction=async function(K){const ne=await copyOverrides(K,["data"]);ne.to=await G.getAddress(),ne.from&&(ne.from=await resolveAddress(ne.from,getResolver(G.runner)));const ue=G.interface,pe=getBigInt(ne.value||fk,"overrides.value")===fk,he="0x"===(ne.data||"0x");!ue.fallback||ue.fallback.payable||!ue.receive||he||pe||assertArgument(!1,"cannot send data to receive or send value to non-payable fallback","overrides",K),assertArgument(ue.fallback||he,"cannot send data to receive-only contract","overrides.data",ne.data);return assertArgument(ue.receive||ue.fallback&&ue.fallback.payable||pe,"cannot send value to non-payable fallback","overrides.value",ne.value),assertArgument(ue.fallback||he,"cannot send data to receive-only contract","overrides.data",ne.data),ne},send=async function(K){const ne=G.runner;assert(canSend(ne),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const ue=await ne.sendTransaction(await populateTransaction(K)),pe=getProvider(G.runner);return new ContractTransactionResponse(G.interface,pe,ue)},method=async G=>await send(G);return defineProperties(method,{_contract:G,estimateGas:async function(K){const ne=getRunner(G.runner,"estimateGas");return assert(canEstimate(ne),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await ne.estimateGas(await populateTransaction(K))},populateTransaction:populateTransaction,send:send,staticCall:async function(K){const ne=getRunner(G.runner,"call");assert(canCall(ne),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const ue=await populateTransaction(K);try{return await ne.call(ue)}catch(K){if(isCallException(K)&&K.data)throw G.interface.makeError(K.data,ue);throw K}}}),method}function buildWrappedMethod(G,K){const getFragment=function(...ne){const ue=G.interface.getFunction(K,ne);return assert(ue,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K,args:ne}}),ue},populateTransaction=async function(...K){const ne=getFragment(...K);let ue={};if(ne.inputs.length+1===K.length&&(ue=await copyOverrides(K.pop()),ue.from&&(ue.from=await resolveAddress(ue.from,getResolver(G.runner)))),ne.inputs.length!==K.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const pe=await async function resolveArgs(G,K,ne){const ue=getRunner(G,"resolveName"),pe=canResolve(ue)?ue:null;return await Promise.all(K.map(((G,K)=>G.walkAsync(ne[K],((G,K)=>(K=Typed.dereference(K,G),"address"===G?resolveAddress(K,pe):K))))))}(G.runner,ne.inputs,K);return Object.assign({},ue,await resolveProperties$1({to:G.getAddress(),data:G.interface.encodeFunctionData(ne,pe)}))},staticCall=async function(...G){const K=await staticCallResult(...G);return 1===K.length?K[0]:K},send=async function(...K){const ne=G.runner;assert(canSend(ne),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const ue=await ne.sendTransaction(await populateTransaction(...K)),pe=getProvider(G.runner);return new ContractTransactionResponse(G.interface,pe,ue)},staticCallResult=async function(...K){const ne=getRunner(G.runner,"call");assert(canCall(ne),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const ue=await populateTransaction(...K);let pe="0x";try{pe=await ne.call(ue)}catch(K){if(isCallException(K)&&K.data)throw G.interface.makeError(K.data,ue);throw K}const he=getFragment(...K);return G.interface.decodeFunctionResult(he,pe)},method=async(...G)=>getFragment(...G).constant?await staticCall(...G):await send(...G);return defineProperties(method,{name:G.interface.getFunctionName(K),_contract:G,_key:K,getFragment:getFragment,estimateGas:async function(...K){const ne=getRunner(G.runner,"estimateGas");return assert(canEstimate(ne),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await ne.estimateGas(await populateTransaction(...K))},populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult}),Object.defineProperty(method,"fragment",{configurable:!1,enumerable:!0,get:()=>{const ne=G.interface.getFunction(K);return assert(ne,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K}}),ne}}),method}const pk=Symbol.for("_ethersInternal_contract"),hk=new WeakMap;function getInternal(G){return hk.get(G[pk])}async function getSubInfo(G,K){let ne,ue=null;if(Array.isArray(K)){const topicHashify=function(K){if(isHexString$1(K,32))return K;const ne=G.interface.getEvent(K);return assertArgument(ne,"unknown fragment","name",K),ne.topicHash};ne=K.map((G=>null==G?null:Array.isArray(G)?G.map(topicHashify):topicHashify(G)))}else"*"===K?ne=[null]:"string"==typeof K?isHexString$1(K,32)?ne=[K]:(ue=G.interface.getEvent(K),assertArgument(ue,"unknown fragment","event",K),ne=[ue.topicHash]):!function isDeferred(G){return G&&"object"==typeof G&&"getTopicFilter"in G&&"function"==typeof G.getTopicFilter&&G.fragment}(K)?"fragment"in K?(ue=K.fragment,ne=[ue.topicHash]):assertArgument(!1,"unknown event name","event",K):ne=await K.getTopicFilter();ne=ne.map((G=>{if(null==G)return null;if(Array.isArray(G)){const K=Array.from(new Set(G.map((G=>G.toLowerCase()))).values());return 1===K.length?K[0]:(K.sort(),K)}return G.toLowerCase()}));const pe=ne.map((G=>null==G?"null":Array.isArray(G)?G.join("|"):G)).join("&");return{fragment:ue,tag:pe,topics:ne}}async function hasSub(G,K){const{subs:ne}=getInternal(G);return ne.get((await getSubInfo(G,K)).tag)||null}async function getSub(G,K,ne){const ue=getProvider(G.runner);assert(ue,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:K});const{fragment:pe,tag:he,topics:ye}=await getSubInfo(G,ne),{addr:me,subs:be}=getInternal(G);let ve=be.get(he);if(!ve){const K={address:me||G,topics:ye},listener=K=>{let ue=pe;if(null==ue)try{ue=G.interface.getEvent(K.topics[0])}catch(G){}if(ue){const he=ue,ye=pe?G.interface.decodeEventLog(pe,K.data,K.topics):[];emit(G,ne,ye,(ue=>new ContractEventPayload(G,ue,ne,he,K)))}else emit(G,ne,[],(ue=>new ContractUnknownEventPayload(G,ue,ne,K)))};let _e=[];ve={tag:he,listeners:[],start:()=>{_e.length||_e.push(ue.on(K,listener))},stop:async()=>{if(0==_e.length)return;let G=_e;_e=[],await Promise.all(G),ue.off(K,listener)}},be.set(he,ve)}return ve}let yk=Promise.resolve();async function emit(G,K,ne,ue){try{await yk}catch(G){}const pe=async function _emit(G,K,ne,ue){await yk;const pe=await hasSub(G,K);if(!pe)return!1;const he=pe.listeners.length;return pe.listeners=pe.listeners.filter((({listener:K,once:pe})=>{const he=Array.from(ne);ue&&he.push(ue(pe?null:K));try{K.call(G,...he)}catch(G){}return!pe})),0===pe.listeners.length&&(pe.stop(),getInternal(G).subs.delete(pe.tag)),he>0}(G,K,ne,ue);return yk=pe,await pe}const mk=["then"];let bk=class BaseContract{constructor(G,K,ne,ue){_defineProperty(this,"target",void 0),_defineProperty(this,"interface",void 0),_defineProperty(this,"runner",void 0),_defineProperty(this,"filters",void 0),_defineProperty(this,pk,void 0),_defineProperty(this,"fallback",void 0),assertArgument("string"==typeof G||isAddressable(G),"invalid value for Contract target","target",G),null==ne&&(ne=null);const pe=nk.from(K);let he;defineProperties(this,{target:G,runner:ne,interface:pe}),Object.defineProperty(this,pk,{value:{}});let ye=null,me=null;if(ue){const G=getProvider(ne);me=new ContractTransactionResponse(this.interface,G,ue)}let be=new Map;if("string"==typeof G)if(isHexString$1(G))ye=G,he=Promise.resolve(G);else{const K=getRunner(ne,"resolveName");if(!canResolve(K))throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});he=K.resolveName(G).then((K=>{if(null==K)throw makeError("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:G});return getInternal(this).addr=K,K}))}else he=G.getAddress().then((G=>{if(null==G)throw new Error("TODO");return getInternal(this).addr=G,G}));!function setInternal(G,K){hk.set(G[pk],K)}(this,{addrPromise:he,addr:ye,deployTx:me,subs:be});const ve=new Proxy({},{get:(G,K,ne)=>{if("symbol"==typeof K||mk.indexOf(K)>=0)return Reflect.get(G,K,ne);try{return this.getEvent(K)}catch(G){if(!isError(G,"INVALID_ARGUMENT")||"key"!==G.argument)throw G}},has:(G,K)=>mk.indexOf(K)>=0?Reflect.has(G,K):Reflect.has(G,K)||this.interface.hasEvent(String(K))});return defineProperties(this,{filters:ve}),defineProperties(this,{fallback:pe.receive||pe.fallback?buildWrappedFallback(this):null}),new Proxy(this,{get:(G,K,ne)=>{if("symbol"==typeof K||K in G||mk.indexOf(K)>=0)return Reflect.get(G,K,ne);try{return G.getFunction(K)}catch(G){if(!isError(G,"INVALID_ARGUMENT")||"key"!==G.argument)throw G}},has:(G,K)=>"symbol"==typeof K||K in G||mk.indexOf(K)>=0?Reflect.has(G,K):G.interface.hasFunction(K)})}connect(G){return new BaseContract(this.target,this.interface,G)}attach(G){return new BaseContract(G,this.interface,this.runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const G=getProvider(this.runner);assert(G,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const K=await G.getCode(await this.getAddress());return"0x"===K?null:K}async waitForDeployment(){const G=this.deploymentTransaction();if(G)return await G.wait(),this;if(null!=await this.getDeployedCode())return this;const K=getProvider(this.runner);return assert(null!=K,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((G,ne)=>{const checkCode=async()=>{try{if(null!=await this.getDeployedCode())return G(this);K.once("block",checkCode)}catch(G){ne(G)}};checkCode()}))}deploymentTransaction(){return getInternal(this).deployTx}getFunction(G){"string"!=typeof G&&(G=G.format());return buildWrappedMethod(this,G)}getEvent(G){return"string"!=typeof G&&(G=G.format()),function buildWrappedEvent(G,K){const getFragment=function(...ne){const ue=G.interface.getEvent(K,ne);return assert(ue,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K,args:ne}}),ue},method=function(...K){return new PreparedTopicFilter(G,getFragment(...K),K)};return defineProperties(method,{name:G.interface.getEventName(K),_contract:G,_key:K,getFragment:getFragment}),Object.defineProperty(method,"fragment",{configurable:!1,enumerable:!0,get:()=>{const ne=G.interface.getEvent(K);return assert(ne,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K}}),ne}}),method}(this,G)}async queryTransaction(G){throw new Error("@TODO")}async queryFilter(G,K,ne){null==K&&(K=0),null==ne&&(ne="latest");const{addr:ue,addrPromise:pe}=getInternal(this),he=ue||await pe,{fragment:ye,topics:me}=await getSubInfo(this,G),be={address:he,topics:me,fromBlock:K,toBlock:ne},ve=getProvider(this.runner);return assert(ve,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await ve.getLogs(be)).map((G=>{let K=ye;if(null==K)try{K=this.interface.getEvent(G.topics[0])}catch(G){}if(K)try{return new EventLog(G,this.interface,K)}catch(K){return new UndecodedEventLog(G,K)}return new Log(G,ve)}))}async on(G,K){const ne=await getSub(this,"on",G);return ne.listeners.push({listener:K,once:!1}),ne.start(),this}async once(G,K){const ne=await getSub(this,"once",G);return ne.listeners.push({listener:K,once:!0}),ne.start(),this}async emit(G,...K){return await emit(this,G,K,null)}async listenerCount(G){if(G){const K=await hasSub(this,G);return K?K.listeners.length:0}const{subs:K}=getInternal(this);let ne=0;for(const{listeners:G}of K.values())ne+=G.length;return ne}async listeners(G){if(G){const K=await hasSub(this,G);return K?K.listeners.map((({listener:G})=>G)):[]}const{subs:K}=getInternal(this);let ne=[];for(const{listeners:G}of K.values())ne=ne.concat(G.map((({listener:G})=>G)));return ne}async off(G,K){const ne=await hasSub(this,G);if(!ne)return this;if(K){const G=ne.listeners.map((({listener:G})=>G)).indexOf(K);G>=0&&ne.listeners.splice(G,1)}return null!=K&&0!==ne.listeners.length||(ne.stop(),getInternal(this).subs.delete(ne.tag)),this}async removeAllListeners(G){if(G){const K=await hasSub(this,G);if(!K)return this;K.stop(),getInternal(this).subs.delete(K.tag)}else{const{subs:G}=getInternal(this);for(const{tag:K,stop:ne}of G.values())ne(),G.delete(K)}return this}async addListener(G,K){return await this.on(G,K)}async removeListener(G,K){return await this.off(G,K)}static buildClass(G){return class CustomContract extends BaseContract{constructor(K,ne=null){super(K,G,ne)}}}static from(G,K,ne){null==ne&&(ne=null);return new this(G,K,ne)}};let gk=class Contract extends(function _ContractBase(){return bk}()){};var vk;function getIpfsLink(G){return G.match(/^ipfs:\/\/ipfs\//i)?G=G.substring(12):G.match(/^ipfs:\/\//i)?G=G.substring(7):assertArgument(!1,"unsupported IPFS format","link",G),`https://gateway.ipfs.io/ipfs/${G}`}class MulticoinProviderPlugin{constructor(G){_defineProperty(this,"name",void 0),defineProperties(this,{name:G})}connect(G){return this}supportsCoinType(G){return!1}async encodeAddress(G,K){throw new Error("unsupported coin")}async decodeAddress(G,K){throw new Error("unsupported coin")}}const wk=new RegExp("^(ipfs)://(.*)$","i"),_k=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),wk,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Tk=new WeakMap,Ak=new WeakMap,Ek=new WeakSet;class EnsResolver{constructor(G,K,ne){_classPrivateMethodInitSpec(this,Ek),_defineProperty(this,"provider",void 0),_defineProperty(this,"address",void 0),_defineProperty(this,"name",void 0),_classPrivateFieldInitSpec(this,Tk,void 0),_classPrivateFieldInitSpec(this,Ak,void 0),defineProperties(this,{provider:G,address:K,name:ne}),_classPrivateFieldSet2(Tk,this,null),_classPrivateFieldSet2(Ak,this,new gk(K,["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)"],G))}async supportsWildcard(){return null==_classPrivateFieldGet2(Tk,this)&&_classPrivateFieldSet2(Tk,this,(async()=>{try{return await _classPrivateFieldGet2(Ak,this).supportsInterface("0x9061b923")}catch(G){if(isError(G,"CALL_EXCEPTION"))return!1;throw _classPrivateFieldSet2(Tk,this,null),G}})()),await _classPrivateFieldGet2(Tk,this)}async getAddress(G){if(null==G&&(G=60),60===G)try{const G=await _assertClassBrand(Ek,this,_fetch).call(this,"addr(bytes32)");return null==G||G===dI?null:G}catch(G){if(isError(G,"CALL_EXCEPTION"))return null;throw G}if(G>=0&&G<2147483648){let K=G+2147483648;const ne=await _assertClassBrand(Ek,this,_fetch).call(this,"addr(bytes32,uint)",[K]);if(isHexString$1(ne,20))return getAddress$1(ne)}let K=null;for(const ne of this.provider.plugins)if(ne instanceof MulticoinProviderPlugin&&ne.supportsCoinType(G)){K=ne;break}if(null==K)return null;const ne=await _assertClassBrand(Ek,this,_fetch).call(this,"addr(bytes32,uint)",[G]);if(null==ne||"0x"===ne)return null;const ue=await K.decodeAddress(G,ne);if(null!=ue)return ue;assert(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${G})`,info:{coinType:G,data:ne}})}async getText(G){const K=await _assertClassBrand(Ek,this,_fetch).call(this,"text(bytes32,string)",[G]);return null==K||"0x"===K?null:K}async getContentHash(){const G=await _assertClassBrand(Ek,this,_fetch).call(this,"contenthash(bytes32)");if(null==G||"0x"===G)return null;const K=G.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(K){const G="e3010170"===K[1]?"ipfs":"ipns",ne=parseInt(K[4],16);if(K[5].length===2*ne)return`${G}://${function encodeBase58(G){const K=getBytes(G);let ne=toBigInt(K),ue="";for(;ne;)ue=mP[Number(ne%bP)]+ue,ne/=bP;for(let G=0;G<K.length&&!K[G];G++)ue=mP[0]+ue;return ue}("0x"+K[2])}`}const ne=G.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(ne&&64===ne[1].length)return`bzz://${ne[1]}`;assert(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:G}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const G=[{type:"name",value:this.name}];try{const K=await this.getText("avatar");if(null==K)return G.push({type:"!avatar",value:""}),{url:null,linkage:G};G.push({type:"avatar",value:K});for(let ne=0;ne<_k.length;ne++){const ue=K.match(_k[ne]);if(null==ue)continue;const pe=ue[1].toLowerCase();switch(pe){case"https":case"data":return G.push({type:"url",value:K}),{linkage:G,url:K};case"ipfs":{const ne=getIpfsLink(K);return G.push({type:"ipfs",value:K}),G.push({type:"url",value:ne}),{linkage:G,url:ne}}case"erc721":case"erc1155":{const ne="erc721"===pe?"tokenURI(uint256)":"uri(uint256)";G.push({type:pe,value:K});const he=await this.getAddress();if(null==he)return G.push({type:"!owner",value:""}),{url:null,linkage:G};const ye=(ue[2]||"").split("/");if(2!==ye.length)return G.push({type:`!${pe}caip`,value:ue[2]||""}),{url:null,linkage:G};const me=ye[1],be=new gk(ye[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===pe){const K=await be.ownerOf(me);if(he!==K)return G.push({type:"!owner",value:K}),{url:null,linkage:G};G.push({type:"owner",value:K})}else if("erc1155"===pe){const K=await be.balanceOf(he,me);if(!K)return G.push({type:"!balance",value:"0"}),{url:null,linkage:G};G.push({type:"balance",value:K.toString()})}let ve=await be[ne](me);if(null==ve||"0x"===ve)return G.push({type:"!metadata-url",value:""}),{url:null,linkage:G};G.push({type:"metadata-url-base",value:ve}),"erc1155"===pe&&(ve=ve.replace("{id}",toBeHex(me,32).substring(2)),G.push({type:"metadata-url-expanded",value:ve})),ve.match(/^ipfs:/i)&&(ve=getIpfsLink(ve)),G.push({type:"metadata-url",value:ve});let _e={};const Te=await new FetchRequest(ve).send();Te.assertOk();try{_e=Te.bodyJson}catch(K){try{G.push({type:"!metadata",value:Te.bodyText})}catch(K){const ne=Te.body;return ne&&G.push({type:"!metadata",value:hexlify$1(ne)}),{url:null,linkage:G}}return{url:null,linkage:G}}if(!_e)return G.push({type:"!metadata",value:""}),{url:null,linkage:G};G.push({type:"metadata",value:JSON.stringify(_e)});let Ee=_e.image;if("string"!=typeof Ee)return G.push({type:"!imageUrl",value:""}),{url:null,linkage:G};if(Ee.match(/^(https:\/\/|data:)/i));else{if(null==Ee.match(wk))return G.push({type:"!imageUrl-ipfs",value:Ee}),{url:null,linkage:G};G.push({type:"imageUrl-ipfs",value:Ee}),Ee=getIpfsLink(Ee)}return G.push({type:"url",value:Ee}),{linkage:G,url:Ee}}}}}catch(G){}return{linkage:G,url:null}}static async getEnsAddress(G){const K=await G.getNetwork(),ne=K.getPlugin("org.ethers.plugins.network.Ens");return assert(ne,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:K}}),ne.address}static async fromName(G,K){let ne=K;for(;;){if(""===ne||"."===ne)return null;if("eth"!==K&&"eth"===ne)return null;const ue=await _getResolver.call(EnsResolver,G,ne);if(null!=ue){const pe=new EnsResolver(G,ue,K);return ne===K||await pe.supportsWildcard()?pe:null}ne=ne.split(".").slice(1).join(".")}}}async function _fetch(G,K){K=(K||[]).slice();const ne=_classPrivateFieldGet2(Ak,this).interface;K.unshift(namehash$1(this.name));let ue=null;await this.supportsWildcard()&&(ue=ne.getFunction(G),assert(ue,"missing fragment","UNKNOWN_ERROR",{info:{funcName:G}}),K=[dnsEncode(this.name,255),ne.encodeFunctionData(ue,K)],G="resolve(bytes,bytes)"),K.push({enableCcipRead:!0});try{const pe=await _classPrivateFieldGet2(Ak,this)[G](...K);return ue?ne.decodeFunctionResult(ue,pe)[0]:pe}catch(G){if(!isError(G,"CALL_EXCEPTION"))throw G}return null}async function _getResolver(G,K){const ne=await vk.getEnsAddress(G);try{const ue=new gk(ne,["function resolver(bytes32) view returns (address)"],G),pe=await ue.resolver(namehash$1(K),{enableCcipRead:!0});return pe===dI?null:pe}catch(G){throw G}return null}vk=EnsResolver;const Pk=BigInt(0);function allowNull(G,K){return function(ne){return null==ne?K:G(ne)}}function arrayOf(G,K){return ne=>{if(K&&null==ne)return null;if(!Array.isArray(ne))throw new Error("not an array");return ne.map((K=>G(K)))}}function object(G,K){return ne=>{const ue={};for(const pe in G){let he=pe;if(K&&pe in K&&!(he in ne))for(const G of K[pe])if(G in ne){he=G;break}try{const K=G[pe](ne[he]);void 0!==K&&(ue[pe]=K)}catch(G){assert(!1,`invalid value for value.${pe} (${G instanceof Error?G.message:"not-an-error"})`,"BAD_DATA",{value:ne})}}return ue}}function formatData(G){return assertArgument(isHexString$1(G,!0),"invalid data","value",G),G}function formatHash(G){return assertArgument(isHexString$1(G,32),"invalid hash","value",G),G}const Sk=object({address:getAddress$1,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull((function formatBoolean(G){switch(G){case!0:case"true":return!0;case!1:case"false":return!1}assertArgument(!1,`invalid boolean; ${JSON.stringify(G)}`,"value",G)}),!1),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});const Ik=object({hash:allowNull(formatHash),parentHash:formatHash,parentBeaconBlockRoot:allowNull(formatHash,null),number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,gasLimit:getBigInt,gasUsed:getBigInt,stateRoot:allowNull(formatHash,null),receiptsRoot:allowNull(formatHash,null),blobGasUsed:allowNull(getBigInt,null),excessBlobGas:allowNull(getBigInt,null),miner:allowNull(getAddress$1),extraData:formatData,baseFeePerGas:allowNull(getBigInt)});const Ck=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress$1,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});const Rk=object({to:allowNull(getAddress$1,null),from:allowNull(getAddress$1,null),contractAddress:allowNull(getAddress$1,null),index:getNumber,root:allowNull(hexlify$1),gasUsed:getBigInt,blobGasUsed:allowNull(getBigInt,null),logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf((function formatReceiptLog(G){return Ck(G)})),blockNumber:getNumber,cumulativeGasUsed:getBigInt,effectiveGasPrice:allowNull(getBigInt),blobGasPrice:allowNull(getBigInt,null),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionResponse(G){G.to&&getBigInt(G.to)===Pk&&(G.to="0x0000000000000000000000000000000000000000");const K=object({hash:formatHash,index:allowNull(getNumber,void 0),type:G=>"0x"===G||null==G?0:getNumber(G),accessList:allowNull(accessListify$1,null),blobVersionedHashes:allowNull(arrayOf(formatHash,!0),null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress$1,gasPrice:allowNull(getBigInt),maxPriorityFeePerGas:allowNull(getBigInt),maxFeePerGas:allowNull(getBigInt),maxFeePerBlobGas:allowNull(getBigInt,null),gasLimit:getBigInt,to:allowNull(getAddress$1,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress$1,null),chainId:allowNull(getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(G);if(null==K.to&&null==K.creates&&(K.creates=function getCreateAddress(G){const K=getAddress$1(G.from);let ne=getBigInt(G.nonce,"tx.nonce").toString(16);return ne="0"===ne?"0x":ne.length%2?"0x0"+ne:"0x"+ne,getAddress$1(dataSlice(keccak256$1(encodeRlp([K,ne])),12))}(K)),1!==G.type&&2!==G.type||null!=G.accessList||(K.accessList=[]),G.signature?K.signature=Signature.from(G.signature):K.signature=Signature.from(G),null==K.chainId){const G=K.signature.legacyChainId;null!=G&&(K.chainId=G)}return K.blockHash&&getBigInt(K.blockHash)===Pk&&(K.blockHash=null),K}class NetworkPlugin{constructor(G){_defineProperty(this,"name",void 0),defineProperties(this,{name:G})}clone(){return new NetworkPlugin(this.name)}}class GasCostPlugin extends NetworkPlugin{constructor(G,K){null==G&&(G=0),super(`org.ethers.network.plugins.GasCost#${G||0}`),_defineProperty(this,"effectiveBlock",void 0),_defineProperty(this,"txBase",void 0),_defineProperty(this,"txCreate",void 0),_defineProperty(this,"txDataZero",void 0),_defineProperty(this,"txDataNonzero",void 0),_defineProperty(this,"txAccessListStorageKey",void 0),_defineProperty(this,"txAccessListAddress",void 0);const ne={effectiveBlock:G};function set(G,ue){let pe=(K||{})[G];null==pe&&(pe=ue),assertArgument("number"==typeof pe,`invalud value for ${G}`,"costs",K),ne[G]=pe}set("txBase",21e3),set("txCreate",32e3),set("txDataZero",4),set("txDataNonzero",16),set("txAccessListStorageKey",1900),set("txAccessListAddress",2400),defineProperties(this,ne)}clone(){return new GasCostPlugin(this.effectiveBlock,this)}}class EnsPlugin extends NetworkPlugin{constructor(G,K){super("org.ethers.plugins.network.Ens"),_defineProperty(this,"address",void 0),_defineProperty(this,"targetNetwork",void 0),defineProperties(this,{address:G||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==K?1:K})}clone(){return new EnsPlugin(this.address,this.targetNetwork)}}var kk=new WeakMap,Ok=new WeakMap;class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin{get url(){return _classPrivateFieldGet2(kk,this)}get processFunc(){return _classPrivateFieldGet2(Ok,this)}constructor(G,K){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),_classPrivateFieldInitSpec(this,kk,void 0),_classPrivateFieldInitSpec(this,Ok,void 0),_classPrivateFieldSet2(kk,this,G),_classPrivateFieldSet2(Ok,this,K)}clone(){return this}}const xk=new Map;var Nk=new WeakMap,Mk=new WeakMap,Bk=new WeakMap;class Network{constructor(G,K){_classPrivateFieldInitSpec(this,Nk,void 0),_classPrivateFieldInitSpec(this,Mk,void 0),_classPrivateFieldInitSpec(this,Bk,void 0),_classPrivateFieldSet2(Nk,this,G),_classPrivateFieldSet2(Mk,this,getBigInt(K)),_classPrivateFieldSet2(Bk,this,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return _classPrivateFieldGet2(Nk,this)}set name(G){_classPrivateFieldSet2(Nk,this,G)}get chainId(){return _classPrivateFieldGet2(Mk,this)}set chainId(G){_classPrivateFieldSet2(Mk,this,getBigInt(G,"chainId"))}matches(G){if(null==G)return!1;if("string"==typeof G){try{return this.chainId===getBigInt(G)}catch(G){}return this.name===G}if("number"==typeof G||"bigint"==typeof G){try{return this.chainId===getBigInt(G)}catch(G){}return!1}if("object"==typeof G){if(null!=G.chainId){try{return this.chainId===getBigInt(G.chainId)}catch(G){}return!1}return null!=G.name&&this.name===G.name}return!1}get plugins(){return Array.from(_classPrivateFieldGet2(Bk,this).values())}attachPlugin(G){if(_classPrivateFieldGet2(Bk,this).get(G.name))throw new Error(`cannot replace existing plugin: ${G.name} `);return _classPrivateFieldGet2(Bk,this).set(G.name,G.clone()),this}getPlugin(G){return _classPrivateFieldGet2(Bk,this).get(G)||null}getPlugins(G){return this.plugins.filter((K=>K.name.split("#")[0]===G))}clone(){const G=new Network(this.name,this.chainId);return this.plugins.forEach((K=>{G.attachPlugin(K.clone())})),G}computeIntrinsicGas(G){const K=this.getPlugin("org.ethers.plugins.network.GasCost")||new GasCostPlugin;let ne=K.txBase;if(null==G.to&&(ne+=K.txCreate),G.data)for(let ue=2;ue<G.data.length;ue+=2)"00"===G.data.substring(ue,ue+2)?ne+=K.txDataZero:ne+=K.txDataNonzero;if(G.accessList){const ue=accessListify$1(G.accessList);for(const G in ue)ne+=K.txAccessListAddress+K.txAccessListStorageKey*ue[G].storageKeys.length}return ne}static from(G){if(function injectCommonNetworks(){if(Fk)return;function registerEth(G,K,ne){const func=function(){const ue=new Network(G,K);return null!=ne.ensNetwork&&ue.attachPlugin(new EnsPlugin(null,ne.ensNetwork)),ue.attachPlugin(new GasCostPlugin),(ne.plugins||[]).forEach((G=>{ue.attachPlugin(G)})),ue};Network.register(G,func),Network.register(K,func),ne.altNames&&ne.altNames.forEach((G=>{Network.register(G,func)}))}Fk=!0,registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),registerEth("ropsten",3,{ensNetwork:3}),registerEth("rinkeby",4,{ensNetwork:4}),registerEth("goerli",5,{ensNetwork:5}),registerEth("kovan",42,{ensNetwork:42}),registerEth("sepolia",11155111,{ensNetwork:11155111}),registerEth("holesky",17e3,{ensNetwork:17e3}),registerEth("classic",61,{}),registerEth("classicKotti",6,{}),registerEth("arbitrum",42161,{ensNetwork:1}),registerEth("arbitrum-goerli",421613,{}),registerEth("arbitrum-sepolia",421614,{}),registerEth("base",8453,{ensNetwork:1}),registerEth("base-goerli",84531,{}),registerEth("base-sepolia",84532,{}),registerEth("bnb",56,{ensNetwork:1}),registerEth("bnbt",97,{}),registerEth("linea",59144,{ensNetwork:1}),registerEth("linea-goerli",59140,{}),registerEth("matic",137,{ensNetwork:1,plugins:[getGasStationPlugin("https://gasstation.polygon.technology/v2")]}),registerEth("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")]}),registerEth("optimism",10,{ensNetwork:1,plugins:[]}),registerEth("optimism-goerli",420,{}),registerEth("optimism-sepolia",11155420,{}),registerEth("xdai",100,{ensNetwork:1})}(),null==G)return Network.from("mainnet");if("number"==typeof G&&(G=BigInt(G)),"string"==typeof G||"bigint"==typeof G){const K=xk.get(G);if(K)return K();if("bigint"==typeof G)return new Network("unknown",G);assertArgument(!1,"unknown network","network",G)}if("function"==typeof G.clone){return G.clone()}if("object"==typeof G){assertArgument("string"==typeof G.name&&"number"==typeof G.chainId,"invalid network object name or chainId","network",G);const K=new Network(G.name,G.chainId);return(G.ensAddress||null!=G.ensNetwork)&&K.attachPlugin(new EnsPlugin(G.ensAddress,G.ensNetwork)),K}assertArgument(!1,"invalid network","network",G)}static register(G,K){"number"==typeof G&&(G=BigInt(G));const ne=xk.get(G);ne&&assertArgument(!1,`conflicting network for ${JSON.stringify(ne.name)}`,"nameOrChainId",G),xk.set(G,K)}}function parseUnits(G,K){const ne=String(G);if(!ne.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${G}`);const ue=ne.split(".");if(1===ue.length&&ue.push(""),2!==ue.length)throw new Error(`invalid gwei value: ${G}`);for(;ue[1].length<K;)ue[1]+="0";if(ue[1].length>9){let G=BigInt(ue[1].substring(0,9));ue[1].substring(9).match(/^0+$/)||G++,ue[1]=G.toString()}return BigInt(ue[0]+ue[1])}function getGasStationPlugin(G){return new FetchUrlFeeDataNetworkPlugin(G,(async(G,K,ne)=>{let ue;ne.setHeader("User-Agent","ethers");try{const[K,pe]=await Promise.all([ne.send(),G()]);ue=K;const he=ue.bodyJson.standard;return{gasPrice:pe.gasPrice,maxFeePerGas:parseUnits(he.maxFee,9),maxPriorityFeePerGas:parseUnits(he.maxPriorityFee,9)}}catch(G){assert(!1,`error encountered with polygon gas station (${JSON.stringify(ne.url)})`,"SERVER_ERROR",{request:ne,response:ue,error:G})}}))}let Fk=!1;function copy$2(G){return JSON.parse(JSON.stringify(G))}var Dk=new WeakMap,Lk=new WeakMap,Uk=new WeakMap,$k=new WeakMap,qk=new WeakSet;class PollingBlockSubscriber{constructor(G){_classPrivateMethodInitSpec(this,qk),_classPrivateFieldInitSpec(this,Dk,void 0),_classPrivateFieldInitSpec(this,Lk,void 0),_classPrivateFieldInitSpec(this,Uk,void 0),_classPrivateFieldInitSpec(this,$k,void 0),_classPrivateFieldSet2(Dk,this,G),_classPrivateFieldSet2(Lk,this,null),_classPrivateFieldSet2(Uk,this,4e3),_classPrivateFieldSet2($k,this,-2)}get pollingInterval(){return _classPrivateFieldGet2(Uk,this)}set pollingInterval(G){_classPrivateFieldSet2(Uk,this,G)}start(){_classPrivateFieldGet2(Lk,this)||(_classPrivateFieldSet2(Lk,this,_classPrivateFieldGet2(Dk,this)._setTimeout(_assertClassBrand(qk,this,_poll$1).bind(this),_classPrivateFieldGet2(Uk,this))),_assertClassBrand(qk,this,_poll$1).call(this))}stop(){_classPrivateFieldGet2(Lk,this)&&(_classPrivateFieldGet2(Dk,this)._clearTimeout(_classPrivateFieldGet2(Lk,this)),_classPrivateFieldSet2(Lk,this,null))}pause(G){this.stop(),G&&_classPrivateFieldSet2($k,this,-2)}resume(){this.start()}}async function _poll$1(){try{const G=await _classPrivateFieldGet2(Dk,this).getBlockNumber();if(-2===_classPrivateFieldGet2($k,this))return void _classPrivateFieldSet2($k,this,G);if(G!==_classPrivateFieldGet2($k,this)){for(let K=_classPrivateFieldGet2($k,this)+1;K<=G;K++){if(null==_classPrivateFieldGet2(Lk,this))return;await _classPrivateFieldGet2(Dk,this).emit("block",K)}_classPrivateFieldSet2($k,this,G)}}catch(G){}null!=_classPrivateFieldGet2(Lk,this)&&_classPrivateFieldSet2(Lk,this,_classPrivateFieldGet2(Dk,this)._setTimeout(_assertClassBrand(qk,this,_poll$1).bind(this),_classPrivateFieldGet2(Uk,this)))}var Gk=new WeakMap,jk=new WeakMap,Hk=new WeakMap;class OnBlockSubscriber{constructor(G){_classPrivateFieldInitSpec(this,Gk,void 0),_classPrivateFieldInitSpec(this,jk,void 0),_classPrivateFieldInitSpec(this,Hk,void 0),_classPrivateFieldSet2(Gk,this,G),_classPrivateFieldSet2(Hk,this,!1),_classPrivateFieldSet2(jk,this,(G=>{this._poll(G,_classPrivateFieldGet2(Gk,this))}))}async _poll(G,K){throw new Error("sub-classes must override this")}start(){_classPrivateFieldGet2(Hk,this)||(_classPrivateFieldSet2(Hk,this,!0),_classPrivateFieldGet2(jk,this).call(this,-2),_classPrivateFieldGet2(Gk,this).on("block",_classPrivateFieldGet2(jk,this)))}stop(){_classPrivateFieldGet2(Hk,this)&&(_classPrivateFieldSet2(Hk,this,!1),_classPrivateFieldGet2(Gk,this).off("block",_classPrivateFieldGet2(jk,this)))}pause(G){this.stop()}resume(){this.start()}}var Wk=new WeakMap,zk=new WeakMap;class PollingBlockTagSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,Wk,void 0),_classPrivateFieldInitSpec(this,zk,void 0),_classPrivateFieldSet2(Wk,this,K),_classPrivateFieldSet2(zk,this,-2)}pause(G){G&&_classPrivateFieldSet2(zk,this,-2),super.pause(G)}async _poll(G,K){const ne=await K.getBlock(_classPrivateFieldGet2(Wk,this));null!=ne&&(-2===_classPrivateFieldGet2(zk,this)?_classPrivateFieldSet2(zk,this,ne.number):ne.number>_classPrivateFieldGet2(zk,this)&&(K.emit(_classPrivateFieldGet2(Wk,this),ne.number),_classPrivateFieldSet2(zk,this,ne.number)))}}var Vk=new WeakMap;class PollingOrphanSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,Vk,void 0),_classPrivateFieldSet2(Vk,this,copy$2(K))}async _poll(G,K){throw new Error("@TODO")}}var Kk=new WeakMap;class PollingTransactionSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,Kk,void 0),_classPrivateFieldSet2(Kk,this,K)}async _poll(G,K){const ne=await K.getTransactionReceipt(_classPrivateFieldGet2(Kk,this));ne&&K.emit(_classPrivateFieldGet2(Kk,this),ne)}}var Jk=new WeakMap,Xk=new WeakMap,Qk=new WeakMap,Zk=new WeakMap,Yk=new WeakMap,eO=new WeakSet;class PollingEventSubscriber{constructor(G,K){_classPrivateMethodInitSpec(this,eO),_classPrivateFieldInitSpec(this,Jk,void 0),_classPrivateFieldInitSpec(this,Xk,void 0),_classPrivateFieldInitSpec(this,Qk,void 0),_classPrivateFieldInitSpec(this,Zk,void 0),_classPrivateFieldInitSpec(this,Yk,void 0),_classPrivateFieldSet2(Jk,this,G),_classPrivateFieldSet2(Xk,this,copy$2(K)),_classPrivateFieldSet2(Qk,this,_assertClassBrand(eO,this,_poll3).bind(this)),_classPrivateFieldSet2(Zk,this,!1),_classPrivateFieldSet2(Yk,this,-2)}start(){_classPrivateFieldGet2(Zk,this)||(_classPrivateFieldSet2(Zk,this,!0),-2===_classPrivateFieldGet2(Yk,this)&&_classPrivateFieldGet2(Jk,this).getBlockNumber().then((G=>{_classPrivateFieldSet2(Yk,this,G)})),_classPrivateFieldGet2(Jk,this).on("block",_classPrivateFieldGet2(Qk,this)))}stop(){_classPrivateFieldGet2(Zk,this)&&(_classPrivateFieldSet2(Zk,this,!1),_classPrivateFieldGet2(Jk,this).off("block",_classPrivateFieldGet2(Qk,this)))}pause(G){this.stop(),G&&_classPrivateFieldSet2(Yk,this,-2)}resume(){this.start()}}async function _poll3(G){if(-2===_classPrivateFieldGet2(Yk,this))return;const K=copy$2(_classPrivateFieldGet2(Xk,this));K.fromBlock=_classPrivateFieldGet2(Yk,this)+1,K.toBlock=G;const ne=await _classPrivateFieldGet2(Jk,this).getLogs(K);if(0!==ne.length)for(const G of ne)_classPrivateFieldGet2(Jk,this).emit(_classPrivateFieldGet2(Xk,this),G),_classPrivateFieldSet2(Yk,this,G.blockNumber);else _classPrivateFieldGet2(Yk,this)<G-60&&_classPrivateFieldSet2(Yk,this,G-60)}const tO=BigInt(2);function isPromise(G){return G&&"function"==typeof G.then}function getTag(G,K){return G+":"+JSON.stringify(K,((G,K)=>{if(null==K)return"null";if("bigint"==typeof K)return`bigint:${K.toString()}`;if("string"==typeof K)return K.toLowerCase();if("object"==typeof K&&!Array.isArray(K)){const G=Object.keys(K);return G.sort(),G.reduce(((G,ne)=>(G[ne]=K[ne],G)),{})}return K}))}class UnmanagedSubscriber{constructor(G){_defineProperty(this,"name",void 0),defineProperties(this,{name:G})}start(){}stop(){}pause(G){}resume(){}}function concisify(G){return(G=Array.from(new Set(G).values())).sort(),G}async function getSubscription(G,K){if(null==G)throw new Error("invalid event");if(Array.isArray(G)&&(G={topics:G}),"string"==typeof G)switch(G){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:G,tag:G}}if(isHexString$1(G,32)){const K=G.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:K}),hash:K}}if(G.orphan){const K=G;return{type:"orphan",tag:getTag("orphan",K),filter:(ne=K,JSON.parse(JSON.stringify(ne)))}}var ne;if(G.address||G.topics){const ne=G,ue={topics:(ne.topics||[]).map((G=>null==G?null:Array.isArray(G)?concisify(G.map((G=>G.toLowerCase()))):G.toLowerCase()))};if(ne.address){const G=[],pe=[],addAddress=ne=>{isHexString$1(ne)?G.push(ne):pe.push((async()=>{G.push(await resolveAddress(ne,K))})())};Array.isArray(ne.address)?ne.address.forEach(addAddress):addAddress(ne.address),pe.length&&await Promise.all(pe),ue.address=concisify(G.map((G=>G.toLowerCase())))}return{filter:ue,tag:getTag("event",ue),type:"event"}}assertArgument(!1,"unknown ProviderEvent","event",G)}function getTime(){return(new Date).getTime()}const rO={cacheTimeout:250,pollingInterval:4e3};var nO=new WeakMap,aO=new WeakMap,iO=new WeakMap,sO=new WeakMap,oO=new WeakMap,cO=new WeakMap,dO=new WeakMap,uO=new WeakMap,fO=new WeakMap,lO=new WeakMap,pO=new WeakMap,hO=new WeakMap,yO=new WeakSet;class AbstractProvider{constructor(G,K){if(_classPrivateMethodInitSpec(this,yO),_classPrivateFieldInitSpec(this,nO,void 0),_classPrivateFieldInitSpec(this,aO,void 0),_classPrivateFieldInitSpec(this,iO,void 0),_classPrivateFieldInitSpec(this,sO,void 0),_classPrivateFieldInitSpec(this,oO,void 0),_classPrivateFieldInitSpec(this,cO,void 0),_classPrivateFieldInitSpec(this,dO,void 0),_classPrivateFieldInitSpec(this,uO,void 0),_classPrivateFieldInitSpec(this,fO,void 0),_classPrivateFieldInitSpec(this,lO,void 0),_classPrivateFieldInitSpec(this,pO,void 0),_classPrivateFieldInitSpec(this,hO,void 0),_classPrivateFieldSet2(hO,this,Object.assign({},rO,K||{})),"any"===G)_classPrivateFieldSet2(cO,this,!0),_classPrivateFieldSet2(oO,this,null);else if(G){const K=Network.from(G);_classPrivateFieldSet2(cO,this,!1),_classPrivateFieldSet2(oO,this,Promise.resolve(K)),setTimeout((()=>{this.emit("network",K,null)}),0)}else _classPrivateFieldSet2(cO,this,!1),_classPrivateFieldSet2(oO,this,null);_classPrivateFieldSet2(uO,this,-1),_classPrivateFieldSet2(dO,this,new Map),_classPrivateFieldSet2(nO,this,new Map),_classPrivateFieldSet2(aO,this,new Map),_classPrivateFieldSet2(iO,this,null),_classPrivateFieldSet2(sO,this,!1),_classPrivateFieldSet2(fO,this,1),_classPrivateFieldSet2(lO,this,new Map),_classPrivateFieldSet2(pO,this,!1)}get pollingInterval(){return _classPrivateFieldGet2(hO,this).pollingInterval}get provider(){return this}get plugins(){return Array.from(_classPrivateFieldGet2(aO,this).values())}attachPlugin(G){if(_classPrivateFieldGet2(aO,this).get(G.name))throw new Error(`cannot replace existing plugin: ${G.name} `);return _classPrivateFieldGet2(aO,this).set(G.name,G.connect(this)),this}getPlugin(G){return _classPrivateFieldGet2(aO,this).get(G)||null}get disableCcipRead(){return _classPrivateFieldGet2(pO,this)}set disableCcipRead(G){_classPrivateFieldSet2(pO,this,!!G)}async ccipReadFetch(G,K,ne){if(this.disableCcipRead||0===ne.length||null==G.to)return null;const ue=G.to.toLowerCase(),pe=K.toLowerCase(),he=[];for(let K=0;K<ne.length;K++){const ye=ne[K],me=ye.replace("{sender}",ue).replace("{data}",pe),be=new FetchRequest(me);-1===ye.indexOf("{data}")&&(be.body={data:pe,sender:ue}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:be,index:K,urls:ne});let ve="unknown error";const _e=await be.send();try{const G=_e.bodyJson;if(G.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:be,result:G}),G.data;G.message&&(ve=G.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:be,result:G})}catch(G){}assert(_e.statusCode<400||_e.statusCode>=500,`response not found during CCIP fetch: ${ve}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:G,info:{url:ye,errorMessage:ve}}),he.push(ve)}assert(!1,`error encountered during CCIP fetch: ${he.map((G=>JSON.stringify(G))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:G,info:{urls:ne,errorMessages:he}})}_wrapBlock(G,K){return new Block(function formatBlock(G){const K=Ik(G);return K.transactions=G.transactions.map((G=>"string"==typeof G?G:formatTransactionResponse(G))),K}(G),this)}_wrapLog(G,K){return new Log(function formatLog(G){return Sk(G)}(G),this)}_wrapTransactionReceipt(G,K){return new TransactionReceipt(function formatTransactionReceipt(G){return Rk(G)}(G),this)}_wrapTransactionResponse(G,K){return new TransactionResponse(formatTransactionResponse(G),this)}_detectNetwork(){assert(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(G){assert(!1,`unsupported method: ${G.method}`,"UNSUPPORTED_OPERATION",{operation:G.method,info:G})}async getBlockNumber(){const G=getNumber(await _assertClassBrand(yO,this,_perform).call(this,{method:"getBlockNumber"}),"%response");return _classPrivateFieldGet2(uO,this)>=0&&_classPrivateFieldSet2(uO,this,G),G}_getAddress(G){return resolveAddress(G,this)}_getBlockTag(G){if(null==G)return"latest";switch(G){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return G}return isHexString$1(G)?isHexString$1(G,32)?G:toQuantity(G):("bigint"==typeof G&&(G=getNumber(G,"blockTag")),"number"==typeof G?G>=0?toQuantity(G):_classPrivateFieldGet2(uO,this)>=0?toQuantity(_classPrivateFieldGet2(uO,this)+G):this.getBlockNumber().then((K=>toQuantity(K+G))):void assertArgument(!1,"invalid blockTag","blockTag",G))}_getFilter(G){const K=(G.topics||[]).map((G=>null==G?null:Array.isArray(G)?concisify(G.map((G=>G.toLowerCase()))):G.toLowerCase())),ne="blockHash"in G?G.blockHash:void 0,resolve=(G,ue,pe)=>{let he;switch(G.length){case 0:break;case 1:he=G[0];break;default:G.sort(),he=G}if(ne&&(null!=ue||null!=pe))throw new Error("invalid filter");const ye={};return he&&(ye.address=he),K.length&&(ye.topics=K),ue&&(ye.fromBlock=ue),pe&&(ye.toBlock=pe),ne&&(ye.blockHash=ne),ye};let ue,pe,he=[];if(G.address)if(Array.isArray(G.address))for(const K of G.address)he.push(this._getAddress(K));else he.push(this._getAddress(G.address));return"fromBlock"in G&&(ue=this._getBlockTag(G.fromBlock)),"toBlock"in G&&(pe=this._getBlockTag(G.toBlock)),he.filter((G=>"string"!=typeof G)).length||null!=ue&&"string"!=typeof ue||null!=pe&&"string"!=typeof pe?Promise.all([Promise.all(he),ue,pe]).then((G=>resolve(G[0],G[1],G[2]))):resolve(he,ue,pe)}_getTransactionRequest(G){const K=copyRequest(G),ne=[];if(["to","from"].forEach((G=>{if(null==K[G])return;const ue=resolveAddress(K[G],this);isPromise(ue)?ne.push(async function(){K[G]=await ue}()):K[G]=ue})),null!=K.blockTag){const G=this._getBlockTag(K.blockTag);isPromise(G)?ne.push(async function(){K.blockTag=await G}()):K.blockTag=G}return ne.length?async function(){return await Promise.all(ne),K}():K}async getNetwork(){if(null==_classPrivateFieldGet2(oO,this)){const G=(async()=>{try{const G=await this._detectNetwork();return this.emit("network",G,null),G}catch(K){throw _classPrivateFieldGet2(oO,this)===G&&_classPrivateFieldSet2(oO,this,null),K}})();return _classPrivateFieldSet2(oO,this,G),(await G).clone()}const G=_classPrivateFieldGet2(oO,this),[K,ne]=await Promise.all([G,this._detectNetwork()]);return K.chainId!==ne.chainId&&(_classPrivateFieldGet2(cO,this)?(this.emit("network",ne,K),_classPrivateFieldGet2(oO,this)===G&&_classPrivateFieldSet2(oO,this,Promise.resolve(ne))):assert(!1,`network changed: ${K.chainId} => ${ne.chainId} `,"NETWORK_ERROR",{event:"changed"})),K.clone()}async getFeeData(){const G=await this.getNetwork(),getFeeDataFunc=async()=>{const{_block:K,gasPrice:ne,priorityFee:ue}=await resolveProperties$1({_block:_assertClassBrand(yO,this,_getBlock).call(this,"latest",!1),gasPrice:(async()=>{try{return getBigInt(await _assertClassBrand(yO,this,_perform).call(this,{method:"getGasPrice"}),"%response")}catch(G){}return null})(),priorityFee:(async()=>{try{return getBigInt(await _assertClassBrand(yO,this,_perform).call(this,{method:"getPriorityFee"}),"%response")}catch(G){}return null})()});let pe=null,he=null;const ye=this._wrapBlock(K,G);return ye&&ye.baseFeePerGas&&(he=null!=ue?ue:BigInt("1000000000"),pe=ye.baseFeePerGas*tO+he),new FeeData(ne,pe,he)},K=G.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(K){const G=new FetchRequest(K.url),ne=await K.processFunc(getFeeDataFunc,this,G);return new FeeData(ne.gasPrice,ne.maxFeePerGas,ne.maxPriorityFeePerGas)}return await getFeeDataFunc()}async estimateGas(G){let K=this._getTransactionRequest(G);return isPromise(K)&&(K=await K),getBigInt(await _assertClassBrand(yO,this,_perform).call(this,{method:"estimateGas",transaction:K}),"%response")}async call(G){const{tx:K,blockTag:ne}=await resolveProperties$1({tx:this._getTransactionRequest(G),blockTag:this._getBlockTag(G.blockTag)});return await _assertClassBrand(yO,this,_checkNetwork).call(this,_assertClassBrand(yO,this,_call).call(this,K,ne,G.enableCcipRead?0:-1))}async getBalance(G,K){return getBigInt(await _assertClassBrand(yO,this,_getAccountValue).call(this,{method:"getBalance"},G,K),"%response")}async getTransactionCount(G,K){return getNumber(await _assertClassBrand(yO,this,_getAccountValue).call(this,{method:"getTransactionCount"},G,K),"%response")}async getCode(G,K){return hexlify$1(await _assertClassBrand(yO,this,_getAccountValue).call(this,{method:"getCode"},G,K))}async getStorage(G,K,ne){const ue=getBigInt(K,"position");return hexlify$1(await _assertClassBrand(yO,this,_getAccountValue).call(this,{method:"getStorage",position:ue},G,ne))}async broadcastTransaction(G){const{blockNumber:K,hash:ne,network:ue}=await resolveProperties$1({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:G}),network:this.getNetwork()}),pe=Transaction.from(G);if(pe.hash!==ne)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(pe,ue).replaceableTransaction(K)}async getBlock(G,K){const{network:ne,params:ue}=await resolveProperties$1({network:this.getNetwork(),params:_assertClassBrand(yO,this,_getBlock).call(this,G,!!K)});return null==ue?null:this._wrapBlock(ue,ne)}async getTransaction(G){const{network:K,params:ne}=await resolveProperties$1({network:this.getNetwork(),params:_assertClassBrand(yO,this,_perform).call(this,{method:"getTransaction",hash:G})});return null==ne?null:this._wrapTransactionResponse(ne,K)}async getTransactionReceipt(G){const{network:K,params:ne}=await resolveProperties$1({network:this.getNetwork(),params:_assertClassBrand(yO,this,_perform).call(this,{method:"getTransactionReceipt",hash:G})});if(null==ne)return null;if(null==ne.gasPrice&&null==ne.effectiveGasPrice){const K=await _assertClassBrand(yO,this,_perform).call(this,{method:"getTransaction",hash:G});if(null==K)throw new Error("report this; could not find tx or effectiveGasPrice");ne.effectiveGasPrice=K.gasPrice}return this._wrapTransactionReceipt(ne,K)}async getTransactionResult(G){const{result:K}=await resolveProperties$1({network:this.getNetwork(),result:_assertClassBrand(yO,this,_perform).call(this,{method:"getTransactionResult",hash:G})});return null==K?null:hexlify$1(K)}async getLogs(G){let K=this._getFilter(G);isPromise(K)&&(K=await K);const{network:ne,params:ue}=await resolveProperties$1({network:this.getNetwork(),params:_assertClassBrand(yO,this,_perform).call(this,{method:"getLogs",filter:K})});return ue.map((G=>this._wrapLog(G,ne)))}_getProvider(G){assert(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(G){return await EnsResolver.fromName(this,G)}async getAvatar(G){const K=await this.getResolver(G);return K?await K.getAvatar():null}async resolveName(G){const K=await this.getResolver(G);return K?await K.getAddress():null}async lookupAddress(G){const K=namehash$1((G=getAddress$1(G)).substring(2).toLowerCase()+".addr.reverse");try{const ne=await EnsResolver.getEnsAddress(this),ue=new gk(ne,["function resolver(bytes32) view returns (address)"],this),pe=await ue.resolver(K);if(null==pe||pe===dI)return null;const he=new gk(pe,["function name(bytes32) view returns (string)"],this),ye=await he.name(K);return await this.resolveName(ye)!==G?null:ye}catch(G){if(isError(G,"BAD_DATA")&&"0x"===G.value)return null;if(isError(G,"CALL_EXCEPTION"))return null;throw G}return null}async waitForTransaction(G,K,ne){const ue=null!=K?K:1;return 0===ue?this.getTransactionReceipt(G):new Promise((async(K,pe)=>{let he=null;const listener=async ne=>{try{const pe=await this.getTransactionReceipt(G);if(null!=pe&&ne-pe.blockNumber+1>=ue)return K(pe),void(he&&(clearTimeout(he),he=null))}catch(G){console.log("EEE",G)}this.once("block",listener)};null!=ne&&(he=setTimeout((()=>{null!=he&&(he=null,this.off("block",listener),pe(makeError("timeout","TIMEOUT",{reason:"timeout"})))}),ne)),listener(await this.getBlockNumber())}))}async waitForBlock(G){assert(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(G){const K=_classPrivateFieldGet2(lO,this).get(G);K&&(K.timer&&clearTimeout(K.timer),_classPrivateFieldGet2(lO,this).delete(G))}_setTimeout(G,K){var ne,ue;null==K&&(K=0);const pe=(_classPrivateFieldSet2(fO,this,(ne=_classPrivateFieldGet2(fO,this),ue=ne++,ne)),ue),func=()=>{_classPrivateFieldGet2(lO,this).delete(pe),G()};if(this.paused)_classPrivateFieldGet2(lO,this).set(pe,{timer:null,func:func,time:K});else{const G=setTimeout(func,K);_classPrivateFieldGet2(lO,this).set(pe,{timer:G,func:func,time:getTime()})}return pe}_forEachSubscriber(G){for(const K of _classPrivateFieldGet2(nO,this).values())G(K.subscriber)}_getSubscriber(G){switch(G.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(G.type);case"block":{const G=new PollingBlockSubscriber(this);return G.pollingInterval=this.pollingInterval,G}case"safe":case"finalized":return new PollingBlockTagSubscriber(this,G.type);case"event":return new PollingEventSubscriber(this,G.filter);case"transaction":return new PollingTransactionSubscriber(this,G.hash);case"orphan":return new PollingOrphanSubscriber(this,G.filter)}throw new Error(`unsupported event: ${G.type}`)}_recoverSubscriber(G,K){for(const ne of _classPrivateFieldGet2(nO,this).values())if(ne.subscriber===G){ne.started&&ne.subscriber.stop(),ne.subscriber=K,ne.started&&K.start(),null!=_classPrivateFieldGet2(iO,this)&&K.pause(_classPrivateFieldGet2(iO,this));break}}async on(G,K){const ne=await _assertClassBrand(yO,this,_getSub).call(this,G);return ne.listeners.push({listener:K,once:!1}),ne.started||(ne.subscriber.start(),ne.started=!0,null!=_classPrivateFieldGet2(iO,this)&&ne.subscriber.pause(_classPrivateFieldGet2(iO,this))),this}async once(G,K){const ne=await _assertClassBrand(yO,this,_getSub).call(this,G);return ne.listeners.push({listener:K,once:!0}),ne.started||(ne.subscriber.start(),ne.started=!0,null!=_classPrivateFieldGet2(iO,this)&&ne.subscriber.pause(_classPrivateFieldGet2(iO,this))),this}async emit(G,...K){const ne=await _assertClassBrand(yO,this,_hasSub).call(this,G,K);if(!ne||0===ne.listeners.length)return!1;const ue=ne.listeners.length;return ne.listeners=ne.listeners.filter((({listener:ne,once:ue})=>{const pe=new EventPayload(this,ue?null:ne,G);try{ne.call(this,...K,pe)}catch(G){}return!ue})),0===ne.listeners.length&&(ne.started&&ne.subscriber.stop(),_classPrivateFieldGet2(nO,this).delete(ne.tag)),ue>0}async listenerCount(G){if(G){const K=await _assertClassBrand(yO,this,_hasSub).call(this,G);return K?K.listeners.length:0}let K=0;for(const{listeners:G}of _classPrivateFieldGet2(nO,this).values())K+=G.length;return K}async listeners(G){if(G){const K=await _assertClassBrand(yO,this,_hasSub).call(this,G);return K?K.listeners.map((({listener:G})=>G)):[]}let K=[];for(const{listeners:G}of _classPrivateFieldGet2(nO,this).values())K=K.concat(G.map((({listener:G})=>G)));return K}async off(G,K){const ne=await _assertClassBrand(yO,this,_hasSub).call(this,G);if(!ne)return this;if(K){const G=ne.listeners.map((({listener:G})=>G)).indexOf(K);G>=0&&ne.listeners.splice(G,1)}return K&&0!==ne.listeners.length||(ne.started&&ne.subscriber.stop(),_classPrivateFieldGet2(nO,this).delete(ne.tag)),this}async removeAllListeners(G){if(G){const{tag:K,started:ne,subscriber:ue}=await _assertClassBrand(yO,this,_getSub).call(this,G);ne&&ue.stop(),_classPrivateFieldGet2(nO,this).delete(K)}else for(const[G,{started:K,subscriber:ne}]of _classPrivateFieldGet2(nO,this))K&&ne.stop(),_classPrivateFieldGet2(nO,this).delete(G);return this}async addListener(G,K){return await this.on(G,K)}async removeListener(G,K){return this.off(G,K)}get destroyed(){return _classPrivateFieldGet2(sO,this)}destroy(){this.removeAllListeners();for(const G of _classPrivateFieldGet2(lO,this).keys())this._clearTimeout(G);_classPrivateFieldSet2(sO,this,!0)}get paused(){return null!=_classPrivateFieldGet2(iO,this)}set paused(G){!!G!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(G){if(_classPrivateFieldSet2(uO,this,-1),null!=_classPrivateFieldGet2(iO,this)){if(_classPrivateFieldGet2(iO,this)==!!G)return;assert(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((K=>K.pause(G))),_classPrivateFieldSet2(iO,this,!!G);for(const G of _classPrivateFieldGet2(lO,this).values())G.timer&&clearTimeout(G.timer),G.time=getTime()-G.time}resume(){if(null!=_classPrivateFieldGet2(iO,this)){this._forEachSubscriber((G=>G.resume())),_classPrivateFieldSet2(iO,this,null);for(const G of _classPrivateFieldGet2(lO,this).values()){let K=G.time;K<0&&(K=0),G.time=getTime(),setTimeout(G.func,K)}}}}async function _perform(G){const K=_classPrivateFieldGet2(hO,this).cacheTimeout;if(K<0)return await this._perform(G);const ne=getTag(G.method,G);let ue=_classPrivateFieldGet2(dO,this).get(ne);return ue||(ue=this._perform(G),_classPrivateFieldGet2(dO,this).set(ne,ue),setTimeout((()=>{_classPrivateFieldGet2(dO,this).get(ne)===ue&&_classPrivateFieldGet2(dO,this).delete(ne)}),K)),await ue}async function _call(G,K,ne){assert(ne<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},G,{blockTag:K,enableCcipRead:!0})});const ue=copyRequest(G);try{return hexlify$1(await this._perform({method:"call",transaction:ue,blockTag:K}))}catch(G){if(!this.disableCcipRead&&isCallException(G)&&G.data&&ne>=0&&"latest"===K&&null!=ue.to&&"0x556f1830"===dataSlice(G.data,0,4)){const pe=G.data,he=await resolveAddress(ue.to,this);let ye;try{ye=function parseOffchainLookup(G){const K={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};assert(dataLength(G)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const ne=dataSlice(G,0,32);assert(dataSlice(ne,0,12)===dataSlice(bO,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),K.sender=dataSlice(ne,12);try{const ne=[],ue=getNumber(dataSlice(G,32,64)),pe=getNumber(dataSlice(G,ue,ue+32)),he=dataSlice(G,ue+32);for(let G=0;G<pe;G++){const K=_parseString(he,32*G);if(null==K)throw new Error("abort");ne.push(K)}K.urls=ne}catch(G){assert(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const ne=_parseBytes(G,64);if(null==ne)throw new Error("abort");K.calldata=ne}catch(G){assert(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}assert(dataSlice(G,100,128)===dataSlice(bO,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),K.selector=dataSlice(G,96,100);try{const ne=_parseBytes(G,128);if(null==ne)throw new Error("abort");K.extraData=ne}catch(G){assert(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return K.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map((G=>K[G])),K}(dataSlice(G.data,4))}catch(G){assert(!1,G.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:ue,info:{data:pe}})}assert(ye.sender.toLowerCase()===he.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:pe,reason:"OffchainLookup",transaction:ue,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ye.errorArgs}});const me=await this.ccipReadFetch(ue,ye.calldata,ye.urls);assert(null!=me,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:ue,info:{data:G.data,errorArgs:ye.errorArgs}});const be={to:he,data:concat$1([ye.selector,encodeBytes([me,ye.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:be});try{const G=await _assertClassBrand(yO,this,_call).call(this,be,K,ne+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},be),result:G}),G}catch(G){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},be),error:G}),G}}throw G}}async function _checkNetwork(G){const{value:K}=await resolveProperties$1({network:this.getNetwork(),value:G});return K}async function _getAccountValue(G,K,ne){let ue=this._getAddress(K),pe=this._getBlockTag(ne);return"string"==typeof ue&&"string"==typeof pe||([ue,pe]=await Promise.all([ue,pe])),await _assertClassBrand(yO,this,_checkNetwork).call(this,_assertClassBrand(yO,this,_perform).call(this,Object.assign(G,{address:ue,blockTag:pe})))}async function _getBlock(G,K){if(isHexString$1(G,32))return await _assertClassBrand(yO,this,_perform).call(this,{method:"getBlock",blockHash:G,includeTransactions:K});let ne=this._getBlockTag(G);return"string"!=typeof ne&&(ne=await ne),await _assertClassBrand(yO,this,_perform).call(this,{method:"getBlock",blockTag:ne,includeTransactions:K})}async function _hasSub(G,K){let ne=await getSubscription(G,this);return"event"===ne.type&&K&&K.length>0&&!0===K[0].removed&&(ne=await getSubscription({orphan:"drop-log",log:K[0]},this)),_classPrivateFieldGet2(nO,this).get(ne.tag)||null}async function _getSub(G){const K=await getSubscription(G,this),ne=K.tag;let ue=_classPrivateFieldGet2(nO,this).get(ne);if(!ue){ue={subscriber:this._getSubscriber(K),tag:ne,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},_classPrivateFieldGet2(nO,this).set(ne,ue)}return ue}function _parseString(G,K){try{const ne=_parseBytes(G,K);if(ne)return toUtf8String$1(ne)}catch(G){}return null}function _parseBytes(G,K){if("0x"===G)return null;try{const ne=getNumber(dataSlice(G,K,K+32)),ue=getNumber(dataSlice(G,ne,ne+32));return dataSlice(G,ne+32,ne+32+ue)}catch(G){}return null}function numPad(G){const K=toBeArray(G);if(K.length>32)throw new Error("internal; should not happen");const ne=new Uint8Array(32);return ne.set(K,32-K.length),ne}function bytesPad(G){if(G.length%32==0)return G;const K=new Uint8Array(32*Math.ceil(G.length/32));return K.set(G),K}const mO=new Uint8Array([]);function encodeBytes(G){const K=[];let ne=0;for(let ue=0;ue<G.length;ue++)K.push(mO),ne+=32;for(let ue=0;ue<G.length;ue++){const pe=getBytes(G[ue]);K[ue]=numPad(ne),K.push(numPad(pe.length)),K.push(bytesPad(pe)),ne+=32+32*Math.ceil(pe.length/32)}return concat$1(K)}const bO="0x0000000000000000000000000000000000000000000000000000000000000000";function checkProvider(G,K){if(G.provider)return G.provider;assert(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:K})}async function populate$1(G,K){let ne=copyRequest(K);if(null!=ne.to&&(ne.to=resolveAddress(ne.to,G)),null!=ne.from){const K=ne.from;ne.from=Promise.all([G.getAddress(),resolveAddress(K,G)]).then((([G,K])=>(assertArgument(G.toLowerCase()===K.toLowerCase(),"transaction from mismatch","tx.from",K),G)))}else ne.from=G.getAddress();return await resolveProperties$1(ne)}class AbstractSigner{constructor(G){_defineProperty(this,"provider",void 0),defineProperties(this,{provider:G||null})}async getNonce(G){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),G)}async populateCall(G){return await populate$1(this,G)}async populateTransaction(G){const K=checkProvider(this,"populateTransaction"),ne=await populate$1(this,G);null==ne.nonce&&(ne.nonce=await this.getNonce("pending")),null==ne.gasLimit&&(ne.gasLimit=await this.estimateGas(ne));const ue=await this.provider.getNetwork();if(null!=ne.chainId){assertArgument(getBigInt(ne.chainId)===ue.chainId,"transaction chainId mismatch","tx.chainId",G.chainId)}else ne.chainId=ue.chainId;const pe=null!=ne.maxFeePerGas||null!=ne.maxPriorityFeePerGas;if(null==ne.gasPrice||2!==ne.type&&!pe?0!==ne.type&&1!==ne.type||!pe||assertArgument(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",G):assertArgument(!1,"eip-1559 transaction do not support gasPrice","tx",G),2!==ne.type&&null!=ne.type||null==ne.maxFeePerGas||null==ne.maxPriorityFeePerGas)if(0===ne.type||1===ne.type){const G=await K.getFeeData();assert(null!=G.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==ne.gasPrice&&(ne.gasPrice=G.gasPrice)}else{const G=await K.getFeeData();if(null==ne.type)if(null!=G.maxFeePerGas&&null!=G.maxPriorityFeePerGas)if(ne.type=2,null!=ne.gasPrice){const G=ne.gasPrice;delete ne.gasPrice,ne.maxFeePerGas=G,ne.maxPriorityFeePerGas=G}else null==ne.maxFeePerGas&&(ne.maxFeePerGas=G.maxFeePerGas),null==ne.maxPriorityFeePerGas&&(ne.maxPriorityFeePerGas=G.maxPriorityFeePerGas);else null!=G.gasPrice?(assert(!pe,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==ne.gasPrice&&(ne.gasPrice=G.gasPrice),ne.type=0):assert(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2===ne.type&&(null==ne.maxFeePerGas&&(ne.maxFeePerGas=G.maxFeePerGas),null==ne.maxPriorityFeePerGas&&(ne.maxPriorityFeePerGas=G.maxPriorityFeePerGas))}else ne.type=2;return await resolveProperties$1(ne)}async estimateGas(G){return checkProvider(this,"estimateGas").estimateGas(await this.populateCall(G))}async call(G){return checkProvider(this,"call").call(await this.populateCall(G))}async resolveName(G){const K=checkProvider(this,"resolveName");return await K.resolveName(G)}async sendTransaction(G){const K=checkProvider(this,"sendTransaction"),ne=await this.populateTransaction(G);delete ne.from;const ue=Transaction.from(ne);return await K.broadcastTransaction(await this.signTransaction(ue))}}var gO=new WeakMap,vO=new WeakMap,wO=new WeakMap,_O=new WeakMap,TO=new WeakMap,AO=new WeakMap,EO=new WeakSet;class FilterIdSubscriber{constructor(G){_classPrivateMethodInitSpec(this,EO),_classPrivateFieldInitSpec(this,gO,void 0),_classPrivateFieldInitSpec(this,vO,void 0),_classPrivateFieldInitSpec(this,wO,void 0),_classPrivateFieldInitSpec(this,_O,void 0),_classPrivateFieldInitSpec(this,TO,void 0),_classPrivateFieldInitSpec(this,AO,void 0),_classPrivateFieldSet2(gO,this,G),_classPrivateFieldSet2(vO,this,null),_classPrivateFieldSet2(wO,this,_assertClassBrand(EO,this,_poll).bind(this)),_classPrivateFieldSet2(_O,this,!1),_classPrivateFieldSet2(TO,this,null),_classPrivateFieldSet2(AO,this,!1)}_subscribe(G){throw new Error("subclasses must override this")}_emitResults(G,K){throw new Error("subclasses must override this")}_recover(G){throw new Error("subclasses must override this")}start(){_classPrivateFieldGet2(_O,this)||(_classPrivateFieldSet2(_O,this,!0),_assertClassBrand(EO,this,_poll).call(this,-2))}stop(){_classPrivateFieldGet2(_O,this)&&(_classPrivateFieldSet2(_O,this,!1),_classPrivateFieldSet2(AO,this,!0),_assertClassBrand(EO,this,_teardown).call(this),_classPrivateFieldGet2(gO,this).off("block",_classPrivateFieldGet2(wO,this)))}pause(G){G&&_assertClassBrand(EO,this,_teardown).call(this),_classPrivateFieldGet2(gO,this).off("block",_classPrivateFieldGet2(wO,this))}resume(){this.start()}}async function _poll(G){try{null==_classPrivateFieldGet2(vO,this)&&_classPrivateFieldSet2(vO,this,this._subscribe(_classPrivateFieldGet2(gO,this)));let G=null;try{G=await _classPrivateFieldGet2(vO,this)}catch(G){if(!isError(G,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==G.operation)throw G}if(null==G)return _classPrivateFieldSet2(vO,this,null),void _classPrivateFieldGet2(gO,this)._recoverSubscriber(this,this._recover(_classPrivateFieldGet2(gO,this)));const K=await _classPrivateFieldGet2(gO,this).getNetwork();if(_classPrivateFieldGet2(TO,this)||_classPrivateFieldSet2(TO,this,K),_classPrivateFieldGet2(TO,this).chainId!==K.chainId)throw new Error("chaid changed");if(_classPrivateFieldGet2(AO,this))return;const ne=await _classPrivateFieldGet2(gO,this).send("eth_getFilterChanges",[G]);await this._emitResults(_classPrivateFieldGet2(gO,this),ne)}catch(G){console.log("@TODO",G)}_classPrivateFieldGet2(gO,this).once("block",_classPrivateFieldGet2(wO,this))}function _teardown(){const G=_classPrivateFieldGet2(vO,this);G&&(_classPrivateFieldSet2(vO,this,null),G.then((G=>{_classPrivateFieldGet2(gO,this).send("eth_uninstallFilter",[G])})))}var PO=new WeakMap;class FilterIdEventSubscriber extends FilterIdSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,PO,void 0),_classPrivateFieldSet2(PO,this,function copy(G){return JSON.parse(JSON.stringify(G))}(K))}_recover(G){return new PollingEventSubscriber(G,_classPrivateFieldGet2(PO,this))}async _subscribe(G){return await G.send("eth_newFilter",[_classPrivateFieldGet2(PO,this)])}async _emitResults(G,K){for(const ne of K)G.emit(_classPrivateFieldGet2(PO,this),G._wrapLog(ne,G._network))}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(G){return await G.send("eth_newPendingTransactionFilter",[])}async _emitResults(G,K){for(const ne of K)G.emit("pending",ne)}}const SO="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy$1(G){if(null==G||SO.indexOf(typeof G)>=0)return G;if("function"==typeof G.getAddress)return G;if(Array.isArray(G))return G.map(deepCopy$1);if("object"==typeof G)return Object.keys(G).reduce(((K,ne)=>(K[ne]=G[ne],K)),{});throw new Error(`should not happen: ${G} (${typeof G})`)}function stall(G){return new Promise((K=>{setTimeout(K,G)}))}function getLowerCase(G){return G?G.toLowerCase():G}function isPollable(G){return G&&"number"==typeof G.pollingInterval}const IO={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class JsonRpcSigner extends AbstractSigner{constructor(G,K){super(G),_defineProperty(this,"address",void 0),defineProperties(this,{address:K=getAddress$1(K)})}connect(G){assert(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(G){return await this.populateCall(G)}async sendUncheckedTransaction(G){const K=deepCopy$1(G),ne=[];if(K.from){const ue=K.from;ne.push((async()=>{const ne=await resolveAddress(ue,this.provider);assertArgument(null!=ne&&ne.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",G),K.from=ne})())}else K.from=this.address;if(null==K.gasLimit&&ne.push((async()=>{K.gasLimit=await this.provider.estimateGas({...K,from:this.address})})()),null!=K.to){const G=K.to;ne.push((async()=>{K.to=await resolveAddress(G,this.provider)})())}ne.length&&await Promise.all(ne);const ue=this.provider.getRpcTransaction(K);return this.provider.send("eth_sendTransaction",[ue])}async sendTransaction(G){const K=await this.provider.getBlockNumber(),ne=await this.sendUncheckedTransaction(G);return await new Promise(((G,ue)=>{const pe=[1e3,100];let he=0;const checkTx=async()=>{try{const ue=await this.provider.getTransaction(ne);if(null!=ue)return void G(ue.replaceableTransaction(K))}catch(G){if(isError(G,"CANCELLED")||isError(G,"BAD_DATA")||isError(G,"NETWORK_ERROR"))return null==G.info&&(G.info={}),G.info.sendTransactionHash=ne,void ue(G);if(isError(G,"INVALID_ARGUMENT")&&(he++,null==G.info&&(G.info={}),G.info.sendTransactionHash=ne,he>10))return void ue(G);this.provider.emit("error",makeError("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:G}))}this.provider._setTimeout((()=>{checkTx()}),pe.pop()||4e3)};checkTx()}))}async signTransaction(G){const K=deepCopy$1(G);if(K.from){const ne=await resolveAddress(K.from,this.provider);assertArgument(null!=ne&&ne.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",G),K.from=ne}else K.from=this.address;const ne=this.provider.getRpcTransaction(K);return await this.provider.send("eth_signTransaction",[ne])}async signMessage(G){const K="string"==typeof G?toUtf8Bytes$1(G):G;return await this.provider.send("personal_sign",[hexlify$1(K),this.address.toLowerCase()])}async signTypedData(G,K,ne){const ue=deepCopy$1(ne),pe=await TypedDataEncoder.resolveNames(G,K,ue,(async G=>{const K=await resolveAddress(G);return assertArgument(null!=K,"TypedData does not support null address","value",G),K}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(pe.domain,K,pe.value))])}async unlock(G){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),G,null])}async _legacySignMessage(G){const K="string"==typeof G?toUtf8Bytes$1(G):G;return await this.provider.send("eth_sign",[this.address.toLowerCase(),hexlify$1(K)])}}var CO=new WeakMap,RO=new WeakMap,kO=new WeakMap,OO=new WeakMap,xO=new WeakMap,NO=new WeakMap,MO=new WeakMap,BO=new WeakSet;class JsonRpcApiProvider extends AbstractProvider{constructor(G,K){super(G,K),_classPrivateMethodInitSpec(this,BO),_classPrivateFieldInitSpec(this,CO,void 0),_classPrivateFieldInitSpec(this,RO,void 0),_classPrivateFieldInitSpec(this,kO,void 0),_classPrivateFieldInitSpec(this,OO,void 0),_classPrivateFieldInitSpec(this,xO,void 0),_classPrivateFieldInitSpec(this,NO,void 0),_classPrivateFieldInitSpec(this,MO,void 0),_classPrivateFieldSet2(RO,this,1),_classPrivateFieldSet2(CO,this,Object.assign({},IO,K||{})),_classPrivateFieldSet2(kO,this,[]),_classPrivateFieldSet2(OO,this,null),_classPrivateFieldSet2(NO,this,null),_classPrivateFieldSet2(MO,this,null);{let G=null;const K=new Promise((K=>{G=K}));_classPrivateFieldSet2(xO,this,{promise:K,resolve:G})}const ne=this._getOption("staticNetwork");"boolean"==typeof ne?(assertArgument(!ne||"any"!==G,"staticNetwork cannot be used on special network 'any'","options",K),ne&&null!=G&&_classPrivateFieldSet2(NO,this,Network.from(G))):ne&&(assertArgument(null==G||ne.matches(G),"staticNetwork MUST match network object","options",K),_classPrivateFieldSet2(NO,this,ne))}_getOption(G){return _classPrivateFieldGet2(CO,this)[G]}get _network(){return assert(_classPrivateFieldGet2(NO,this),"network is not available yet","NETWORK_ERROR"),_classPrivateFieldGet2(NO,this)}async _perform(G){if("call"===G.method||"estimateGas"===G.method){let K=G.transaction;if(K&&null!=K.type&&getBigInt(K.type)&&null==K.maxFeePerGas&&null==K.maxPriorityFeePerGas){const ne=await this.getFeeData();null==ne.maxFeePerGas&&null==ne.maxPriorityFeePerGas&&(G=Object.assign({},G,{transaction:Object.assign({},K,{type:void 0})}))}}const K=this.getRpcRequest(G);return null!=K?await this.send(K.method,K.args):super._perform(G)}async _detectNetwork(){const G=this._getOption("staticNetwork");if(G){if(!0!==G)return G;if(_classPrivateFieldGet2(NO,this))return _classPrivateFieldGet2(NO,this)}return _classPrivateFieldGet2(MO,this)?await _classPrivateFieldGet2(MO,this):this.ready?(_classPrivateFieldSet2(MO,this,(async()=>{try{const G=Network.from(getBigInt(await this.send("eth_chainId",[])));return _classPrivateFieldSet2(MO,this,null),G}catch(G){throw _classPrivateFieldSet2(MO,this,null),G}})()),await _classPrivateFieldGet2(MO,this)):(_classPrivateFieldSet2(MO,this,(async(G,K)=>{const ne={id:(_classPrivateFieldSet2(RO,this,(G=_classPrivateFieldGet2(RO,this),K=G++,G)),K),method:"eth_chainId",params:[],jsonrpc:"2.0"};let ue;this.emit("debug",{action:"sendRpcPayload",payload:ne});try{ue=(await this._send(ne))[0],_classPrivateFieldSet2(MO,this,null)}catch(G){throw _classPrivateFieldSet2(MO,this,null),this.emit("debug",{action:"receiveRpcError",error:G}),G}if(this.emit("debug",{action:"receiveRpcResult",result:ue}),"result"in ue)return Network.from(getBigInt(ue.result));throw this.getRpcError(ne,ue)})()),await _classPrivateFieldGet2(MO,this))}_start(){null!=_classPrivateFieldGet2(xO,this)&&null!=_classPrivateFieldGet2(xO,this).resolve&&(_classPrivateFieldGet2(xO,this).resolve(),_classPrivateFieldSet2(xO,this,null),(async()=>{for(;null==_classPrivateFieldGet2(NO,this)&&!this.destroyed;)try{_classPrivateFieldSet2(NO,this,await this._detectNetwork())}catch(G){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",makeError("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:G}})),await stall(1e3)}_assertClassBrand(BO,this,_scheduleDrain).call(this)})())}async _waitUntilReady(){if(null!=_classPrivateFieldGet2(xO,this))return await _classPrivateFieldGet2(xO,this).promise}_getSubscriber(G){return"pending"===G.type?new FilterIdPendingSubscriber(this):"event"===G.type?this._getOption("polling")?new PollingEventSubscriber(this,G.filter):new FilterIdEventSubscriber(this,G.filter):"orphan"===G.type&&"drop-log"===G.filter.orphan?new UnmanagedSubscriber("orphan"):super._getSubscriber(G)}get ready(){return null==_classPrivateFieldGet2(xO,this)}getRpcTransaction(G){const K={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((ne=>{if(null==G[ne])return;let ue=ne;"gasLimit"===ne&&(ue="gas"),K[ue]=toQuantity(getBigInt(G[ne],`tx.${ne}`))})),["from","to","data"].forEach((ne=>{null!=G[ne]&&(K[ne]=hexlify$1(G[ne]))})),G.accessList&&(K.accessList=accessListify$1(G.accessList)),K}getRpcRequest(G){switch(G.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[getLowerCase(G.address),G.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[getLowerCase(G.address),G.blockTag]};case"getCode":return{method:"eth_getCode",args:[getLowerCase(G.address),G.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[getLowerCase(G.address),"0x"+G.position.toString(16),G.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[G.signedTransaction]};case"getBlock":if("blockTag"in G)return{method:"eth_getBlockByNumber",args:[G.blockTag,!!G.includeTransactions]};if("blockHash"in G)return{method:"eth_getBlockByHash",args:[G.blockHash,!!G.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[G.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[G.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(G.transaction),G.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(G.transaction)]};case"getLogs":return G.filter&&null!=G.filter.address&&(Array.isArray(G.filter.address)?G.filter.address=G.filter.address.map(getLowerCase):G.filter.address=getLowerCase(G.filter.address)),{method:"eth_getLogs",args:[G.filter]}}return null}getRpcError(G,K){const{method:ne}=G,{error:ue}=K;if("eth_estimateGas"===ne&&ue.message){const K=ue.message;if(!K.match(/revert/i)&&K.match(/insufficient funds/i))return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:G.params[0],info:{payload:G,error:ue}})}if("eth_call"===ne||"eth_estimateGas"===ne){const K=spelunkData(ue),pe=KR.getBuiltinCallException("eth_call"===ne?"call":"estimateGas",G.params[0],K?K.data:null);return pe.info={error:ue,payload:G},pe}const pe=JSON.stringify(function spelunkMessage(G){const K=[];return _spelunkMessage(G,K),K}(ue));if("string"==typeof ue.message&&ue.message.match(/user denied|ethers-user-denied/i)){return makeError("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[ne]||"unknown",reason:"rejected",info:{payload:G,error:ue}})}if("eth_sendRawTransaction"===ne||"eth_sendTransaction"===ne){const K=G.params[0];if(pe.match(/insufficient funds|base fee exceeds gas limit/i))return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:K,info:{error:ue}});if(pe.match(/nonce/i)&&pe.match(/too low/i))return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:K,info:{error:ue}});if(pe.match(/replacement transaction/i)&&pe.match(/underpriced/i))return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:K,info:{error:ue}});if(pe.match(/only replay-protected/i))return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:ne,info:{transaction:K,info:{error:ue}}})}let he=!!pe.match(/the method .* does not exist/i);return he||ue&&ue.details&&ue.details.startsWith("Unauthorized method:")&&(he=!0),he?makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:G.method,info:{error:ue,payload:G}}):makeError("could not coalesce error","UNKNOWN_ERROR",{error:ue,payload:G})}send(G,K){var ne,ue;if(this.destroyed)return Promise.reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:G}));const pe=(_classPrivateFieldSet2(RO,this,(ne=_classPrivateFieldGet2(RO,this),ue=ne++,ne)),ue),he=new Promise(((ne,ue)=>{_classPrivateFieldGet2(kO,this).push({resolve:ne,reject:ue,payload:{method:G,params:K,id:pe,jsonrpc:"2.0"}})}));return _assertClassBrand(BO,this,_scheduleDrain).call(this),he}async getSigner(G){null==G&&(G=0);const K=this.send("eth_accounts",[]);if("number"==typeof G){const ne=await K;if(G>=ne.length)throw new Error("no such account");return new JsonRpcSigner(this,ne[G])}const{accounts:ne}=await resolveProperties$1({network:this.getNetwork(),accounts:K});G=getAddress$1(G);for(const K of ne)if(getAddress$1(K)===G)return new JsonRpcSigner(this,G);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((G=>new JsonRpcSigner(this,G)))}destroy(){_classPrivateFieldGet2(OO,this)&&(clearTimeout(_classPrivateFieldGet2(OO,this)),_classPrivateFieldSet2(OO,this,null));for(const{payload:G,reject:K}of _classPrivateFieldGet2(kO,this))K(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:G.method}));_classPrivateFieldSet2(kO,this,[]),super.destroy()}}function _scheduleDrain(){if(_classPrivateFieldGet2(OO,this))return;const G=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");_classPrivateFieldSet2(OO,this,setTimeout((()=>{_classPrivateFieldSet2(OO,this,null);const G=_classPrivateFieldGet2(kO,this);for(_classPrivateFieldSet2(kO,this,[]);G.length;){const K=[G.shift()];for(;G.length&&K.length!==_classPrivateFieldGet2(CO,this).batchMaxCount;){K.push(G.shift());const ne=JSON.stringify(K.map((G=>G.payload)));if(ne.length>_classPrivateFieldGet2(CO,this).batchMaxSize){G.unshift(K.pop());break}}(async()=>{const G=1===K.length?K[0].payload:K.map((G=>G.payload));this.emit("debug",{action:"sendRpcPayload",payload:G});try{const ne=await this._send(G);this.emit("debug",{action:"receiveRpcResult",result:ne});for(const{resolve:G,reject:ue,payload:pe}of K){if(this.destroyed){ue(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:pe.method}));continue}const K=ne.filter((G=>G.id===pe.id))[0];if(null!=K)"error"in K?ue(this.getRpcError(pe,K)):G(K.result);else{const G=makeError("missing response for request","BAD_DATA",{value:ne,info:{payload:pe}});this.emit("error",G),ue(G)}}}catch(G){this.emit("debug",{action:"receiveRpcError",error:G});for(const{reject:ne}of K)ne(G)}})()}}),G))}var FO=new WeakMap;class JsonRpcApiPollingProvider extends JsonRpcApiProvider{constructor(G,K){super(G,K),_classPrivateFieldInitSpec(this,FO,void 0),_classPrivateFieldSet2(FO,this,4e3)}_getSubscriber(G){const K=super._getSubscriber(G);return isPollable(K)&&(K.pollingInterval=_classPrivateFieldGet2(FO,this)),K}get pollingInterval(){return _classPrivateFieldGet2(FO,this)}set pollingInterval(G){if(!Number.isInteger(G)||G<0)throw new Error("invalid interval");_classPrivateFieldSet2(FO,this,G),this._forEachSubscriber((G=>{isPollable(G)&&(G.pollingInterval=_classPrivateFieldGet2(FO,this))}))}}var DO=new WeakMap;class JsonRpcProvider extends JsonRpcApiPollingProvider{constructor(G,K,ne){null==G&&(G="http://localhost:8545"),super(K,ne),_classPrivateFieldInitSpec(this,DO,void 0),_classPrivateFieldSet2(DO,this,"string"==typeof G?new FetchRequest(G):G.clone())}_getConnection(){return _classPrivateFieldGet2(DO,this).clone()}async send(G,K){return await this._start(),await super.send(G,K)}async _send(G){const K=this._getConnection();K.body=JSON.stringify(G),K.setHeader("content-type","application/json");const ne=await K.send();ne.assertOk();let ue=ne.bodyJson;return Array.isArray(ue)||(ue=[ue]),ue}}function spelunkData(G){if(null==G)return null;if("string"==typeof G.message&&G.message.match(/revert/i)&&isHexString$1(G.data))return{message:G.message,data:G.data};if("object"==typeof G){for(const K in G){const ne=spelunkData(G[K]);if(ne)return ne}return null}if("string"==typeof G)try{return spelunkData(JSON.parse(G))}catch(G){}return null}function _spelunkMessage(G,K){if(null!=G){if("string"==typeof G.message&&K.push(G.message),"object"==typeof G)for(const ne in G)_spelunkMessage(G[ne],K);if("string"==typeof G)try{return _spelunkMessage(JSON.parse(G),K)}catch(G){}}}var LO={},UO={},$O={exports:{}};!function(G,K){G.exports=function(){function makePrefix(G,K){var ne=K?"└":"├";return ne+=G?"─ ":"──┐"}function filterKeys(G,K){var ne=[];for(var ue in G)G.hasOwnProperty(ue)&&(K&&"function"==typeof G[ue]||ne.push(ue));return ne}function growBranch(G,K,ne,ue,pe,he,ye){var me,be,ve="",_e=0,Te=ue.slice(0);if(Te.push([K,ne])&&ue.length>0&&(ue.forEach((function(G,ne){ne>0&&(ve+=(G[1]?" ":"│")+"  "),be||G[0]!==K||(be=!0)})),ve+=makePrefix(G,ne)+G,pe&&("object"!=typeof K||K instanceof Date)&&(ve+=": "+K),be&&(ve+=" (circular ref.)"),ye(ve)),!be&&"object"==typeof K){var Ee=filterKeys(K,he);Ee.forEach((function(G){me=++_e===Ee.length,growBranch(G,K[G],me,Te,pe,he,ye)}))}}var G={asLines:function(G,K,ne,ue){growBranch(".",G,!1,[],K,"function"!=typeof ne&&ne,ue||ne)},asTree:function(G,K,ne){var ue="";return growBranch(".",G,!1,[],K,ne,(function(G){ue+=G+"\n"})),ue}};return G}()}($O);var qO,GO=$O.exports,jO={},HO={exports:{}},WO={exports:{}};function requireX64Core(){return qO||(qO=1,function(G,K){G.exports=function(G){return function(K){var ne=G,ue=ne.lib,pe=ue.Base,he=ue.WordArray,ye=ne.x64={};ye.Word=pe.extend({init:function(G,K){this.high=G,this.low=K}}),ye.WordArray=pe.extend({init:function(G,ne){G=this.words=G||[],this.sigBytes=ne!=K?ne:8*G.length},toX32:function(){for(var G=this.words,K=G.length,ne=[],ue=0;ue<K;ue++){var pe=G[ue];ne.push(pe.high),ne.push(pe.low)}return he.create(ne,this.sigBytes)},clone:function(){for(var G=pe.clone.call(this),K=G.words=this.words.slice(0),ne=K.length,ue=0;ue<ne;ue++)K[ue]=K[ue].clone();return G}})}(),G}(Lv)}(WO)),WO.exports}var zO,VO={exports:{}};function requireLibTypedarrays(){return zO||(zO=1,function(G,K){G.exports=function(G){return function(){if("function"==typeof ArrayBuffer){var K=G.lib.WordArray,ne=K.init,ue=K.init=function(G){if(G instanceof ArrayBuffer&&(G=new Uint8Array(G)),(G instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&G instanceof Uint8ClampedArray||G instanceof Int16Array||G instanceof Uint16Array||G instanceof Int32Array||G instanceof Uint32Array||G instanceof Float32Array||G instanceof Float64Array)&&(G=new Uint8Array(G.buffer,G.byteOffset,G.byteLength)),G instanceof Uint8Array){for(var K=G.byteLength,ue=[],pe=0;pe<K;pe++)ue[pe>>>2]|=G[pe]<<24-pe%4*8;ne.call(this,ue,K)}else ne.apply(this,arguments)};ue.prototype=K}}(),G.lib.WordArray}(Lv)}(VO)),VO.exports}var KO,JO={exports:{}};function requireEncUtf16(){return KO||(KO=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.WordArray,ue=K.enc;function swapEndian(G){return G<<8&4278255360|G>>>8&16711935}ue.Utf16=ue.Utf16BE={stringify:function(G){for(var K=G.words,ne=G.sigBytes,ue=[],pe=0;pe<ne;pe+=2){var he=K[pe>>>2]>>>16-pe%4*8&65535;ue.push(String.fromCharCode(he))}return ue.join("")},parse:function(G){for(var K=G.length,ue=[],pe=0;pe<K;pe++)ue[pe>>>1]|=G.charCodeAt(pe)<<16-pe%2*16;return ne.create(ue,2*K)}},ue.Utf16LE={stringify:function(G){for(var K=G.words,ne=G.sigBytes,ue=[],pe=0;pe<ne;pe+=2){var he=swapEndian(K[pe>>>2]>>>16-pe%4*8&65535);ue.push(String.fromCharCode(he))}return ue.join("")},parse:function(G){for(var K=G.length,ue=[],pe=0;pe<K;pe++)ue[pe>>>1]|=swapEndian(G.charCodeAt(pe)<<16-pe%2*16);return ne.create(ue,2*K)}}}(),G.enc.Utf16}(Lv)}(JO)),JO.exports}var XO,QO={exports:{}};function requireEncBase64url(){return XO||(XO=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.WordArray;function parseLoop(G,K,ue){for(var pe=[],he=0,ye=0;ye<K;ye++)if(ye%4){var me=ue[G.charCodeAt(ye-1)]<<ye%4*2|ue[G.charCodeAt(ye)]>>>6-ye%4*2;pe[he>>>2]|=me<<24-he%4*8,he++}return ne.create(pe,he)}K.enc.Base64url={stringify:function(G,K){void 0===K&&(K=!0);var ne=G.words,ue=G.sigBytes,pe=K?this._safe_map:this._map;G.clamp();for(var he=[],ye=0;ye<ue;ye+=3)for(var me=(ne[ye>>>2]>>>24-ye%4*8&255)<<16|(ne[ye+1>>>2]>>>24-(ye+1)%4*8&255)<<8|ne[ye+2>>>2]>>>24-(ye+2)%4*8&255,be=0;be<4&&ye+.75*be<ue;be++)he.push(pe.charAt(me>>>6*(3-be)&63));var ve=pe.charAt(64);if(ve)for(;he.length%4;)he.push(ve);return he.join("")},parse:function(G,K){void 0===K&&(K=!0);var ne=G.length,ue=K?this._safe_map:this._map,pe=this._reverseMap;if(!pe){pe=this._reverseMap=[];for(var he=0;he<ue.length;he++)pe[ue.charCodeAt(he)]=he}var ye=ue.charAt(64);if(ye){var me=G.indexOf(ye);-1!==me&&(ne=me)}return parseLoop(G,ne,pe)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),G.enc.Base64url}(Lv)}(QO)),QO.exports}var ZO,YO={exports:{}};function requireMd5(){return ZO||(ZO=1,function(G,K){G.exports=function(G){return function(K){var ne=G,ue=ne.lib,pe=ue.WordArray,he=ue.Hasher,ye=ne.algo,me=[];!function(){for(var G=0;G<64;G++)me[G]=4294967296*K.abs(K.sin(G+1))|0}();var be=ye.MD5=he.extend({_doReset:function(){this._hash=new pe.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(G,K){for(var ne=0;ne<16;ne++){var ue=K+ne,pe=G[ue];G[ue]=16711935&(pe<<8|pe>>>24)|4278255360&(pe<<24|pe>>>8)}var he=this._hash.words,ye=G[K+0],be=G[K+1],ve=G[K+2],_e=G[K+3],Te=G[K+4],Ee=G[K+5],Pe=G[K+6],Se=G[K+7],Ce=G[K+8],ke=G[K+9],Oe=G[K+10],xe=G[K+11],Ne=G[K+12],Me=G[K+13],Be=G[K+14],Fe=G[K+15],De=he[0],Le=he[1],Ue=he[2],je=he[3];De=FF(De,Le,Ue,je,ye,7,me[0]),je=FF(je,De,Le,Ue,be,12,me[1]),Ue=FF(Ue,je,De,Le,ve,17,me[2]),Le=FF(Le,Ue,je,De,_e,22,me[3]),De=FF(De,Le,Ue,je,Te,7,me[4]),je=FF(je,De,Le,Ue,Ee,12,me[5]),Ue=FF(Ue,je,De,Le,Pe,17,me[6]),Le=FF(Le,Ue,je,De,Se,22,me[7]),De=FF(De,Le,Ue,je,Ce,7,me[8]),je=FF(je,De,Le,Ue,ke,12,me[9]),Ue=FF(Ue,je,De,Le,Oe,17,me[10]),Le=FF(Le,Ue,je,De,xe,22,me[11]),De=FF(De,Le,Ue,je,Ne,7,me[12]),je=FF(je,De,Le,Ue,Me,12,me[13]),Ue=FF(Ue,je,De,Le,Be,17,me[14]),De=GG(De,Le=FF(Le,Ue,je,De,Fe,22,me[15]),Ue,je,be,5,me[16]),je=GG(je,De,Le,Ue,Pe,9,me[17]),Ue=GG(Ue,je,De,Le,xe,14,me[18]),Le=GG(Le,Ue,je,De,ye,20,me[19]),De=GG(De,Le,Ue,je,Ee,5,me[20]),je=GG(je,De,Le,Ue,Oe,9,me[21]),Ue=GG(Ue,je,De,Le,Fe,14,me[22]),Le=GG(Le,Ue,je,De,Te,20,me[23]),De=GG(De,Le,Ue,je,ke,5,me[24]),je=GG(je,De,Le,Ue,Be,9,me[25]),Ue=GG(Ue,je,De,Le,_e,14,me[26]),Le=GG(Le,Ue,je,De,Ce,20,me[27]),De=GG(De,Le,Ue,je,Me,5,me[28]),je=GG(je,De,Le,Ue,ve,9,me[29]),Ue=GG(Ue,je,De,Le,Se,14,me[30]),De=HH(De,Le=GG(Le,Ue,je,De,Ne,20,me[31]),Ue,je,Ee,4,me[32]),je=HH(je,De,Le,Ue,Ce,11,me[33]),Ue=HH(Ue,je,De,Le,xe,16,me[34]),Le=HH(Le,Ue,je,De,Be,23,me[35]),De=HH(De,Le,Ue,je,be,4,me[36]),je=HH(je,De,Le,Ue,Te,11,me[37]),Ue=HH(Ue,je,De,Le,Se,16,me[38]),Le=HH(Le,Ue,je,De,Oe,23,me[39]),De=HH(De,Le,Ue,je,Me,4,me[40]),je=HH(je,De,Le,Ue,ye,11,me[41]),Ue=HH(Ue,je,De,Le,_e,16,me[42]),Le=HH(Le,Ue,je,De,Pe,23,me[43]),De=HH(De,Le,Ue,je,ke,4,me[44]),je=HH(je,De,Le,Ue,Ne,11,me[45]),Ue=HH(Ue,je,De,Le,Fe,16,me[46]),De=II(De,Le=HH(Le,Ue,je,De,ve,23,me[47]),Ue,je,ye,6,me[48]),je=II(je,De,Le,Ue,Se,10,me[49]),Ue=II(Ue,je,De,Le,Be,15,me[50]),Le=II(Le,Ue,je,De,Ee,21,me[51]),De=II(De,Le,Ue,je,Ne,6,me[52]),je=II(je,De,Le,Ue,_e,10,me[53]),Ue=II(Ue,je,De,Le,Oe,15,me[54]),Le=II(Le,Ue,je,De,be,21,me[55]),De=II(De,Le,Ue,je,Ce,6,me[56]),je=II(je,De,Le,Ue,Fe,10,me[57]),Ue=II(Ue,je,De,Le,Pe,15,me[58]),Le=II(Le,Ue,je,De,Me,21,me[59]),De=II(De,Le,Ue,je,Te,6,me[60]),je=II(je,De,Le,Ue,xe,10,me[61]),Ue=II(Ue,je,De,Le,ve,15,me[62]),Le=II(Le,Ue,je,De,ke,21,me[63]),he[0]=he[0]+De|0,he[1]=he[1]+Le|0,he[2]=he[2]+Ue|0,he[3]=he[3]+je|0},_doFinalize:function(){var G=this._data,ne=G.words,ue=8*this._nDataBytes,pe=8*G.sigBytes;ne[pe>>>5]|=128<<24-pe%32;var he=K.floor(ue/4294967296),ye=ue;ne[15+(pe+64>>>9<<4)]=16711935&(he<<8|he>>>24)|4278255360&(he<<24|he>>>8),ne[14+(pe+64>>>9<<4)]=16711935&(ye<<8|ye>>>24)|4278255360&(ye<<24|ye>>>8),G.sigBytes=4*(ne.length+1),this._process();for(var me=this._hash,be=me.words,ve=0;ve<4;ve++){var _e=be[ve];be[ve]=16711935&(_e<<8|_e>>>24)|4278255360&(_e<<24|_e>>>8)}return me},clone:function(){var G=he.clone.call(this);return G._hash=this._hash.clone(),G}});function FF(G,K,ne,ue,pe,he,ye){var me=G+(K&ne|~K&ue)+pe+ye;return(me<<he|me>>>32-he)+K}function GG(G,K,ne,ue,pe,he,ye){var me=G+(K&ue|ne&~ue)+pe+ye;return(me<<he|me>>>32-he)+K}function HH(G,K,ne,ue,pe,he,ye){var me=G+(K^ne^ue)+pe+ye;return(me<<he|me>>>32-he)+K}function II(G,K,ne,ue,pe,he,ye){var me=G+(ne^(K|~ue))+pe+ye;return(me<<he|me>>>32-he)+K}ne.MD5=he._createHelper(be),ne.HmacMD5=he._createHmacHelper(be)}(Math),G.MD5}(Lv)}(YO)),YO.exports}var ex,tx={exports:{}};function requireSha1(){return ex||(ex=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib,ue=ne.WordArray,pe=ne.Hasher,he=K.algo,ye=[],me=he.SHA1=pe.extend({_doReset:function(){this._hash=new ue.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(G,K){for(var ne=this._hash.words,ue=ne[0],pe=ne[1],he=ne[2],me=ne[3],be=ne[4],ve=0;ve<80;ve++){if(ve<16)ye[ve]=0|G[K+ve];else{var _e=ye[ve-3]^ye[ve-8]^ye[ve-14]^ye[ve-16];ye[ve]=_e<<1|_e>>>31}var Te=(ue<<5|ue>>>27)+be+ye[ve];Te+=ve<20?1518500249+(pe&he|~pe&me):ve<40?1859775393+(pe^he^me):ve<60?(pe&he|pe&me|he&me)-1894007588:(pe^he^me)-899497514,be=me,me=he,he=pe<<30|pe>>>2,pe=ue,ue=Te}ne[0]=ne[0]+ue|0,ne[1]=ne[1]+pe|0,ne[2]=ne[2]+he|0,ne[3]=ne[3]+me|0,ne[4]=ne[4]+be|0},_doFinalize:function(){var G=this._data,K=G.words,ne=8*this._nDataBytes,ue=8*G.sigBytes;return K[ue>>>5]|=128<<24-ue%32,K[14+(ue+64>>>9<<4)]=Math.floor(ne/4294967296),K[15+(ue+64>>>9<<4)]=ne,G.sigBytes=4*K.length,this._process(),this._hash},clone:function(){var G=pe.clone.call(this);return G._hash=this._hash.clone(),G}});K.SHA1=pe._createHelper(me),K.HmacSHA1=pe._createHmacHelper(me)}(),G.SHA1}(Lv)}(tx)),tx.exports}var rx,nx={exports:{}};var ax,ix={exports:{}};function requireSha512$1(){return ax||(ax=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.Hasher,ue=K.x64,pe=ue.Word,he=ue.WordArray,ye=K.algo;function X64Word_create(){return pe.create.apply(pe,arguments)}var me=[X64Word_create(1116352408,3609767458),X64Word_create(1899447441,602891725),X64Word_create(3049323471,3964484399),X64Word_create(3921009573,2173295548),X64Word_create(961987163,4081628472),X64Word_create(1508970993,3053834265),X64Word_create(2453635748,2937671579),X64Word_create(2870763221,3664609560),X64Word_create(3624381080,2734883394),X64Word_create(310598401,1164996542),X64Word_create(607225278,1323610764),X64Word_create(1426881987,3590304994),X64Word_create(1925078388,4068182383),X64Word_create(2162078206,991336113),X64Word_create(2614888103,633803317),X64Word_create(3248222580,3479774868),X64Word_create(3835390401,2666613458),X64Word_create(4022224774,944711139),X64Word_create(264347078,2341262773),X64Word_create(604807628,2007800933),X64Word_create(770255983,1495990901),X64Word_create(1249150122,1856431235),X64Word_create(1555081692,3175218132),X64Word_create(1996064986,2198950837),X64Word_create(2554220882,3999719339),X64Word_create(2821834349,766784016),X64Word_create(2952996808,2566594879),X64Word_create(3210313671,3203337956),X64Word_create(3336571891,1034457026),X64Word_create(3584528711,2466948901),X64Word_create(113926993,3758326383),X64Word_create(338241895,168717936),X64Word_create(666307205,1188179964),X64Word_create(773529912,1546045734),X64Word_create(1294757372,1522805485),X64Word_create(1396182291,2643833823),X64Word_create(1695183700,2343527390),X64Word_create(1986661051,1014477480),X64Word_create(2177026350,1206759142),X64Word_create(2456956037,344077627),X64Word_create(2730485921,1290863460),X64Word_create(2820302411,3158454273),X64Word_create(3259730800,3505952657),X64Word_create(3345764771,106217008),X64Word_create(3516065817,3606008344),X64Word_create(3600352804,1432725776),X64Word_create(4094571909,1467031594),X64Word_create(275423344,851169720),X64Word_create(430227734,3100823752),X64Word_create(506948616,1363258195),X64Word_create(659060556,3750685593),X64Word_create(883997877,3785050280),X64Word_create(958139571,3318307427),X64Word_create(1322822218,3812723403),X64Word_create(1537002063,2003034995),X64Word_create(1747873779,3602036899),X64Word_create(1955562222,1575990012),X64Word_create(2024104815,1125592928),X64Word_create(2227730452,2716904306),X64Word_create(2361852424,442776044),X64Word_create(2428436474,593698344),X64Word_create(2756734187,3733110249),X64Word_create(3204031479,2999351573),X64Word_create(3329325298,3815920427),X64Word_create(3391569614,3928383900),X64Word_create(3515267271,566280711),X64Word_create(3940187606,3454069534),X64Word_create(4118630271,4000239992),X64Word_create(116418474,1914138554),X64Word_create(174292421,2731055270),X64Word_create(289380356,3203993006),X64Word_create(460393269,320620315),X64Word_create(685471733,587496836),X64Word_create(852142971,1086792851),X64Word_create(1017036298,365543100),X64Word_create(1126000580,2618297676),X64Word_create(1288033470,3409855158),X64Word_create(1501505948,4234509866),X64Word_create(1607167915,987167468),X64Word_create(1816402316,1246189591)],be=[];!function(){for(var G=0;G<80;G++)be[G]=X64Word_create()}();var ve=ye.SHA512=ne.extend({_doReset:function(){this._hash=new he.init([new pe.init(1779033703,4089235720),new pe.init(3144134277,2227873595),new pe.init(1013904242,4271175723),new pe.init(2773480762,1595750129),new pe.init(1359893119,2917565137),new pe.init(2600822924,725511199),new pe.init(528734635,4215389547),new pe.init(1541459225,327033209)])},_doProcessBlock:function(G,K){for(var ne=this._hash.words,ue=ne[0],pe=ne[1],he=ne[2],ye=ne[3],ve=ne[4],_e=ne[5],Te=ne[6],Ee=ne[7],Pe=ue.high,Se=ue.low,Ce=pe.high,ke=pe.low,Oe=he.high,xe=he.low,Ne=ye.high,Me=ye.low,Be=ve.high,Fe=ve.low,De=_e.high,Le=_e.low,Ue=Te.high,je=Te.low,ze=Ee.high,Je=Ee.low,Xe=Pe,Qe=Se,Ye=Ce,et=ke,tt=Oe,rt=xe,nt=Ne,at=Me,it=Be,ot=Fe,ct=De,dt=Le,ut=Ue,ft=je,yt=ze,wt=Je,At=0;At<80;At++){var St,kt,Bt=be[At];if(At<16)kt=Bt.high=0|G[K+2*At],St=Bt.low=0|G[K+2*At+1];else{var Lt=be[At-15],Ut=Lt.high,$t=Lt.low,Ht=(Ut>>>1|$t<<31)^(Ut>>>8|$t<<24)^Ut>>>7,Vt=($t>>>1|Ut<<31)^($t>>>8|Ut<<24)^($t>>>7|Ut<<25),er=be[At-2],tr=er.high,rr=er.low,cr=(tr>>>19|rr<<13)^(tr<<3|rr>>>29)^tr>>>6,dr=(rr>>>19|tr<<13)^(rr<<3|tr>>>29)^(rr>>>6|tr<<26),Rr=be[At-7],kr=Rr.high,$r=Rr.low,qr=be[At-16],Hr=qr.high,Vr=qr.low;kt=(kt=(kt=Ht+kr+((St=Vt+$r)>>>0<Vt>>>0?1:0))+cr+((St+=dr)>>>0<dr>>>0?1:0))+Hr+((St+=Vr)>>>0<Vr>>>0?1:0),Bt.high=kt,Bt.low=St}var Zr,en=it&ct^~it&ut,tn=ot&dt^~ot&ft,an=Xe&Ye^Xe&tt^Ye&tt,sn=Qe&et^Qe&rt^et&rt,un=(Xe>>>28|Qe<<4)^(Xe<<30|Qe>>>2)^(Xe<<25|Qe>>>7),fn=(Qe>>>28|Xe<<4)^(Qe<<30|Xe>>>2)^(Qe<<25|Xe>>>7),pn=(it>>>14|ot<<18)^(it>>>18|ot<<14)^(it<<23|ot>>>9),hn=(ot>>>14|it<<18)^(ot>>>18|it<<14)^(ot<<23|it>>>9),yn=me[At],mn=yn.high,bn=yn.low,gn=yt+pn+((Zr=wt+hn)>>>0<wt>>>0?1:0),vn=fn+sn;yt=ut,wt=ft,ut=ct,ft=dt,ct=it,dt=ot,it=nt+(gn=(gn=(gn=gn+en+((Zr+=tn)>>>0<tn>>>0?1:0))+mn+((Zr+=bn)>>>0<bn>>>0?1:0))+kt+((Zr+=St)>>>0<St>>>0?1:0))+((ot=at+Zr|0)>>>0<at>>>0?1:0)|0,nt=tt,at=rt,tt=Ye,rt=et,Ye=Xe,et=Qe,Xe=gn+(un+an+(vn>>>0<fn>>>0?1:0))+((Qe=Zr+vn|0)>>>0<Zr>>>0?1:0)|0}Se=ue.low=Se+Qe,ue.high=Pe+Xe+(Se>>>0<Qe>>>0?1:0),ke=pe.low=ke+et,pe.high=Ce+Ye+(ke>>>0<et>>>0?1:0),xe=he.low=xe+rt,he.high=Oe+tt+(xe>>>0<rt>>>0?1:0),Me=ye.low=Me+at,ye.high=Ne+nt+(Me>>>0<at>>>0?1:0),Fe=ve.low=Fe+ot,ve.high=Be+it+(Fe>>>0<ot>>>0?1:0),Le=_e.low=Le+dt,_e.high=De+ct+(Le>>>0<dt>>>0?1:0),je=Te.low=je+ft,Te.high=Ue+ut+(je>>>0<ft>>>0?1:0),Je=Ee.low=Je+wt,Ee.high=ze+yt+(Je>>>0<wt>>>0?1:0)},_doFinalize:function(){var G=this._data,K=G.words,ne=8*this._nDataBytes,ue=8*G.sigBytes;return K[ue>>>5]|=128<<24-ue%32,K[30+(ue+128>>>10<<5)]=Math.floor(ne/4294967296),K[31+(ue+128>>>10<<5)]=ne,G.sigBytes=4*K.length,this._process(),this._hash.toX32()},clone:function(){var G=ne.clone.call(this);return G._hash=this._hash.clone(),G},blockSize:32});K.SHA512=ne._createHelper(ve),K.HmacSHA512=ne._createHmacHelper(ve)}(),G.SHA512}(Lv,requireX64Core())}(ix)),ix.exports}var sx,ox={exports:{}};var cx,dx={exports:{}};function requireSha3$1(){return cx||(cx=1,function(G,K){G.exports=function(G){return function(K){var ne=G,ue=ne.lib,pe=ue.WordArray,he=ue.Hasher,ye=ne.x64.Word,me=ne.algo,be=[],ve=[],_e=[];!function(){for(var G=1,K=0,ne=0;ne<24;ne++){be[G+5*K]=(ne+1)*(ne+2)/2%64;var ue=(2*G+3*K)%5;G=K%5,K=ue}for(G=0;G<5;G++)for(K=0;K<5;K++)ve[G+5*K]=K+(2*G+3*K)%5*5;for(var pe=1,he=0;he<24;he++){for(var me=0,Te=0,Ee=0;Ee<7;Ee++){if(1&pe){var Pe=(1<<Ee)-1;Pe<32?Te^=1<<Pe:me^=1<<Pe-32}128&pe?pe=pe<<1^113:pe<<=1}_e[he]=ye.create(me,Te)}}();var Te=[];!function(){for(var G=0;G<25;G++)Te[G]=ye.create()}();var Ee=me.SHA3=he.extend({cfg:he.cfg.extend({outputLength:512}),_doReset:function(){for(var G=this._state=[],K=0;K<25;K++)G[K]=new ye.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(G,K){for(var ne=this._state,ue=this.blockSize/2,pe=0;pe<ue;pe++){var he=G[K+2*pe],ye=G[K+2*pe+1];he=16711935&(he<<8|he>>>24)|4278255360&(he<<24|he>>>8),ye=16711935&(ye<<8|ye>>>24)|4278255360&(ye<<24|ye>>>8),(Je=ne[pe]).high^=ye,Je.low^=he}for(var me=0;me<24;me++){for(var Ee=0;Ee<5;Ee++){for(var Pe=0,Se=0,Ce=0;Ce<5;Ce++)Pe^=(Je=ne[Ee+5*Ce]).high,Se^=Je.low;var ke=Te[Ee];ke.high=Pe,ke.low=Se}for(Ee=0;Ee<5;Ee++){var Oe=Te[(Ee+4)%5],xe=Te[(Ee+1)%5],Ne=xe.high,Me=xe.low;for(Pe=Oe.high^(Ne<<1|Me>>>31),Se=Oe.low^(Me<<1|Ne>>>31),Ce=0;Ce<5;Ce++)(Je=ne[Ee+5*Ce]).high^=Pe,Je.low^=Se}for(var Be=1;Be<25;Be++){var Fe=(Je=ne[Be]).high,De=Je.low,Le=be[Be];Le<32?(Pe=Fe<<Le|De>>>32-Le,Se=De<<Le|Fe>>>32-Le):(Pe=De<<Le-32|Fe>>>64-Le,Se=Fe<<Le-32|De>>>64-Le);var Ue=Te[ve[Be]];Ue.high=Pe,Ue.low=Se}var je=Te[0],ze=ne[0];for(je.high=ze.high,je.low=ze.low,Ee=0;Ee<5;Ee++)for(Ce=0;Ce<5;Ce++){var Je=ne[Be=Ee+5*Ce],Xe=Te[Be],Qe=Te[(Ee+1)%5+5*Ce],Ye=Te[(Ee+2)%5+5*Ce];Je.high=Xe.high^~Qe.high&Ye.high,Je.low=Xe.low^~Qe.low&Ye.low}Je=ne[0];var et=_e[me];Je.high^=et.high,Je.low^=et.low}},_doFinalize:function(){var G=this._data,ne=G.words;this._nDataBytes;var ue=8*G.sigBytes,he=32*this.blockSize;ne[ue>>>5]|=1<<24-ue%32,ne[(K.ceil((ue+1)/he)*he>>>5)-1]|=128,G.sigBytes=4*ne.length,this._process();for(var ye=this._state,me=this.cfg.outputLength/8,be=me/8,ve=[],_e=0;_e<be;_e++){var Te=ye[_e],Ee=Te.high,Pe=Te.low;Ee=16711935&(Ee<<8|Ee>>>24)|4278255360&(Ee<<24|Ee>>>8),Pe=16711935&(Pe<<8|Pe>>>24)|4278255360&(Pe<<24|Pe>>>8),ve.push(Pe),ve.push(Ee)}return new pe.init(ve,me)},clone:function(){for(var G=he.clone.call(this),K=G._state=this._state.slice(0),ne=0;ne<25;ne++)K[ne]=K[ne].clone();return G}});ne.SHA3=he._createHelper(Ee),ne.HmacSHA3=he._createHmacHelper(Ee)}(Math),G.SHA3}(Lv,requireX64Core())}(dx)),dx.exports}var ux,fx={exports:{}};var lx,px={exports:{}};function requireHmac$3(){return lx||(lx=1,function(G,K){G.exports=function(G){!function(){var K=G,ne=K.lib.Base,ue=K.enc.Utf8;K.algo.HMAC=ne.extend({init:function(G,K){G=this._hasher=new G.init,"string"==typeof K&&(K=ue.parse(K));var ne=G.blockSize,pe=4*ne;K.sigBytes>pe&&(K=G.finalize(K)),K.clamp();for(var he=this._oKey=K.clone(),ye=this._iKey=K.clone(),me=he.words,be=ye.words,ve=0;ve<ne;ve++)me[ve]^=1549556828,be[ve]^=909522486;he.sigBytes=ye.sigBytes=pe,this.reset()},reset:function(){var G=this._hasher;G.reset(),G.update(this._iKey)},update:function(G){return this._hasher.update(G),this},finalize:function(G){var K=this._hasher,ne=K.finalize(G);return K.reset(),K.finalize(this._oKey.clone().concat(ne))}})}()}(Lv)}(px)),px.exports}var hx,yx={exports:{}};var mx,bx={exports:{}};function requireEvpkdf(){return mx||(mx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib,ue=ne.Base,pe=ne.WordArray,he=K.algo,ye=he.MD5,me=he.EvpKDF=ue.extend({cfg:ue.extend({keySize:4,hasher:ye,iterations:1}),init:function(G){this.cfg=this.cfg.extend(G)},compute:function(G,K){for(var ne,ue=this.cfg,he=ue.hasher.create(),ye=pe.create(),me=ye.words,be=ue.keySize,ve=ue.iterations;me.length<be;){ne&&he.update(ne),ne=he.update(G).finalize(K),he.reset();for(var _e=1;_e<ve;_e++)ne=he.finalize(ne),he.reset();ye.concat(ne)}return ye.sigBytes=4*be,ye}});K.EvpKDF=function(G,K,ne){return me.create(ne).compute(G,K)}}(),G.EvpKDF}(Lv,requireSha1(),requireHmac$3())}(bx)),bx.exports}var gx,vx={exports:{}};function requireCipherCore(){return gx||(gx=1,function(G,K){G.exports=function(G){G.lib.Cipher||function(K){var ne=G,ue=ne.lib,pe=ue.Base,he=ue.WordArray,ye=ue.BufferedBlockAlgorithm,me=ne.enc;me.Utf8;var be=me.Base64,ve=ne.algo.EvpKDF,_e=ue.Cipher=ye.extend({cfg:pe.extend(),createEncryptor:function(G,K){return this.create(this._ENC_XFORM_MODE,G,K)},createDecryptor:function(G,K){return this.create(this._DEC_XFORM_MODE,G,K)},init:function(G,K,ne){this.cfg=this.cfg.extend(ne),this._xformMode=G,this._key=K,this.reset()},reset:function(){ye.reset.call(this),this._doReset()},undefined:function(G){return this._append(G),this._process()},finalize:function(G){return G&&this._append(G),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(G){return"string"==typeof G?Ne:Oe}return function(G){return{encrypt:function(K,ne,ue){return selectCipherStrategy(ne).encrypt(G,K,ne,ue)},decrypt:function(K,ne,ue){return selectCipherStrategy(ne).decrypt(G,K,ne,ue)}}}}()});ue.StreamCipher=_e.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var Te=ne.mode={},Ee=ue.BlockCipherMode=pe.extend({createEncryptor:function(G,K){return this.Encryptor.create(G,K)},createDecryptor:function(G,K){return this.Decryptor.create(G,K)},init:function(G,K){this._cipher=G,this._iv=K}}),Pe=Te.CBC=function(){var G=Ee.extend();function xorBlock(G,ne,ue){var pe,he=this._iv;he?(pe=he,this._iv=K):pe=this._prevBlock;for(var ye=0;ye<ue;ye++)G[ne+ye]^=pe[ye]}return G.Encryptor=G.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize;xorBlock.call(this,G,K,ue),ne.encryptBlock(G,K),this._prevBlock=G.slice(K,K+ue)}}),G.Decryptor=G.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize,pe=G.slice(K,K+ue);ne.decryptBlock(G,K),xorBlock.call(this,G,K,ue),this._prevBlock=pe}}),G}(),Se=(ne.pad={}).Pkcs7={pad:function(G,K){for(var ne=4*K,ue=ne-G.sigBytes%ne,pe=ue<<24|ue<<16|ue<<8|ue,ye=[],me=0;me<ue;me+=4)ye.push(pe);var be=he.create(ye,ue);G.concat(be)},unpad:function(G){var K=255&G.words[G.sigBytes-1>>>2];G.sigBytes-=K}};ue.BlockCipher=_e.extend({cfg:_e.cfg.extend({mode:Pe,padding:Se}),reset:function(){var G;_e.reset.call(this);var K=this.cfg,ne=K.iv,ue=K.mode;this._xformMode==this._ENC_XFORM_MODE?G=ue.createEncryptor:(G=ue.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==G?this._mode.init(this,ne&&ne.words):(this._mode=G.call(ue,this,ne&&ne.words),this._mode.__creator=G)},_doProcessBlock:function(G,K){this._mode.processBlock(G,K)},_doFinalize:function(){var G,K=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(K.pad(this._data,this.blockSize),G=this._process(!0)):(G=this._process(!0),K.unpad(G)),G},blockSize:4});var Ce=ue.CipherParams=pe.extend({init:function(G){this.mixIn(G)},toString:function(G){return(G||this.formatter).stringify(this)}}),ke=(ne.format={}).OpenSSL={stringify:function(G){var K=G.ciphertext,ne=G.salt;return(ne?he.create([1398893684,1701076831]).concat(ne).concat(K):K).toString(be)},parse:function(G){var K,ne=be.parse(G),ue=ne.words;return 1398893684==ue[0]&&1701076831==ue[1]&&(K=he.create(ue.slice(2,4)),ue.splice(0,4),ne.sigBytes-=16),Ce.create({ciphertext:ne,salt:K})}},Oe=ue.SerializableCipher=pe.extend({cfg:pe.extend({format:ke}),encrypt:function(G,K,ne,ue){ue=this.cfg.extend(ue);var pe=G.createEncryptor(ne,ue),he=pe.finalize(K),ye=pe.cfg;return Ce.create({ciphertext:he,key:ne,iv:ye.iv,algorithm:G,mode:ye.mode,padding:ye.padding,blockSize:G.blockSize,formatter:ue.format})},decrypt:function(G,K,ne,ue){return ue=this.cfg.extend(ue),K=this._parse(K,ue.format),G.createDecryptor(ne,ue).finalize(K.ciphertext)},_parse:function(G,K){return"string"==typeof G?K.parse(G,this):G}}),xe=(ne.kdf={}).OpenSSL={execute:function(G,K,ne,ue,pe){if(ue||(ue=he.random(8)),pe)ye=ve.create({keySize:K+ne,hasher:pe}).compute(G,ue);else var ye=ve.create({keySize:K+ne}).compute(G,ue);var me=he.create(ye.words.slice(K),4*ne);return ye.sigBytes=4*K,Ce.create({key:ye,iv:me,salt:ue})}},Ne=ue.PasswordBasedCipher=Oe.extend({cfg:Oe.cfg.extend({kdf:xe}),encrypt:function(G,K,ne,ue){var pe=(ue=this.cfg.extend(ue)).kdf.execute(ne,G.keySize,G.ivSize,ue.salt,ue.hasher);ue.iv=pe.iv;var he=Oe.encrypt.call(this,G,K,pe.key,ue);return he.mixIn(pe),he},decrypt:function(G,K,ne,ue){ue=this.cfg.extend(ue),K=this._parse(K,ue.format);var pe=ue.kdf.execute(ne,G.keySize,G.ivSize,K.salt,ue.hasher);return ue.iv=pe.iv,Oe.decrypt.call(this,G,K,pe.key,ue)}})}()}(Lv,requireEvpkdf())}(vx)),vx.exports}var wx,_x={exports:{}};function requireModeCfb$1(){return wx||(wx=1,function(G,K){G.exports=function(G){return G.mode.CFB=function(){var K=G.lib.BlockCipherMode.extend();function generateKeystreamAndEncrypt(G,K,ne,ue){var pe,he=this._iv;he?(pe=he.slice(0),this._iv=void 0):pe=this._prevBlock,ue.encryptBlock(pe,0);for(var ye=0;ye<ne;ye++)G[K+ye]^=pe[ye]}return K.Encryptor=K.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize;generateKeystreamAndEncrypt.call(this,G,K,ue,ne),this._prevBlock=G.slice(K,K+ue)}}),K.Decryptor=K.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize,pe=G.slice(K,K+ue);generateKeystreamAndEncrypt.call(this,G,K,ue,ne),this._prevBlock=pe}}),K}(),G.mode.CFB}(Lv,requireCipherCore())}(_x)),_x.exports}var Tx,Ax={exports:{}};function requireModeCtr$1(){return Tx||(Tx=1,function(G,K){G.exports=function(G){return G.mode.CTR=(K=G.lib.BlockCipherMode.extend(),ne=K.Encryptor=K.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize,pe=this._iv,he=this._counter;pe&&(he=this._counter=pe.slice(0),this._iv=void 0);var ye=he.slice(0);ne.encryptBlock(ye,0),he[ue-1]=he[ue-1]+1|0;for(var me=0;me<ue;me++)G[K+me]^=ye[me]}}),K.Decryptor=ne,K),G.mode.CTR;var K,ne}(Lv,requireCipherCore())}(Ax)),Ax.exports}var Ex,Px={exports:{}};function requireModeCtrGladman(){return Ex||(Ex=1,function(G,K){G.exports=function(G){
/** @preserve
  			 * Counter block mode compatible with  Dr Brian Gladman fileenc.c
  			 * derived from CryptoJS.mode.CTR
  			 * Jan Hruby jhruby.web@gmail.com
  			 */
return G.mode.CTRGladman=function(){var K=G.lib.BlockCipherMode.extend();function incWord(G){if(255==(G>>24&255)){var K=G>>16&255,ne=G>>8&255,ue=255&G;255===K?(K=0,255===ne?(ne=0,255===ue?ue=0:++ue):++ne):++K,G=0,G+=K<<16,G+=ne<<8,G+=ue}else G+=1<<24;return G}function incCounter(G){return 0===(G[0]=incWord(G[0]))&&(G[1]=incWord(G[1])),G}var ne=K.Encryptor=K.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize,pe=this._iv,he=this._counter;pe&&(he=this._counter=pe.slice(0),this._iv=void 0),incCounter(he);var ye=he.slice(0);ne.encryptBlock(ye,0);for(var me=0;me<ue;me++)G[K+me]^=ye[me]}});return K.Decryptor=ne,K}(),G.mode.CTRGladman}(Lv,requireCipherCore())}(Px)),Px.exports}var Sx,Ix={exports:{}};function requireModeOfb$1(){return Sx||(Sx=1,function(G,K){G.exports=function(G){return G.mode.OFB=(K=G.lib.BlockCipherMode.extend(),ne=K.Encryptor=K.extend({processBlock:function(G,K){var ne=this._cipher,ue=ne.blockSize,pe=this._iv,he=this._keystream;pe&&(he=this._keystream=pe.slice(0),this._iv=void 0),ne.encryptBlock(he,0);for(var ye=0;ye<ue;ye++)G[K+ye]^=he[ye]}}),K.Decryptor=ne,K),G.mode.OFB;var K,ne}(Lv,requireCipherCore())}(Ix)),Ix.exports}var Cx,Rx={exports:{}};var kx,Ox={exports:{}};var xx,Nx={exports:{}};var Mx,Bx={exports:{}};var Fx,Dx={exports:{}};var Lx,Ux={exports:{}};var $x,qx={exports:{}};var Gx,jx={exports:{}};var Hx,Wx={exports:{}};function requireTripledes(){return Hx||(Hx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib,ue=ne.WordArray,pe=ne.BlockCipher,he=K.algo,ye=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],me=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],be=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],ve=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],_e=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],Te=he.DES=pe.extend({_doReset:function(){for(var G=this._key.words,K=[],ne=0;ne<56;ne++){var ue=ye[ne]-1;K[ne]=G[ue>>>5]>>>31-ue%32&1}for(var pe=this._subKeys=[],he=0;he<16;he++){var ve=pe[he]=[],_e=be[he];for(ne=0;ne<24;ne++)ve[ne/6|0]|=K[(me[ne]-1+_e)%28]<<31-ne%6,ve[4+(ne/6|0)]|=K[28+(me[ne+24]-1+_e)%28]<<31-ne%6;for(ve[0]=ve[0]<<1|ve[0]>>>31,ne=1;ne<7;ne++)ve[ne]=ve[ne]>>>4*(ne-1)+3;ve[7]=ve[7]<<5|ve[7]>>>27}var Te=this._invSubKeys=[];for(ne=0;ne<16;ne++)Te[ne]=pe[15-ne]},encryptBlock:function(G,K){this._doCryptBlock(G,K,this._subKeys)},decryptBlock:function(G,K){this._doCryptBlock(G,K,this._invSubKeys)},_doCryptBlock:function(G,K,ne){this._lBlock=G[K],this._rBlock=G[K+1],exchangeLR.call(this,4,252645135),exchangeLR.call(this,16,65535),exchangeRL.call(this,2,858993459),exchangeRL.call(this,8,16711935),exchangeLR.call(this,1,1431655765);for(var ue=0;ue<16;ue++){for(var pe=ne[ue],he=this._lBlock,ye=this._rBlock,me=0,be=0;be<8;be++)me|=ve[be][((ye^pe[be])&_e[be])>>>0];this._lBlock=ye,this._rBlock=he^me}var Te=this._lBlock;this._lBlock=this._rBlock,this._rBlock=Te,exchangeLR.call(this,1,1431655765),exchangeRL.call(this,8,16711935),exchangeRL.call(this,2,858993459),exchangeLR.call(this,16,65535),exchangeLR.call(this,4,252645135),G[K]=this._lBlock,G[K+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function exchangeLR(G,K){var ne=(this._lBlock>>>G^this._rBlock)&K;this._rBlock^=ne,this._lBlock^=ne<<G}function exchangeRL(G,K){var ne=(this._rBlock>>>G^this._lBlock)&K;this._lBlock^=ne,this._rBlock^=ne<<G}K.DES=pe._createHelper(Te);var Ee=he.TripleDES=pe.extend({_doReset:function(){var G=this._key.words;if(2!==G.length&&4!==G.length&&G.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var K=G.slice(0,2),ne=G.length<4?G.slice(0,2):G.slice(2,4),pe=G.length<6?G.slice(0,2):G.slice(4,6);this._des1=Te.createEncryptor(ue.create(K)),this._des2=Te.createEncryptor(ue.create(ne)),this._des3=Te.createEncryptor(ue.create(pe))},encryptBlock:function(G,K){this._des1.encryptBlock(G,K),this._des2.decryptBlock(G,K),this._des3.encryptBlock(G,K)},decryptBlock:function(G,K){this._des3.decryptBlock(G,K),this._des2.encryptBlock(G,K),this._des1.decryptBlock(G,K)},keySize:6,ivSize:2,blockSize:2});K.TripleDES=pe._createHelper(Ee)}(),G.TripleDES}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(Wx)),Wx.exports}var zx,Vx={exports:{}};var Kx,Jx={exports:{}};var Xx,Qx={exports:{}};var Zx,Yx={exports:{}};function requireBlowfish(){return Zx||(Zx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.BlockCipher,ue=K.algo;const pe=16,he=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],ye=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var me={pbox:[],sbox:[]};function F(G,K){let ne=K>>24&255,ue=K>>16&255,pe=K>>8&255,he=255&K,ye=G.sbox[0][ne]+G.sbox[1][ue];return ye^=G.sbox[2][pe],ye+=G.sbox[3][he],ye}function BlowFish_Encrypt(G,K,ne){let ue,he=K,ye=ne;for(let K=0;K<pe;++K)he^=G.pbox[K],ye=F(G,he)^ye,ue=he,he=ye,ye=ue;return ue=he,he=ye,ye=ue,ye^=G.pbox[pe],he^=G.pbox[pe+1],{left:he,right:ye}}function BlowFish_Decrypt(G,K,ne){let ue,he=K,ye=ne;for(let K=pe+1;K>1;--K)he^=G.pbox[K],ye=F(G,he)^ye,ue=he,he=ye,ye=ue;return ue=he,he=ye,ye=ue,ye^=G.pbox[1],he^=G.pbox[0],{left:he,right:ye}}function BlowFishInit(G,K,ne){for(let K=0;K<4;K++){G.sbox[K]=[];for(let ne=0;ne<256;ne++)G.sbox[K][ne]=ye[K][ne]}let ue=0;for(let ye=0;ye<pe+2;ye++)G.pbox[ye]=he[ye]^K[ue],ue++,ue>=ne&&(ue=0);let me=0,be=0,ve=0;for(let K=0;K<pe+2;K+=2)ve=BlowFish_Encrypt(G,me,be),me=ve.left,be=ve.right,G.pbox[K]=me,G.pbox[K+1]=be;for(let K=0;K<4;K++)for(let ne=0;ne<256;ne+=2)ve=BlowFish_Encrypt(G,me,be),me=ve.left,be=ve.right,G.sbox[K][ne]=me,G.sbox[K][ne+1]=be;return!0}var be=ue.Blowfish=ne.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var G=this._keyPriorReset=this._key,K=G.words,ne=G.sigBytes/4;BlowFishInit(me,K,ne)}},encryptBlock:function(G,K){var ne=BlowFish_Encrypt(me,G[K],G[K+1]);G[K]=ne.left,G[K+1]=ne.right},decryptBlock:function(G,K){var ne=BlowFish_Decrypt(me,G[K],G[K+1]);G[K]=ne.left,G[K+1]=ne.right},blockSize:2,keySize:4,ivSize:2});K.Blowfish=ne._createHelper(be)}(),G.Blowfish}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(Yx)),Yx.exports}!function(G,K){G.exports=function(G){return G}(Lv,requireX64Core(),requireLibTypedarrays(),requireEncUtf16(),requireEncBase64url(),requireMd5(),requireSha1(),function requireSha224(){return rx||(rx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.WordArray,ue=K.algo,pe=ue.SHA256,he=ue.SHA224=pe.extend({_doReset:function(){this._hash=new ne.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var G=pe._doFinalize.call(this);return G.sigBytes-=4,G}});K.SHA224=pe._createHelper(he),K.HmacSHA224=pe._createHmacHelper(he)}(),G.SHA224}(Lv)}(nx)),nx.exports}(),requireSha512$1(),function requireSha384(){return sx||(sx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.x64,ue=ne.Word,pe=ne.WordArray,he=K.algo,ye=he.SHA512,me=he.SHA384=ye.extend({_doReset:function(){this._hash=new pe.init([new ue.init(3418070365,3238371032),new ue.init(1654270250,914150663),new ue.init(2438529370,812702999),new ue.init(355462360,4144912697),new ue.init(1731405415,4290775857),new ue.init(2394180231,1750603025),new ue.init(3675008525,1694076839),new ue.init(1203062813,3204075428)])},_doFinalize:function(){var G=ye._doFinalize.call(this);return G.sigBytes-=16,G}});K.SHA384=ye._createHelper(me),K.HmacSHA384=ye._createHmacHelper(me)}(),G.SHA384}(Lv,requireX64Core(),requireSha512$1())}(ox)),ox.exports}(),requireSha3$1(),function requireRipemd160$2(){return ux||(ux=1,function(G,K){G.exports=function(G){
/** @preserve
  			(c) 2012 by Cédric Mesnil. All rights reserved.

  			Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  			    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  			    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  			THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  			*/
return function(K){var ne=G,ue=ne.lib,pe=ue.WordArray,he=ue.Hasher,ye=ne.algo,me=pe.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),be=pe.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),ve=pe.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),_e=pe.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Te=pe.create([0,1518500249,1859775393,2400959708,2840853838]),Ee=pe.create([1352829926,1548603684,1836072691,2053994217,0]),Pe=ye.RIPEMD160=he.extend({_doReset:function(){this._hash=pe.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(G,K){for(var ne=0;ne<16;ne++){var ue=K+ne,pe=G[ue];G[ue]=16711935&(pe<<8|pe>>>24)|4278255360&(pe<<24|pe>>>8)}var he,ye,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe=this._hash.words,De=Te.words,Le=Ee.words,Ue=me.words,je=be.words,ze=ve.words,Je=_e.words;for(ke=he=Fe[0],Oe=ye=Fe[1],xe=Pe=Fe[2],Ne=Se=Fe[3],Me=Ce=Fe[4],ne=0;ne<80;ne+=1)Be=he+G[K+Ue[ne]]|0,Be+=ne<16?f1(ye,Pe,Se)+De[0]:ne<32?f2(ye,Pe,Se)+De[1]:ne<48?f3(ye,Pe,Se)+De[2]:ne<64?f4(ye,Pe,Se)+De[3]:f5(ye,Pe,Se)+De[4],Be=(Be=rotl(Be|=0,ze[ne]))+Ce|0,he=Ce,Ce=Se,Se=rotl(Pe,10),Pe=ye,ye=Be,Be=ke+G[K+je[ne]]|0,Be+=ne<16?f5(Oe,xe,Ne)+Le[0]:ne<32?f4(Oe,xe,Ne)+Le[1]:ne<48?f3(Oe,xe,Ne)+Le[2]:ne<64?f2(Oe,xe,Ne)+Le[3]:f1(Oe,xe,Ne)+Le[4],Be=(Be=rotl(Be|=0,Je[ne]))+Me|0,ke=Me,Me=Ne,Ne=rotl(xe,10),xe=Oe,Oe=Be;Be=Fe[1]+Pe+Ne|0,Fe[1]=Fe[2]+Se+Me|0,Fe[2]=Fe[3]+Ce+ke|0,Fe[3]=Fe[4]+he+Oe|0,Fe[4]=Fe[0]+ye+xe|0,Fe[0]=Be},_doFinalize:function(){var G=this._data,K=G.words,ne=8*this._nDataBytes,ue=8*G.sigBytes;K[ue>>>5]|=128<<24-ue%32,K[14+(ue+64>>>9<<4)]=16711935&(ne<<8|ne>>>24)|4278255360&(ne<<24|ne>>>8),G.sigBytes=4*(K.length+1),this._process();for(var pe=this._hash,he=pe.words,ye=0;ye<5;ye++){var me=he[ye];he[ye]=16711935&(me<<8|me>>>24)|4278255360&(me<<24|me>>>8)}return pe},clone:function(){var G=he.clone.call(this);return G._hash=this._hash.clone(),G}});function f1(G,K,ne){return G^K^ne}function f2(G,K,ne){return G&K|~G&ne}function f3(G,K,ne){return(G|~K)^ne}function f4(G,K,ne){return G&ne|K&~ne}function f5(G,K,ne){return G^(K|~ne)}function rotl(G,K){return G<<K|G>>>32-K}ne.RIPEMD160=he._createHelper(Pe),ne.HmacRIPEMD160=he._createHmacHelper(Pe)}(),G.RIPEMD160}(Lv)}(fx)),fx.exports}(),requireHmac$3(),function requirePbkdf2$2(){return hx||(hx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib,ue=ne.Base,pe=ne.WordArray,he=K.algo,ye=he.SHA256,me=he.HMAC,be=he.PBKDF2=ue.extend({cfg:ue.extend({keySize:4,hasher:ye,iterations:25e4}),init:function(G){this.cfg=this.cfg.extend(G)},compute:function(G,K){for(var ne=this.cfg,ue=me.create(ne.hasher,G),he=pe.create(),ye=pe.create([1]),be=he.words,ve=ye.words,_e=ne.keySize,Te=ne.iterations;be.length<_e;){var Ee=ue.update(K).finalize(ye);ue.reset();for(var Pe=Ee.words,Se=Pe.length,Ce=Ee,ke=1;ke<Te;ke++){Ce=ue.finalize(Ce),ue.reset();for(var Oe=Ce.words,xe=0;xe<Se;xe++)Pe[xe]^=Oe[xe]}he.concat(Ee),ve[0]++}return he.sigBytes=4*_e,he}});K.PBKDF2=function(G,K,ne){return be.create(ne).compute(G,K)}}(),G.PBKDF2}(Lv,requireHmac$3())}(yx)),yx.exports}(),requireEvpkdf(),requireCipherCore(),requireModeCfb$1(),requireModeCtr$1(),requireModeCtrGladman(),requireModeOfb$1(),function requireModeEcb$1(){return Cx||(Cx=1,function(G,K){G.exports=function(G){return G.mode.ECB=((K=G.lib.BlockCipherMode.extend()).Encryptor=K.extend({processBlock:function(G,K){this._cipher.encryptBlock(G,K)}}),K.Decryptor=K.extend({processBlock:function(G,K){this._cipher.decryptBlock(G,K)}}),K),G.mode.ECB;var K}(Lv,requireCipherCore())}(Rx)),Rx.exports}(),function requirePadAnsix923(){return kx||(kx=1,function(G,K){G.exports=function(G){return G.pad.AnsiX923={pad:function(G,K){var ne=G.sigBytes,ue=4*K,pe=ue-ne%ue,he=ne+pe-1;G.clamp(),G.words[he>>>2]|=pe<<24-he%4*8,G.sigBytes+=pe},unpad:function(G){var K=255&G.words[G.sigBytes-1>>>2];G.sigBytes-=K}},G.pad.Ansix923}(Lv,requireCipherCore())}(Ox)),Ox.exports}(),function requirePadIso10126(){return xx||(xx=1,function(G,K){G.exports=function(G){return G.pad.Iso10126={pad:function(K,ne){var ue=4*ne,pe=ue-K.sigBytes%ue;K.concat(G.lib.WordArray.random(pe-1)).concat(G.lib.WordArray.create([pe<<24],1))},unpad:function(G){var K=255&G.words[G.sigBytes-1>>>2];G.sigBytes-=K}},G.pad.Iso10126}(Lv,requireCipherCore())}(Nx)),Nx.exports}(),function requirePadIso97971(){return Mx||(Mx=1,function(G,K){G.exports=function(G){return G.pad.Iso97971={pad:function(K,ne){K.concat(G.lib.WordArray.create([2147483648],1)),G.pad.ZeroPadding.pad(K,ne)},unpad:function(K){G.pad.ZeroPadding.unpad(K),K.sigBytes--}},G.pad.Iso97971}(Lv,requireCipherCore())}(Bx)),Bx.exports}(),function requirePadZeropadding(){return Fx||(Fx=1,function(G,K){G.exports=function(G){return G.pad.ZeroPadding={pad:function(G,K){var ne=4*K;G.clamp(),G.sigBytes+=ne-(G.sigBytes%ne||ne)},unpad:function(G){var K=G.words,ne=G.sigBytes-1;for(ne=G.sigBytes-1;ne>=0;ne--)if(K[ne>>>2]>>>24-ne%4*8&255){G.sigBytes=ne+1;break}}},G.pad.ZeroPadding}(Lv,requireCipherCore())}(Dx)),Dx.exports}(),function requirePadNopadding(){return Lx||(Lx=1,function(G,K){G.exports=function(G){return G.pad.NoPadding={pad:function(){},unpad:function(){}},G.pad.NoPadding}(Lv,requireCipherCore())}(Ux)),Ux.exports}(),function requireFormatHex(){return $x||($x=1,function(G,K){G.exports=function(G){return function(K){var ne=G,ue=ne.lib.CipherParams,pe=ne.enc.Hex;ne.format.Hex={stringify:function(G){return G.ciphertext.toString(pe)},parse:function(G){var K=pe.parse(G);return ue.create({ciphertext:K})}}}(),G.format.Hex}(Lv,requireCipherCore())}(qx)),qx.exports}(),function requireAes$1(){return Gx||(Gx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.BlockCipher,ue=K.algo,pe=[],he=[],ye=[],me=[],be=[],ve=[],_e=[],Te=[],Ee=[],Pe=[];!function(){for(var G=[],K=0;K<256;K++)G[K]=K<128?K<<1:K<<1^283;var ne=0,ue=0;for(K=0;K<256;K++){var Se=ue^ue<<1^ue<<2^ue<<3^ue<<4;Se=Se>>>8^255&Se^99,pe[ne]=Se,he[Se]=ne;var Ce=G[ne],ke=G[Ce],Oe=G[ke],xe=257*G[Se]^16843008*Se;ye[ne]=xe<<24|xe>>>8,me[ne]=xe<<16|xe>>>16,be[ne]=xe<<8|xe>>>24,ve[ne]=xe,xe=16843009*Oe^65537*ke^257*Ce^16843008*ne,_e[Se]=xe<<24|xe>>>8,Te[Se]=xe<<16|xe>>>16,Ee[Se]=xe<<8|xe>>>24,Pe[Se]=xe,ne?(ne=Ce^G[G[G[Oe^Ce]]],ue^=G[G[ue]]):ne=ue=1}}();var Se=[0,1,2,4,8,16,32,64,128,27,54],Ce=ue.AES=ne.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var G=this._keyPriorReset=this._key,K=G.words,ne=G.sigBytes/4,ue=4*((this._nRounds=ne+6)+1),he=this._keySchedule=[],ye=0;ye<ue;ye++)ye<ne?he[ye]=K[ye]:(ve=he[ye-1],ye%ne?ne>6&&ye%ne==4&&(ve=pe[ve>>>24]<<24|pe[ve>>>16&255]<<16|pe[ve>>>8&255]<<8|pe[255&ve]):(ve=pe[(ve=ve<<8|ve>>>24)>>>24]<<24|pe[ve>>>16&255]<<16|pe[ve>>>8&255]<<8|pe[255&ve],ve^=Se[ye/ne|0]<<24),he[ye]=he[ye-ne]^ve);for(var me=this._invKeySchedule=[],be=0;be<ue;be++){if(ye=ue-be,be%4)var ve=he[ye];else ve=he[ye-4];me[be]=be<4||ye<=4?ve:_e[pe[ve>>>24]]^Te[pe[ve>>>16&255]]^Ee[pe[ve>>>8&255]]^Pe[pe[255&ve]]}}},encryptBlock:function(G,K){this._doCryptBlock(G,K,this._keySchedule,ye,me,be,ve,pe)},decryptBlock:function(G,K){var ne=G[K+1];G[K+1]=G[K+3],G[K+3]=ne,this._doCryptBlock(G,K,this._invKeySchedule,_e,Te,Ee,Pe,he),ne=G[K+1],G[K+1]=G[K+3],G[K+3]=ne},_doCryptBlock:function(G,K,ne,ue,pe,he,ye,me){for(var be=this._nRounds,ve=G[K]^ne[0],_e=G[K+1]^ne[1],Te=G[K+2]^ne[2],Ee=G[K+3]^ne[3],Pe=4,Se=1;Se<be;Se++){var Ce=ue[ve>>>24]^pe[_e>>>16&255]^he[Te>>>8&255]^ye[255&Ee]^ne[Pe++],ke=ue[_e>>>24]^pe[Te>>>16&255]^he[Ee>>>8&255]^ye[255&ve]^ne[Pe++],Oe=ue[Te>>>24]^pe[Ee>>>16&255]^he[ve>>>8&255]^ye[255&_e]^ne[Pe++],xe=ue[Ee>>>24]^pe[ve>>>16&255]^he[_e>>>8&255]^ye[255&Te]^ne[Pe++];ve=Ce,_e=ke,Te=Oe,Ee=xe}Ce=(me[ve>>>24]<<24|me[_e>>>16&255]<<16|me[Te>>>8&255]<<8|me[255&Ee])^ne[Pe++],ke=(me[_e>>>24]<<24|me[Te>>>16&255]<<16|me[Ee>>>8&255]<<8|me[255&ve])^ne[Pe++],Oe=(me[Te>>>24]<<24|me[Ee>>>16&255]<<16|me[ve>>>8&255]<<8|me[255&_e])^ne[Pe++],xe=(me[Ee>>>24]<<24|me[ve>>>16&255]<<16|me[_e>>>8&255]<<8|me[255&Te])^ne[Pe++],G[K]=Ce,G[K+1]=ke,G[K+2]=Oe,G[K+3]=xe},keySize:8});K.AES=ne._createHelper(Ce)}(),G.AES}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(jx)),jx.exports}(),requireTripledes(),function requireRc4(){return zx||(zx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.StreamCipher,ue=K.algo,pe=ue.RC4=ne.extend({_doReset:function(){for(var G=this._key,K=G.words,ne=G.sigBytes,ue=this._S=[],pe=0;pe<256;pe++)ue[pe]=pe;pe=0;for(var he=0;pe<256;pe++){var ye=pe%ne,me=K[ye>>>2]>>>24-ye%4*8&255;he=(he+ue[pe]+me)%256;var be=ue[pe];ue[pe]=ue[he],ue[he]=be}this._i=this._j=0},_doProcessBlock:function(G,K){G[K]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var G=this._S,K=this._i,ne=this._j,ue=0,pe=0;pe<4;pe++){ne=(ne+G[K=(K+1)%256])%256;var he=G[K];G[K]=G[ne],G[ne]=he,ue|=G[(G[K]+G[ne])%256]<<24-8*pe}return this._i=K,this._j=ne,ue}K.RC4=ne._createHelper(pe);var he=ue.RC4Drop=pe.extend({cfg:pe.cfg.extend({drop:192}),_doReset:function(){pe._doReset.call(this);for(var G=this.cfg.drop;G>0;G--)generateKeystreamWord.call(this)}});K.RC4Drop=ne._createHelper(he)}(),G.RC4}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(Vx)),Vx.exports}(),function requireRabbit(){return Kx||(Kx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.StreamCipher,ue=K.algo,pe=[],he=[],ye=[],me=ue.Rabbit=ne.extend({_doReset:function(){for(var G=this._key.words,K=this.cfg.iv,ne=0;ne<4;ne++)G[ne]=16711935&(G[ne]<<8|G[ne]>>>24)|4278255360&(G[ne]<<24|G[ne]>>>8);var ue=this._X=[G[0],G[3]<<16|G[2]>>>16,G[1],G[0]<<16|G[3]>>>16,G[2],G[1]<<16|G[0]>>>16,G[3],G[2]<<16|G[1]>>>16],pe=this._C=[G[2]<<16|G[2]>>>16,4294901760&G[0]|65535&G[1],G[3]<<16|G[3]>>>16,4294901760&G[1]|65535&G[2],G[0]<<16|G[0]>>>16,4294901760&G[2]|65535&G[3],G[1]<<16|G[1]>>>16,4294901760&G[3]|65535&G[0]];for(this._b=0,ne=0;ne<4;ne++)nextState.call(this);for(ne=0;ne<8;ne++)pe[ne]^=ue[ne+4&7];if(K){var he=K.words,ye=he[0],me=he[1],be=16711935&(ye<<8|ye>>>24)|4278255360&(ye<<24|ye>>>8),ve=16711935&(me<<8|me>>>24)|4278255360&(me<<24|me>>>8),_e=be>>>16|4294901760&ve,Te=ve<<16|65535&be;for(pe[0]^=be,pe[1]^=_e,pe[2]^=ve,pe[3]^=Te,pe[4]^=be,pe[5]^=_e,pe[6]^=ve,pe[7]^=Te,ne=0;ne<4;ne++)nextState.call(this)}},_doProcessBlock:function(G,K){var ne=this._X;nextState.call(this),pe[0]=ne[0]^ne[5]>>>16^ne[3]<<16,pe[1]=ne[2]^ne[7]>>>16^ne[5]<<16,pe[2]=ne[4]^ne[1]>>>16^ne[7]<<16,pe[3]=ne[6]^ne[3]>>>16^ne[1]<<16;for(var ue=0;ue<4;ue++)pe[ue]=16711935&(pe[ue]<<8|pe[ue]>>>24)|4278255360&(pe[ue]<<24|pe[ue]>>>8),G[K+ue]^=pe[ue]},blockSize:4,ivSize:2});function nextState(){for(var G=this._X,K=this._C,ne=0;ne<8;ne++)he[ne]=K[ne];for(K[0]=K[0]+1295307597+this._b|0,K[1]=K[1]+3545052371+(K[0]>>>0<he[0]>>>0?1:0)|0,K[2]=K[2]+886263092+(K[1]>>>0<he[1]>>>0?1:0)|0,K[3]=K[3]+1295307597+(K[2]>>>0<he[2]>>>0?1:0)|0,K[4]=K[4]+3545052371+(K[3]>>>0<he[3]>>>0?1:0)|0,K[5]=K[5]+886263092+(K[4]>>>0<he[4]>>>0?1:0)|0,K[6]=K[6]+1295307597+(K[5]>>>0<he[5]>>>0?1:0)|0,K[7]=K[7]+3545052371+(K[6]>>>0<he[6]>>>0?1:0)|0,this._b=K[7]>>>0<he[7]>>>0?1:0,ne=0;ne<8;ne++){var ue=G[ne]+K[ne],pe=65535&ue,me=ue>>>16,be=((pe*pe>>>17)+pe*me>>>15)+me*me,ve=((4294901760&ue)*ue|0)+((65535&ue)*ue|0);ye[ne]=be^ve}G[0]=ye[0]+(ye[7]<<16|ye[7]>>>16)+(ye[6]<<16|ye[6]>>>16)|0,G[1]=ye[1]+(ye[0]<<8|ye[0]>>>24)+ye[7]|0,G[2]=ye[2]+(ye[1]<<16|ye[1]>>>16)+(ye[0]<<16|ye[0]>>>16)|0,G[3]=ye[3]+(ye[2]<<8|ye[2]>>>24)+ye[1]|0,G[4]=ye[4]+(ye[3]<<16|ye[3]>>>16)+(ye[2]<<16|ye[2]>>>16)|0,G[5]=ye[5]+(ye[4]<<8|ye[4]>>>24)+ye[3]|0,G[6]=ye[6]+(ye[5]<<16|ye[5]>>>16)+(ye[4]<<16|ye[4]>>>16)|0,G[7]=ye[7]+(ye[6]<<8|ye[6]>>>24)+ye[5]|0}K.Rabbit=ne._createHelper(me)}(),G.Rabbit}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(Jx)),Jx.exports}(),function requireRabbitLegacy(){return Xx||(Xx=1,function(G,K){G.exports=function(G){return function(){var K=G,ne=K.lib.StreamCipher,ue=K.algo,pe=[],he=[],ye=[],me=ue.RabbitLegacy=ne.extend({_doReset:function(){var G=this._key.words,K=this.cfg.iv,ne=this._X=[G[0],G[3]<<16|G[2]>>>16,G[1],G[0]<<16|G[3]>>>16,G[2],G[1]<<16|G[0]>>>16,G[3],G[2]<<16|G[1]>>>16],ue=this._C=[G[2]<<16|G[2]>>>16,4294901760&G[0]|65535&G[1],G[3]<<16|G[3]>>>16,4294901760&G[1]|65535&G[2],G[0]<<16|G[0]>>>16,4294901760&G[2]|65535&G[3],G[1]<<16|G[1]>>>16,4294901760&G[3]|65535&G[0]];this._b=0;for(var pe=0;pe<4;pe++)nextState.call(this);for(pe=0;pe<8;pe++)ue[pe]^=ne[pe+4&7];if(K){var he=K.words,ye=he[0],me=he[1],be=16711935&(ye<<8|ye>>>24)|4278255360&(ye<<24|ye>>>8),ve=16711935&(me<<8|me>>>24)|4278255360&(me<<24|me>>>8),_e=be>>>16|4294901760&ve,Te=ve<<16|65535&be;for(ue[0]^=be,ue[1]^=_e,ue[2]^=ve,ue[3]^=Te,ue[4]^=be,ue[5]^=_e,ue[6]^=ve,ue[7]^=Te,pe=0;pe<4;pe++)nextState.call(this)}},_doProcessBlock:function(G,K){var ne=this._X;nextState.call(this),pe[0]=ne[0]^ne[5]>>>16^ne[3]<<16,pe[1]=ne[2]^ne[7]>>>16^ne[5]<<16,pe[2]=ne[4]^ne[1]>>>16^ne[7]<<16,pe[3]=ne[6]^ne[3]>>>16^ne[1]<<16;for(var ue=0;ue<4;ue++)pe[ue]=16711935&(pe[ue]<<8|pe[ue]>>>24)|4278255360&(pe[ue]<<24|pe[ue]>>>8),G[K+ue]^=pe[ue]},blockSize:4,ivSize:2});function nextState(){for(var G=this._X,K=this._C,ne=0;ne<8;ne++)he[ne]=K[ne];for(K[0]=K[0]+1295307597+this._b|0,K[1]=K[1]+3545052371+(K[0]>>>0<he[0]>>>0?1:0)|0,K[2]=K[2]+886263092+(K[1]>>>0<he[1]>>>0?1:0)|0,K[3]=K[3]+1295307597+(K[2]>>>0<he[2]>>>0?1:0)|0,K[4]=K[4]+3545052371+(K[3]>>>0<he[3]>>>0?1:0)|0,K[5]=K[5]+886263092+(K[4]>>>0<he[4]>>>0?1:0)|0,K[6]=K[6]+1295307597+(K[5]>>>0<he[5]>>>0?1:0)|0,K[7]=K[7]+3545052371+(K[6]>>>0<he[6]>>>0?1:0)|0,this._b=K[7]>>>0<he[7]>>>0?1:0,ne=0;ne<8;ne++){var ue=G[ne]+K[ne],pe=65535&ue,me=ue>>>16,be=((pe*pe>>>17)+pe*me>>>15)+me*me,ve=((4294901760&ue)*ue|0)+((65535&ue)*ue|0);ye[ne]=be^ve}G[0]=ye[0]+(ye[7]<<16|ye[7]>>>16)+(ye[6]<<16|ye[6]>>>16)|0,G[1]=ye[1]+(ye[0]<<8|ye[0]>>>24)+ye[7]|0,G[2]=ye[2]+(ye[1]<<16|ye[1]>>>16)+(ye[0]<<16|ye[0]>>>16)|0,G[3]=ye[3]+(ye[2]<<8|ye[2]>>>24)+ye[1]|0,G[4]=ye[4]+(ye[3]<<16|ye[3]>>>16)+(ye[2]<<16|ye[2]>>>16)|0,G[5]=ye[5]+(ye[4]<<8|ye[4]>>>24)+ye[3]|0,G[6]=ye[6]+(ye[5]<<16|ye[5]>>>16)+(ye[4]<<16|ye[4]>>>16)|0,G[7]=ye[7]+(ye[6]<<8|ye[6]>>>24)+ye[5]|0}K.RabbitLegacy=ne._createHelper(me)}(),G.RabbitLegacy}(Lv,requireMd5(),requireEvpkdf(),requireCipherCore())}(Qx)),Qx.exports}(),requireBlowfish())}(HO);var eN=HO.exports,tN=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(jO,"__esModule",{value:!0}),jO.Base=void 0;const rN=Ti,nN=tN(eN);class Base{print(){Base.print(this)}bufferIndexOf(G,K,ne=!1){if(ne)return this.binarySearch(G,K,rN.Buffer.compare);return this.linearSearch(G,K,((G,K)=>G.equals(K)))}static binarySearch(G,K,ne){let ue=0,pe=G.length-1;for(;ue<=pe;){const he=Math.floor((ue+pe)/2),ye=ne(G[he],K);if(0===ye){for(let ue=he-1;ue>=0;ue--)if(0!==ne(G[ue],K))return ue+1;return 0}ye<0?ue=he+1:pe=he-1}return-1}binarySearch(G,K,ne){return Base.binarySearch(G,K,ne)}static linearSearch(G,K,ne){for(let ue=0;ue<G.length;ue++)if(ne(G[ue],K))return ue;return-1}linearSearch(G,K,ne){return Base.linearSearch(G,K,ne)}static bufferify(G){if(!rN.Buffer.isBuffer(G)){if("object"==typeof G&&G.words)return rN.Buffer.from(G.toString(nN.default.enc.Hex),"hex");if(Base.isHexString(G))return rN.Buffer.from(G.replace(/^0x/,""),"hex");if("string"==typeof G)return rN.Buffer.from(G);if("bigint"==typeof G)return rN.Buffer.from(G.toString(16),"hex");if(G instanceof Uint8Array)return rN.Buffer.from(G.buffer);if("number"==typeof G){let K=G.toString();return K.length%2&&(K=`0${K}`),rN.Buffer.from(K,"hex")}if(ArrayBuffer.isView(G))return rN.Buffer.from(G.buffer,G.byteOffset,G.byteLength)}return G}bigNumberify(G){return Base.bigNumberify(G)}static bigNumberify(G){if("bigint"==typeof G)return G;if("string"==typeof G)return G.startsWith("0x")&&Base.isHexString(G)?BigInt("0x"+G.replace("0x","").toString()):BigInt(G);if(rN.Buffer.isBuffer(G))return BigInt("0x"+G.toString("hex"));if(G instanceof Uint8Array)return BigInt(G);if("number"==typeof G)return BigInt(G);throw new Error("cannot bigNumberify")}static isHexString(G){return"string"==typeof G&&/^(0x)?[0-9A-Fa-f]*$/.test(G)}static print(G){console.log(G.toString())}bufferToHex(G,K=!0){return Base.bufferToHex(G,K)}static bufferToHex(G,K=!0){return`${K?"0x":""}${(G||rN.Buffer.alloc(0)).toString("hex")}`}bufferify(G){return Base.bufferify(G)}bufferifyFn(G){return K=>{const ne=G(K);return rN.Buffer.isBuffer(ne)?ne:this.isHexString(ne)?rN.Buffer.from(ne.replace("0x",""),"hex"):"string"==typeof ne?rN.Buffer.from(ne):"bigint"==typeof ne?rN.Buffer.from(K.toString(16),"hex"):ArrayBuffer.isView(ne)?rN.Buffer.from(ne.buffer,ne.byteOffset,ne.byteLength):rN.Buffer.from(G(nN.default.enc.Hex.parse(K.toString("hex"))).toString(nN.default.enc.Hex),"hex")}}isHexString(G){return Base.isHexString(G)}log2(G){return 1===G?0:1+this.log2(G/2|0)}zip(G,K){return G.map(((G,ne)=>[G,K[ne]]))}static hexZeroPad(G,K){return"0x"+G.replace("0x","").padStart(K,"0")}}jO.Base=Base,jO.default=Base;var aN=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(UO,"__esModule",{value:!0}),UO.MerkleTree=void 0;const iN=Ti,sN=aN((function reverse(G){for(var K=new Buffer(G.length),ne=0,ue=G.length-1;ne<=ue;++ne,--ue)K[ne]=G[ue],K[ue]=G[ne];return K})),oN=aN(qv),cN=aN(GO),dN=aN(jO);let uN=class MerkleTree extends dN.default{constructor(G,K=oN.default,ne={}){if(super(),this.duplicateOdd=!1,this.concatenator=iN.Buffer.concat,this.hashLeaves=!1,this.isBitcoinTree=!1,this.leaves=[],this.layers=[],this.sortLeaves=!1,this.sortPairs=!1,this.sort=!1,this.fillDefaultHash=null,this.complete=!1,ne.complete){if(ne.isBitcoinTree)throw new Error('option "complete" is incompatible with "isBitcoinTree"');if(ne.duplicateOdd)throw new Error('option "complete" is incompatible with "duplicateOdd"')}if(this.isBitcoinTree=!!ne.isBitcoinTree,this.hashLeaves=!!ne.hashLeaves,this.sortLeaves=!!ne.sortLeaves,this.sortPairs=!!ne.sortPairs,this.complete=!!ne.complete,ne.fillDefaultHash)if("function"==typeof ne.fillDefaultHash)this.fillDefaultHash=ne.fillDefaultHash;else{if(!iN.Buffer.isBuffer(ne.fillDefaultHash)&&"string"!=typeof ne.fillDefaultHash)throw new Error('method "fillDefaultHash" must be a function, Buffer, or string');this.fillDefaultHash=(G,K)=>ne.fillDefaultHash}this.sort=!!ne.sort,this.sort&&(this.sortLeaves=!0,this.sortPairs=!0),this.duplicateOdd=!!ne.duplicateOdd,ne.concatenator&&(this.concatenator=ne.concatenator),this.hashFn=this.bufferifyFn(K),this.processLeaves(G)}getOptions(){var G,K;return{complete:this.complete,isBitcoinTree:this.isBitcoinTree,hashLeaves:this.hashLeaves,sortLeaves:this.sortLeaves,sortPairs:this.sortPairs,sort:this.sort,fillDefaultHash:null!==(K=null===(G=this.fillDefaultHash)||void 0===G?void 0:G.toString())&&void 0!==K?K:null,duplicateOdd:this.duplicateOdd}}processLeaves(G){if(this.hashLeaves&&(G=G.map(this.hashFn)),this.leaves=G.map(this.bufferify),this.sortLeaves&&(this.leaves=this.leaves.sort(iN.Buffer.compare)),this.fillDefaultHash)for(let G=this.leaves.length;G<Math.pow(2,Math.ceil(Math.log2(this.leaves.length)));G++)this.leaves.push(this.bufferify(this.fillDefaultHash(G,this.hashFn)));this.createHashes(this.leaves)}createHashes(G){for(this.layers=[G];G.length>1;){const K=this.layers.length;this.layers.push([]);const ne=this.complete&&1===K&&!Number.isInteger(Math.log2(G.length))?2*G.length-Math.pow(2,Math.ceil(Math.log2(G.length))):G.length;for(let ue=0;ue<G.length;ue+=2){if(ue>=ne){this.layers[K].push(...G.slice(ne));break}if(ue+1===G.length&&G.length%2==1){const ne=G[G.length-1];let pe=ne;if(this.isBitcoinTree){pe=this.hashFn(this.concatenator([sN.default(ne),sN.default(ne)])),pe=sN.default(this.hashFn(pe)),this.layers[K].push(pe);continue}if(!this.duplicateOdd){this.layers[K].push(G[ue]);continue}}const pe=G[ue],he=ue+1===G.length?pe:G[ue+1];let ye=null;ye=this.isBitcoinTree?[sN.default(pe),sN.default(he)]:[pe,he],this.sortPairs&&ye.sort(iN.Buffer.compare);let me=this.hashFn(this.concatenator(ye));this.isBitcoinTree&&(me=sN.default(this.hashFn(me))),this.layers[K].push(me)}G=this.layers[K]}}addLeaf(G,K=!1){K&&(G=this.hashFn(G)),this.processLeaves(this.leaves.concat(G))}addLeaves(G,K=!1){K&&(G=G.map(this.hashFn)),this.processLeaves(this.leaves.concat(G))}getLeaves(G){return Array.isArray(G)?(this.hashLeaves&&(G=G.map(this.hashFn),this.sortLeaves&&(G=G.sort(iN.Buffer.compare))),this.leaves.filter((K=>-1!==this.bufferIndexOf(G,K,this.sortLeaves)))):this.leaves}getLeaf(G){return G<0||G>this.leaves.length-1?iN.Buffer.from([]):this.leaves[G]}getLeafIndex(G){G=this.bufferify(G);const K=this.getLeaves();for(let ne=0;ne<K.length;ne++){if(K[ne].equals(G))return ne}return-1}getLeafCount(){return this.leaves.length}getHexLeaves(){return this.leaves.map((G=>this.bufferToHex(G)))}static marshalLeaves(G){return JSON.stringify(G.map((G=>MerkleTree.bufferToHex(G))),null,2)}static unmarshalLeaves(G){let K=null;if("string"==typeof G)K=JSON.parse(G);else{if(!(G instanceof Object))throw new Error("Expected type of string or object");K=G}if(!K)return[];if(!Array.isArray(K))throw new Error("Expected JSON string to be array");return K.map(MerkleTree.bufferify)}getLayers(){return this.layers}getHexLayers(){return this.layers.reduce(((G,K)=>(Array.isArray(K)?G.push(K.map((G=>this.bufferToHex(G)))):G.push(K),G)),[])}getLayersFlat(){const G=this.layers.reduce(((G,K)=>(Array.isArray(K)?G.unshift(...K):G.unshift(K),G)),[]);return G.unshift(iN.Buffer.from([0])),G}getHexLayersFlat(){return this.getLayersFlat().map((G=>this.bufferToHex(G)))}getLayerCount(){return this.getLayers().length}getRoot(){return 0===this.layers.length?iN.Buffer.from([]):this.layers[this.layers.length-1][0]||iN.Buffer.from([])}getHexRoot(){return this.bufferToHex(this.getRoot())}getProof(G,K){if(void 0===G)throw new Error("leaf is required");G=this.bufferify(G);const ne=[];if(!Number.isInteger(K)){K=-1;for(let ne=0;ne<this.leaves.length;ne++)0===iN.Buffer.compare(G,this.leaves[ne])&&(K=ne)}if(K<=-1)return[];for(let G=0;G<this.layers.length;G++){const ue=this.layers[G],pe=K%2,he=pe?K-1:this.isBitcoinTree&&K===ue.length-1&&G<this.layers.length-1?K:K+1;he<ue.length&&ne.push({position:pe?"left":"right",data:ue[he]}),K=K/2|0}return ne}getHexProof(G,K){return this.getProof(G,K).map((G=>this.bufferToHex(G.data)))}getProofs(){const G=[];return this.getProofsDFS(this.layers.length-1,0,[],G),G}getProofsDFS(G,K,ne,ue){const pe=K%2;if(-1===G)return void(pe||ue.push([...ne].reverse()));if(K>=this.layers[G].length)return;const he=this.layers[G],ye=pe?K-1:K+1;let me=!1;ye<he.length&&(me=!0,ne.push({position:pe?"left":"right",data:he[ye]}));const be=2*K,ve=2*K+1;this.getProofsDFS(G-1,be,ne,ue),this.getProofsDFS(G-1,ve,ne,ue),me&&ne.splice(ne.length-1,1)}getHexProofs(){return this.getProofs().map((G=>this.bufferToHex(G.data)))}getPositionalHexProof(G,K){return this.getProof(G,K).map((G=>["left"===G.position?0:1,this.bufferToHex(G.data)]))}static marshalProof(G){const K=G.map((G=>"string"==typeof G?G:iN.Buffer.isBuffer(G)?MerkleTree.bufferToHex(G):{position:G.position,data:MerkleTree.bufferToHex(G.data)}));return JSON.stringify(K,null,2)}static unmarshalProof(G){let K=null;if("string"==typeof G)K=JSON.parse(G);else{if(!(G instanceof Object))throw new Error("Expected type of string or object");K=G}if(!K)return[];if(!Array.isArray(K))throw new Error("Expected JSON string to be array");return K.map((G=>{if("string"==typeof G)return MerkleTree.bufferify(G);if(G instanceof Object)return{position:G.position,data:MerkleTree.bufferify(G.data)};throw new Error("Expected item to be of type string or object")}))}static marshalTree(G){const K=G.getHexRoot(),ne=G.leaves.map((G=>MerkleTree.bufferToHex(G))),ue=G.getHexLayers(),pe=G.getOptions();return JSON.stringify({options:pe,root:K,layers:ue,leaves:ne},null,2)}static unmarshalTree(G,K=oN.default,ne={}){let ue=null;if("string"==typeof G)ue=JSON.parse(G);else{if(!(G instanceof Object))throw new Error("Expected type of string or object");ue=G}if(!ue)throw new Error("could not parse json");return ne=Object.assign({},ue.options||{},ne),new MerkleTree(ue.leaves,K,ne)}getProofIndices(G,K){const ne=Math.pow(2,K);let ue=new Set;for(const K of G){let G=ne+K;for(;G>1;)ue.add(1^G),G=G/2|0}const pe=G.map((G=>ne+G)),he=Array.from(ue).sort(((G,K)=>G-K)).reverse();ue=pe.concat(he);const ye=new Set,me=[];for(let G of ue)if(!ye.has(G))for(me.push(G);G>1&&(ye.add(G),ye.has(1^G));)G=G/2|0;return me.filter((K=>!G.includes(K-ne)))}getProofIndicesForUnevenTree(G,K){const ne=Math.ceil(Math.log2(K)),ue=[];for(let G=0;G<ne;G++){K%2!=0&&ue.push({index:G,leavesCount:K}),K=Math.ceil(K/2)}const pe=[];let he=G;for(let G=0;G<ne;G++){const K=he.map((G=>G%2==0?G+1:G-1));let ne=K.filter((G=>!he.includes(G)));const ye=ue.find((({index:K})=>K===G));ye&&he.includes(ye.leavesCount-1)&&(ne=ne.slice(0,-1)),pe.push(ne),he=[...new Set(he.map((G=>G%2==0?G/2:G%2==0?(G+1)/2:(G-1)/2)))]}return pe}getMultiProof(G,K){this.complete||console.warn("Warning: For correct multiProofs it's strongly recommended to set complete: true"),K||(K=G,G=this.getLayersFlat());if(this.isUnevenTree()&&K.every(Number.isInteger))return this.getMultiProofForUnevenTree(K);if(!K.every(Number.isInteger)){let G=K;this.sortPairs&&(G=G.sort(iN.Buffer.compare));let ne=G.map((G=>this.bufferIndexOf(this.leaves,G,this.sortLeaves))).sort(((G,K)=>G===K?0:G>K?1:-1));if(!ne.every((G=>-1!==G)))throw new Error("Element does not exist in Merkle tree");const ue=[],pe=[];let he=[];for(let G=0;G<this.layers.length;G++){const K=this.layers[G];for(let G=0;G<ne.length;G++){const ye=ne[G],me=this.getPairNode(K,ye);ue.push(K[ye]),me&&pe.push(me),he.push(ye/2|0)}ne=he.filter(((G,K,ne)=>ne.indexOf(G)===K)),he=[]}return pe.filter((G=>!ue.includes(G)))}return this.getProofIndices(K,Math.log2(G.length/2|0)).map((K=>G[K]))}getMultiProofForUnevenTree(G,K){K||(K=G,G=this.getLayers());let ne=[],ue=K;for(const K of G){const G=[];for(const ne of ue){if(ne%2==0){const pe=ne+1;if(!ue.includes(pe)&&K[pe]){G.push(K[pe]);continue}}const pe=ne-1;ue.includes(pe)||!K[pe]||G.push(K[pe])}ne=ne.concat(G);const pe=new Set;for(const G of ue)G%2!=0?G%2!=0?pe.add((G-1)/2):pe.add((G+1)/2):pe.add(G/2);ue=Array.from(pe)}return ne}getHexMultiProof(G,K){return this.getMultiProof(G,K).map((G=>this.bufferToHex(G)))}getProofFlags(G,K){if(!Array.isArray(G)||G.length<=0)throw new Error("Invalid Inputs!");let ne;if(ne=G.every(Number.isInteger)?[...G].sort(((G,K)=>G===K?0:G>K?1:-1)):G.map((G=>this.bufferIndexOf(this.leaves,G,this.sortLeaves))).sort(((G,K)=>G===K?0:G>K?1:-1)),!ne.every((G=>-1!==G)))throw new Error("Element does not exist in Merkle tree");const ue=K.map((G=>this.bufferify(G))),pe=[],he=[];for(let G=0;G<this.layers.length;G++){const K=this.layers[G];ne=ne.reduce(((G,ne)=>{if(!pe.includes(K[ne])){const G=this.getPairNode(K,ne),ye=ue.includes(K[ne])||ue.includes(G);G&&he.push(!ye),pe.push(K[ne]),pe.push(G)}return G.push(ne/2|0),G}),[])}return he}verify(G,K,ne){let ue=this.bufferify(K);if(ne=this.bufferify(ne),!Array.isArray(G)||!K||!ne)return!1;for(let K=0;K<G.length;K++){const ne=G[K];let pe=null,he=null;if("string"==typeof ne)pe=this.bufferify(ne),he=!0;else if(Array.isArray(ne))he=0===ne[0],pe=this.bufferify(ne[1]);else if(iN.Buffer.isBuffer(ne))pe=ne,he=!0;else{if(!(ne instanceof Object))throw new Error("Expected node to be of type string or object");pe=this.bufferify(ne.data),he="left"===ne.position}const ye=[];this.isBitcoinTree?(ye.push(sN.default(ue)),ye[he?"unshift":"push"](sN.default(pe)),ue=this.hashFn(this.concatenator(ye)),ue=sN.default(this.hashFn(ue))):this.sortPairs?-1===iN.Buffer.compare(ue,pe)?(ye.push(ue,pe),ue=this.hashFn(this.concatenator(ye))):(ye.push(pe,ue),ue=this.hashFn(this.concatenator(ye))):(ye.push(ue),ye[he?"unshift":"push"](pe),ue=this.hashFn(this.concatenator(ye)))}return 0===iN.Buffer.compare(ue,ne)}verifyMultiProof(G,K,ne,ue,pe){if(this.isUnevenTree())return this.verifyMultiProofForUnevenTree(G,K,ne,ue,pe);const he=Math.ceil(Math.log2(ue));G=this.bufferify(G),ne=ne.map((G=>this.bufferify(G))),pe=pe.map((G=>this.bufferify(G)));const ye={};for(const[G,ue]of this.zip(K,ne))ye[Math.pow(2,he)+G]=ue;for(const[G,ne]of this.zip(this.getProofIndices(K,he),pe))ye[G]=ne;let me=Object.keys(ye).map((G=>+G)).sort(((G,K)=>G-K));me=me.slice(0,me.length-1);let be=0;for(;be<me.length;){const G=me[be];if(G>=2&&{}.hasOwnProperty.call(ye,1^G)){let K=[ye[G-G%2],ye[G-G%2+1]];this.sortPairs&&(K=K.sort(iN.Buffer.compare));const ne=K[1]?this.hashFn(this.concatenator(K)):K[0];ye[G/2|0]=ne,me.push(G/2|0)}be+=1}return!K.length||{}.hasOwnProperty.call(ye,1)&&ye[1].equals(G)}verifyMultiProofWithFlags(G,K,ne,ue){G=this.bufferify(G),K=K.map(this.bufferify),ne=ne.map(this.bufferify);const pe=K.length,he=ue.length,ye=[];let me=0,be=0,ve=0;for(let G=0;G<he;G++){const he=[ue[G]?me<pe?K[me++]:ye[be++]:ne[ve++],me<pe?K[me++]:ye[be++]].sort(iN.Buffer.compare);ye[G]=this.hashFn(this.concatenator(he))}return 0===iN.Buffer.compare(ye[he-1],G)}verifyMultiProofForUnevenTree(G,K,ne,ue,pe){G=this.bufferify(G),ne=ne.map((G=>this.bufferify(G))),pe=pe.map((G=>this.bufferify(G)));const he=this.calculateRootForUnevenTree(K,ne,ue,pe);return G.equals(he)}getDepth(){return this.getLayers().length-1}getLayersAsObject(){const G=this.getLayers().map((G=>G.map((G=>this.bufferToHex(G,!1))))),K=[];for(let ne=0;ne<G.length;ne++){const ue=[];for(let pe=0;pe<G[ne].length;pe++){const he={[G[ne][pe]]:null};if(K.length){he[G[ne][pe]]={};const ue=K.shift(),ye=Object.keys(ue)[0];if(he[G[ne][pe]][ye]=ue[ye],K.length){const ue=K.shift(),ye=Object.keys(ue)[0];he[G[ne][pe]][ye]=ue[ye]}}ue.push(he)}K.push(...ue)}return K[0]}static verify(G,K,ne,ue=oN.default,pe={}){return new MerkleTree([],ue,pe).verify(G,K,ne)}static getMultiProof(G,K){return new MerkleTree([]).getMultiProof(G,K)}resetTree(){this.leaves=[],this.layers=[]}getPairNode(G,K){const ne=K%2==0?K+1:K-1;return ne<G.length?G[ne]:null}toTreeString(){const G=this.getLayersAsObject();return cN.default.asTree(G,!0)}toString(){return this.toTreeString()}isUnevenTree(G){const K=(null==G?void 0:G.length)||this.getDepth();return!this.isPowOf2(K)}isPowOf2(G){return G&&!(G&G-1)}calculateRootForUnevenTree(G,K,ne,ue){const pe=this.zip(G,K).sort((([G],[K])=>G-K)),he=pe.map((([G])=>G)),ye=this.getProofIndicesForUnevenTree(he,ne);let me=0;const be=[];for(let G=0;G<ye.length;G++){const K=ye[G],ne=me;me+=K.length,be[G]=this.zip(K,ue.slice(ne,me))}const ve=[pe];for(let G=0;G<be.length;G++){const K=be[G].concat(ve[G]).sort((([G],[K])=>G-K)).map((([,G])=>G)),ne=ve[G].map((([G])=>G)),ue=[...new Set(ne.map((G=>G%2==0?G/2:G%2==0?(G+1)/2:(G-1)/2)))],pe=[];for(let G=0;G<ue.length;G++){const ne=ue[G],he=K[2*G],ye=K[2*G+1],me=ye?this.hashFn(this.concatenator([he,ye])):he;pe.push([ne,me])}ve.push(pe)}return ve[ve.length-1][0][1]}};UO.MerkleTree=uN,"undefined"!=typeof window&&(window.MerkleTree=uN),UO.default=uN;var fN={},lN=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(fN,"__esModule",{value:!0}),fN.MerkleMountainRange=void 0;const pN=Ti,hN=lN(qv),yN=lN(jO);class MerkleMountainRange extends yN.default{constructor(G=hN.default,K=[],ne,ue,pe){super(),this.root=pN.Buffer.alloc(0),this.size=0,this.width=0,this.hashes={},this.data={},K=K.map(this.bufferify),this.hashFn=this.bufferifyFn(G),this.hashLeafFn=ne,this.peakBaggingFn=ue,this.hashBranchFn=pe;for(const G of K)this.append(G)}append(G){G=this.bufferify(G);const K=this.hashFn(G),ne=this.bufferToHex(K);this.data[ne]&&this.bufferToHex(this.hashFn(this.data[ne]))===ne||(this.data[ne]=G);const ue=this.hashLeaf(this.size+1,K);this.hashes[this.size+1]=ue,this.width+=1;const pe=this.getPeakIndexes(this.width);this.size=this.getSize(this.width);const he=[];for(let G=0;G<pe.length;G++)he[G]=this._getOrCreateNode(pe[G]);this.root=this.peakBagging(this.width,he)}hashLeaf(G,K){return K=this.bufferify(K),this.hashLeafFn?this.bufferify(this.hashLeafFn(G,K)):this.hashFn(pN.Buffer.concat([this.bufferify(G),K]))}hashBranch(G,K,ne){return this.hashBranchFn?this.bufferify(this.hashBranchFn(G,K,ne)):this.hashFn(pN.Buffer.concat([this.bufferify(G),this.bufferify(K),this.bufferify(ne)]))}getPeaks(){const G=this.getPeakIndexes(this.width),K=[];for(let ne=0;ne<G.length;ne++)K[ne]=this.hashes[G[ne]];return K}getLeafIndex(G){return G%2==1?this.getSize(G):this.getSize(G-1)+1}getPeakIndexes(G){const K=this.numOfPeaks(G),ne=[];let ue=0,pe=0;for(let he=255;he>0&&!(0!=(G&1<<he-1)&&(pe=pe+(1<<he)-1,ne[ue++]=pe,ne.length>=K));he--);if(ue!==ne.length)throw new Error("invalid bit calculation");return ne}numOfPeaks(G){let K=G,ne=0;for(;K>0;)K%2==1&&ne++,K>>=1;return ne}peakBagging(G,K){const ne=this.getSize(G);if(this.numOfPeaks(G)!==K.length)throw new Error("received invalid number of peaks");return 0!==G||K.length?this.peakBaggingFn?this.bufferify(this.peakBaggingFn(ne,K)):this.hashFn(pN.Buffer.concat([this.bufferify(ne),...K.map(this.bufferify)])):pN.Buffer.alloc(0)}getSize(G){return(G<<1)-this.numOfPeaks(G)}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.getRoot())}getNode(G){return this.hashes[G]}mountainHeight(G){let K=1;for(;1<<K<=G+K;)K++;return K-1}heightAt(G){let K=G,ne=0,ue=0;for(;K>ne;)K-=(1<<ue)-1,ue=this.mountainHeight(K),ne=(1<<ue)-1;return ue-(ne-K)}isLeaf(G){return 1===this.heightAt(G)}getChildren(G){const K=G-(1<<this.heightAt(G)-1),ne=G-1;if(K===ne)throw new Error("not a parent");return[K,ne]}getMerkleProof(G){if(G>this.size)throw new Error("out of range");if(!this.isLeaf(G))throw new Error("not a leaf");const K=this.root,ne=this.width,ue=this.getPeakIndexes(this.width),pe=[];let he=0;for(let K=0;K<ue.length;K++)pe[K]=this.hashes[ue[K]],ue[K]>=G&&0===he&&(he=ue[K]);let ye=0,me=0,be=this.heightAt(he);const ve=[];for(;he!==G;)be--,[ye,me]=this.getChildren(he),he=G<=ye?ye:me,ve[be-1]=this.hashes[G<=ye?me:ye];return{root:K,width:ne,peakBagging:pe,siblings:ve}}verify(G,K,ne,ue,pe,he){ue=this.bufferify(ue);if(this.getSize(K)<ne)throw new Error("index is out of range");if(!G.equals(this.peakBagging(K,pe)))throw new Error("invalid root hash from the peaks");let ye,me=0;const be=this.getPeakIndexes(K);for(let G=0;G<be.length;G++)if(be[G]>=ne){ye=pe[G],me=be[G];break}if(!ye)throw new Error("target not found");let ve=he.length+1;const _e=new Array(ve);let Te,Ee=0,Pe=0;for(;ve>0&&(_e[--ve]=me,me!==ne);)[Ee,Pe]=this.getChildren(me),me=ne>Ee?Pe:Ee;for(;ve<_e.length;)me=_e[ve],Te=0===ve?this.hashLeaf(me,this.hashFn(ue)):me-1===_e[ve-1]?this.hashBranch(me,he[ve-1],Te):this.hashBranch(me,Te,he[ve-1]),ve++;if(!Te.equals(ye))throw new Error("hashed peak is invalid");return!0}peaksToPeakMap(G,K){const ne={};let ue=0,pe=0,he=K.length;for(let ye=1;ye<=32;ye++)ue=32-ye,pe=1<<ye-1,ne[ue]=0!=(G&pe)?K[--he]:0;if(0!==he)throw new Error("invalid number of peaks");return ne}peakMapToPeaks(G,K){const ne=this.numOfPeaks(G),ue=new Array(ne);let pe=0;for(let G=0;G<32;G++)0!==K[G]&&(ue[pe++]=K[G]);if(pe!==ne)throw new Error("invalid number of peaks");return ue}peakUpdate(G,K,ne){const ue={},pe=G+1;let he=this.getLeafIndex(pe),ye=this.hashLeaf(he,ne),me=0,be=0,ve=!1,_e=!1,Te=!1;for(let ne=1;ne<=32;ne++)me=32-ne,Te?ue[me]=K[me]:(be=1<<ne-1,ve=0!=(G&be),_e=0!=(pe&be),he++,ve&&(ye=this.hashBranch(he,K[me],ye)),_e?(ue[me]=ve?K[me]:ye,Te=!0):ue[me]=0);return ue}rollUp(G,K,ne,ue){if(!G.equals(this.peakBagging(K,ne)))throw new Error("invalid root hash from the peaks");let pe=K,he=this.peaksToPeakMap(K,ne);for(let G=0;G<ue.length;G++)he=this.peakUpdate(pe,he,ue[G]),pe++;return this.peakBagging(pe,this.peakMapToPeaks(pe,he))}_getOrCreateNode(G){if(G>this.size)throw new Error("out of range");if(!this.hashes[G]){const[K,ne]=this.getChildren(G),ue=this._getOrCreateNode(K),pe=this._getOrCreateNode(ne);this.hashes[G]=this.hashBranch(G,ue,pe)}return this.hashes[G]}}fN.MerkleMountainRange=MerkleMountainRange,"undefined"!=typeof window&&(window.MerkleMountainRange=MerkleMountainRange),fN.default=MerkleMountainRange;var mN={},bN=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(mN,"__esModule",{value:!0}),mN.IncrementalMerkleTree=void 0;const gN=bN(jO),vN=bN(GO);class IncrementalMerkleTree extends gN.default{constructor(G,K){if(super(),this.hashFn=G,K.depth&&(this.depth=K.depth),K.arity&&(this.arity=K.arity),this.depth<1)throw new Error("depth must be greater than 0");if(this.arity<1)throw new Error("arity must be greater than 0");const ne=[];let ue=K.zeroValue;if(this.zeroValue=ue,this.zeroes=[],this.depth)for(let G=0;G<this.depth;G++)this.zeroes.push(ue),ne[G]=[],ue=this.hashFn(Array(this.arity).fill(ue));this.nodes=ne,this.root=ue}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.bufferify(this.getRoot()))}insert(G){if(this.depth&&this.arity&&this.nodes[0].length>=this.getMaxLeaves())throw new Error("tree is full");let K=G,ne=this.nodes[0].length;for(let G=0;G<this.depth;G+=1){const ue=ne-ne%this.arity,pe=ue+this.arity,he=[];this.nodes[G][ne]=K;for(let K=ue;K<pe;K+=1)K<this.nodes[G].length?he.push(this.nodes[G][K]):he.push(this.zeroes[G]);K=this.hashFn(he),ne=Math.floor(ne/this.arity)}this.root=K}delete(G){this.update(G,this.zeroValue)}update(G,K){if(G<0||G>=this.nodes[0].length)throw new Error("out of bounds");let ne=K;for(let K=0;K<this.depth;K+=1){const ue=G-G%this.arity,pe=ue+this.arity,he=[];this.nodes[K][G]=ne;for(let G=ue;G<pe;G+=1)G<this.nodes[K].length?he.push(this.nodes[K][G]):he.push(this.zeroes[K]);ne=this.hashFn(he),G=Math.floor(G/this.arity)}this.root=ne}getDepth(){return this.depth}getArity(){return this.arity}getMaxLeaves(){return Math.pow(this.depth,this.arity)}indexOf(G){return this.nodes[0].indexOf(G)}getLeaves(){const G=this.copyList(this.nodes[0]);for(let K=this.nodes[0].length;K<this.getMaxLeaves();K++)G[K]=this.zeroValue;return G}copyList(G){return G.map((G=>BigInt(G)))}getLayers(){const G=[];for(const K of this.nodes)G.push(this.copyList(K));if(G[0].length<this.getMaxLeaves()){let K=G[0].length;for(let ne=K;ne<this.getMaxLeaves();ne++)G[0][ne]=this.zeroValue;for(let ne=0;ne<this.depth;ne++){const ue=K-K%this.arity,pe=ue+this.arity;for(let K=ue;K<pe;K++)K>=G[ne].length&&(G[ne][K]=this.zeroes[ne]);K=Math.floor(K/this.arity)}}return G.push([this.root]),G}getHexLayers(){return this.getLayers().reduce(((G,K)=>(Array.isArray(K)?G.push(K.map((G=>this.bufferToHex(this.bufferify(G))))):G.push(K),G)),[])}getLayersAsObject(){const G=this.getLayers().map((G=>G.map((G=>this.bufferToHex(this.bufferify(G),!1))))),K=[];for(let ne=0;ne<G.length;ne++){const ue=[];for(let pe=0;pe<G[ne].length;pe++){const he={[G[ne][pe]]:null};if(K.length){he[G[ne][pe]]={};const ue=K.shift(),ye=Object.keys(ue)[0];if(he[G[ne][pe]][ye]=ue[ye],K.length){const ue=K.shift(),ye=Object.keys(ue)[0];he[G[ne][pe]][ye]=ue[ye]}}ue.push(he)}K.push(...ue)}return K[0]}computeRoot(){let G,K=this.nodes[0].length;for(let ne=0;ne<this.depth;ne+=1){const ue=K-K%this.arity,pe=ue+this.arity,he=[];for(let G=ue;G<pe;G+=1)G<this.nodes[ne].length?he.push(this.nodes[ne][G]):he.push(this.zeroes[ne]);G=this.hashFn(he),K=Math.floor(K/this.arity)}return G}getProof(G){if(G<0||G>=this.nodes[0].length)throw new Error("The leaf does not exist in this tree");const K=[],ne=[],ue=G;for(let ue=0;ue<this.depth;ue+=1){const pe=G%this.arity,he=G-pe,ye=he+this.arity;ne[ue]=pe,K[ue]=[];for(let ne=he;ne<ye;ne+=1)ne!==G&&(ne<this.nodes[ue].length?K[ue].push(this.nodes[ue][ne]):K[ue].push(this.zeroes[ue]));G=Math.floor(G/this.arity)}return{root:this.root,leaf:this.nodes[0][ue],pathIndices:ne,siblings:K}}verify(G){let K=G.leaf;for(let ne=0;ne<G.siblings.length;ne+=1){const ue=G.siblings[ne].slice();ue.splice(G.pathIndices[ne],0,K),K=this.hashFn(ue)}return G.root===K}toString(){return this.toTreeString()}toTreeString(){const G=this.getLayersAsObject();return vN.default.asTree(G,!0)}}mN.IncrementalMerkleTree=IncrementalMerkleTree,"undefined"!=typeof window&&(window.IncrementalMerkleTree=IncrementalMerkleTree),mN.default=IncrementalMerkleTree;var wN={};Object.defineProperty(wN,"__esModule",{value:!0}),wN.MerkleSumTree=wN.ProofStep=wN.Leaf=wN.Bucket=void 0;const _N=jO;class Bucket{constructor(G,K){this.size=BigInt(G),this.hashed=K,this.parent=null,this.left=null,this.right=null}}wN.Bucket=Bucket;wN.Leaf=class Leaf{constructor(G,K,ne){this.hashFn=G,this.rng=K.map((G=>BigInt(G))),this.data=ne}getBucket(){let G;return G=this.data?this.hashFn(this.data):Buffer.alloc(32),new Bucket(BigInt(this.rng[1])-BigInt(this.rng[0]),G)}};class ProofStep{constructor(G,K){this.bucket=G,this.right=K}}wN.ProofStep=ProofStep;class MerkleSumTree extends _N.Base{constructor(G,K){super(),this.leaves=G,this.hashFn=K,MerkleSumTree.checkConsecutive(G),this.buckets=[];for(const K of G)this.buckets.push(K.getBucket());let ne=[];for(const G of this.buckets)ne.push(G);for(;1!==ne.length;){const G=[];for(;ne.length;)if(ne.length>=2){const K=ne.shift(),ue=ne.shift(),pe=K.size+ue.size,he=this.hashFn(Buffer.concat([this.sizeToBuffer(K.size),this.bufferify(K.hashed),this.sizeToBuffer(ue.size),this.bufferify(ue.hashed)])),ye=new Bucket(pe,he);ue.parent=ye,K.parent=ue.parent,K.right=ue,ue.left=K,G.push(ye)}else G.push(ne.shift());ne=G}this.root=ne[0]}sizeToBuffer(G){const K=Buffer.alloc(8);return new DataView(K.buffer).setBigInt64(0,BigInt(G),!1),K}static checkConsecutive(G){let K=BigInt(0);for(const ne of G){if(ne.rng[0]!==K)throw new Error("leaf ranges are invalid");K=BigInt(ne.rng[1])}}getProof(G){let K=this.buckets[Number(G)];const ne=[];for(;K&&K.parent;){const G=!!K.right,ue=K.right?K.right:K.left;K=K.parent,ne.push(new ProofStep(ue,G))}return ne}sum(G){let K=BigInt(0);for(const ne of G)K+=BigInt(ne);return K}verifyProof(G,K,ne){const ue=[this.sum(ne.filter((G=>!G.right)).map((G=>G.bucket.size))),BigInt(G.size)-this.sum(ne.filter((G=>G.right)).map((G=>G.bucket.size)))];if(ue[0]!==K.rng[0]||ue[1]!==K.rng[1])return!1;let pe,he=K.getBucket();for(const G of ne)pe=G.right?this.hashFn(Buffer.concat([this.sizeToBuffer(he.size),this.bufferify(he.hashed),this.sizeToBuffer(G.bucket.size),this.bufferify(G.bucket.hashed)])):this.hashFn(Buffer.concat([this.sizeToBuffer(G.bucket.size),this.bufferify(G.bucket.hashed),this.sizeToBuffer(he.size),this.bufferify(he.hashed)])),he=new Bucket(BigInt(he.size)+BigInt(G.bucket.size),pe);return he.size===G.size&&he.hashed.toString("hex")===G.hashed.toString("hex")}}wN.MerkleSumTree=MerkleSumTree,"undefined"!=typeof window&&(window.MerkleSumTree=MerkleSumTree),wN.default=MerkleSumTree,function(G){var K=pn&&pn.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(G,"__esModule",{value:!0}),G.MerkleTree=void 0;const ne=K(UO);G.MerkleTree=ne.default;var ue=fN;Object.defineProperty(G,"MerkleMountainRange",{enumerable:!0,get:function(){return ue.MerkleMountainRange}});var pe=mN;Object.defineProperty(G,"IncrementalMerkleTree",{enumerable:!0,get:function(){return pe.IncrementalMerkleTree}});var he=wN;Object.defineProperty(G,"MerkleSumTree",{enumerable:!0,get:function(){return he.MerkleSumTree}}),G.default=ne.default}(LO);var TN={},AN={},EN={},extendStatics=function(G,K){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,K){G.__proto__=K}||function(G,K){for(var ne in K)Object.prototype.hasOwnProperty.call(K,ne)&&(G[ne]=K[ne])},extendStatics(G,K)};function __extends(G,K){if("function"!=typeof K&&null!==K)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function __(){this.constructor=G}extendStatics(G,K),G.prototype=null===K?Object.create(K):(__.prototype=K.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(G){for(var K,ne=1,ue=arguments.length;ne<ue;ne++)for(var pe in K=arguments[ne])Object.prototype.hasOwnProperty.call(K,pe)&&(G[pe]=K[pe]);return G},__assign.apply(this,arguments)};function __rest(G,K){var ne={};for(var ue in G)Object.prototype.hasOwnProperty.call(G,ue)&&K.indexOf(ue)<0&&(ne[ue]=G[ue]);if(null!=G&&"function"==typeof Object.getOwnPropertySymbols){var pe=0;for(ue=Object.getOwnPropertySymbols(G);pe<ue.length;pe++)K.indexOf(ue[pe])<0&&Object.prototype.propertyIsEnumerable.call(G,ue[pe])&&(ne[ue[pe]]=G[ue[pe]])}return ne}function __decorate(G,K,ne,ue){var pe,he=arguments.length,ye=he<3?K:null===ue?ue=Object.getOwnPropertyDescriptor(K,ne):ue;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)ye=Reflect.decorate(G,K,ne,ue);else for(var me=G.length-1;me>=0;me--)(pe=G[me])&&(ye=(he<3?pe(ye):he>3?pe(K,ne,ye):pe(K,ne))||ye);return he>3&&ye&&Object.defineProperty(K,ne,ye),ye}function __param(G,K){return function(ne,ue){K(ne,ue,G)}}function __metadata(G,K){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(G,K)}function __awaiter$4(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))}function __generator(G,K){var ne,ue,pe,he,ye={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return he={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(he[Symbol.iterator]=function(){return this}),he;function verb(me){return function(be){return function step(me){if(ne)throw new TypeError("Generator is already executing.");for(;he&&(he=0,me[0]&&(ye=0)),ye;)try{if(ne=1,ue&&(pe=2&me[0]?ue.return:me[0]?ue.throw||((pe=ue.return)&&pe.call(ue),0):ue.next)&&!(pe=pe.call(ue,me[1])).done)return pe;switch(ue=0,pe&&(me=[2&me[0],pe.value]),me[0]){case 0:case 1:pe=me;break;case 4:return ye.label++,{value:me[1],done:!1};case 5:ye.label++,ue=me[1],me=[0];continue;case 7:me=ye.ops.pop(),ye.trys.pop();continue;default:if(!(pe=ye.trys,(pe=pe.length>0&&pe[pe.length-1])||6!==me[0]&&2!==me[0])){ye=0;continue}if(3===me[0]&&(!pe||me[1]>pe[0]&&me[1]<pe[3])){ye.label=me[1];break}if(6===me[0]&&ye.label<pe[1]){ye.label=pe[1],pe=me;break}if(pe&&ye.label<pe[2]){ye.label=pe[2],ye.ops.push(me);break}pe[2]&&ye.ops.pop(),ye.trys.pop();continue}me=K.call(G,ye)}catch(G){me=[6,G],ue=0}finally{ne=pe=0}if(5&me[0])throw me[1];return{value:me[0]?me[1]:void 0,done:!0}}([me,be])}}}var PN=Object.create?function(G,K,ne,ue){void 0===ue&&(ue=ne);var pe=Object.getOwnPropertyDescriptor(K,ne);pe&&!("get"in pe?!K.__esModule:pe.writable||pe.configurable)||(pe={enumerable:!0,get:function(){return K[ne]}}),Object.defineProperty(G,ue,pe)}:function(G,K,ne,ue){void 0===ue&&(ue=ne),G[ue]=K[ne]};function __exportStar(G,K){for(var ne in G)"default"===ne||Object.prototype.hasOwnProperty.call(K,ne)||PN(K,G,ne)}function __values(G){var K="function"==typeof Symbol&&Symbol.iterator,ne=K&&G[K],ue=0;if(ne)return ne.call(G);if(G&&"number"==typeof G.length)return{next:function(){return G&&ue>=G.length&&(G=void 0),{value:G&&G[ue++],done:!G}}};throw new TypeError(K?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(G,K){var ne="function"==typeof Symbol&&G[Symbol.iterator];if(!ne)return G;var ue,pe,he=ne.call(G),ye=[];try{for(;(void 0===K||K-- >0)&&!(ue=he.next()).done;)ye.push(ue.value)}catch(G){pe={error:G}}finally{try{ue&&!ue.done&&(ne=he.return)&&ne.call(he)}finally{if(pe)throw pe.error}}return ye}function __spread(){for(var G=[],K=0;K<arguments.length;K++)G=G.concat(__read(arguments[K]));return G}function __spreadArrays(){for(var G=0,K=0,ne=arguments.length;K<ne;K++)G+=arguments[K].length;var ue=Array(G),pe=0;for(K=0;K<ne;K++)for(var he=arguments[K],ye=0,me=he.length;ye<me;ye++,pe++)ue[pe]=he[ye];return ue}function __spreadArray(G,K,ne){if(ne||2===arguments.length)for(var ue,pe=0,he=K.length;pe<he;pe++)!ue&&pe in K||(ue||(ue=Array.prototype.slice.call(K,0,pe)),ue[pe]=K[pe]);return G.concat(ue||Array.prototype.slice.call(K))}function __await(G){return this instanceof __await?(this.v=G,this):new __await(G)}function __asyncGenerator(G,K,ne){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var ue,pe=ne.apply(G,K||[]),he=[];return ue={},verb("next"),verb("throw"),verb("return"),ue[Symbol.asyncIterator]=function(){return this},ue;function verb(G){pe[G]&&(ue[G]=function(K){return new Promise((function(ne,ue){he.push([G,K,ne,ue])>1||resume(G,K)}))})}function resume(G,K){try{!function step(G){G.value instanceof __await?Promise.resolve(G.value.v).then(fulfill,reject):settle(he[0][2],G)}(pe[G](K))}catch(G){settle(he[0][3],G)}}function fulfill(G){resume("next",G)}function reject(G){resume("throw",G)}function settle(G,K){G(K),he.shift(),he.length&&resume(he[0][0],he[0][1])}}function __asyncDelegator(G){var K,ne;return K={},verb("next"),verb("throw",(function(G){throw G})),verb("return"),K[Symbol.iterator]=function(){return this},K;function verb(ue,pe){K[ue]=G[ue]?function(K){return(ne=!ne)?{value:__await(G[ue](K)),done:!1}:pe?pe(K):K}:pe}}function __asyncValues(G){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var K,ne=G[Symbol.asyncIterator];return ne?ne.call(G):(G=__values(G),K={},verb("next"),verb("throw"),verb("return"),K[Symbol.asyncIterator]=function(){return this},K);function verb(ne){K[ne]=G[ne]&&function(K){return new Promise((function(ue,pe){(function settle(G,K,ne,ue){Promise.resolve(ue).then((function(K){G({value:K,done:ne})}),K)})(ue,pe,(K=G[ne](K)).done,K.value)}))}}}function __makeTemplateObject(G,K){return Object.defineProperty?Object.defineProperty(G,"raw",{value:K}):G.raw=K,G}var SN=Object.create?function(G,K){Object.defineProperty(G,"default",{enumerable:!0,value:K})}:function(G,K){G.default=K};function __importStar(G){if(G&&G.__esModule)return G;var K={};if(null!=G)for(var ne in G)"default"!==ne&&Object.prototype.hasOwnProperty.call(G,ne)&&PN(K,G,ne);return SN(K,G),K}function __importDefault(G){return G&&G.__esModule?G:{default:G}}function __classPrivateFieldGet(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)}function __classPrivateFieldSet(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne}function __classPrivateFieldIn(G,K){if(null===K||"object"!=typeof K&&"function"!=typeof K)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof G?K===G:G.has(K)}function __addDisposableResource(G,K,ne){if(null!=K){if("object"!=typeof K&&"function"!=typeof K)throw new TypeError("Object expected.");var ue;if(ne){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");ue=K[Symbol.asyncDispose]}if(void 0===ue){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");ue=K[Symbol.dispose]}if("function"!=typeof ue)throw new TypeError("Object not disposable.");G.stack.push({value:K,dispose:ue,async:ne})}else ne&&G.stack.push({async:!0});return K}var IN="function"==typeof SuppressedError?SuppressedError:function(G,K,ne){var ue=new Error(ne);return ue.name="SuppressedError",ue.error=G,ue.suppressed=K,ue};function __disposeResources(G){function fail(K){G.error=G.hasError?new IN(K,G.error,"An error was suppressed during disposal."):K,G.hasError=!0}return function next(){for(;G.stack.length;){var K=G.stack.pop();try{var ne=K.dispose&&K.dispose.call(K.value);if(K.async)return Promise.resolve(ne).then(next,(function(G){return fail(G),next()}))}catch(G){fail(G)}}if(G.hasError)throw G.error}()}var CN,RN={__extends:__extends,__assign:__assign,__rest:__rest,__decorate:__decorate,__param:__param,__metadata:__metadata,__awaiter:__awaiter$4,__generator:__generator,__createBinding:PN,__exportStar:__exportStar,__values:__values,__read:__read,__spread:__spread,__spreadArrays:__spreadArrays,__spreadArray:__spreadArray,__await:__await,__asyncGenerator:__asyncGenerator,__asyncDelegator:__asyncDelegator,__asyncValues:__asyncValues,__makeTemplateObject:__makeTemplateObject,__importStar:__importStar,__importDefault:__importDefault,__classPrivateFieldGet:__classPrivateFieldGet,__classPrivateFieldSet:__classPrivateFieldSet,__classPrivateFieldIn:__classPrivateFieldIn,__addDisposableResource:__addDisposableResource,__disposeResources:__disposeResources},kN=Object.freeze({__proto__:null,__addDisposableResource:__addDisposableResource,get __assign(){return __assign},__asyncDelegator:__asyncDelegator,__asyncGenerator:__asyncGenerator,__asyncValues:__asyncValues,__await:__await,__awaiter:__awaiter$4,__classPrivateFieldGet:__classPrivateFieldGet,__classPrivateFieldIn:__classPrivateFieldIn,__classPrivateFieldSet:__classPrivateFieldSet,__createBinding:PN,__decorate:__decorate,__disposeResources:__disposeResources,__esDecorate:function __esDecorate(G,K,ne,ue,pe,he){function accept(G){if(void 0!==G&&"function"!=typeof G)throw new TypeError("Function expected");return G}for(var ye,me=ue.kind,be="getter"===me?"get":"setter"===me?"set":"value",ve=!K&&G?ue.static?G:G.prototype:null,_e=K||(ve?Object.getOwnPropertyDescriptor(ve,ue.name):{}),Te=!1,Ee=ne.length-1;Ee>=0;Ee--){var Pe={};for(var Se in ue)Pe[Se]="access"===Se?{}:ue[Se];for(var Se in ue.access)Pe.access[Se]=ue.access[Se];Pe.addInitializer=function(G){if(Te)throw new TypeError("Cannot add initializers after decoration has completed");he.push(accept(G||null))};var Ce=(0,ne[Ee])("accessor"===me?{get:_e.get,set:_e.set}:_e[be],Pe);if("accessor"===me){if(void 0===Ce)continue;if(null===Ce||"object"!=typeof Ce)throw new TypeError("Object expected");(ye=accept(Ce.get))&&(_e.get=ye),(ye=accept(Ce.set))&&(_e.set=ye),(ye=accept(Ce.init))&&pe.unshift(ye)}else(ye=accept(Ce))&&("field"===me?pe.unshift(ye):_e[be]=ye)}ve&&Object.defineProperty(ve,ue.name,_e),Te=!0},__exportStar:__exportStar,__extends:__extends,__generator:__generator,__importDefault:__importDefault,__importStar:__importStar,__makeTemplateObject:__makeTemplateObject,__metadata:__metadata,__param:__param,__propKey:function __propKey(G){return"symbol"==typeof G?G:"".concat(G)},__read:__read,__rest:__rest,__runInitializers:function __runInitializers(G,K,ne){for(var ue=arguments.length>2,pe=0;pe<K.length;pe++)ne=ue?K[pe].call(G,ne):K[pe].call(G);return ue?ne:void 0},__setFunctionName:function __setFunctionName(G,K,ne){return"symbol"==typeof K&&(K=K.description?"[".concat(K.description,"]"):""),Object.defineProperty(G,"name",{configurable:!0,value:ne?"".concat(ne," ",K):K})},__spread:__spread,__spreadArray:__spreadArray,__spreadArrays:__spreadArrays,__values:__values,default:RN}),ON=getAugmentedNamespace$1(kN),xN={},NN={};function require_version(){return CN||(CN=1,Object.defineProperty(NN,"__esModule",{value:!0}),NN.version=void 0,NN.version="6.11.1"),NN}var MN,FN,DN,LN={},UN={},$N={},qN={},GN={},jN={},HN={};function requireProperties(){if(MN)return HN;function checkType(G,K,ne){const ue=K.split("|").map((G=>G.trim()));for(let ne=0;ne<ue.length;ne++)switch(K){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof G===K)return}const pe=new Error(`invalid value for type ${K}`);throw pe.code="INVALID_ARGUMENT",pe.argument=`value.${ne}`,pe.value=G,pe}return MN=1,Object.defineProperty(HN,"__esModule",{value:!0}),HN.defineProperties=HN.resolveProperties=void 0,HN.resolveProperties=async function resolveProperties(G){const K=Object.keys(G),ne=await Promise.all(K.map((K=>Promise.resolve(G[K]))));return ne.reduce(((G,ne,ue)=>(G[K[ue]]=ne,G)),{})},HN.defineProperties=function defineProperties(G,K,ne){for(let ue in K){let pe=K[ue];const he=ne?ne[ue]:null;he&&checkType(pe,he,ue),Object.defineProperty(G,ue,{enumerable:!0,value:pe,writable:!1})}},HN}function requireErrors(){if(FN)return jN;FN=1,Object.defineProperty(jN,"__esModule",{value:!0}),jN.assertPrivate=jN.assertNormalize=jN.assertArgumentCount=jN.assertArgument=jN.assert=jN.makeError=jN.isCallException=jN.isError=void 0;const G=require_version(),K=requireProperties();function stringify(G){if(null==G)return"null";if(Array.isArray(G))return"[ "+G.map(stringify).join(", ")+" ]";if(G instanceof Uint8Array){const K="0123456789abcdef";let ne="0x";for(let ue=0;ue<G.length;ue++)ne+=K[G[ue]>>4],ne+=K[15&G[ue]];return ne}if("object"==typeof G&&"function"==typeof G.toJSON)return stringify(G.toJSON());switch(typeof G){case"boolean":case"symbol":case"number":return G.toString();case"bigint":return BigInt(G).toString();case"string":return JSON.stringify(G);case"object":{const K=Object.keys(G);return K.sort(),"{ "+K.map((K=>`${stringify(K)}: ${stringify(G[K])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function isError(G,K){return G&&G.code===K}function makeError(ne,ue,pe){let he,ye=ne;{const K=[];if(pe){if("message"in pe||"code"in pe||"name"in pe)throw new Error(`value will overwrite populated values: ${stringify(pe)}`);for(const G in pe){if("shortMessage"===G)continue;const ne=pe[G];K.push(G+"="+stringify(ne))}}K.push(`code=${ue}`),K.push(`version=${G.version}`),K.length&&(ne+=" ("+K.join(", ")+")")}switch(ue){case"INVALID_ARGUMENT":he=new TypeError(ne);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":he=new RangeError(ne);break;default:he=new Error(ne)}return(0,K.defineProperties)(he,{code:ue}),pe&&Object.assign(he,pe),null==he.shortMessage&&(0,K.defineProperties)(he,{shortMessage:ye}),he}function assert(G,K,ne,ue){if(!G)throw makeError(K,ne,ue)}jN.isError=isError,jN.isCallException=function isCallException(G){return isError(G,"CALL_EXCEPTION")},jN.makeError=makeError,jN.assert=assert,jN.assertArgument=function assertArgument(G,K,ne,ue){assert(G,K,"INVALID_ARGUMENT",{argument:ne,value:ue})},jN.assertArgumentCount=function assertArgumentCount(G,K,ne){null==ne&&(ne=""),ne&&(ne=": "+ne),assert(G>=K,"missing arguemnt"+ne,"MISSING_ARGUMENT",{count:G,expectedCount:K}),assert(G<=K,"too many arguments"+ne,"UNEXPECTED_ARGUMENT",{count:G,expectedCount:K})};const ne=["NFD","NFC","NFKD","NFKC"].reduce(((G,K)=>{try{if("test"!=="test".normalize(K))throw new Error("bad");if("NFD"===K){const G=String.fromCharCode(233).normalize("NFD");if(G!==String.fromCharCode(101,769))throw new Error("broken")}G.push(K)}catch(G){}return G}),[]);return jN.assertNormalize=function assertNormalize(G){assert(ne.indexOf(G)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:G}})},jN.assertPrivate=function assertPrivate(G,K,ne){if(null==ne&&(ne=""),G!==K){let G=ne,K="new";ne&&(G+=".",K+=" "+ne),assert(!1,`private constructor; use ${G}from* methods`,"UNSUPPORTED_OPERATION",{operation:K})}},jN}function requireData(){if(DN)return GN;DN=1,Object.defineProperty(GN,"__esModule",{value:!0}),GN.zeroPadBytes=GN.zeroPadValue=GN.stripZerosLeft=GN.dataSlice=GN.dataLength=GN.concat=GN.hexlify=GN.isBytesLike=GN.isHexString=GN.getBytesCopy=GN.getBytes=void 0;const G=requireErrors();function _getBytes(K,ne,ue){if(K instanceof Uint8Array)return ue?new Uint8Array(K):K;if("string"==typeof K&&K.match(/^0x([0-9a-f][0-9a-f])*$/i)){const G=new Uint8Array((K.length-2)/2);let ne=2;for(let ue=0;ue<G.length;ue++)G[ue]=parseInt(K.substring(ne,ne+2),16),ne+=2;return G}(0,G.assertArgument)(!1,"invalid BytesLike value",ne||"value",K)}function getBytes(G,K){return _getBytes(G,K,!1)}function isHexString(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof K||G.length===2+2*K)&&(!0!==K||G.length%2==0))}GN.getBytes=getBytes,GN.getBytesCopy=function getBytesCopy(G,K){return _getBytes(G,K,!0)},GN.isHexString=isHexString,GN.isBytesLike=function isBytesLike(G){return isHexString(G,!0)||G instanceof Uint8Array};const K="0123456789abcdef";function hexlify(G){const ne=getBytes(G);let ue="0x";for(let G=0;G<ne.length;G++){const pe=ne[G];ue+=K[(240&pe)>>4]+K[15&pe]}return ue}function zeroPad(K,ne,ue){const pe=getBytes(K);(0,G.assert)(ne>=pe.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(pe),length:ne,offset:ne+1});const he=new Uint8Array(ne);return he.fill(0),ue?he.set(pe,ne-pe.length):he.set(pe,0),hexlify(he)}return GN.hexlify=hexlify,GN.concat=function concat(G){return"0x"+G.map((G=>hexlify(G).substring(2))).join("")},GN.dataLength=function dataLength(G){return isHexString(G,!0)?(G.length-2)/2:getBytes(G).length},GN.dataSlice=function dataSlice(K,ne,ue){const pe=getBytes(K);return null!=ue&&ue>pe.length&&(0,G.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:pe,length:pe.length,offset:ue}),hexlify(pe.slice(null==ne?0:ne,null==ue?pe.length:ue))},GN.stripZerosLeft=function stripZerosLeft(G){let K=hexlify(G).substring(2);for(;K.startsWith("00");)K=K.substring(2);return"0x"+K},GN.zeroPadValue=function zeroPadValue(G,K){return zeroPad(G,K,!0)},GN.zeroPadBytes=function zeroPadBytes(G,K){return zeroPad(G,K,!1)},GN}var WN,zN,VN={};function requireMaths(){if(WN)return VN;WN=1,Object.defineProperty(VN,"__esModule",{value:!0}),VN.toQuantity=VN.toBeArray=VN.toBeHex=VN.toNumber=VN.getNumber=VN.toBigInt=VN.getUint=VN.getBigInt=VN.mask=VN.toTwos=VN.fromTwos=void 0;const G=requireData(),K=requireErrors(),ne=BigInt(0),ue=BigInt(1),pe=9007199254740991;function getBigInt(G,ne){switch(typeof G){case"bigint":return G;case"number":return(0,K.assertArgument)(Number.isInteger(G),"underflow",ne||"value",G),(0,K.assertArgument)(G>=-pe&&G<=pe,"overflow",ne||"value",G),BigInt(G);case"string":try{if(""===G)throw new Error("empty string");return"-"===G[0]&&"-"!==G[1]?-BigInt(G.substring(1)):BigInt(G)}catch(ue){(0,K.assertArgument)(!1,`invalid BigNumberish string: ${ue.message}`,ne||"value",G)}}(0,K.assertArgument)(!1,"invalid BigNumberish value",ne||"value",G)}function getUint(G,ue){const pe=getBigInt(G,ue);return(0,K.assert)(pe>=ne,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:G}),pe}VN.fromTwos=function fromTwos(G,pe){const he=getUint(G,"value"),ye=BigInt(getNumber(pe,"width"));if((0,K.assert)(he>>ye===ne,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:G}),he>>ye-ue){return-((~he&(ue<<ye)-ue)+ue)}return he},VN.toTwos=function toTwos(G,pe){let he=getBigInt(G,"value");const ye=BigInt(getNumber(pe,"width")),me=ue<<ye-ue;if(he<ne){he=-he,(0,K.assert)(he<=me,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:G});return(~he&(ue<<ye)-ue)+ue}return(0,K.assert)(he<me,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:G}),he},VN.mask=function mask(G,K){const ne=getUint(G,"value"),pe=BigInt(getNumber(K,"bits"));return ne&(ue<<pe)-ue},VN.getBigInt=getBigInt,VN.getUint=getUint;const he="0123456789abcdef";function toBigInt(G){if(G instanceof Uint8Array){let K="0x0";for(const ne of G)K+=he[ne>>4],K+=he[15&ne];return BigInt(K)}return getBigInt(G)}function getNumber(G,ne){switch(typeof G){case"bigint":return(0,K.assertArgument)(G>=-pe&&G<=pe,"overflow",ne||"value",G),Number(G);case"number":return(0,K.assertArgument)(Number.isInteger(G),"underflow",ne||"value",G),(0,K.assertArgument)(G>=-pe&&G<=pe,"overflow",ne||"value",G),G;case"string":try{if(""===G)throw new Error("empty string");return getNumber(BigInt(G),ne)}catch(ue){(0,K.assertArgument)(!1,`invalid numeric string: ${ue.message}`,ne||"value",G)}}(0,K.assertArgument)(!1,"invalid numeric value",ne||"value",G)}function toBeArray(G){const K=getUint(G,"value");if(K===ne)return new Uint8Array([]);let ue=K.toString(16);ue.length%2&&(ue="0"+ue);const pe=new Uint8Array(ue.length/2);for(let G=0;G<pe.length;G++){const K=2*G;pe[G]=parseInt(ue.substring(K,K+2),16)}return pe}return VN.toBigInt=toBigInt,VN.getNumber=getNumber,VN.toNumber=function toNumber(G){return getNumber(toBigInt(G))},VN.toBeHex=function toBeHex(G,ne){let ue=getUint(G,"value").toString(16);if(null==ne)ue.length%2&&(ue="0"+ue);else{const pe=getNumber(ne,"width");for((0,K.assert)(2*pe>=ue.length,`value exceeds width (${pe} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:G});ue.length<2*pe;)ue="0"+ue}return"0x"+ue},VN.toBeArray=toBeArray,VN.toQuantity=function toQuantity(K){let ne=(0,G.hexlify)((0,G.isBytesLike)(K)?K:toBeArray(K)).substring(2);for(;ne.startsWith("0");)ne=ne.substring(1);return""===ne&&(ne="0"),"0x"+ne},VN}var KN,JN={};function requireBase64Browser(){if(KN)return JN;KN=1,Object.defineProperty(JN,"__esModule",{value:!0}),JN.encodeBase64=JN.decodeBase64=void 0;const G=requireData();return JN.decodeBase64=function decodeBase64(K){K=atob(K);const ne=new Uint8Array(K.length);for(let G=0;G<K.length;G++)ne[G]=K.charCodeAt(G);return(0,G.getBytes)(ne)},JN.encodeBase64=function encodeBase64(K){const ne=(0,G.getBytes)(K);let ue="";for(let G=0;G<ne.length;G++)ue+=String.fromCharCode(ne[G]);return btoa(ue)},JN}var XN,QN={};var ZN,YN={},eM={};function requireUtf8(){return ZN||(ZN=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.toUtf8CodePoints=G.toUtf8String=G.toUtf8Bytes=G.Utf8ErrorFuncs=void 0;const K=requireData(),ne=requireErrors();function ignoreFunc(G,K,ne,ue,pe){if("BAD_PREFIX"===G||"UNEXPECTED_CONTINUE"===G){let G=0;for(let ue=K+1;ue<ne.length&&ne[ue]>>6==2;ue++)G++;return G}return"OVERRUN"===G?ne.length-K-1:0}function getUtf8CodePoints(ne,ue){null==ue&&(ue=G.Utf8ErrorFuncs.error);const pe=(0,K.getBytes)(ne,"bytes"),he=[];let ye=0;for(;ye<pe.length;){const G=pe[ye++];if(G>>7==0){he.push(G);continue}let K=null,ne=null;if(192==(224&G))K=1,ne=127;else if(224==(240&G))K=2,ne=2047;else{if(240!=(248&G)){ye+=ue(128==(192&G)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",ye-1,pe,he);continue}K=3,ne=65535}if(ye-1+K>=pe.length){ye+=ue("OVERRUN",ye-1,pe,he);continue}let me=G&(1<<8-K-1)-1;for(let G=0;G<K;G++){let G=pe[ye];if(128!=(192&G)){ye+=ue("MISSING_CONTINUE",ye,pe,he),me=null;break}me=me<<6|63&G,ye++}null!==me&&(me>1114111?ye+=ue("OUT_OF_RANGE",ye-1-K,pe,he,me):me>=55296&&me<=57343?ye+=ue("UTF16_SURROGATE",ye-1-K,pe,he,me):me<=ne?ye+=ue("OVERLONG",ye-1-K,pe,he,me):he.push(me))}return he}function toUtf8Bytes(G,K){(0,ne.assertArgument)("string"==typeof G,"invalid string value","str",G),null!=K&&((0,ne.assertNormalize)(K),G=G.normalize(K));let ue=[];for(let K=0;K<G.length;K++){const pe=G.charCodeAt(K);if(pe<128)ue.push(pe);else if(pe<2048)ue.push(pe>>6|192),ue.push(63&pe|128);else if(55296==(64512&pe)){K++;const he=G.charCodeAt(K);(0,ne.assertArgument)(K<G.length&&56320==(64512&he),"invalid surrogate pair","str",G);const ye=65536+((1023&pe)<<10)+(1023&he);ue.push(ye>>18|240),ue.push(ye>>12&63|128),ue.push(ye>>6&63|128),ue.push(63&ye|128)}else ue.push(pe>>12|224),ue.push(pe>>6&63|128),ue.push(63&pe|128)}return new Uint8Array(ue)}G.Utf8ErrorFuncs=Object.freeze({error:function errorFunc(G,K,ue,pe,he){(0,ne.assertArgument)(!1,`invalid codepoint at offset ${K}; ${G}`,"bytes",ue)},ignore:ignoreFunc,replace:function replaceFunc(G,K,ue,pe,he){return"OVERLONG"===G?((0,ne.assertArgument)("number"==typeof he,"invalid bad code point for replacement","badCodepoint",he),pe.push(he),0):(pe.push(65533),ignoreFunc(G,K,ue))}}),G.toUtf8Bytes=toUtf8Bytes,G.toUtf8String=function toUtf8String(G,K){return function _toUtf8String(G){return G.map((G=>G<=65535?String.fromCharCode(G):(G-=65536,String.fromCharCode(55296+(G>>10&1023),56320+(1023&G))))).join("")}(getUtf8CodePoints(G,K))},G.toUtf8CodePoints=function toUtf8CodePoints(G,K){return getUtf8CodePoints(toUtf8Bytes(G,K))}}(eM)),eM}var tM,rM,nM={};function requireFetch(){if(rM)return YN;rM=1,Object.defineProperty(YN,"__esModule",{value:!0}),YN.FetchResponse=YN.FetchRequest=YN.FetchCancelSignal=void 0;const G=requireBase64Browser(),K=requireData(),ne=requireErrors(),ue=requireProperties(),pe=requireUtf8(),he=function requireGeturlBrowser(){if(tM)return nM;tM=1,Object.defineProperty(nM,"__esModule",{value:!0}),nM.getUrl=nM.createGetUrl=void 0;const G=requireErrors();function createGetUrl(K){return async function getUrl(K,ne){const ue=K.url.split(":")[0].toLowerCase();let pe;if((0,G.assert)("http"===ue||"https"===ue,`unsupported protocol ${ue}`,"UNSUPPORTED_OPERATION",{info:{protocol:ue},operation:"request"}),(0,G.assert)("https"===ue||!K.credentials||K.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"}),ne){const G=new AbortController;pe=G.signal,ne.addListener((()=>{G.abort()}))}const he={method:K.method,headers:new Headers(Array.from(K)),body:K.body||void 0,signal:pe},ye=await fetch(K.url,he),me={};ye.headers.forEach(((G,K)=>{me[K.toLowerCase()]=G}));const be=await ye.arrayBuffer(),ve=null==be?null:new Uint8Array(be);return{statusCode:ye.status,statusMessage:ye.statusText,headers:me,body:ve}}}nM.createGetUrl=createGetUrl;const K=createGetUrl();return nM.getUrl=async function getUrl(G,ne){return K(G,ne)},nM}();let ye=(0,he.createGetUrl)();const me=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),be=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let ve=!1;async function dataGatewayFunc(K,ne){try{const ne=K.match(me);if(!ne)throw new Error("invalid data");return new FetchResponse(200,"OK",{"content-type":ne[1]||"text/plain"},ne[2]?(0,G.decodeBase64)(ne[3]):function unpercent(G){return(0,pe.toUtf8Bytes)(G.replace(/%([0-9a-f][0-9a-f])/gi,((G,K)=>String.fromCharCode(parseInt(K,16)))))}(ne[3]))}catch(G){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(K))}}function getIpfsGatewayFunc(G){return async function gatewayIpfs(K,ne){try{const ne=K.match(be);if(!ne)throw new Error("invalid link");return new FetchRequest(`${G}${ne[2]}`)}catch(G){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(K))}}}const _e={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")},Te=new WeakMap;var Ee=new WeakMap,Pe=new WeakMap;class FetchCancelSignal{constructor(G){_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0),_classPrivateFieldSet2(Ee,this,[]),_classPrivateFieldSet2(Pe,this,!1),Te.set(G,(()=>{if(!_classPrivateFieldGet2(Pe,this)){_classPrivateFieldSet2(Pe,this,!0);for(const G of _classPrivateFieldGet2(Ee,this))setTimeout((()=>{G()}),0);_classPrivateFieldSet2(Ee,this,[])}}))}addListener(G){(0,ne.assert)(!_classPrivateFieldGet2(Pe,this),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),_classPrivateFieldGet2(Ee,this).push(G)}get cancelled(){return _classPrivateFieldGet2(Pe,this)}checkSignal(){(0,ne.assert)(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(G){if(null==G)throw new Error("missing signal; should not happen");return G.checkSignal(),G}YN.FetchCancelSignal=FetchCancelSignal;var Se=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Be=new WeakMap,Fe=new WeakMap,De=new WeakMap,Le=new WeakMap,Ue=new WeakMap,je=new WeakMap,ze=new WeakMap,Je=new WeakMap,Xe=new WeakSet;class FetchRequest{get url(){return _classPrivateFieldGet2(Ne,this)}set url(G){_classPrivateFieldSet2(Ne,this,String(G))}get body(){return null==_classPrivateFieldGet2(Me,this)?null:new Uint8Array(_classPrivateFieldGet2(Me,this))}set body(G){if(null==G)_classPrivateFieldSet2(Me,this,void 0),_classPrivateFieldSet2(Be,this,void 0);else if("string"==typeof G)_classPrivateFieldSet2(Me,this,(0,pe.toUtf8Bytes)(G)),_classPrivateFieldSet2(Be,this,"text/plain");else if(G instanceof Uint8Array)_classPrivateFieldSet2(Me,this,G),_classPrivateFieldSet2(Be,this,"application/octet-stream");else{if("object"!=typeof G)throw new Error("invalid body");_classPrivateFieldSet2(Me,this,(0,pe.toUtf8Bytes)(JSON.stringify(G))),_classPrivateFieldSet2(Be,this,"application/json")}}hasBody(){return null!=_classPrivateFieldGet2(Me,this)}get method(){return _classPrivateFieldGet2(Oe,this)?_classPrivateFieldGet2(Oe,this):this.hasBody()?"POST":"GET"}set method(G){null==G&&(G=""),_classPrivateFieldSet2(Oe,this,String(G).toUpperCase())}get headers(){const K=Object.assign({},_classPrivateFieldGet2(ke,this));return _classPrivateFieldGet2(Fe,this)&&(K.authorization=`Basic ${(0,G.encodeBase64)((0,pe.toUtf8Bytes)(_classPrivateFieldGet2(Fe,this)))}`),this.allowGzip&&(K["accept-encoding"]="gzip"),null==K["content-type"]&&_classPrivateFieldGet2(Be,this)&&(K["content-type"]=_classPrivateFieldGet2(Be,this)),this.body&&(K["content-length"]=String(this.body.length)),K}getHeader(G){return this.headers[G.toLowerCase()]}setHeader(G,K){_classPrivateFieldGet2(ke,this)[String(G).toLowerCase()]=String(K)}clearHeaders(){_classPrivateFieldSet2(ke,this,{})}[Symbol.iterator](){const G=this.headers,K=Object.keys(G);let ne=0;return{next:()=>{if(ne<K.length){const ue=K[ne++];return{value:[ue,G[ue]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return _classPrivateFieldGet2(Fe,this)||null}setCredentials(G,K){(0,ne.assertArgument)(!G.match(/:/),"invalid basic authentication username","username","[REDACTED]"),_classPrivateFieldSet2(Fe,this,`${G}:${K}`)}get allowGzip(){return _classPrivateFieldGet2(Ce,this)}set allowGzip(G){_classPrivateFieldSet2(Ce,this,!!G)}get allowInsecureAuthentication(){return!!_classPrivateFieldGet2(Se,this)}set allowInsecureAuthentication(G){_classPrivateFieldSet2(Se,this,!!G)}get timeout(){return _classPrivateFieldGet2(xe,this)}set timeout(G){(0,ne.assertArgument)(G>=0,"timeout must be non-zero","timeout",G),_classPrivateFieldSet2(xe,this,G)}get preflightFunc(){return _classPrivateFieldGet2(De,this)||null}set preflightFunc(G){_classPrivateFieldSet2(De,this,G)}get processFunc(){return _classPrivateFieldGet2(Le,this)||null}set processFunc(G){_classPrivateFieldSet2(Le,this,G)}get retryFunc(){return _classPrivateFieldGet2(Ue,this)||null}set retryFunc(G){_classPrivateFieldSet2(Ue,this,G)}get getUrlFunc(){return _classPrivateFieldGet2(Je,this)||ye}set getUrlFunc(G){_classPrivateFieldSet2(Je,this,G)}constructor(G){_classPrivateMethodInitSpec(this,Xe),_classPrivateFieldInitSpec(this,Se,void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldInitSpec(this,xe,void 0),_classPrivateFieldInitSpec(this,Ne,void 0),_classPrivateFieldInitSpec(this,Me,void 0),_classPrivateFieldInitSpec(this,Be,void 0),_classPrivateFieldInitSpec(this,Fe,void 0),_classPrivateFieldInitSpec(this,De,void 0),_classPrivateFieldInitSpec(this,Le,void 0),_classPrivateFieldInitSpec(this,Ue,void 0),_classPrivateFieldInitSpec(this,je,void 0),_classPrivateFieldInitSpec(this,ze,void 0),_classPrivateFieldInitSpec(this,Je,void 0),_classPrivateFieldSet2(Ne,this,String(G)),_classPrivateFieldSet2(Se,this,!1),_classPrivateFieldSet2(Ce,this,!0),_classPrivateFieldSet2(ke,this,{}),_classPrivateFieldSet2(Oe,this,""),_classPrivateFieldSet2(xe,this,3e5),_classPrivateFieldSet2(ze,this,{slotInterval:250,maxAttempts:12}),_classPrivateFieldSet2(Je,this,null)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${_classPrivateFieldGet2(Me,this)?(0,K.hexlify)(_classPrivateFieldGet2(Me,this)):"null"}>`}setThrottleParams(G){null!=G.slotInterval&&(_classPrivateFieldGet2(ze,this).slotInterval=G.slotInterval),null!=G.maxAttempts&&(_classPrivateFieldGet2(ze,this).maxAttempts=G.maxAttempts)}send(){return(0,ne.assert)(null==_classPrivateFieldGet2(je,this),"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),_classPrivateFieldSet2(je,this,new FetchCancelSignal(this)),_assertClassBrand(Xe,this,_send).call(this,0,getTime()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){(0,ne.assert)(null!=_classPrivateFieldGet2(je,this),"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const G=Te.get(this);if(!G)throw new Error("missing signal; should not happen");G()}redirect(G){const K=this.url.split(":")[0].toLowerCase(),ue=G.split(":")[0].toLowerCase();(0,ne.assert)("GET"===this.method&&("https"!==K||"http"!==ue)&&G.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(G)})`});const pe=new FetchRequest(G);return pe.method="GET",pe.allowGzip=this.allowGzip,pe.timeout=this.timeout,_classPrivateFieldSet2(ke,pe,Object.assign({},_classPrivateFieldGet2(ke,this))),_classPrivateFieldGet2(Me,this)&&_classPrivateFieldSet2(Me,pe,new Uint8Array(_classPrivateFieldGet2(Me,this))),_classPrivateFieldSet2(Be,pe,_classPrivateFieldGet2(Be,this)),pe}clone(){const G=new FetchRequest(this.url);return _classPrivateFieldSet2(Oe,G,_classPrivateFieldGet2(Oe,this)),_classPrivateFieldGet2(Me,this)&&_classPrivateFieldSet2(Me,G,_classPrivateFieldGet2(Me,this)),_classPrivateFieldSet2(Be,G,_classPrivateFieldGet2(Be,this)),_classPrivateFieldSet2(ke,G,Object.assign({},_classPrivateFieldGet2(ke,this))),_classPrivateFieldSet2(Fe,G,_classPrivateFieldGet2(Fe,this)),this.allowGzip&&(G.allowGzip=!0),G.timeout=this.timeout,this.allowInsecureAuthentication&&(G.allowInsecureAuthentication=!0),_classPrivateFieldSet2(De,G,_classPrivateFieldGet2(De,this)),_classPrivateFieldSet2(Le,G,_classPrivateFieldGet2(Le,this)),_classPrivateFieldSet2(Ue,G,_classPrivateFieldGet2(Ue,this)),_classPrivateFieldSet2(Je,G,_classPrivateFieldGet2(Je,this)),G}static lockConfig(){ve=!0}static getGateway(G){return _e[G.toLowerCase()]||null}static registerGateway(G,K){if("http"===(G=G.toLowerCase())||"https"===G)throw new Error(`cannot intercept ${G}; use registerGetUrl`);if(ve)throw new Error("gateways locked");_e[G]=K}static registerGetUrl(G){if(ve)throw new Error("gateways locked");ye=G}static createGetUrlFunc(G){return(0,he.createGetUrl)(G)}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(G){return getIpfsGatewayFunc(G)}}async function _send(G,K,ue,pe,he){if(G>=_classPrivateFieldGet2(ze,this).maxAttempts)return he.makeServerError("exceeded maximum retry limit");(0,ne.assert)(getTime()<=K,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:pe}),ue>0&&await function wait(G){return new Promise((K=>setTimeout(K,G)))}(ue);let ye=this.clone();const me=(ye.url.split(":")[0]||"").toLowerCase();if(me in _e){const G=await _e[me](ye.url,checkSignal(_classPrivateFieldGet2(je,pe)));if(G instanceof FetchResponse){let K=G;if(this.processFunc){checkSignal(_classPrivateFieldGet2(je,pe));try{K=await this.processFunc(ye,K)}catch(G){null!=G.throttle&&"number"==typeof G.stall||K.makeServerError("error in post-processing function",G).assertOk()}}return K}ye=G}this.preflightFunc&&(ye=await this.preflightFunc(ye));const be=await this.getUrlFunc(ye,checkSignal(_classPrivateFieldGet2(je,pe)));let ve=new FetchResponse(be.statusCode,be.statusMessage,be.headers,be.body,pe);if(301===ve.statusCode||302===ve.statusCode){try{var Te;const ne=ve.headers.location||"";return _assertClassBrand(Xe,Te=ye.redirect(ne),_send).call(Te,G+1,K,0,pe,ve)}catch(G){}return ve}if(429===ve.statusCode&&(null==this.retryFunc||await this.retryFunc(ye,ve,G))){var Ee;const ne=ve.headers["retry-after"];let ue=_classPrivateFieldGet2(ze,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,G));return"string"==typeof ne&&ne.match(/^[1-9][0-9]*$/)&&(ue=parseInt(ne)),_assertClassBrand(Xe,Ee=ye.clone(),_send).call(Ee,G+1,K,ue,pe,ve)}if(this.processFunc){checkSignal(_classPrivateFieldGet2(je,pe));try{ve=await this.processFunc(ye,ve)}catch(ne){var Pe;null!=ne.throttle&&"number"==typeof ne.stall||ve.makeServerError("error in post-processing function",ne).assertOk();let ue=_classPrivateFieldGet2(ze,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,G));return ne.stall>=0&&(ue=ne.stall),_assertClassBrand(Xe,Pe=ye.clone(),_send).call(Pe,G+1,K,ue,pe,ve)}}return ve}YN.FetchRequest=FetchRequest;var Qe=new WeakMap,Ye=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,nt=new WeakMap;class FetchResponse{toString(){return`<FetchResponse status=${this.statusCode} body=${_classPrivateFieldGet2(tt,this)?(0,K.hexlify)(_classPrivateFieldGet2(tt,this)):"null"}>`}get statusCode(){return _classPrivateFieldGet2(Qe,this)}get statusMessage(){return _classPrivateFieldGet2(Ye,this)}get headers(){return Object.assign({},_classPrivateFieldGet2(et,this))}get body(){return null==_classPrivateFieldGet2(tt,this)?null:new Uint8Array(_classPrivateFieldGet2(tt,this))}get bodyText(){try{return null==_classPrivateFieldGet2(tt,this)?"":(0,pe.toUtf8String)(_classPrivateFieldGet2(tt,this))}catch(G){(0,ne.assert)(!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(G){(0,ne.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const G=this.headers,K=Object.keys(G);let ne=0;return{next:()=>{if(ne<K.length){const ue=K[ne++];return{value:[ue,G[ue]],done:!1}}return{value:void 0,done:!0}}}}constructor(G,K,ne,ue,pe){_classPrivateFieldInitSpec(this,Qe,void 0),_classPrivateFieldInitSpec(this,Ye,void 0),_classPrivateFieldInitSpec(this,et,void 0),_classPrivateFieldInitSpec(this,tt,void 0),_classPrivateFieldInitSpec(this,rt,void 0),_classPrivateFieldInitSpec(this,nt,void 0),_classPrivateFieldSet2(Qe,this,G),_classPrivateFieldSet2(Ye,this,K),_classPrivateFieldSet2(et,this,Object.keys(ne).reduce(((G,K)=>(G[K.toLowerCase()]=String(ne[K]),G)),{})),_classPrivateFieldSet2(tt,this,null==ue?null:new Uint8Array(ue)),_classPrivateFieldSet2(rt,this,pe||null),_classPrivateFieldSet2(nt,this,{message:""})}makeServerError(G,K){let ne;ne=G?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${G})`:`CLIENT ESCALATED SERVER ERROR (${G=`${this.statusCode} ${this.statusMessage}`})`;const ue=new FetchResponse(599,ne,this.headers,this.body,_classPrivateFieldGet2(rt,this)||void 0);return _classPrivateFieldSet2(nt,ue,{message:G,error:K}),ue}throwThrottleError(G,K){null==K?K=-1:(0,ne.assertArgument)(Number.isInteger(K)&&K>=0,"invalid stall timeout","stall",K);const pe=new Error(G||"throttling requests");throw(0,ue.defineProperties)(pe,{stall:K,throttle:!0}),pe}getHeader(G){return this.headers[G.toLowerCase()]}hasBody(){return null!=_classPrivateFieldGet2(tt,this)}get request(){return _classPrivateFieldGet2(rt,this)}ok(){return""===_classPrivateFieldGet2(nt,this).message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:G,error:K}=_classPrivateFieldGet2(nt,this);""===G&&(G=`server response ${this.statusCode} ${this.statusMessage}`);let ue=null;this.request&&(ue=this.request.url);let he=null;try{_classPrivateFieldGet2(tt,this)&&(he=(0,pe.toUtf8String)(_classPrivateFieldGet2(tt,this)))}catch(G){}(0,ne.assert)(!1,G,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:K,info:{requestUrl:ue,responseBody:he,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function getTime(){return(new Date).getTime()}return YN.FetchResponse=FetchResponse,YN}var aM,iM={};function requireFixednumber(){var G;if(aM)return iM;aM=1,Object.defineProperty(iM,"__esModule",{value:!0}),iM.FixedNumber=void 0;const K=requireData(),ne=requireErrors(),ue=requireMaths(),pe=requireProperties(),he=BigInt(-1),ye=BigInt(0),me=BigInt(1),be=BigInt(5),ve={};let _e="0000";for(;_e.length<80;)_e+=_e;function getTens(G){let K=_e;for(;K.length<G;)K+=K;return BigInt("1"+K.substring(0,G))}function checkValue(G,K,pe){const he=BigInt(K.width);if(K.signed){const K=me<<he-me;(0,ne.assert)(null==pe||G>=-K&&G<K,"overflow","NUMERIC_FAULT",{operation:pe,fault:"overflow",value:G}),G=G>ye?(0,ue.fromTwos)((0,ue.mask)(G,he),he):-(0,ue.fromTwos)((0,ue.mask)(-G,he),he)}else{const K=me<<he;(0,ne.assert)(null==pe||G>=0&&G<K,"overflow","NUMERIC_FAULT",{operation:pe,fault:"overflow",value:G}),G=(G%K+K)%K&K-me}return G}function getFormat(G){"number"==typeof G&&(G=`fixed128x${G}`);let K=!0,ue=128,pe=18;if("string"==typeof G)if("fixed"===G);else if("ufixed"===G)K=!1;else{const he=G.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,ne.assertArgument)(he,"invalid fixed format","format",G),K="u"!==he[1],ue=parseInt(he[2]),pe=parseInt(he[3])}else if(G){const he=G,check=(G,K,ue)=>null==he[G]?ue:((0,ne.assertArgument)(typeof he[G]===K,"invalid fixed format ("+G+" not "+K+")","format."+G,he[G]),he[G]);K=check("signed","boolean",K),ue=check("width","number",ue),pe=check("decimals","number",pe)}(0,ne.assertArgument)(ue%8==0,"invalid FixedNumber width (not byte aligned)","format.width",ue),(0,ne.assertArgument)(pe<=80,"invalid FixedNumber decimals (too large)","format.decimals",pe);return{signed:K,width:ue,decimals:pe,name:(K?"":"u")+"fixed"+String(ue)+"x"+String(pe)}}var Te=new WeakMap,Ee=new WeakMap,Pe=new WeakMap,Se=new WeakSet;class FixedNumber{constructor(G,K,ue){_classPrivateMethodInitSpec(this,Se),_defineProperty(this,"format",void 0),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0),_defineProperty(this,"_value",void 0),(0,ne.assertPrivate)(G,ve,"FixedNumber"),_classPrivateFieldSet2(Ee,this,K),_classPrivateFieldSet2(Te,this,ue);const me=function toString(G,K){let ne="";G<ye&&(ne="-",G*=he);let ue=G.toString();if(0===K)return ne+ue;for(;ue.length<=K;)ue=_e+ue;const pe=ue.length-K;for(ue=ue.substring(0,pe)+"."+ue.substring(pe);"0"===ue[0]&&"."!==ue[1];)ue=ue.substring(1);for(;"0"===ue[ue.length-1]&&"."!==ue[ue.length-2];)ue=ue.substring(0,ue.length-1);return ne+ue}(K,ue.decimals);(0,pe.defineProperties)(this,{format:ue.name,_value:me}),_classPrivateFieldSet2(Pe,this,getTens(ue.decimals))}get signed(){return _classPrivateFieldGet2(Te,this).signed}get width(){return _classPrivateFieldGet2(Te,this).width}get decimals(){return _classPrivateFieldGet2(Te,this).decimals}get value(){return _classPrivateFieldGet2(Ee,this)}addUnsafe(G){return _assertClassBrand(Se,this,_add).call(this,G)}add(G){return _assertClassBrand(Se,this,_add).call(this,G,"add")}subUnsafe(G){return _assertClassBrand(Se,this,_sub).call(this,G)}sub(G){return _assertClassBrand(Se,this,_sub).call(this,G,"sub")}mulUnsafe(G){return _assertClassBrand(Se,this,_mul).call(this,G)}mul(G){return _assertClassBrand(Se,this,_mul).call(this,G,"mul")}mulSignal(G){_assertClassBrand(Se,this,_checkFormat).call(this,G);const K=_classPrivateFieldGet2(Ee,this)*_classPrivateFieldGet2(Ee,G);return(0,ne.assert)(K%_classPrivateFieldGet2(Pe,this)===ye,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),_assertClassBrand(Se,this,_checkValue).call(this,K/_classPrivateFieldGet2(Pe,this),"mulSignal")}divUnsafe(G){return _assertClassBrand(Se,this,_div).call(this,G)}div(G){return _assertClassBrand(Se,this,_div).call(this,G,"div")}divSignal(G){(0,ne.assert)(_classPrivateFieldGet2(Ee,G)!==ye,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),_assertClassBrand(Se,this,_checkFormat).call(this,G);const K=_classPrivateFieldGet2(Ee,this)*_classPrivateFieldGet2(Pe,this);return(0,ne.assert)(K%_classPrivateFieldGet2(Ee,G)===ye,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),_assertClassBrand(Se,this,_checkValue).call(this,K/_classPrivateFieldGet2(Ee,G),"divSignal")}cmp(G){let K=this.value,ne=G.value;const ue=this.decimals-G.decimals;return ue>0?ne*=getTens(ue):ue<0&&(K*=getTens(-ue)),K<ne?-1:K>ne?1:0}eq(G){return 0===this.cmp(G)}lt(G){return this.cmp(G)<0}lte(G){return this.cmp(G)<=0}gt(G){return this.cmp(G)>0}gte(G){return this.cmp(G)>=0}floor(){let G=_classPrivateFieldGet2(Ee,this);return _classPrivateFieldGet2(Ee,this)<ye&&(G-=_classPrivateFieldGet2(Pe,this)-me),G=_classPrivateFieldGet2(Ee,this)/_classPrivateFieldGet2(Pe,this)*_classPrivateFieldGet2(Pe,this),_assertClassBrand(Se,this,_checkValue).call(this,G,"floor")}ceiling(){let G=_classPrivateFieldGet2(Ee,this);return _classPrivateFieldGet2(Ee,this)>ye&&(G+=_classPrivateFieldGet2(Pe,this)-me),G=_classPrivateFieldGet2(Ee,this)/_classPrivateFieldGet2(Pe,this)*_classPrivateFieldGet2(Pe,this),_assertClassBrand(Se,this,_checkValue).call(this,G,"ceiling")}round(G){if(null==G&&(G=0),G>=this.decimals)return this;const K=this.decimals-G,ne=be*getTens(K-1);let ue=this.value+ne;const pe=getTens(K);return ue=ue/pe*pe,checkValue(ue,_classPrivateFieldGet2(Te,this),"round"),new FixedNumber(ve,ue,_classPrivateFieldGet2(Te,this))}isZero(){return _classPrivateFieldGet2(Ee,this)===ye}isNegative(){return _classPrivateFieldGet2(Ee,this)<ye}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(G){return FixedNumber.fromString(this.toString(),G)}static fromValue(G,K,pe){const he=null==K?0:(0,ue.getNumber)(K),me=getFormat(pe);let be=(0,ue.getBigInt)(G,"value");const _e=he-me.decimals;if(_e>0){const K=getTens(_e);(0,ne.assert)(be%K===ye,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:G}),be/=K}else _e<0&&(be*=getTens(-_e));return checkValue(be,me,"fromValue"),new FixedNumber(ve,be,me)}static fromString(G,K){const ue=G.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,ne.assertArgument)(ue&&ue[2].length+ue[3].length>0,"invalid FixedNumber string value","value",G);const pe=getFormat(K);let he=ue[2]||"0",ye=ue[3]||"";for(;ye.length<pe.decimals;)ye+=_e;(0,ne.assert)(ye.substring(pe.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:G}),ye=ye.substring(0,pe.decimals);const me=BigInt(ue[1]+he+ye);return checkValue(me,pe,"fromString"),new FixedNumber(ve,me,pe)}static fromBytes(G,ne){let pe=(0,ue.toBigInt)((0,K.getBytes)(G,"value"));const he=getFormat(ne);return he.signed&&(pe=(0,ue.fromTwos)(pe,he.width)),checkValue(pe,he,"fromBytes"),new FixedNumber(ve,pe,he)}}function _checkFormat(G){(0,ne.assertArgument)(this.format===G.format,"incompatible format; use fixedNumber.toFormat","other",G)}function _checkValue(K,ne){return K=checkValue(K,_classPrivateFieldGet2(Te,this),ne),new G(ve,K,_classPrivateFieldGet2(Te,this))}function _add(G,K){return _assertClassBrand(Se,this,_checkFormat).call(this,G),_assertClassBrand(Se,this,_checkValue).call(this,_classPrivateFieldGet2(Ee,this)+_classPrivateFieldGet2(Ee,G),K)}function _sub(G,K){return _assertClassBrand(Se,this,_checkFormat).call(this,G),_assertClassBrand(Se,this,_checkValue).call(this,_classPrivateFieldGet2(Ee,this)-_classPrivateFieldGet2(Ee,G),K)}function _mul(G,K){return _assertClassBrand(Se,this,_checkFormat).call(this,G),_assertClassBrand(Se,this,_checkValue).call(this,_classPrivateFieldGet2(Ee,this)*_classPrivateFieldGet2(Ee,G)/_classPrivateFieldGet2(Pe,this),K)}function _div(G,K){return(0,ne.assert)(_classPrivateFieldGet2(Ee,G)!==ye,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),_assertClassBrand(Se,this,_checkFormat).call(this,G),_assertClassBrand(Se,this,_checkValue).call(this,_classPrivateFieldGet2(Ee,this)*_classPrivateFieldGet2(Pe,this)/_classPrivateFieldGet2(Ee,G),K)}return G=FixedNumber,iM.FixedNumber=FixedNumber,iM}var sM,oM={};var cM,dM={};function requireRlpEncode(){if(cM)return dM;cM=1,Object.defineProperty(dM,"__esModule",{value:!0}),dM.encodeRlp=void 0;const G=requireData();function arrayifyInteger(G){const K=[];for(;G;)K.unshift(255&G),G>>=8;return K}function _encode(K){if(Array.isArray(K)){let G=[];if(K.forEach((function(K){G=G.concat(_encode(K))})),G.length<=55)return G.unshift(192+G.length),G;const ne=arrayifyInteger(G.length);return ne.unshift(247+ne.length),ne.concat(G)}const ne=Array.prototype.slice.call((0,G.getBytes)(K,"object"));if(1===ne.length&&ne[0]<=127)return ne;if(ne.length<=55)return ne.unshift(128+ne.length),ne;const ue=arrayifyInteger(ne.length);return ue.unshift(183+ue.length),ue.concat(ne)}const K="0123456789abcdef";return dM.encodeRlp=function encodeRlp(G){let ne="0x";for(const ue of _encode(G))ne+=K[ue>>4],ne+=K[15&ue];return ne},dM}var uM,fM={};var lM,pM,hM={};function requireUtils$4(){return pM||(pM=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.toUtf8String=G.toUtf8CodePoints=G.toUtf8Bytes=G.parseUnits=G.formatUnits=G.parseEther=G.formatEther=G.encodeRlp=G.decodeRlp=G.defineProperties=G.resolveProperties=G.toQuantity=G.toBeArray=G.toBeHex=G.toNumber=G.toBigInt=G.getUint=G.getNumber=G.getBigInt=G.mask=G.toTwos=G.fromTwos=G.FixedNumber=G.FetchCancelSignal=G.FetchResponse=G.FetchRequest=G.EventPayload=G.makeError=G.assertNormalize=G.assertPrivate=G.assertArgumentCount=G.assertArgument=G.assert=G.isError=G.isCallException=G.zeroPadBytes=G.zeroPadValue=G.stripZerosLeft=G.dataSlice=G.dataLength=G.concat=G.hexlify=G.isBytesLike=G.isHexString=G.getBytesCopy=G.getBytes=G.encodeBase64=G.decodeBase64=G.encodeBase58=G.decodeBase58=void 0,G.uuidV4=G.Utf8ErrorFuncs=void 0;var K=function requireBase58(){if(zN)return qN;zN=1,Object.defineProperty(qN,"__esModule",{value:!0}),qN.decodeBase58=qN.encodeBase58=void 0;const G=requireData(),K=requireErrors(),ne=requireMaths(),ue="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let pe=null;function getAlpha(G){if(null==pe){pe={};for(let G=0;G<ue.length;G++)pe[ue[G]]=BigInt(G)}const ne=pe[G];return(0,K.assertArgument)(null!=ne,"invalid base58 value","letter",G),ne}const he=BigInt(0),ye=BigInt(58);return qN.encodeBase58=function encodeBase58(K){const pe=(0,G.getBytes)(K);let he=(0,ne.toBigInt)(pe),me="";for(;he;)me=ue[Number(he%ye)]+me,he/=ye;for(let G=0;G<pe.length&&!pe[G];G++)me=ue[0]+me;return me},qN.decodeBase58=function decodeBase58(G){let K=he;for(let ne=0;ne<G.length;ne++)K*=ye,K+=getAlpha(G[ne]);return K},qN}();Object.defineProperty(G,"decodeBase58",{enumerable:!0,get:function(){return K.decodeBase58}}),Object.defineProperty(G,"encodeBase58",{enumerable:!0,get:function(){return K.encodeBase58}});var ne=requireBase64Browser();Object.defineProperty(G,"decodeBase64",{enumerable:!0,get:function(){return ne.decodeBase64}}),Object.defineProperty(G,"encodeBase64",{enumerable:!0,get:function(){return ne.encodeBase64}});var ue=requireData();Object.defineProperty(G,"getBytes",{enumerable:!0,get:function(){return ue.getBytes}}),Object.defineProperty(G,"getBytesCopy",{enumerable:!0,get:function(){return ue.getBytesCopy}}),Object.defineProperty(G,"isHexString",{enumerable:!0,get:function(){return ue.isHexString}}),Object.defineProperty(G,"isBytesLike",{enumerable:!0,get:function(){return ue.isBytesLike}}),Object.defineProperty(G,"hexlify",{enumerable:!0,get:function(){return ue.hexlify}}),Object.defineProperty(G,"concat",{enumerable:!0,get:function(){return ue.concat}}),Object.defineProperty(G,"dataLength",{enumerable:!0,get:function(){return ue.dataLength}}),Object.defineProperty(G,"dataSlice",{enumerable:!0,get:function(){return ue.dataSlice}}),Object.defineProperty(G,"stripZerosLeft",{enumerable:!0,get:function(){return ue.stripZerosLeft}}),Object.defineProperty(G,"zeroPadValue",{enumerable:!0,get:function(){return ue.zeroPadValue}}),Object.defineProperty(G,"zeroPadBytes",{enumerable:!0,get:function(){return ue.zeroPadBytes}});var pe=requireErrors();Object.defineProperty(G,"isCallException",{enumerable:!0,get:function(){return pe.isCallException}}),Object.defineProperty(G,"isError",{enumerable:!0,get:function(){return pe.isError}}),Object.defineProperty(G,"assert",{enumerable:!0,get:function(){return pe.assert}}),Object.defineProperty(G,"assertArgument",{enumerable:!0,get:function(){return pe.assertArgument}}),Object.defineProperty(G,"assertArgumentCount",{enumerable:!0,get:function(){return pe.assertArgumentCount}}),Object.defineProperty(G,"assertPrivate",{enumerable:!0,get:function(){return pe.assertPrivate}}),Object.defineProperty(G,"assertNormalize",{enumerable:!0,get:function(){return pe.assertNormalize}}),Object.defineProperty(G,"makeError",{enumerable:!0,get:function(){return pe.makeError}});var he=function requireEvents(){if(XN)return QN;XN=1,Object.defineProperty(QN,"__esModule",{value:!0}),QN.EventPayload=void 0;const G=requireProperties();var K=new WeakMap;return QN.EventPayload=class EventPayload{constructor(ne,ue,pe){_defineProperty(this,"filter",void 0),_defineProperty(this,"emitter",void 0),_classPrivateFieldInitSpec(this,K,void 0),_classPrivateFieldSet2(K,this,ue),(0,G.defineProperties)(this,{emitter:ne,filter:pe})}async removeListener(){null!=_classPrivateFieldGet2(K,this)&&await this.emitter.off(this.filter,_classPrivateFieldGet2(K,this))}},QN}();Object.defineProperty(G,"EventPayload",{enumerable:!0,get:function(){return he.EventPayload}});var ye=requireFetch();Object.defineProperty(G,"FetchRequest",{enumerable:!0,get:function(){return ye.FetchRequest}}),Object.defineProperty(G,"FetchResponse",{enumerable:!0,get:function(){return ye.FetchResponse}}),Object.defineProperty(G,"FetchCancelSignal",{enumerable:!0,get:function(){return ye.FetchCancelSignal}});var me=requireFixednumber();Object.defineProperty(G,"FixedNumber",{enumerable:!0,get:function(){return me.FixedNumber}});var be=requireMaths();Object.defineProperty(G,"fromTwos",{enumerable:!0,get:function(){return be.fromTwos}}),Object.defineProperty(G,"toTwos",{enumerable:!0,get:function(){return be.toTwos}}),Object.defineProperty(G,"mask",{enumerable:!0,get:function(){return be.mask}}),Object.defineProperty(G,"getBigInt",{enumerable:!0,get:function(){return be.getBigInt}}),Object.defineProperty(G,"getNumber",{enumerable:!0,get:function(){return be.getNumber}}),Object.defineProperty(G,"getUint",{enumerable:!0,get:function(){return be.getUint}}),Object.defineProperty(G,"toBigInt",{enumerable:!0,get:function(){return be.toBigInt}}),Object.defineProperty(G,"toNumber",{enumerable:!0,get:function(){return be.toNumber}}),Object.defineProperty(G,"toBeHex",{enumerable:!0,get:function(){return be.toBeHex}}),Object.defineProperty(G,"toBeArray",{enumerable:!0,get:function(){return be.toBeArray}}),Object.defineProperty(G,"toQuantity",{enumerable:!0,get:function(){return be.toQuantity}});var ve=requireProperties();Object.defineProperty(G,"resolveProperties",{enumerable:!0,get:function(){return ve.resolveProperties}}),Object.defineProperty(G,"defineProperties",{enumerable:!0,get:function(){return ve.defineProperties}});var _e=function requireRlpDecode(){if(sM)return oM;sM=1,Object.defineProperty(oM,"__esModule",{value:!0}),oM.decodeRlp=void 0;const G=requireData(),K=requireErrors(),ne=requireData();function hexlifyByte(G){let K=G.toString(16);for(;K.length<2;)K="0"+K;return"0x"+K}function unarrayifyInteger(G,K,ne){let ue=0;for(let pe=0;pe<ne;pe++)ue=256*ue+G[K+pe];return ue}function _decodeChildren(G,ne,ue,pe){const he=[];for(;ue<ne+1+pe;){const ye=_decode(G,ue);he.push(ye.result),ue+=ye.consumed,(0,K.assert)(ue<=ne+1+pe,"child data too short","BUFFER_OVERRUN",{buffer:G,length:pe,offset:ne})}return{consumed:1+pe,result:he}}function _decode(ne,ue){(0,K.assert)(0!==ne.length,"data too short","BUFFER_OVERRUN",{buffer:ne,length:0,offset:1});const checkOffset=G=>{(0,K.assert)(G<=ne.length,"data short segment too short","BUFFER_OVERRUN",{buffer:ne,length:ne.length,offset:G})};if(ne[ue]>=248){const G=ne[ue]-247;checkOffset(ue+1+G);const K=unarrayifyInteger(ne,ue+1,G);return checkOffset(ue+1+G+K),_decodeChildren(ne,ue,ue+1+G,G+K)}if(ne[ue]>=192){const G=ne[ue]-192;return checkOffset(ue+1+G),_decodeChildren(ne,ue,ue+1,G)}if(ne[ue]>=184){const K=ne[ue]-183;checkOffset(ue+1+K);const pe=unarrayifyInteger(ne,ue+1,K);return checkOffset(ue+1+K+pe),{consumed:1+K+pe,result:(0,G.hexlify)(ne.slice(ue+1+K,ue+1+K+pe))}}if(ne[ue]>=128){const K=ne[ue]-128;return checkOffset(ue+1+K),{consumed:1+K,result:(0,G.hexlify)(ne.slice(ue+1,ue+1+K))}}return{consumed:1,result:hexlifyByte(ne[ue])}}return oM.decodeRlp=function decodeRlp(G){const ue=(0,ne.getBytes)(G,"data"),pe=_decode(ue,0);return(0,K.assertArgument)(pe.consumed===ue.length,"unexpected junk after rlp payload","data",G),pe.result},oM}();Object.defineProperty(G,"decodeRlp",{enumerable:!0,get:function(){return _e.decodeRlp}});var Te=requireRlpEncode();Object.defineProperty(G,"encodeRlp",{enumerable:!0,get:function(){return Te.encodeRlp}});var Ee=function requireUnits(){if(uM)return fM;uM=1,Object.defineProperty(fM,"__esModule",{value:!0}),fM.parseEther=fM.formatEther=fM.parseUnits=fM.formatUnits=void 0;const G=requireErrors(),K=requireFixednumber(),ne=requireMaths(),ue=["wei","kwei","mwei","gwei","szabo","finney","ether"];function formatUnits(pe,he){let ye=18;if("string"==typeof he){const K=ue.indexOf(he);(0,G.assertArgument)(K>=0,"invalid unit","unit",he),ye=3*K}else null!=he&&(ye=(0,ne.getNumber)(he,"unit"));return K.FixedNumber.fromValue(pe,ye,{decimals:ye,width:512}).toString()}function parseUnits(pe,he){(0,G.assertArgument)("string"==typeof pe,"value must be a string","value",pe);let ye=18;if("string"==typeof he){const K=ue.indexOf(he);(0,G.assertArgument)(K>=0,"invalid unit","unit",he),ye=3*K}else null!=he&&(ye=(0,ne.getNumber)(he,"unit"));return K.FixedNumber.fromString(pe,{decimals:ye,width:512}).value}return fM.formatUnits=formatUnits,fM.parseUnits=parseUnits,fM.formatEther=function formatEther(G){return formatUnits(G,18)},fM.parseEther=function parseEther(G){return parseUnits(G,18)},fM}();Object.defineProperty(G,"formatEther",{enumerable:!0,get:function(){return Ee.formatEther}}),Object.defineProperty(G,"parseEther",{enumerable:!0,get:function(){return Ee.parseEther}}),Object.defineProperty(G,"formatUnits",{enumerable:!0,get:function(){return Ee.formatUnits}}),Object.defineProperty(G,"parseUnits",{enumerable:!0,get:function(){return Ee.parseUnits}});var Pe=requireUtf8();Object.defineProperty(G,"toUtf8Bytes",{enumerable:!0,get:function(){return Pe.toUtf8Bytes}}),Object.defineProperty(G,"toUtf8CodePoints",{enumerable:!0,get:function(){return Pe.toUtf8CodePoints}}),Object.defineProperty(G,"toUtf8String",{enumerable:!0,get:function(){return Pe.toUtf8String}}),Object.defineProperty(G,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return Pe.Utf8ErrorFuncs}});var Se=function requireUuid(){if(lM)return hM;lM=1,Object.defineProperty(hM,"__esModule",{value:!0}),hM.uuidV4=void 0;const G=requireData();return hM.uuidV4=function uuidV4(K){const ne=(0,G.getBytes)(K,"randomBytes");ne[6]=15&ne[6]|64,ne[8]=63&ne[8]|128;const ue=(0,G.hexlify)(ne);return[ue.substring(2,10),ue.substring(10,14),ue.substring(14,18),ue.substring(18,22),ue.substring(22,34)].join("-")},hM}();Object.defineProperty(G,"uuidV4",{enumerable:!0,get:function(){return Se.uuidV4}})}($N)),$N}var yM,mM={};function requireAbstractCoder(){return yM||(yM=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Reader=G.Writer=G.Coder=G.checkResultErrors=G.Result=G.WordSize=void 0;const K=requireUtils$4();G.WordSize=32;const ne=new Uint8Array(G.WordSize),ue=["then"],pe={};function throwError(G,K){const ne=new Error(`deferred error during ABI decoding triggered accessing ${G}`);throw ne.error=K,ne}var he=new WeakMap;class Result extends Array{constructor(...G){const ne=G[0];let ye=G[1],me=(G[2]||[]).slice(),be=!0;ne!==pe&&(ye=G,me=[],be=!1),super(ye.length),_classPrivateFieldInitSpec(this,he,void 0),ye.forEach(((G,K)=>{this[K]=G}));const ve=me.reduce(((G,K)=>("string"==typeof K&&G.set(K,(G.get(K)||0)+1),G)),new Map);if(_classPrivateFieldSet2(he,this,Object.freeze(ye.map(((G,K)=>{const ne=me[K];return null!=ne&&1===ve.get(ne)?ne:null})))),be)return Object.freeze(this),new Proxy(this,{get:(G,ne,pe)=>{if("string"==typeof ne){if(ne.match(/^[0-9]+$/)){const ue=(0,K.getNumber)(ne,"%index");if(ue<0||ue>=this.length)throw new RangeError("out of result range");const pe=G[ue];return pe instanceof Error&&throwError(`index ${ue}`,pe),pe}if(ue.indexOf(ne)>=0)return Reflect.get(G,ne,pe);const he=G[ne];if(he instanceof Function)return function(...K){return he.apply(this===pe?G:this,K)};if(!(ne in G))return G.getValue.apply(this===pe?G:this,[ne])}return Reflect.get(G,ne,pe)}})}toArray(){const G=[];return this.forEach(((K,ne)=>{K instanceof Error&&throwError(`index ${ne}`,K),G.push(K)})),G}toObject(){return _classPrivateFieldGet2(he,this).reduce(((G,ne,ue)=>((0,K.assert)(null!=ne,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),ne in G||(G[ne]=this.getValue(ne)),G)),{})}slice(G,K){null==G&&(G=0),G<0&&(G+=this.length)<0&&(G=0),null==K&&(K=this.length),K<0&&(K+=this.length)<0&&(K=0),K>this.length&&(K=this.length);const ne=[],ue=[];for(let pe=G;pe<K;pe++)ne.push(this[pe]),ue.push(_classPrivateFieldGet2(he,this)[pe]);return new Result(pe,ne,ue)}filter(G,K){const ne=[],ue=[];for(let pe=0;pe<this.length;pe++){const ye=this[pe];ye instanceof Error&&throwError(`index ${pe}`,ye),G.call(K,ye,pe,this)&&(ne.push(ye),ue.push(_classPrivateFieldGet2(he,this)[pe]))}return new Result(pe,ne,ue)}map(G,K){const ne=[];for(let ue=0;ue<this.length;ue++){const pe=this[ue];pe instanceof Error&&throwError(`index ${ue}`,pe),ne.push(G.call(K,pe,ue,this))}return ne}getValue(G){const K=_classPrivateFieldGet2(he,this).indexOf(G);if(-1===K)return;const ne=this[K];return ne instanceof Error&&throwError(`property ${JSON.stringify(G)}`,ne.error),ne}static fromItems(G,K){return new Result(pe,G,K)}}function getValue(ue){let pe=(0,K.toBeArray)(ue);return(0,K.assert)(pe.length<=G.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:pe,length:G.WordSize,offset:pe.length}),pe.length!==G.WordSize&&(pe=(0,K.getBytesCopy)((0,K.concat)([ne.slice(pe.length%G.WordSize),pe]))),pe}G.Result=Result,G.checkResultErrors=function checkResultErrors(G){const K=[],checkErrors=function(G,ne){if(Array.isArray(ne))for(let ue in ne){const pe=G.slice();pe.push(ue);try{checkErrors(pe,ne[ue])}catch(G){K.push({path:pe,error:G})}}};return checkErrors([],G),K};G.Coder=class Coder{constructor(G,ne,ue,pe){_defineProperty(this,"name",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"localName",void 0),_defineProperty(this,"dynamic",void 0),(0,K.defineProperties)(this,{name:G,type:ne,localName:ue,dynamic:pe},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(G,ne){(0,K.assertArgument)(!1,G,this.localName,ne)}};var ye=new WeakMap,me=new WeakMap,be=new WeakSet;function _writeData(G){return _classPrivateFieldGet2(ye,this).push(G),_classPrivateFieldSet2(me,this,_classPrivateFieldGet2(me,this)+G.length),G.length}G.Writer=class Writer{constructor(){_classPrivateMethodInitSpec(this,be),_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldInitSpec(this,me,void 0),_classPrivateFieldSet2(ye,this,[]),_classPrivateFieldSet2(me,this,0)}get data(){return(0,K.concat)(_classPrivateFieldGet2(ye,this))}get length(){return _classPrivateFieldGet2(me,this)}appendWriter(G){return _assertClassBrand(be,this,_writeData).call(this,(0,K.getBytesCopy)(G.data))}writeBytes(ue){let pe=(0,K.getBytesCopy)(ue);const he=pe.length%G.WordSize;return he&&(pe=(0,K.getBytesCopy)((0,K.concat)([pe,ne.slice(he)]))),_assertClassBrand(be,this,_writeData).call(this,pe)}writeValue(G){return _assertClassBrand(be,this,_writeData).call(this,getValue(G))}writeUpdatableValue(){const K=_classPrivateFieldGet2(ye,this).length;return _classPrivateFieldGet2(ye,this).push(ne),_classPrivateFieldSet2(me,this,_classPrivateFieldGet2(me,this)+G.WordSize),G=>{_classPrivateFieldGet2(ye,this)[K]=getValue(G)}}};var ve=new WeakMap,_e=new WeakMap,Te=new WeakMap,Ee=new WeakMap,Pe=new WeakMap,Se=new WeakSet;class Reader{constructor(G,ne,ue){_classPrivateMethodInitSpec(this,Se),_defineProperty(this,"allowLoose",void 0),_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldInitSpec(this,_e,void 0),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0),(0,K.defineProperties)(this,{allowLoose:!!ne}),_classPrivateFieldSet2(ve,this,(0,K.getBytesCopy)(G)),_classPrivateFieldSet2(Te,this,0),_classPrivateFieldSet2(Ee,this,null),_classPrivateFieldSet2(Pe,this,null!=ue?ue:1024),_classPrivateFieldSet2(_e,this,0)}get data(){return(0,K.hexlify)(_classPrivateFieldGet2(ve,this))}get dataLength(){return _classPrivateFieldGet2(ve,this).length}get consumed(){return _classPrivateFieldGet2(_e,this)}get bytes(){return new Uint8Array(_classPrivateFieldGet2(ve,this))}subReader(G){const K=new Reader(_classPrivateFieldGet2(ve,this).slice(_classPrivateFieldGet2(_e,this)+G),this.allowLoose,_classPrivateFieldGet2(Pe,this));return _classPrivateFieldSet2(Ee,K,this),K}readBytes(G,K){let ne=_assertClassBrand(Se,this,_peekBytes).call(this,0,G,!!K);return _assertClassBrand(Se,this,_incrementBytesRead).call(this,G),_classPrivateFieldSet2(_e,this,_classPrivateFieldGet2(_e,this)+ne.length),ne.slice(0,G)}readValue(){return(0,K.toBigInt)(this.readBytes(G.WordSize))}readIndex(){return(0,K.toNumber)(this.readBytes(G.WordSize))}}function _incrementBytesRead(G){var ne;if(_classPrivateFieldGet2(Ee,this))return _assertClassBrand(Se,ne=_classPrivateFieldGet2(Ee,this),_incrementBytesRead).call(ne,G);_classPrivateFieldSet2(Te,this,_classPrivateFieldGet2(Te,this)+G),(0,K.assert)(_classPrivateFieldGet2(Pe,this)<1||_classPrivateFieldGet2(Te,this)<=_classPrivateFieldGet2(Pe,this)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${_classPrivateFieldGet2(Pe,this)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,K.getBytesCopy)(_classPrivateFieldGet2(ve,this)),offset:_classPrivateFieldGet2(_e,this),length:G,info:{bytesRead:_classPrivateFieldGet2(Te,this),dataLength:this.dataLength}})}function _peekBytes(ne,ue,pe){let he=Math.ceil(ue/G.WordSize)*G.WordSize;return _classPrivateFieldGet2(_e,this)+he>_classPrivateFieldGet2(ve,this).length&&(this.allowLoose&&pe&&_classPrivateFieldGet2(_e,this)+ue<=_classPrivateFieldGet2(ve,this).length?he=ue:(0,K.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,K.getBytesCopy)(_classPrivateFieldGet2(ve,this)),length:_classPrivateFieldGet2(ve,this).length,offset:_classPrivateFieldGet2(_e,this)+he})),_classPrivateFieldGet2(ve,this).slice(_classPrivateFieldGet2(_e,this),_classPrivateFieldGet2(_e,this)+he)}G.Reader=Reader}(mM)),mM}var bM,gM={},vM={},wM={},_M={},TM={},AM={},EM={},PM={};function require_assert$1(){if(bM)return PM;function number(G){if(!Number.isSafeInteger(G)||G<0)throw new Error(`Wrong positive integer: ${G}`)}function bool(G){if("boolean"!=typeof G)throw new Error(`Expected boolean, not ${G}`)}function bytes(G,...K){if(!(G instanceof Uint8Array))throw new Error("Expected Uint8Array");if(K.length>0&&!K.includes(G.length))throw new Error(`Expected Uint8Array of length ${K}, not of length=${G.length}`)}function hash(G){if("function"!=typeof G||"function"!=typeof G.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");number(G.outputLen),number(G.blockLen)}function exists(G,K=!0){if(G.destroyed)throw new Error("Hash instance has been destroyed");if(K&&G.finished)throw new Error("Hash#digest() has already been called")}function output(G,K){bytes(G);const ne=K.outputLen;if(G.length<ne)throw new Error(`digestInto() expects output buffer of length at least ${ne}`)}bM=1,Object.defineProperty(PM,"__esModule",{value:!0}),PM.output=PM.exists=PM.hash=PM.bytes=PM.bool=PM.number=void 0,PM.number=number,PM.bool=bool,PM.bytes=bytes,PM.hash=hash,PM.exists=exists,PM.output=output;const G={number:number,bool:bool,bytes:bytes,hash:hash,exists:exists,output:output};return PM.default=G,PM}var SM,IM,CM,RM={},kM={};function requireUtils$3(){return IM||(IM=1,function(G){
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
Object.defineProperty(G,"__esModule",{value:!0}),G.randomBytes=G.wrapXOFConstructorWithOpts=G.wrapConstructorWithOpts=G.wrapConstructor=G.checkOpts=G.Hash=G.concatBytes=G.toBytes=G.utf8ToBytes=G.asyncLoop=G.nextTick=G.hexToBytes=G.bytesToHex=G.isLE=G.rotr=G.createView=G.u32=G.u8=void 0;const K=function requireCrypto$2(){return SM||(SM=1,Object.defineProperty(kM,"__esModule",{value:!0}),kM.crypto=void 0,kM.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),kM}(),u8a=G=>G instanceof Uint8Array;G.u8=G=>new Uint8Array(G.buffer,G.byteOffset,G.byteLength);G.u32=G=>new Uint32Array(G.buffer,G.byteOffset,Math.floor(G.byteLength/4));G.createView=G=>new DataView(G.buffer,G.byteOffset,G.byteLength);if(G.rotr=(G,K)=>G<<32-K|G>>>K,G.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!G.isLE)throw new Error("Non little-endian hardware is not supported");const ne=Array.from({length:256},((G,K)=>K.toString(16).padStart(2,"0")));G.bytesToHex=function bytesToHex(G){if(!u8a(G))throw new Error("Uint8Array expected");let K="";for(let ue=0;ue<G.length;ue++)K+=ne[G[ue]];return K},G.hexToBytes=function hexToBytes(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);const K=G.length;if(K%2)throw new Error("padded hex string expected, got unpadded hex of length "+K);const ne=new Uint8Array(K/2);for(let K=0;K<ne.length;K++){const ue=2*K,pe=G.slice(ue,ue+2),he=Number.parseInt(pe,16);if(Number.isNaN(he)||he<0)throw new Error("Invalid byte sequence");ne[K]=he}return ne};function utf8ToBytes(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))}function toBytes(G){if("string"==typeof G&&(G=utf8ToBytes(G)),!u8a(G))throw new Error("expected Uint8Array, got "+typeof G);return G}G.nextTick=async()=>{},G.asyncLoop=async function asyncLoop(K,ne,ue){let pe=Date.now();for(let he=0;he<K;he++){ue(he);const K=Date.now()-pe;K>=0&&K<ne||(await(0,G.nextTick)(),pe+=K)}},G.utf8ToBytes=utf8ToBytes,G.toBytes=toBytes,G.concatBytes=function concatBytes(...G){const K=new Uint8Array(G.reduce(((G,K)=>G+K.length),0));let ne=0;return G.forEach((G=>{if(!u8a(G))throw new Error("Uint8Array expected");K.set(G,ne),ne+=G.length})),K};G.Hash=class Hash{clone(){return this._cloneInto()}};const ue={}.toString;G.checkOpts=function checkOpts(G,K){if(void 0!==K&&"[object Object]"!==ue.call(K))throw new Error("Options should be object or undefined");return Object.assign(G,K)},G.wrapConstructor=function wrapConstructor(G){const hashC=K=>G().update(toBytes(K)).digest(),K=G();return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=()=>G(),hashC},G.wrapConstructorWithOpts=function wrapConstructorWithOpts(G){const hashC=(K,ne)=>G(ne).update(toBytes(K)).digest(),K=G({});return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=K=>G(K),hashC},G.wrapXOFConstructorWithOpts=function wrapXOFConstructorWithOpts(G){const hashC=(K,ne)=>G(ne).update(toBytes(K)).digest(),K=G({});return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=K=>G(K),hashC},G.randomBytes=function randomBytes(G=32){if(K.crypto&&"function"==typeof K.crypto.getRandomValues)return K.crypto.getRandomValues(new Uint8Array(G));throw new Error("crypto.getRandomValues must be defined")}}(RM)),RM}function requireHmac$2(){return CM||(CM=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.hmac=G.HMAC=void 0;const K=require_assert$1(),ne=requireUtils$3();class HMAC extends ne.Hash{constructor(G,ue){super(),this.finished=!1,this.destroyed=!1,(0,K.hash)(G);const pe=(0,ne.toBytes)(ue);if(this.iHash=G.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const he=this.blockLen,ye=new Uint8Array(he);ye.set(pe.length>he?G.create().update(pe).digest():pe);for(let G=0;G<ye.length;G++)ye[G]^=54;this.iHash.update(ye),this.oHash=G.create();for(let G=0;G<ye.length;G++)ye[G]^=106;this.oHash.update(ye),ye.fill(0)}update(G){return(0,K.exists)(this),this.iHash.update(G),this}digestInto(G){(0,K.exists)(this),(0,K.bytes)(G,this.outputLen),this.finished=!0,this.iHash.digestInto(G),this.oHash.update(G),this.oHash.digestInto(G),this.destroy()}digest(){const G=new Uint8Array(this.oHash.outputLen);return this.digestInto(G),G}_cloneInto(G){G||(G=Object.create(Object.getPrototypeOf(this),{}));const{oHash:K,iHash:ne,finished:ue,destroyed:pe,blockLen:he,outputLen:ye}=this;return G.finished=ue,G.destroyed=pe,G.blockLen=he,G.outputLen=ye,G.oHash=K._cloneInto(G.oHash),G.iHash=ne._cloneInto(G.iHash),G}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}G.HMAC=HMAC;G.hmac=(G,K,ne)=>new HMAC(G,K).update(ne).digest(),G.hmac.create=(G,K)=>new HMAC(G,K)}(EM)),EM}var OM,xM={};function requirePbkdf2$1(){if(OM)return xM;OM=1,Object.defineProperty(xM,"__esModule",{value:!0}),xM.pbkdf2Async=xM.pbkdf2=void 0;const G=require_assert$1(),K=requireHmac$2(),ne=requireUtils$3();function pbkdf2Init(ue,pe,he,ye){(0,G.hash)(ue);const me=(0,ne.checkOpts)({dkLen:32,asyncTick:10},ye),{c:be,dkLen:ve,asyncTick:_e}=me;if((0,G.number)(be),(0,G.number)(ve),(0,G.number)(_e),be<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const Te=(0,ne.toBytes)(pe),Ee=(0,ne.toBytes)(he),Pe=new Uint8Array(ve),Se=K.hmac.create(ue,Te),Ce=Se._cloneInto().update(Ee);return{c:be,dkLen:ve,asyncTick:_e,DK:Pe,PRF:Se,PRFSalt:Ce}}function pbkdf2Output(G,K,ne,ue,pe){return G.destroy(),K.destroy(),ue&&ue.destroy(),pe.fill(0),ne}return xM.pbkdf2=function pbkdf2(G,K,ue,pe){const{c:he,dkLen:ye,DK:me,PRF:be,PRFSalt:ve}=pbkdf2Init(G,K,ue,pe);let _e;const Te=new Uint8Array(4),Ee=(0,ne.createView)(Te),Pe=new Uint8Array(be.outputLen);for(let G=1,K=0;K<ye;G++,K+=be.outputLen){const ne=me.subarray(K,K+be.outputLen);Ee.setInt32(0,G,!1),(_e=ve._cloneInto(_e)).update(Te).digestInto(Pe),ne.set(Pe.subarray(0,ne.length));for(let G=1;G<he;G++){be._cloneInto(_e).update(Pe).digestInto(Pe);for(let G=0;G<ne.length;G++)ne[G]^=Pe[G]}}return pbkdf2Output(be,ve,me,_e,Pe)},xM.pbkdf2Async=async function pbkdf2Async(G,K,ue,pe){const{c:he,dkLen:ye,asyncTick:me,DK:be,PRF:ve,PRFSalt:_e}=pbkdf2Init(G,K,ue,pe);let Te;const Ee=new Uint8Array(4),Pe=(0,ne.createView)(Ee),Se=new Uint8Array(ve.outputLen);for(let G=1,K=0;K<ye;G++,K+=ve.outputLen){const ue=be.subarray(K,K+ve.outputLen);Pe.setInt32(0,G,!1),(Te=_e._cloneInto(Te)).update(Ee).digestInto(Se),ue.set(Se.subarray(0,ue.length)),await(0,ne.asyncLoop)(he-1,me,(()=>{ve._cloneInto(Te).update(Se).digestInto(Se);for(let G=0;G<ue.length;G++)ue[G]^=Se[G]}))}return pbkdf2Output(ve,_e,be,Te,Se)},xM}var NM,MM,BM={},FM={};function require_sha2$1(){if(NM)return FM;NM=1,Object.defineProperty(FM,"__esModule",{value:!0}),FM.SHA2=void 0;const G=require_assert$1(),K=requireUtils$3();class SHA2 extends K.Hash{constructor(G,ne,ue,pe){super(),this.blockLen=G,this.outputLen=ne,this.padOffset=ue,this.isLE=pe,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(G),this.view=(0,K.createView)(this.buffer)}update(ne){(0,G.exists)(this);const{view:ue,buffer:pe,blockLen:he}=this,ye=(ne=(0,K.toBytes)(ne)).length;for(let G=0;G<ye;){const me=Math.min(he-this.pos,ye-G);if(me!==he)pe.set(ne.subarray(G,G+me),this.pos),this.pos+=me,G+=me,this.pos===he&&(this.undefined(ue,0),this.pos=0);else{const ue=(0,K.createView)(ne);for(;he<=ye-G;G+=he)this.undefined(ue,G)}}return this.length+=ne.length,this.roundClean(),this}digestInto(ne){(0,G.exists)(this),(0,G.output)(ne,this),this.finished=!0;const{buffer:ue,view:pe,blockLen:he,isLE:ye}=this;let{pos:me}=this;ue[me++]=128,this.buffer.subarray(me).fill(0),this.padOffset>he-me&&(this.undefined(pe,0),me=0);for(let G=me;G<he;G++)ue[G]=0;!function setBigUint64(G,K,ne,ue){if("function"==typeof G.setBigUint64)return G.setBigUint64(K,ne,ue);const pe=BigInt(32),he=BigInt(4294967295),ye=Number(ne>>pe&he),me=Number(ne&he),be=ue?4:0,ve=ue?0:4;G.setUint32(K+be,ye,ue),G.setUint32(K+ve,me,ue)}(pe,he-8,BigInt(8*this.length),ye),this.undefined(pe,0);const be=(0,K.createView)(ne),ve=this.outputLen;if(ve%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const _e=ve/4,Te=this.get();if(_e>Te.length)throw new Error("_sha2: outputLen bigger than state");for(let G=0;G<_e;G++)be.setUint32(4*G,Te[G],ye)}digest(){const{buffer:G,outputLen:K}=this;this.digestInto(G);const ne=G.slice(0,K);return this.destroy(),ne}_cloneInto(G){G||(G=new this.constructor),G.set(...this.get());const{blockLen:K,buffer:ne,length:ue,finished:pe,destroyed:he,pos:ye}=this;return G.length=ue,G.pos=ye,G.finished=pe,G.destroyed=he,ue%K&&G.buffer.set(ne),G}}return FM.SHA2=SHA2,FM}function requireSha256$1(){if(MM)return BM;MM=1,Object.defineProperty(BM,"__esModule",{value:!0}),BM.sha224=BM.sha256=void 0;const G=require_sha2$1(),K=requireUtils$3(),Chi=(G,K,ne)=>G&K^~G&ne,Maj=(G,K,ne)=>G&K^G&ne^K&ne,ne=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]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pe=new Uint32Array(64);class SHA256 extends G.SHA2{constructor(){super(64,32,8,!1),this.A=0|ue[0],this.B=0|ue[1],this.C=0|ue[2],this.D=0|ue[3],this.E=0|ue[4],this.F=0|ue[5],this.G=0|ue[6],this.H=0|ue[7]}get(){const{A:G,B:K,C:ne,D:ue,E:pe,F:he,G:ye,H:me}=this;return[G,K,ne,ue,pe,he,ye,me]}set(G,K,ne,ue,pe,he,ye,me){this.A=0|G,this.B=0|K,this.C=0|ne,this.D=0|ue,this.E=0|pe,this.F=0|he,this.G=0|ye,this.H=0|me}undefined(G,ue){for(let K=0;K<16;K++,ue+=4)pe[K]=G.getUint32(ue,!1);for(let G=16;G<64;G++){const ne=pe[G-15],ue=pe[G-2],he=(0,K.rotr)(ne,7)^(0,K.rotr)(ne,18)^ne>>>3,ye=(0,K.rotr)(ue,17)^(0,K.rotr)(ue,19)^ue>>>10;pe[G]=ye+pe[G-7]+he+pe[G-16]|0}let{A:he,B:ye,C:me,D:be,E:ve,F:_e,G:Te,H:Ee}=this;for(let G=0;G<64;G++){const ue=Ee+((0,K.rotr)(ve,6)^(0,K.rotr)(ve,11)^(0,K.rotr)(ve,25))+Chi(ve,_e,Te)+ne[G]+pe[G]|0,Pe=((0,K.rotr)(he,2)^(0,K.rotr)(he,13)^(0,K.rotr)(he,22))+Maj(he,ye,me)|0;Ee=Te,Te=_e,_e=ve,ve=be+ue|0,be=me,me=ye,ye=he,he=ue+Pe|0}he=he+this.A|0,ye=ye+this.B|0,me=me+this.C|0,be=be+this.D|0,ve=ve+this.E|0,_e=_e+this.F|0,Te=Te+this.G|0,Ee=Ee+this.H|0,this.set(he,ye,me,be,ve,_e,Te,Ee)}roundClean(){pe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return BM.sha256=(0,K.wrapConstructor)((()=>new SHA256)),BM.sha224=(0,K.wrapConstructor)((()=>new SHA224)),BM}var DM,LM,UM,$M,qM={},GM={};function require_u64(){if(DM)return GM;DM=1,Object.defineProperty(GM,"__esModule",{value:!0}),GM.add5L=GM.add5H=GM.add4H=GM.add4L=GM.add3H=GM.add3L=GM.add=GM.rotlBL=GM.rotlBH=GM.rotlSL=GM.rotlSH=GM.rotr32L=GM.rotr32H=GM.rotrBL=GM.rotrBH=GM.rotrSL=GM.rotrSH=GM.shrSL=GM.shrSH=GM.toBig=GM.split=GM.fromBig=void 0;const G=BigInt(2**32-1),K=BigInt(32);function fromBig(ne,ue=!1){return ue?{h:Number(ne&G),l:Number(ne>>K&G)}:{h:0|Number(ne>>K&G),l:0|Number(ne&G)}}function split(G,K=!1){let ne=new Uint32Array(G.length),ue=new Uint32Array(G.length);for(let pe=0;pe<G.length;pe++){const{h:he,l:ye}=fromBig(G[pe],K);[ne[pe],ue[pe]]=[he,ye]}return[ne,ue]}GM.fromBig=fromBig,GM.split=split;const toBig=(G,ne)=>BigInt(G>>>0)<<K|BigInt(ne>>>0);GM.toBig=toBig;const shrSH=(G,K,ne)=>G>>>ne;GM.shrSH=shrSH;const shrSL=(G,K,ne)=>G<<32-ne|K>>>ne;GM.shrSL=shrSL;const rotrSH=(G,K,ne)=>G>>>ne|K<<32-ne;GM.rotrSH=rotrSH;const rotrSL=(G,K,ne)=>G<<32-ne|K>>>ne;GM.rotrSL=rotrSL;const rotrBH=(G,K,ne)=>G<<64-ne|K>>>ne-32;GM.rotrBH=rotrBH;const rotrBL=(G,K,ne)=>G>>>ne-32|K<<64-ne;GM.rotrBL=rotrBL;const rotr32H=(G,K)=>K;GM.rotr32H=rotr32H;const rotr32L=(G,K)=>G;GM.rotr32L=rotr32L;const rotlSH=(G,K,ne)=>G<<ne|K>>>32-ne;GM.rotlSH=rotlSH;const rotlSL=(G,K,ne)=>K<<ne|G>>>32-ne;GM.rotlSL=rotlSL;const rotlBH=(G,K,ne)=>K<<ne-32|G>>>64-ne;GM.rotlBH=rotlBH;const rotlBL=(G,K,ne)=>G<<ne-32|K>>>64-ne;function add(G,K,ne,ue){const pe=(K>>>0)+(ue>>>0);return{h:G+ne+(pe/2**32|0)|0,l:0|pe}}GM.rotlBL=rotlBL,GM.add=add;const add3L=(G,K,ne)=>(G>>>0)+(K>>>0)+(ne>>>0);GM.add3L=add3L;const add3H=(G,K,ne,ue)=>K+ne+ue+(G/2**32|0)|0;GM.add3H=add3H;const add4L=(G,K,ne,ue)=>(G>>>0)+(K>>>0)+(ne>>>0)+(ue>>>0);GM.add4L=add4L;const add4H=(G,K,ne,ue,pe)=>K+ne+ue+pe+(G/2**32|0)|0;GM.add4H=add4H;const add5L=(G,K,ne,ue,pe)=>(G>>>0)+(K>>>0)+(ne>>>0)+(ue>>>0)+(pe>>>0);GM.add5L=add5L;const add5H=(G,K,ne,ue,pe,he)=>K+ne+ue+pe+he+(G/2**32|0)|0;GM.add5H=add5H;const ne={fromBig:fromBig,split:split,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};return GM.default=ne,GM}function requireCryptoBrowser(){if(UM)return AM;UM=1,Object.defineProperty(AM,"__esModule",{value:!0}),AM.randomBytes=AM.pbkdf2Sync=AM.createHmac=AM.createHash=void 0;const G=requireHmac$2(),K=requirePbkdf2$1(),ne=requireSha256$1(),ue=function requireSha512(){if(LM)return qM;LM=1,Object.defineProperty(qM,"__esModule",{value:!0}),qM.sha384=qM.sha512_256=qM.sha512_224=qM.sha512=qM.SHA512=void 0;const G=require_sha2$1(),K=require_u64(),ne=requireUtils$3(),[ue,pe]=(()=>K.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((G=>BigInt(G)))))(),he=new Uint32Array(80),ye=new Uint32Array(80);class SHA512 extends G.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:G,Al:K,Bh:ne,Bl:ue,Ch:pe,Cl:he,Dh:ye,Dl:me,Eh:be,El:ve,Fh:_e,Fl:Te,Gh:Ee,Gl:Pe,Hh:Se,Hl:Ce}=this;return[G,K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce]}set(G,K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce){this.Ah=0|G,this.Al=0|K,this.Bh=0|ne,this.Bl=0|ue,this.Ch=0|pe,this.Cl=0|he,this.Dh=0|ye,this.Dl=0|me,this.Eh=0|be,this.El=0|ve,this.Fh=0|_e,this.Fl=0|Te,this.Gh=0|Ee,this.Gl=0|Pe,this.Hh=0|Se,this.Hl=0|Ce}undefined(G,ne){for(let K=0;K<16;K++,ne+=4)he[K]=G.getUint32(ne),ye[K]=G.getUint32(ne+=4);for(let G=16;G<80;G++){const ne=0|he[G-15],ue=0|ye[G-15],pe=K.default.rotrSH(ne,ue,1)^K.default.rotrSH(ne,ue,8)^K.default.shrSH(ne,ue,7),me=K.default.rotrSL(ne,ue,1)^K.default.rotrSL(ne,ue,8)^K.default.shrSL(ne,ue,7),be=0|he[G-2],ve=0|ye[G-2],_e=K.default.rotrSH(be,ve,19)^K.default.rotrBH(be,ve,61)^K.default.shrSH(be,ve,6),Te=K.default.rotrSL(be,ve,19)^K.default.rotrBL(be,ve,61)^K.default.shrSL(be,ve,6),Ee=K.default.add4L(me,Te,ye[G-7],ye[G-16]),Pe=K.default.add4H(Ee,pe,_e,he[G-7],he[G-16]);he[G]=0|Pe,ye[G]=0|Ee}let{Ah:me,Al:be,Bh:ve,Bl:_e,Ch:Te,Cl:Ee,Dh:Pe,Dl:Se,Eh:Ce,El:ke,Fh:Oe,Fl:xe,Gh:Ne,Gl:Me,Hh:Be,Hl:Fe}=this;for(let G=0;G<80;G++){const ne=K.default.rotrSH(Ce,ke,14)^K.default.rotrSH(Ce,ke,18)^K.default.rotrBH(Ce,ke,41),De=K.default.rotrSL(Ce,ke,14)^K.default.rotrSL(Ce,ke,18)^K.default.rotrBL(Ce,ke,41),Le=Ce&Oe^~Ce&Ne,Ue=ke&xe^~ke&Me,je=K.default.add5L(Fe,De,Ue,pe[G],ye[G]),ze=K.default.add5H(je,Be,ne,Le,ue[G],he[G]),Je=0|je,Xe=K.default.rotrSH(me,be,28)^K.default.rotrBH(me,be,34)^K.default.rotrBH(me,be,39),Qe=K.default.rotrSL(me,be,28)^K.default.rotrBL(me,be,34)^K.default.rotrBL(me,be,39),Ye=me&ve^me&Te^ve&Te,et=be&_e^be&Ee^_e&Ee;Be=0|Ne,Fe=0|Me,Ne=0|Oe,Me=0|xe,Oe=0|Ce,xe=0|ke,({h:Ce,l:ke}=K.default.add(0|Pe,0|Se,0|ze,0|Je)),Pe=0|Te,Se=0|Ee,Te=0|ve,Ee=0|_e,ve=0|me,_e=0|be;const tt=K.default.add3L(Je,Qe,et);me=K.default.add3H(tt,ze,Xe,Ye),be=0|tt}({h:me,l:be}=K.default.add(0|this.Ah,0|this.Al,0|me,0|be)),({h:ve,l:_e}=K.default.add(0|this.Bh,0|this.Bl,0|ve,0|_e)),({h:Te,l:Ee}=K.default.add(0|this.Ch,0|this.Cl,0|Te,0|Ee)),({h:Pe,l:Se}=K.default.add(0|this.Dh,0|this.Dl,0|Pe,0|Se)),({h:Ce,l:ke}=K.default.add(0|this.Eh,0|this.El,0|Ce,0|ke)),({h:Oe,l:xe}=K.default.add(0|this.Fh,0|this.Fl,0|Oe,0|xe)),({h:Ne,l:Me}=K.default.add(0|this.Gh,0|this.Gl,0|Ne,0|Me)),({h:Be,l:Fe}=K.default.add(0|this.Hh,0|this.Hl,0|Be,0|Fe)),this.set(me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe)}roundClean(){he.fill(0),ye.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}qM.SHA512=SHA512;class SHA512_224 extends SHA512{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class SHA512_256 extends SHA512{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class SHA384 extends SHA512{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return qM.sha512=(0,ne.wrapConstructor)((()=>new SHA512)),qM.sha512_224=(0,ne.wrapConstructor)((()=>new SHA512_224)),qM.sha512_256=(0,ne.wrapConstructor)((()=>new SHA512_256)),qM.sha384=(0,ne.wrapConstructor)((()=>new SHA384)),qM}(),pe=requireUtils$4();const he=function getGlobal(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==pn)return pn;throw new Error("unable to locate global object")}(),ye=he.crypto||he.msCrypto;return AM.createHash=function createHash(G){switch(G){case"sha256":return ne.sha256.create();case"sha512":return ue.sha512.create()}(0,pe.assertArgument)(!1,"invalid hashing algorithm name","algorithm",G)},AM.createHmac=function createHmac(K,he){const ye={sha256:ne.sha256,sha512:ue.sha512}[K];return(0,pe.assertArgument)(null!=ye,"invalid hmac algorithm","algorithm",K),G.hmac.create(ye,he)},AM.pbkdf2Sync=function pbkdf2Sync(G,he,ye,me,be){const ve={sha256:ne.sha256,sha512:ue.sha512}[be];return(0,pe.assertArgument)(null!=ve,"invalid pbkdf2 algorithm","algorithm",be),(0,K.pbkdf2)(ve,G,he,{c:ye,dkLen:me})},AM.randomBytes=function randomBytes(G){(0,pe.assert)(null!=ye,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,pe.assertArgument)(Number.isInteger(G)&&G>0&&G<=1024,"invalid length","length",G);const K=new Uint8Array(G);return ye.getRandomValues(K),K},AM}var jM,HM,WM={},zM={};function requireKeccak(){if(HM)return WM;HM=1,Object.defineProperty(WM,"__esModule",{value:!0}),WM.keccak256=void 0;const G=function requireSha3(){if(jM)return zM;jM=1,Object.defineProperty(zM,"__esModule",{value:!0}),zM.shake256=zM.shake128=zM.keccak_512=zM.keccak_384=zM.keccak_256=zM.keccak_224=zM.sha3_512=zM.sha3_384=zM.sha3_256=zM.sha3_224=zM.Keccak=zM.keccakP=void 0;const G=require_assert$1(),K=require_u64(),ne=requireUtils$3(),[ue,pe,he]=[[],[],[]],ye=BigInt(0),me=BigInt(1),be=BigInt(2),ve=BigInt(7),_e=BigInt(256),Te=BigInt(113);for(let G=0,K=me,ne=1,Ee=0;G<24;G++){[ne,Ee]=[Ee,(2*ne+3*Ee)%5],ue.push(2*(5*Ee+ne)),pe.push((G+1)*(G+2)/2%64);let Pe=ye;for(let G=0;G<7;G++)K=(K<<me^(K>>ve)*Te)%_e,K&be&&(Pe^=me<<(me<<BigInt(G))-me);he.push(Pe)}const[Ee,Pe]=(0,K.split)(he,!0),rotlH=(G,ne,ue)=>ue>32?(0,K.rotlBH)(G,ne,ue):(0,K.rotlSH)(G,ne,ue),rotlL=(G,ne,ue)=>ue>32?(0,K.rotlBL)(G,ne,ue):(0,K.rotlSL)(G,ne,ue);function keccakP(G,K=24){const ne=new Uint32Array(10);for(let he=24-K;he<24;he++){for(let K=0;K<10;K++)ne[K]=G[K]^G[K+10]^G[K+20]^G[K+30]^G[K+40];for(let K=0;K<10;K+=2){const ue=(K+8)%10,pe=(K+2)%10,he=ne[pe],ye=ne[pe+1],me=rotlH(he,ye,1)^ne[ue],be=rotlL(he,ye,1)^ne[ue+1];for(let ne=0;ne<50;ne+=10)G[K+ne]^=me,G[K+ne+1]^=be}let K=G[2],ye=G[3];for(let ne=0;ne<24;ne++){const he=pe[ne],me=rotlH(K,ye,he),be=rotlL(K,ye,he),ve=ue[ne];K=G[ve],ye=G[ve+1],G[ve]=me,G[ve+1]=be}for(let K=0;K<50;K+=10){for(let ue=0;ue<10;ue++)ne[ue]=G[K+ue];for(let ue=0;ue<10;ue++)G[K+ue]^=~ne[(ue+2)%10]&ne[(ue+4)%10]}G[0]^=Ee[he],G[1]^=Pe[he]}ne.fill(0)}zM.keccakP=keccakP;class Keccak extends ne.Hash{constructor(K,ue,pe,he=!1,ye=24){if(super(),this.blockLen=K,this.suffix=ue,this.outputLen=pe,this.enableXOF=he,this.rounds=ye,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,G.number)(pe),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,ne.u32)(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(K){(0,G.exists)(this);const{blockLen:ue,state:pe}=this,he=(K=(0,ne.toBytes)(K)).length;for(let G=0;G<he;){const ne=Math.min(ue-this.pos,he-G);for(let ue=0;ue<ne;ue++)pe[this.pos++]^=K[G++];this.pos===ue&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:G,suffix:K,pos:ne,blockLen:ue}=this;G[ne]^=K,0!=(128&K)&&ne===ue-1&&this.keccak(),G[ue-1]^=128,this.keccak()}writeInto(K){(0,G.exists)(this,!1),(0,G.bytes)(K),this.finish();const ne=this.state,{blockLen:ue}=this;for(let G=0,pe=K.length;G<pe;){this.posOut>=ue&&this.keccak();const he=Math.min(ue-this.posOut,pe-G);K.set(ne.subarray(this.posOut,this.posOut+he),G),this.posOut+=he,G+=he}return K}xofInto(G){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(G)}xof(K){return(0,G.number)(K),this.xofInto(new Uint8Array(K))}digestInto(K){if((0,G.output)(K,this),this.finished)throw new Error("digest() was already called");return this.writeInto(K),this.destroy(),K}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(G){const{blockLen:K,suffix:ne,outputLen:ue,rounds:pe,enableXOF:he}=this;return G||(G=new Keccak(K,ne,ue,he,pe)),G.state32.set(this.state32),G.pos=this.pos,G.posOut=this.posOut,G.finished=this.finished,G.rounds=pe,G.suffix=ne,G.outputLen=ue,G.enableXOF=he,G.destroyed=this.destroyed,G}}zM.Keccak=Keccak;const gen=(G,K,ue)=>(0,ne.wrapConstructor)((()=>new Keccak(K,G,ue)));zM.sha3_224=gen(6,144,28),zM.sha3_256=gen(6,136,32),zM.sha3_384=gen(6,104,48),zM.sha3_512=gen(6,72,64),zM.keccak_224=gen(1,144,28),zM.keccak_256=gen(1,136,32),zM.keccak_384=gen(1,104,48),zM.keccak_512=gen(1,72,64);const genShake=(G,K,ue)=>(0,ne.wrapXOFConstructorWithOpts)(((ne={})=>new Keccak(K,G,void 0===ne.dkLen?ue:ne.dkLen,!0)));return zM.shake128=genShake(31,168,16),zM.shake256=genShake(31,136,32),zM}(),K=requireUtils$4();let ne=!1;const _keccak256=function(K){return(0,G.keccak_256)(K)};let ue=_keccak256;function keccak256(G){const ne=(0,K.getBytes)(G,"data");return(0,K.hexlify)(ue(ne))}return WM.keccak256=keccak256,keccak256._=_keccak256,keccak256.lock=function(){ne=!0},keccak256.register=function(G){if(ne)throw new TypeError("keccak256 is locked");ue=G},Object.freeze(keccak256),WM}var VM,KM,JM={},XM={};function requireRipemd160$1(){if(VM)return XM;VM=1,Object.defineProperty(XM,"__esModule",{value:!0}),XM.ripemd160=XM.RIPEMD160=void 0;const G=require_sha2$1(),K=requireUtils$3(),ne=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ue=Uint8Array.from({length:16},((G,K)=>K)),pe=ue.map((G=>(9*G+5)%16));let he=[ue],ye=[pe];for(let G=0;G<4;G++)for(let K of[he,ye])K.push(K[G].map((G=>ne[G])));const me=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((G=>new Uint8Array(G))),be=he.map(((G,K)=>G.map((G=>me[K][G])))),ve=ye.map(((G,K)=>G.map((G=>me[K][G])))),_e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Te=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),rotl=(G,K)=>G<<K|G>>>32-K;function f(G,K,ne,ue){return 0===G?K^ne^ue:1===G?K&ne|~K&ue:2===G?(K|~ne)^ue:3===G?K&ue|ne&~ue:K^(ne|~ue)}const Ee=new Uint32Array(16);class RIPEMD160 extends G.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:G,h1:K,h2:ne,h3:ue,h4:pe}=this;return[G,K,ne,ue,pe]}set(G,K,ne,ue,pe){this.h0=0|G,this.h1=0|K,this.h2=0|ne,this.h3=0|ue,this.h4=0|pe}undefined(G,K){for(let ne=0;ne<16;ne++,K+=4)Ee[ne]=G.getUint32(K,!0);let ne=0|this.h0,ue=ne,pe=0|this.h1,me=pe,Pe=0|this.h2,Se=Pe,Ce=0|this.h3,ke=Ce,Oe=0|this.h4,xe=Oe;for(let G=0;G<5;G++){const K=4-G,Ne=_e[G],Me=Te[G],Be=he[G],Fe=ye[G],De=be[G],Le=ve[G];for(let K=0;K<16;K++){const ue=rotl(ne+f(G,pe,Pe,Ce)+Ee[Be[K]]+Ne,De[K])+Oe|0;ne=Oe,Oe=Ce,Ce=0|rotl(Pe,10),Pe=pe,pe=ue}for(let G=0;G<16;G++){const ne=rotl(ue+f(K,me,Se,ke)+Ee[Fe[G]]+Me,Le[G])+xe|0;ue=xe,xe=ke,ke=0|rotl(Se,10),Se=me,me=ne}}this.set(this.h1+Pe+ke|0,this.h2+Ce+xe|0,this.h3+Oe+ue|0,this.h4+ne+me|0,this.h0+pe+Se|0)}roundClean(){Ee.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}return XM.RIPEMD160=RIPEMD160,XM.ripemd160=(0,K.wrapConstructor)((()=>new RIPEMD160)),XM}var QM,ZM={};var YM,eB={};var tB,rB,nB={},aB={};function requireScrypt$1(){if(tB)return aB;tB=1,Object.defineProperty(aB,"__esModule",{value:!0}),aB.scryptAsync=aB.scrypt=void 0;const G=require_assert$1(),K=requireSha256$1(),ne=requirePbkdf2$1(),ue=requireUtils$3(),rotl=(G,K)=>G<<K|G>>>32-K;function XorAndSalsa(G,K,ne,ue,pe,he){let ye=G[K++]^ne[ue++],me=G[K++]^ne[ue++],be=G[K++]^ne[ue++],ve=G[K++]^ne[ue++],_e=G[K++]^ne[ue++],Te=G[K++]^ne[ue++],Ee=G[K++]^ne[ue++],Pe=G[K++]^ne[ue++],Se=G[K++]^ne[ue++],Ce=G[K++]^ne[ue++],ke=G[K++]^ne[ue++],Oe=G[K++]^ne[ue++],xe=G[K++]^ne[ue++],Ne=G[K++]^ne[ue++],Me=G[K++]^ne[ue++],Be=G[K++]^ne[ue++],Fe=ye,De=me,Le=be,Ue=ve,je=_e,ze=Te,Je=Ee,Xe=Pe,Qe=Se,Ye=Ce,et=ke,tt=Oe,rt=xe,nt=Ne,at=Me,it=Be;for(let G=0;G<8;G+=2)je^=rotl(Fe+rt|0,7),Qe^=rotl(je+Fe|0,9),rt^=rotl(Qe+je|0,13),Fe^=rotl(rt+Qe|0,18),Ye^=rotl(ze+De|0,7),nt^=rotl(Ye+ze|0,9),De^=rotl(nt+Ye|0,13),ze^=rotl(De+nt|0,18),at^=rotl(et+Je|0,7),Le^=rotl(at+et|0,9),Je^=rotl(Le+at|0,13),et^=rotl(Je+Le|0,18),Ue^=rotl(it+tt|0,7),Xe^=rotl(Ue+it|0,9),tt^=rotl(Xe+Ue|0,13),it^=rotl(tt+Xe|0,18),De^=rotl(Fe+Ue|0,7),Le^=rotl(De+Fe|0,9),Ue^=rotl(Le+De|0,13),Fe^=rotl(Ue+Le|0,18),Je^=rotl(ze+je|0,7),Xe^=rotl(Je+ze|0,9),je^=rotl(Xe+Je|0,13),ze^=rotl(je+Xe|0,18),tt^=rotl(et+Ye|0,7),Qe^=rotl(tt+et|0,9),Ye^=rotl(Qe+tt|0,13),et^=rotl(Ye+Qe|0,18),rt^=rotl(it+at|0,7),nt^=rotl(rt+it|0,9),at^=rotl(nt+rt|0,13),it^=rotl(at+nt|0,18);pe[he++]=ye+Fe|0,pe[he++]=me+De|0,pe[he++]=be+Le|0,pe[he++]=ve+Ue|0,pe[he++]=_e+je|0,pe[he++]=Te+ze|0,pe[he++]=Ee+Je|0,pe[he++]=Pe+Xe|0,pe[he++]=Se+Qe|0,pe[he++]=Ce+Ye|0,pe[he++]=ke+et|0,pe[he++]=Oe+tt|0,pe[he++]=xe+rt|0,pe[he++]=Ne+nt|0,pe[he++]=Me+at|0,pe[he++]=Be+it|0}function BlockMix(G,K,ne,ue,pe){let he=ue+0,ye=ue+16*pe;for(let ue=0;ue<16;ue++)ne[ye+ue]=G[K+16*(2*pe-1)+ue];for(let ue=0;ue<pe;ue++,he+=16,K+=16)XorAndSalsa(ne,ye,G,K,ne,he),ue>0&&(ye+=16),XorAndSalsa(ne,he,G,K+=16,ne,ye)}function scryptInit(pe,he,ye){const me=(0,ue.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},ye),{N:be,r:ve,p:_e,dkLen:Te,asyncTick:Ee,maxmem:Pe,onProgress:Se}=me;if((0,G.number)(be),(0,G.number)(ve),(0,G.number)(_e),(0,G.number)(Te),(0,G.number)(Ee),(0,G.number)(Pe),void 0!==Se&&"function"!=typeof Se)throw new Error("progressCb should be function");const Ce=128*ve,ke=Ce/4;if(be<=1||0!=(be&be-1)||be>=2**(Ce/8)||be>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(_e<0||_e>137438953440/Ce)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(Te<0||Te>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const Oe=Ce*(be+_e);if(Oe>Pe)throw new Error(`Scrypt: parameters too large, ${Oe} (128 * r * (N + p)) > ${Pe} (maxmem)`);const xe=(0,ne.pbkdf2)(K.sha256,pe,he,{c:1,dkLen:Ce*_e}),Ne=(0,ue.u32)(xe),Me=(0,ue.u32)(new Uint8Array(Ce*be)),Be=(0,ue.u32)(new Uint8Array(Ce));let blockMixCb=()=>{};if(Se){const G=2*be*_e,K=Math.max(Math.floor(G/1e4),1);let ne=0;blockMixCb=()=>{ne++,!Se||ne%K&&ne!==G||Se(ne/G)}}return{N:be,r:ve,p:_e,dkLen:Te,blockSize32:ke,V:Me,B32:Ne,B:xe,tmp:Be,blockMixCb:blockMixCb,asyncTick:Ee}}function scryptOutput(G,ue,pe,he,ye){const me=(0,ne.pbkdf2)(K.sha256,G,pe,{c:1,dkLen:ue});return pe.fill(0),he.fill(0),ye.fill(0),me}return aB.scrypt=function scrypt$1(G,K,ne){const{N:ue,r:pe,p:he,dkLen:ye,blockSize32:me,V:be,B32:ve,B:_e,tmp:Te,blockMixCb:Ee}=scryptInit(G,K,ne);for(let G=0;G<he;G++){const K=me*G;for(let G=0;G<me;G++)be[G]=ve[K+G];for(let G=0,K=0;G<ue-1;G++)BlockMix(be,K,be,K+=me,pe),Ee();BlockMix(be,(ue-1)*me,ve,K,pe),Ee();for(let G=0;G<ue;G++){const G=ve[K+me-16]%ue;for(let ne=0;ne<me;ne++)Te[ne]=ve[K+ne]^be[G*me+ne];BlockMix(Te,0,ve,K,pe),Ee()}}return scryptOutput(G,ye,_e,be,Te)},aB.scryptAsync=async function scryptAsync(G,K,ne){const{N:pe,r:he,p:ye,dkLen:me,blockSize32:be,V:ve,B32:_e,B:Te,tmp:Ee,blockMixCb:Pe,asyncTick:Se}=scryptInit(G,K,ne);for(let G=0;G<ye;G++){const K=be*G;for(let G=0;G<be;G++)ve[G]=_e[K+G];let ne=0;await(0,ue.asyncLoop)(pe-1,Se,(()=>{BlockMix(ve,ne,ve,ne+=be,he),Pe()})),BlockMix(ve,(pe-1)*be,_e,K,he),Pe(),await(0,ue.asyncLoop)(pe,Se,(()=>{const G=_e[K+be-16]%pe;for(let ne=0;ne<be;ne++)Ee[ne]=_e[K+ne]^ve[G*be+ne];BlockMix(Ee,0,_e,K,he),Pe()}))}return scryptOutput(G,me,Te,ve,Ee)},aB}var iB,sB={};var oB,cB={},dB={},uB={},fB={},lB={};function require_assert(){if(oB)return lB;function number(G){if(!Number.isSafeInteger(G)||G<0)throw new Error(`Wrong positive integer: ${G}`)}function bool(G){if("boolean"!=typeof G)throw new Error(`Expected boolean, not ${G}`)}function bytes(G,...K){if(!(G instanceof Uint8Array))throw new Error("Expected Uint8Array");if(K.length>0&&!K.includes(G.length))throw new Error(`Expected Uint8Array of length ${K}, not of length=${G.length}`)}function hash(G){if("function"!=typeof G||"function"!=typeof G.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");number(G.outputLen),number(G.blockLen)}function exists(G,K=!0){if(G.destroyed)throw new Error("Hash instance has been destroyed");if(K&&G.finished)throw new Error("Hash#digest() has already been called")}function output(G,K){bytes(G);const ne=K.outputLen;if(G.length<ne)throw new Error(`digestInto() expects output buffer of length at least ${ne}`)}oB=1,Object.defineProperty(lB,"__esModule",{value:!0}),lB.output=lB.exists=lB.hash=lB.bytes=lB.bool=lB.number=void 0,lB.number=number,lB.bool=bool,lB.bytes=bytes,lB.hash=hash,lB.exists=exists,lB.output=output;const G={number:number,bool:bool,bytes:bytes,hash:hash,exists:exists,output:output};return lB.default=G,lB}var pB,hB,yB,mB,bB={},gB={};function requireUtils$2(){return hB||(hB=1,function(G){
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
Object.defineProperty(G,"__esModule",{value:!0}),G.randomBytes=G.wrapXOFConstructorWithOpts=G.wrapConstructorWithOpts=G.wrapConstructor=G.checkOpts=G.Hash=G.concatBytes=G.toBytes=G.utf8ToBytes=G.asyncLoop=G.nextTick=G.hexToBytes=G.bytesToHex=G.isLE=G.rotr=G.createView=G.u32=G.u8=void 0;const K=function requireCrypto$1(){return pB||(pB=1,Object.defineProperty(gB,"__esModule",{value:!0}),gB.crypto=void 0,gB.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),gB}(),u8a=G=>G instanceof Uint8Array;G.u8=G=>new Uint8Array(G.buffer,G.byteOffset,G.byteLength);G.u32=G=>new Uint32Array(G.buffer,G.byteOffset,Math.floor(G.byteLength/4));G.createView=G=>new DataView(G.buffer,G.byteOffset,G.byteLength);if(G.rotr=(G,K)=>G<<32-K|G>>>K,G.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!G.isLE)throw new Error("Non little-endian hardware is not supported");const ne=Array.from({length:256},((G,K)=>K.toString(16).padStart(2,"0")));G.bytesToHex=function bytesToHex(G){if(!u8a(G))throw new Error("Uint8Array expected");let K="";for(let ue=0;ue<G.length;ue++)K+=ne[G[ue]];return K},G.hexToBytes=function hexToBytes(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);const K=G.length;if(K%2)throw new Error("padded hex string expected, got unpadded hex of length "+K);const ne=new Uint8Array(K/2);for(let K=0;K<ne.length;K++){const ue=2*K,pe=G.slice(ue,ue+2),he=Number.parseInt(pe,16);if(Number.isNaN(he)||he<0)throw new Error("Invalid byte sequence");ne[K]=he}return ne};function utf8ToBytes(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))}function toBytes(G){if("string"==typeof G&&(G=utf8ToBytes(G)),!u8a(G))throw new Error("expected Uint8Array, got "+typeof G);return G}G.nextTick=async()=>{},G.asyncLoop=async function asyncLoop(K,ne,ue){let pe=Date.now();for(let he=0;he<K;he++){ue(he);const K=Date.now()-pe;K>=0&&K<ne||(await(0,G.nextTick)(),pe+=K)}},G.utf8ToBytes=utf8ToBytes,G.toBytes=toBytes,G.concatBytes=function concatBytes(...G){const K=new Uint8Array(G.reduce(((G,K)=>G+K.length),0));let ne=0;return G.forEach((G=>{if(!u8a(G))throw new Error("Uint8Array expected");K.set(G,ne),ne+=G.length})),K};G.Hash=class Hash{clone(){return this._cloneInto()}};const ue={}.toString;G.checkOpts=function checkOpts(G,K){if(void 0!==K&&"[object Object]"!==ue.call(K))throw new Error("Options should be object or undefined");return Object.assign(G,K)},G.wrapConstructor=function wrapConstructor(G){const hashC=K=>G().update(toBytes(K)).digest(),K=G();return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=()=>G(),hashC},G.wrapConstructorWithOpts=function wrapConstructorWithOpts(G){const hashC=(K,ne)=>G(ne).update(toBytes(K)).digest(),K=G({});return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=K=>G(K),hashC},G.wrapXOFConstructorWithOpts=function wrapXOFConstructorWithOpts(G){const hashC=(K,ne)=>G(ne).update(toBytes(K)).digest(),K=G({});return hashC.outputLen=K.outputLen,hashC.blockLen=K.blockLen,hashC.create=K=>G(K),hashC},G.randomBytes=function randomBytes(G=32){if(K.crypto&&"function"==typeof K.crypto.getRandomValues)return K.crypto.getRandomValues(new Uint8Array(G));throw new Error("crypto.getRandomValues must be defined")}}(bB)),bB}function require_sha2(){if(yB)return fB;yB=1,Object.defineProperty(fB,"__esModule",{value:!0}),fB.SHA2=void 0;const G=require_assert(),K=requireUtils$2();class SHA2 extends K.Hash{constructor(G,ne,ue,pe){super(),this.blockLen=G,this.outputLen=ne,this.padOffset=ue,this.isLE=pe,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(G),this.view=(0,K.createView)(this.buffer)}update(ne){(0,G.exists)(this);const{view:ue,buffer:pe,blockLen:he}=this,ye=(ne=(0,K.toBytes)(ne)).length;for(let G=0;G<ye;){const me=Math.min(he-this.pos,ye-G);if(me!==he)pe.set(ne.subarray(G,G+me),this.pos),this.pos+=me,G+=me,this.pos===he&&(this.undefined(ue,0),this.pos=0);else{const ue=(0,K.createView)(ne);for(;he<=ye-G;G+=he)this.undefined(ue,G)}}return this.length+=ne.length,this.roundClean(),this}digestInto(ne){(0,G.exists)(this),(0,G.output)(ne,this),this.finished=!0;const{buffer:ue,view:pe,blockLen:he,isLE:ye}=this;let{pos:me}=this;ue[me++]=128,this.buffer.subarray(me).fill(0),this.padOffset>he-me&&(this.undefined(pe,0),me=0);for(let G=me;G<he;G++)ue[G]=0;!function setBigUint64(G,K,ne,ue){if("function"==typeof G.setBigUint64)return G.setBigUint64(K,ne,ue);const pe=BigInt(32),he=BigInt(4294967295),ye=Number(ne>>pe&he),me=Number(ne&he),be=ue?4:0,ve=ue?0:4;G.setUint32(K+be,ye,ue),G.setUint32(K+ve,me,ue)}(pe,he-8,BigInt(8*this.length),ye),this.undefined(pe,0);const be=(0,K.createView)(ne),ve=this.outputLen;if(ve%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const _e=ve/4,Te=this.get();if(_e>Te.length)throw new Error("_sha2: outputLen bigger than state");for(let G=0;G<_e;G++)be.setUint32(4*G,Te[G],ye)}digest(){const{buffer:G,outputLen:K}=this;this.digestInto(G);const ne=G.slice(0,K);return this.destroy(),ne}_cloneInto(G){G||(G=new this.constructor),G.set(...this.get());const{blockLen:K,buffer:ne,length:ue,finished:pe,destroyed:he,pos:ye}=this;return G.length=ue,G.pos=ye,G.finished=pe,G.destroyed=he,ue%K&&G.buffer.set(ne),G}}return fB.SHA2=SHA2,fB}var vB,wB,_B={},TB={};function requireUtils$1(){if(vB)return TB;vB=1,Object.defineProperty(TB,"__esModule",{value:!0}),TB.validateObject=TB.createHmacDrbg=TB.bitMask=TB.bitSet=TB.bitGet=TB.bitLen=TB.utf8ToBytes=TB.equalBytes=TB.concatBytes=TB.ensureBytes=TB.numberToVarBytesBE=TB.numberToBytesLE=TB.numberToBytesBE=TB.bytesToNumberLE=TB.bytesToNumberBE=TB.hexToBytes=TB.hexToNumber=TB.numberToHexUnpadded=TB.bytesToHex=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const G=BigInt(0),K=BigInt(1),ne=BigInt(2),u8a=G=>G instanceof Uint8Array,ue=Array.from({length:256},((G,K)=>K.toString(16).padStart(2,"0")));function bytesToHex(G){if(!u8a(G))throw new Error("Uint8Array expected");let K="";for(let ne=0;ne<G.length;ne++)K+=ue[G[ne]];return K}function numberToHexUnpadded(G){const K=G.toString(16);return 1&K.length?`0${K}`:K}function hexToNumber(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);return BigInt(""===G?"0":`0x${G}`)}function hexToBytes(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);const K=G.length;if(K%2)throw new Error("padded hex string expected, got unpadded hex of length "+K);const ne=new Uint8Array(K/2);for(let K=0;K<ne.length;K++){const ue=2*K,pe=G.slice(ue,ue+2),he=Number.parseInt(pe,16);if(Number.isNaN(he)||he<0)throw new Error("Invalid byte sequence");ne[K]=he}return ne}function numberToBytesBE(G,K){return hexToBytes(G.toString(16).padStart(2*K,"0"))}function concatBytes(...G){const K=new Uint8Array(G.reduce(((G,K)=>G+K.length),0));let ne=0;return G.forEach((G=>{if(!u8a(G))throw new Error("Uint8Array expected");K.set(G,ne),ne+=G.length})),K}TB.bytesToHex=bytesToHex,TB.numberToHexUnpadded=numberToHexUnpadded,TB.hexToNumber=hexToNumber,TB.hexToBytes=hexToBytes,TB.bytesToNumberBE=function bytesToNumberBE(G){return hexToNumber(bytesToHex(G))},TB.bytesToNumberLE=function bytesToNumberLE(G){if(!u8a(G))throw new Error("Uint8Array expected");return hexToNumber(bytesToHex(Uint8Array.from(G).reverse()))},TB.numberToBytesBE=numberToBytesBE,TB.numberToBytesLE=function numberToBytesLE(G,K){return numberToBytesBE(G,K).reverse()},TB.numberToVarBytesBE=function numberToVarBytesBE(G){return hexToBytes(numberToHexUnpadded(G))},TB.ensureBytes=function ensureBytes(G,K,ne){let ue;if("string"==typeof K)try{ue=hexToBytes(K)}catch(ne){throw new Error(`${G} must be valid hex string, got "${K}". Cause: ${ne}`)}else{if(!u8a(K))throw new Error(`${G} must be hex string or Uint8Array`);ue=Uint8Array.from(K)}const pe=ue.length;if("number"==typeof ne&&pe!==ne)throw new Error(`${G} expected ${ne} bytes, got ${pe}`);return ue},TB.concatBytes=concatBytes,TB.equalBytes=function equalBytes(G,K){if(G.length!==K.length)return!1;for(let ne=0;ne<G.length;ne++)if(G[ne]!==K[ne])return!1;return!0},TB.utf8ToBytes=function utf8ToBytes(G){if("string"!=typeof G)throw new Error("utf8ToBytes expected string, got "+typeof G);return new Uint8Array((new TextEncoder).encode(G))},TB.bitLen=function bitLen(ne){let ue;for(ue=0;ne>G;ne>>=K,ue+=1);return ue},TB.bitGet=function bitGet(G,ne){return G>>BigInt(ne)&K};TB.bitSet=(ne,ue,pe)=>ne|(pe?K:G)<<BigInt(ue);TB.bitMask=G=>(ne<<BigInt(G-1))-K;const u8n=G=>new Uint8Array(G),u8fr=G=>Uint8Array.from(G);TB.createHmacDrbg=function createHmacDrbg(G,K,ne){if("number"!=typeof G||G<2)throw new Error("hashLen must be a number");if("number"!=typeof K||K<2)throw new Error("qByteLen must be a number");if("function"!=typeof ne)throw new Error("hmacFn must be a function");let ue=u8n(G),pe=u8n(G),he=0;const reset=()=>{ue.fill(1),pe.fill(0),he=0},h=(...G)=>ne(pe,ue,...G),reseed=(G=u8n())=>{pe=h(u8fr([0]),G),ue=h(),0!==G.length&&(pe=h(u8fr([1]),G),ue=h())},gen=()=>{if(he++>=1e3)throw new Error("drbg: tried 1000 values");let G=0;const ne=[];for(;G<K;){ue=h();const K=ue.slice();ne.push(K),G+=ue.length}return concatBytes(...ne)};return(G,K)=>{let ne;for(reset(),reseed(G);!(ne=K(gen()));)reseed();return reset(),ne}};const pe={bigint:G=>"bigint"==typeof G,function:G=>"function"==typeof G,boolean:G=>"boolean"==typeof G,string:G=>"string"==typeof G,stringOrUint8Array:G=>"string"==typeof G||G instanceof Uint8Array,isSafeInteger:G=>Number.isSafeInteger(G),array:G=>Array.isArray(G),field:(G,K)=>K.Fp.isValid(G),hash:G=>"function"==typeof G&&Number.isSafeInteger(G.outputLen)};return TB.validateObject=function validateObject(G,K,ne={}){const checkField=(K,ne,ue)=>{const he=pe[ne];if("function"!=typeof he)throw new Error(`Invalid validator "${ne}", expected function`);const ye=G[K];if(!(ue&&void 0===ye||he(ye,G)))throw new Error(`Invalid param ${String(K)}=${ye} (${typeof ye}), expected ${ne}`)};for(const[G,ne]of Object.entries(K))checkField(G,ne,!1);for(const[G,K]of Object.entries(ne))checkField(G,K,!0);return G},TB}function requireModular(){if(wB)return _B;wB=1,Object.defineProperty(_B,"__esModule",{value:!0}),_B.mapHashToField=_B.getMinHashLength=_B.getFieldBytesLength=_B.hashToPrivateScalar=_B.FpSqrtEven=_B.FpSqrtOdd=_B.Field=_B.nLength=_B.FpIsSquare=_B.FpDiv=_B.FpInvertBatch=_B.FpPow=_B.validateField=_B.isNegativeLE=_B.FpSqrt=_B.tonelliShanks=_B.invert=_B.pow2=_B.pow=_B.mod=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const G=requireUtils$1(),K=BigInt(0),ne=BigInt(1),ue=BigInt(2),pe=BigInt(3),he=BigInt(4),ye=BigInt(5),me=BigInt(8);function mod(G,ne){const ue=G%ne;return ue>=K?ue:ne+ue}function pow(G,ue,pe){if(pe<=K||ue<K)throw new Error("Expected power/modulo > 0");if(pe===ne)return K;let he=ne;for(;ue>K;)ue&ne&&(he=he*G%pe),G=G*G%pe,ue>>=ne;return he}function invert(G,ue){if(G===K||ue<=K)throw new Error(`invert: expected positive integers, got n=${G} mod=${ue}`);let pe=mod(G,ue),he=ue,ye=K,me=ne;for(;pe!==K;){const G=he%pe,K=ye-me*(he/pe);he=pe,pe=G,ye=me,me=K}if(he!==ne)throw new Error("invert: does not exist");return mod(ye,ue)}function tonelliShanks(G){const pe=(G-ne)/ue;let ye,me,be;for(ye=G-ne,me=0;ye%ue===K;ye/=ue,me++);for(be=ue;be<G&&pow(be,pe,G)!==G-ne;be++);if(1===me){const K=(G+ne)/he;return function tonelliFast(G,ne){const ue=G.pow(ne,K);if(!G.eql(G.sqr(ue),ne))throw new Error("Cannot find square root");return ue}}const ve=(ye+ne)/ue;return function tonelliSlow(G,K){if(G.pow(K,pe)===G.neg(G.ONE))throw new Error("Cannot find square root");let ue=me,he=G.pow(G.mul(G.ONE,be),ye),_e=G.pow(K,ve),Te=G.pow(K,ye);for(;!G.eql(Te,G.ONE);){if(G.eql(Te,G.ZERO))return G.ZERO;let K=1;for(let ne=G.sqr(Te);K<ue&&!G.eql(ne,G.ONE);K++)ne=G.sqr(ne);const pe=G.pow(he,ne<<BigInt(ue-K-1));he=G.sqr(pe),_e=G.mul(_e,pe),Te=G.mul(Te,he),ue=K}return _e}}function FpSqrt(G){if(G%he===pe){const K=(G+ne)/he;return function sqrt3mod4(G,ne){const ue=G.pow(ne,K);if(!G.eql(G.sqr(ue),ne))throw new Error("Cannot find square root");return ue}}if(G%me===ye){const K=(G-ye)/me;return function sqrt5mod8(G,ne){const pe=G.mul(ne,ue),he=G.pow(pe,K),ye=G.mul(ne,he),me=G.mul(G.mul(ye,ue),he),be=G.mul(ye,G.sub(me,G.ONE));if(!G.eql(G.sqr(be),ne))throw new Error("Cannot find square root");return be}}return tonelliShanks(G)}BigInt(9),BigInt(16),_B.mod=mod,_B.pow=pow,_B.pow2=function pow2(G,ne,ue){let pe=G;for(;ne-- >K;)pe*=pe,pe%=ue;return pe},_B.invert=invert,_B.tonelliShanks=tonelliShanks,_B.FpSqrt=FpSqrt;_B.isNegativeLE=(G,K)=>(mod(G,K)&ne)===ne;const be=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function FpPow(G,ue,pe){if(pe<K)throw new Error("Expected power > 0");if(pe===K)return G.ONE;if(pe===ne)return ue;let he=G.ONE,ye=ue;for(;pe>K;)pe&ne&&(he=G.mul(he,ye)),ye=G.sqr(ye),pe>>=ne;return he}function FpInvertBatch(G,K){const ne=new Array(K.length),ue=K.reduce(((K,ue,pe)=>G.is0(ue)?K:(ne[pe]=K,G.mul(K,ue))),G.ONE),pe=G.inv(ue);return K.reduceRight(((K,ue,pe)=>G.is0(ue)?K:(ne[pe]=G.mul(K,ne[pe]),G.mul(K,ue))),pe),ne}function nLength(G,K){const ne=void 0!==K?K:G.toString(2).length;return{nBitLength:ne,nByteLength:Math.ceil(ne/8)}}function getFieldBytesLength(G){if("bigint"!=typeof G)throw new Error("field order must be bigint");const K=G.toString(2).length;return Math.ceil(K/8)}function getMinHashLength(G){const K=getFieldBytesLength(G);return K+Math.ceil(K/2)}return _B.validateField=function validateField(K){const ne=be.reduce(((G,K)=>(G[K]="function",G)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,G.validateObject)(K,ne)},_B.FpPow=FpPow,_B.FpInvertBatch=FpInvertBatch,_B.FpDiv=function FpDiv(G,K,ne){return G.mul(K,"bigint"==typeof ne?invert(ne,G.ORDER):G.inv(ne))},_B.FpIsSquare=function FpIsSquare(G){const K=(G.ORDER-ne)/ue;return ne=>{const ue=G.pow(ne,K);return G.eql(ue,G.ZERO)||G.eql(ue,G.ONE)}},_B.nLength=nLength,_B.Field=function Field(ue,pe,he=!1,ye={}){if(ue<=K)throw new Error(`Expected Field ORDER > 0, got ${ue}`);const{nBitLength:me,nByteLength:be}=nLength(ue,pe);if(be>2048)throw new Error("Field lengths over 2048 bytes are not supported");const ve=FpSqrt(ue),_e=Object.freeze({ORDER:ue,BITS:me,BYTES:be,MASK:(0,G.bitMask)(me),ZERO:K,ONE:ne,create:G=>mod(G,ue),isValid:G=>{if("bigint"!=typeof G)throw new Error("Invalid field element: expected bigint, got "+typeof G);return K<=G&&G<ue},is0:G=>G===K,isOdd:G=>(G&ne)===ne,neg:G=>mod(-G,ue),eql:(G,K)=>G===K,sqr:G=>mod(G*G,ue),add:(G,K)=>mod(G+K,ue),sub:(G,K)=>mod(G-K,ue),mul:(G,K)=>mod(G*K,ue),pow:(G,K)=>FpPow(_e,G,K),div:(G,K)=>mod(G*invert(K,ue),ue),sqrN:G=>G*G,addN:(G,K)=>G+K,subN:(G,K)=>G-K,mulN:(G,K)=>G*K,inv:G=>invert(G,ue),sqrt:ye.sqrt||(G=>ve(_e,G)),invertBatch:G=>FpInvertBatch(_e,G),cmov:(G,K,ne)=>ne?K:G,toBytes:K=>he?(0,G.numberToBytesLE)(K,be):(0,G.numberToBytesBE)(K,be),fromBytes:K=>{if(K.length!==be)throw new Error(`Fp.fromBytes: expected ${be}, got ${K.length}`);return he?(0,G.bytesToNumberLE)(K):(0,G.bytesToNumberBE)(K)}});return Object.freeze(_e)},_B.FpSqrtOdd=function FpSqrtOdd(G,K){if(!G.isOdd)throw new Error("Field doesn't have isOdd");const ne=G.sqrt(K);return G.isOdd(ne)?ne:G.neg(ne)},_B.FpSqrtEven=function FpSqrtEven(G,K){if(!G.isOdd)throw new Error("Field doesn't have isOdd");const ne=G.sqrt(K);return G.isOdd(ne)?G.neg(ne):ne},_B.hashToPrivateScalar=function hashToPrivateScalar(K,ue,pe=!1){const he=(K=(0,G.ensureBytes)("privateHash",K)).length,ye=nLength(ue).nByteLength+8;if(ye<24||he<ye||he>1024)throw new Error(`hashToPrivateScalar: expected ${ye}-1024 bytes of input, got ${he}`);return mod(pe?(0,G.bytesToNumberLE)(K):(0,G.bytesToNumberBE)(K),ue-ne)+ne},_B.getFieldBytesLength=getFieldBytesLength,_B.getMinHashLength=getMinHashLength,_B.mapHashToField=function mapHashToField(K,ue,pe=!1){const he=K.length,ye=getFieldBytesLength(ue),me=getMinHashLength(ue);if(he<16||he<me||he>1024)throw new Error(`expected ${me}-1024 bytes of input, got ${he}`);const be=mod(pe?(0,G.bytesToNumberBE)(K):(0,G.bytesToNumberLE)(K),ue-ne)+ne;return pe?(0,G.numberToBytesLE)(be,ye):(0,G.numberToBytesBE)(be,ye)},_B}var AB,EB,PB={},SB={};function requireWeierstrass(){return EB||(EB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.mapToCurveSimpleSWU=G.SWUFpSqrtRatio=G.weierstrass=G.weierstrassPoints=G.DER=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const K=requireModular(),ne=requireUtils$1(),ue=requireUtils$1(),pe=function requireCurve(){if(AB)return SB;AB=1,Object.defineProperty(SB,"__esModule",{value:!0}),SB.validateBasic=SB.wNAF=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const G=requireModular(),K=requireUtils$1(),ne=BigInt(0),ue=BigInt(1);return SB.wNAF=function wNAF(G,K){const constTimeNegate=(G,K)=>{const ne=K.negate();return G?ne:K},opts=G=>({windows:Math.ceil(K/G)+1,windowSize:2**(G-1)});return{constTimeNegate:constTimeNegate,unsafeLadder(K,pe){let he=G.ZERO,ye=K;for(;pe>ne;)pe&ue&&(he=he.add(ye)),ye=ye.double(),pe>>=ue;return he},precomputeWindow(G,K){const{windows:ne,windowSize:ue}=opts(K),pe=[];let he=G,ye=he;for(let G=0;G<ne;G++){ye=he,pe.push(ye);for(let G=1;G<ue;G++)ye=ye.add(he),pe.push(ye);he=ye.double()}return pe},wNAF(K,ne,pe){const{windows:he,windowSize:ye}=opts(K);let me=G.ZERO,be=G.BASE;const ve=BigInt(2**K-1),_e=2**K,Te=BigInt(K);for(let G=0;G<he;G++){const K=G*ye;let he=Number(pe&ve);pe>>=Te,he>ye&&(he-=_e,pe+=ue);const Ee=K,Pe=K+Math.abs(he)-1,Se=G%2!=0,Ce=he<0;0===he?be=be.add(constTimeNegate(Se,ne[Ee])):me=me.add(constTimeNegate(Ce,ne[Pe]))}return{p:me,f:be}},wNAFCached(G,K,ne,ue){const pe=G._WINDOW_SIZE||1;let he=K.get(G);return he||(he=this.precomputeWindow(G,pe),1!==pe&&K.set(G,ue(he))),this.wNAF(pe,he,ne)}}},SB.validateBasic=function validateBasic(ne){return(0,G.validateField)(ne.Fp),(0,K.validateObject)(ne,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,G.nLength)(ne.n,ne.nBitLength),...ne,p:ne.Fp.ORDER})},SB}();const{bytesToNumberBE:he,hexToBytes:ye}=ne;G.DER={Err:class DERErr extends Error{constructor(G=""){super(G)}},_parseInt(K){const{Err:ne}=G.DER;if(K.length<2||2!==K[0])throw new ne("Invalid signature integer tag");const ue=K[1],pe=K.subarray(2,ue+2);if(!ue||pe.length!==ue)throw new ne("Invalid signature integer: wrong length");if(128&pe[0])throw new ne("Invalid signature integer: negative");if(0===pe[0]&&!(128&pe[1]))throw new ne("Invalid signature integer: unnecessary leading zero");return{d:he(pe),l:K.subarray(ue+2)}},toSig(K){const{Err:ne}=G.DER,ue="string"==typeof K?ye(K):K;if(!(ue instanceof Uint8Array))throw new Error("ui8a expected");let pe=ue.length;if(pe<2||48!=ue[0])throw new ne("Invalid signature tag");if(ue[1]!==pe-2)throw new ne("Invalid signature: incorrect length");const{d:he,l:me}=G.DER._parseInt(ue.subarray(2)),{d:be,l:ve}=G.DER._parseInt(me);if(ve.length)throw new ne("Invalid signature: left bytes after parsing");return{r:he,s:be}},hexFromSig(G){const slice=G=>8&Number.parseInt(G[0],16)?"00"+G:G,h=G=>{const K=G.toString(16);return 1&K.length?`0${K}`:K},K=slice(h(G.s)),ne=slice(h(G.r)),ue=K.length/2,pe=ne.length/2,he=h(ue),ye=h(pe);return`30${h(pe+ue+4)}02${ye}${ne}02${he}${K}`}};const me=BigInt(0),be=BigInt(1),ve=BigInt(2),_e=BigInt(3),Te=BigInt(4);function weierstrassPoints(G){const he=function validatePointOpts(G){const K=(0,pe.validateBasic)(G);ne.validateObject(K,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:ue,Fp:he,a:ye}=K;if(ue){if(!he.eql(ye,he.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof ue||"bigint"!=typeof ue.beta||"function"!=typeof ue.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...K})}(G),{Fp:ye}=he,ve=he.toBytes||((G,K,ue)=>{const pe=K.toAffine();return ne.concatBytes(Uint8Array.from([4]),ye.toBytes(pe.x),ye.toBytes(pe.y))}),Te=he.fromBytes||(G=>{const K=G.subarray(1);return{x:ye.fromBytes(K.subarray(0,ye.BYTES)),y:ye.fromBytes(K.subarray(ye.BYTES,2*ye.BYTES))}});function weierstrassEquation(G){const{a:K,b:ne}=he,ue=ye.sqr(G),pe=ye.mul(ue,G);return ye.add(ye.add(pe,ye.mul(G,K)),ne)}if(!ye.eql(ye.sqr(he.Gy),weierstrassEquation(he.Gx)))throw new Error("bad generator point: equation left != right");function isWithinCurveOrder(G){return"bigint"==typeof G&&me<G&&G<he.n}function assertGE(G){if(!isWithinCurveOrder(G))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function normPrivateKeyToScalar(G){const{allowedPrivateKeyLengths:pe,nByteLength:ye,wrapPrivateKey:me,n:be}=he;if(pe&&"bigint"!=typeof G){if(G instanceof Uint8Array&&(G=ne.bytesToHex(G)),"string"!=typeof G||!pe.includes(G.length))throw new Error("Invalid key");G=G.padStart(2*ye,"0")}let ve;try{ve="bigint"==typeof G?G:ne.bytesToNumberBE((0,ue.ensureBytes)("private key",G,ye))}catch(K){throw new Error(`private key must be ${ye} bytes, hex or bigint, not ${typeof G}`)}return me&&(ve=K.mod(ve,be)),assertGE(ve),ve}const Ee=new Map;function assertPrjPoint(G){if(!(G instanceof Point))throw new Error("ProjectivePoint expected")}class Point{constructor(G,K,ne){if(this.px=G,this.py=K,this.pz=ne,null==G||!ye.isValid(G))throw new Error("x required");if(null==K||!ye.isValid(K))throw new Error("y required");if(null==ne||!ye.isValid(ne))throw new Error("z required")}static fromAffine(G){const{x:K,y:ne}=G||{};if(!G||!ye.isValid(K)||!ye.isValid(ne))throw new Error("invalid affine point");if(G instanceof Point)throw new Error("projective point not allowed");const is0=G=>ye.eql(G,ye.ZERO);return is0(K)&&is0(ne)?Point.ZERO:new Point(K,ne,ye.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(G){const K=ye.invertBatch(G.map((G=>G.pz)));return G.map(((G,ne)=>G.toAffine(K[ne]))).map(Point.fromAffine)}static fromHex(G){const K=Point.fromAffine(Te((0,ue.ensureBytes)("pointHex",G)));return K.assertValidity(),K}static fromPrivateKey(G){return Point.BASE.multiply(normPrivateKeyToScalar(G))}_setWindowSize(G){this._WINDOW_SIZE=G,Ee.delete(this)}assertValidity(){if(this.is0()){if(he.allowInfinityPoint&&!ye.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:G,y:K}=this.toAffine();if(!ye.isValid(G)||!ye.isValid(K))throw new Error("bad point: x or y not FE");const ne=ye.sqr(K),ue=weierstrassEquation(G);if(!ye.eql(ne,ue))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:G}=this.toAffine();if(ye.isOdd)return!ye.isOdd(G);throw new Error("Field doesn't support isOdd")}equals(G){assertPrjPoint(G);const{px:K,py:ne,pz:ue}=this,{px:pe,py:he,pz:me}=G,be=ye.eql(ye.mul(K,me),ye.mul(pe,ue)),ve=ye.eql(ye.mul(ne,me),ye.mul(he,ue));return be&&ve}negate(){return new Point(this.px,ye.neg(this.py),this.pz)}double(){const{a:G,b:K}=he,ne=ye.mul(K,_e),{px:ue,py:pe,pz:me}=this;let be=ye.ZERO,ve=ye.ZERO,Te=ye.ZERO,Ee=ye.mul(ue,ue),Pe=ye.mul(pe,pe),Se=ye.mul(me,me),Ce=ye.mul(ue,pe);return Ce=ye.add(Ce,Ce),Te=ye.mul(ue,me),Te=ye.add(Te,Te),be=ye.mul(G,Te),ve=ye.mul(ne,Se),ve=ye.add(be,ve),be=ye.sub(Pe,ve),ve=ye.add(Pe,ve),ve=ye.mul(be,ve),be=ye.mul(Ce,be),Te=ye.mul(ne,Te),Se=ye.mul(G,Se),Ce=ye.sub(Ee,Se),Ce=ye.mul(G,Ce),Ce=ye.add(Ce,Te),Te=ye.add(Ee,Ee),Ee=ye.add(Te,Ee),Ee=ye.add(Ee,Se),Ee=ye.mul(Ee,Ce),ve=ye.add(ve,Ee),Se=ye.mul(pe,me),Se=ye.add(Se,Se),Ee=ye.mul(Se,Ce),be=ye.sub(be,Ee),Te=ye.mul(Se,Pe),Te=ye.add(Te,Te),Te=ye.add(Te,Te),new Point(be,ve,Te)}add(G){assertPrjPoint(G);const{px:K,py:ne,pz:ue}=this,{px:pe,py:me,pz:be}=G;let ve=ye.ZERO,Te=ye.ZERO,Ee=ye.ZERO;const Pe=he.a,Se=ye.mul(he.b,_e);let Ce=ye.mul(K,pe),ke=ye.mul(ne,me),Oe=ye.mul(ue,be),xe=ye.add(K,ne),Ne=ye.add(pe,me);xe=ye.mul(xe,Ne),Ne=ye.add(Ce,ke),xe=ye.sub(xe,Ne),Ne=ye.add(K,ue);let Me=ye.add(pe,be);return Ne=ye.mul(Ne,Me),Me=ye.add(Ce,Oe),Ne=ye.sub(Ne,Me),Me=ye.add(ne,ue),ve=ye.add(me,be),Me=ye.mul(Me,ve),ve=ye.add(ke,Oe),Me=ye.sub(Me,ve),Ee=ye.mul(Pe,Ne),ve=ye.mul(Se,Oe),Ee=ye.add(ve,Ee),ve=ye.sub(ke,Ee),Ee=ye.add(ke,Ee),Te=ye.mul(ve,Ee),ke=ye.add(Ce,Ce),ke=ye.add(ke,Ce),Oe=ye.mul(Pe,Oe),Ne=ye.mul(Se,Ne),ke=ye.add(ke,Oe),Oe=ye.sub(Ce,Oe),Oe=ye.mul(Pe,Oe),Ne=ye.add(Ne,Oe),Ce=ye.mul(ke,Ne),Te=ye.add(Te,Ce),Ce=ye.mul(Me,Ne),ve=ye.mul(xe,ve),ve=ye.sub(ve,Ce),Ce=ye.mul(xe,ke),Ee=ye.mul(Me,Ee),Ee=ye.add(Ee,Ce),new Point(ve,Te,Ee)}subtract(G){return this.add(G.negate())}is0(){return this.equals(Point.ZERO)}wNAF(G){return Se.wNAFCached(this,Ee,G,(G=>{const K=ye.invertBatch(G.map((G=>G.pz)));return G.map(((G,ne)=>G.toAffine(K[ne]))).map(Point.fromAffine)}))}multiplyUnsafe(G){const K=Point.ZERO;if(G===me)return K;if(assertGE(G),G===be)return this;const{endo:ne}=he;if(!ne)return Se.unsafeLadder(this,G);let{k1neg:ue,k1:pe,k2neg:ve,k2:_e}=ne.splitScalar(G),Te=K,Ee=K,Pe=this;for(;pe>me||_e>me;)pe&be&&(Te=Te.add(Pe)),_e&be&&(Ee=Ee.add(Pe)),Pe=Pe.double(),pe>>=be,_e>>=be;return ue&&(Te=Te.negate()),ve&&(Ee=Ee.negate()),Ee=new Point(ye.mul(Ee.px,ne.beta),Ee.py,Ee.pz),Te.add(Ee)}multiply(G){assertGE(G);let K,ne,ue=G;const{endo:pe}=he;if(pe){const{k1neg:G,k1:he,k2neg:me,k2:be}=pe.splitScalar(ue);let{p:ve,f:_e}=this.wNAF(he),{p:Te,f:Ee}=this.wNAF(be);ve=Se.constTimeNegate(G,ve),Te=Se.constTimeNegate(me,Te),Te=new Point(ye.mul(Te.px,pe.beta),Te.py,Te.pz),K=ve.add(Te),ne=_e.add(Ee)}else{const{p:G,f:pe}=this.wNAF(ue);K=G,ne=pe}return Point.normalizeZ([K,ne])[0]}multiplyAndAddUnsafe(G,K,ne){const ue=Point.BASE,mul=(G,K)=>K!==me&&K!==be&&G.equals(ue)?G.multiply(K):G.multiplyUnsafe(K),pe=mul(this,K).add(mul(G,ne));return pe.is0()?void 0:pe}toAffine(G){const{px:K,py:ne,pz:ue}=this,pe=this.is0();null==G&&(G=pe?ye.ONE:ye.inv(ue));const he=ye.mul(K,G),me=ye.mul(ne,G),be=ye.mul(ue,G);if(pe)return{x:ye.ZERO,y:ye.ZERO};if(!ye.eql(be,ye.ONE))throw new Error("invZ was invalid");return{x:he,y:me}}isTorsionFree(){const{h:G,isTorsionFree:K}=he;if(G===be)return!0;if(K)return K(Point,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:G,clearCofactor:K}=he;return G===be?this:K?K(Point,this):this.multiplyUnsafe(he.h)}toRawBytes(G=!0){return this.assertValidity(),ve(Point,this,G)}toHex(G=!0){return ne.bytesToHex(this.toRawBytes(G))}}Point.BASE=new Point(he.Gx,he.Gy,ye.ONE),Point.ZERO=new Point(ye.ZERO,ye.ONE,ye.ZERO);const Pe=he.nBitLength,Se=(0,pe.wNAF)(Point,he.endo?Math.ceil(Pe/2):Pe);return{CURVE:he,ProjectivePoint:Point,normPrivateKeyToScalar:normPrivateKeyToScalar,weierstrassEquation:weierstrassEquation,isWithinCurveOrder:isWithinCurveOrder}}function SWUFpSqrtRatio(G,K){const ne=G.ORDER;let ue=me;for(let G=ne-be;G%ve===me;G/=ve)ue+=be;const pe=ue,he=ve<<pe-be-be,ye=he*ve,Ee=(ne-be)/ye,Pe=(Ee-be)/ve,Se=ye-be,Ce=he,ke=G.pow(K,Ee),Oe=G.pow(K,(Ee+be)/ve);let sqrtRatio=(K,ne)=>{let ue=ke,he=G.pow(ne,Se),ye=G.sqr(he);ye=G.mul(ye,ne);let me=G.mul(K,ye);me=G.pow(me,Pe),me=G.mul(me,he),he=G.mul(me,ne),ye=G.mul(me,K);let _e=G.mul(ye,he);me=G.pow(_e,Ce);let Te=G.eql(me,G.ONE);he=G.mul(ye,Oe),me=G.mul(_e,ue),ye=G.cmov(he,ye,Te),_e=G.cmov(me,_e,Te);for(let K=pe;K>be;K--){let ne=K-ve;ne=ve<<ne-be;let pe=G.pow(_e,ne);const me=G.eql(pe,G.ONE);he=G.mul(ye,ue),ue=G.mul(ue,ue),pe=G.mul(_e,ue),ye=G.cmov(he,ye,me),_e=G.cmov(pe,_e,me)}return{isValid:Te,value:ye}};if(G.ORDER%Te===_e){const ne=(G.ORDER-_e)/Te,ue=G.sqrt(G.neg(K));sqrtRatio=(K,pe)=>{let he=G.sqr(pe);const ye=G.mul(K,pe);he=G.mul(he,ye);let me=G.pow(he,ne);me=G.mul(me,ye);const be=G.mul(me,ue),ve=G.mul(G.sqr(me),pe),_e=G.eql(ve,K);return{isValid:_e,value:G.cmov(be,me,_e)}}}return sqrtRatio}G.weierstrassPoints=weierstrassPoints,G.weierstrass=function weierstrass(he){const ye=function validateOpts(G){const K=(0,pe.validateBasic)(G);return ne.validateObject(K,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...K})}(he),{Fp:ve,n:_e}=ye,Te=ve.BYTES+1,Ee=2*ve.BYTES+1;function modN(G){return K.mod(G,_e)}function invN(G){return K.invert(G,_e)}const{ProjectivePoint:Pe,normPrivateKeyToScalar:Se,weierstrassEquation:Ce,isWithinCurveOrder:ke}=weierstrassPoints({...ye,toBytes(G,K,ue){const pe=K.toAffine(),he=ve.toBytes(pe.x),ye=ne.concatBytes;return ue?ye(Uint8Array.from([K.hasEvenY()?2:3]),he):ye(Uint8Array.from([4]),he,ve.toBytes(pe.y))},fromBytes(G){const K=G.length,ue=G[0],pe=G.subarray(1);if(K!==Te||2!==ue&&3!==ue){if(K===Ee&&4===ue){return{x:ve.fromBytes(pe.subarray(0,ve.BYTES)),y:ve.fromBytes(pe.subarray(ve.BYTES,2*ve.BYTES))}}throw new Error(`Point of length ${K} was invalid. Expected ${Te} compressed bytes or ${Ee} uncompressed bytes`)}{const G=ne.bytesToNumberBE(pe);if(!function isValidFieldElement(G){return me<G&&G<ve.ORDER}(G))throw new Error("Point is not on curve");const K=Ce(G);let he=ve.sqrt(K);return 1==(1&ue)!==((he&be)===be)&&(he=ve.neg(he)),{x:G,y:he}}}}),numToNByteStr=G=>ne.bytesToHex(ne.numberToBytesBE(G,ye.nByteLength));function isBiggerThanHalfOrder(G){return G>_e>>be}const slcNum=(G,K,ue)=>ne.bytesToNumberBE(G.slice(K,ue));class Signature{constructor(G,K,ne){this.r=G,this.s=K,this.recovery=ne,this.assertValidity()}static fromCompact(G){const K=ye.nByteLength;return G=(0,ue.ensureBytes)("compactSignature",G,2*K),new Signature(slcNum(G,0,K),slcNum(G,K,2*K))}static fromDER(K){const{r:ne,s:pe}=G.DER.toSig((0,ue.ensureBytes)("DER",K));return new Signature(ne,pe)}assertValidity(){if(!ke(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ke(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(G){return new Signature(this.r,this.s,G)}recoverPublicKey(G){const{r:K,s:ne,recovery:pe}=this,he=Ne((0,ue.ensureBytes)("msgHash",G));if(null==pe||![0,1,2,3].includes(pe))throw new Error("recovery id invalid");const me=2===pe||3===pe?K+ye.n:K;if(me>=ve.ORDER)throw new Error("recovery id 2 or 3 invalid");const be=0==(1&pe)?"02":"03",_e=Pe.fromHex(be+numToNByteStr(me)),Te=invN(me),Ee=modN(-he*Te),Se=modN(ne*Te),Ce=Pe.BASE.multiplyAndAddUnsafe(_e,Ee,Se);if(!Ce)throw new Error("point at infinify");return Ce.assertValidity(),Ce}hasHighS(){return isBiggerThanHalfOrder(this.s)}normalizeS(){return this.hasHighS()?new Signature(this.r,modN(-this.s),this.recovery):this}toDERRawBytes(){return ne.hexToBytes(this.toDERHex())}toDERHex(){return G.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ne.hexToBytes(this.toCompactHex())}toCompactHex(){return numToNByteStr(this.r)+numToNByteStr(this.s)}}const Oe={isValidPrivateKey(G){try{return Se(G),!0}catch(G){return!1}},normPrivateKeyToScalar:Se,randomPrivateKey:()=>{const G=K.getMinHashLength(ye.n);return K.mapHashToField(ye.randomBytes(G),ye.n)},precompute:(G=8,K=Pe.BASE)=>(K._setWindowSize(G),K.multiply(BigInt(3)),K)};function isProbPub(G){const K=G instanceof Uint8Array,ne="string"==typeof G,ue=(K||ne)&&G.length;return K?ue===Te||ue===Ee:ne?ue===2*Te||ue===2*Ee:G instanceof Pe}const xe=ye.bits2int||function(G){const K=ne.bytesToNumberBE(G),ue=8*G.length-ye.nBitLength;return ue>0?K>>BigInt(ue):K},Ne=ye.bits2int_modN||function(G){return modN(xe(G))},Me=ne.bitMask(ye.nBitLength);function int2octets(G){if("bigint"!=typeof G)throw new Error("bigint expected");if(!(me<=G&&G<Me))throw new Error(`bigint expected < 2^${ye.nBitLength}`);return ne.numberToBytesBE(G,ye.nByteLength)}function prepSig(G,K,pe=Be){if(["recovered","canonical"].some((G=>G in pe)))throw new Error("sign() legacy options not supported");const{hash:he,randomBytes:_e}=ye;let{lowS:Te,prehash:Ee,extraEntropy:Ce}=pe;null==Te&&(Te=!0),G=(0,ue.ensureBytes)("msgHash",G),Ee&&(G=(0,ue.ensureBytes)("prehashed msgHash",he(G)));const Oe=Ne(G),Me=Se(K),Fe=[int2octets(Me),int2octets(Oe)];if(null!=Ce){const G=!0===Ce?_e(ve.BYTES):Ce;Fe.push((0,ue.ensureBytes)("extraEntropy",G))}const De=ne.concatBytes(...Fe),Le=Oe;return{seed:De,k2sig:function k2sig(G){const K=xe(G);if(!ke(K))return;const ne=invN(K),ue=Pe.BASE.multiply(K).toAffine(),pe=modN(ue.x);if(pe===me)return;const he=modN(ne*modN(Le+pe*Me));if(he===me)return;let ye=(ue.x===pe?0:2)|Number(ue.y&be),ve=he;return Te&&isBiggerThanHalfOrder(he)&&(ve=function normalizeS(G){return isBiggerThanHalfOrder(G)?modN(-G):G}(he),ye^=1),new Signature(pe,ve,ye)}}}const Be={lowS:ye.lowS,prehash:!1},Fe={lowS:ye.lowS,prehash:!1};return Pe.BASE._setWindowSize(8),{CURVE:ye,getPublicKey:function getPublicKey(G,K=!0){return Pe.fromPrivateKey(G).toRawBytes(K)},getSharedSecret:function getSharedSecret(G,K,ne=!0){if(isProbPub(G))throw new Error("first arg must be private key");if(!isProbPub(K))throw new Error("second arg must be public key");return Pe.fromHex(K).multiply(Se(G)).toRawBytes(ne)},sign:function sign(G,K,ue=Be){const{seed:pe,k2sig:he}=prepSig(G,K,ue),me=ye;return ne.createHmacDrbg(me.hash.outputLen,me.nByteLength,me.hmac)(pe,he)},verify:function verify(K,ne,pe,he=Fe){const me=K;if(ne=(0,ue.ensureBytes)("msgHash",ne),pe=(0,ue.ensureBytes)("publicKey",pe),"strict"in he)throw new Error("options.strict was renamed to lowS");const{lowS:be,prehash:ve}=he;let _e,Te;try{if("string"==typeof me||me instanceof Uint8Array)try{_e=Signature.fromDER(me)}catch(K){if(!(K instanceof G.DER.Err))throw K;_e=Signature.fromCompact(me)}else{if("object"!=typeof me||"bigint"!=typeof me.r||"bigint"!=typeof me.s)throw new Error("PARSE");{const{r:G,s:K}=me;_e=new Signature(G,K)}}Te=Pe.fromHex(pe)}catch(G){if("PARSE"===G.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(be&&_e.hasHighS())return!1;ve&&(ne=ye.hash(ne));const{r:Ee,s:Se}=_e,Ce=Ne(ne),ke=invN(Se),Oe=modN(Ce*ke),xe=modN(Ee*ke),Me=Pe.BASE.multiplyAndAddUnsafe(Te,Oe,xe)?.toAffine();return!!Me&&modN(Me.x)===Ee},ProjectivePoint:Pe,Signature:Signature,utils:Oe}},G.SWUFpSqrtRatio=SWUFpSqrtRatio,G.mapToCurveSimpleSWU=function mapToCurveSimpleSWU(G,ne){if(K.validateField(G),!G.isValid(ne.A)||!G.isValid(ne.B)||!G.isValid(ne.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const ue=SWUFpSqrtRatio(G,ne.Z);if(!G.isOdd)throw new Error("Fp.isOdd is not implemented!");return K=>{let pe,he,ye,me,be,ve,_e,Te;pe=G.sqr(K),pe=G.mul(pe,ne.Z),he=G.sqr(pe),he=G.add(he,pe),ye=G.add(he,G.ONE),ye=G.mul(ye,ne.B),me=G.cmov(ne.Z,G.neg(he),!G.eql(he,G.ZERO)),me=G.mul(me,ne.A),he=G.sqr(ye),ve=G.sqr(me),be=G.mul(ve,ne.A),he=G.add(he,be),he=G.mul(he,ye),ve=G.mul(ve,me),be=G.mul(ve,ne.B),he=G.add(he,be),_e=G.mul(pe,ye);const{isValid:Ee,value:Pe}=ue(he,ve);Te=G.mul(pe,K),Te=G.mul(Te,Pe),_e=G.cmov(_e,ye,Ee),Te=G.cmov(Te,Pe,Ee);const Se=G.isOdd(K)===G.isOdd(Te);return Te=G.cmov(G.neg(Te),Te,Se),_e=G.div(_e,me),{x:_e,y:Te}}}}(PB)),PB}var IB,CB={};function requireHashToCurve(){if(IB)return CB;IB=1,Object.defineProperty(CB,"__esModule",{value:!0}),CB.createHasher=CB.isogenyMap=CB.hash_to_field=CB.expand_message_xof=CB.expand_message_xmd=void 0;const G=requireModular(),K=requireUtils$1();const ne=K.bytesToNumberBE;function i2osp(G,K){if(G<0||G>=1<<8*K)throw new Error(`bad I2OSP call: value=${G} length=${K}`);const ne=Array.from({length:K}).fill(0);for(let ue=K-1;ue>=0;ue--)ne[ue]=255&G,G>>>=8;return new Uint8Array(ne)}function strxor(G,K){const ne=new Uint8Array(G.length);for(let ue=0;ue<G.length;ue++)ne[ue]=G[ue]^K[ue];return ne}function isBytes(G){if(!(G instanceof Uint8Array))throw new Error("Uint8Array expected")}function isNum(G){if(!Number.isSafeInteger(G))throw new Error("number expected")}function expand_message_xmd(G,ne,ue,pe){isBytes(G),isBytes(ne),isNum(ue),ne.length>255&&(ne=pe((0,K.concatBytes)((0,K.utf8ToBytes)("H2C-OVERSIZE-DST-"),ne)));const{outputLen:he,blockLen:ye}=pe,me=Math.ceil(ue/he);if(me>255)throw new Error("Invalid xmd length");const be=(0,K.concatBytes)(ne,i2osp(ne.length,1)),ve=i2osp(0,ye),_e=i2osp(ue,2),Te=new Array(me),Ee=pe((0,K.concatBytes)(ve,G,_e,i2osp(0,1),be));Te[0]=pe((0,K.concatBytes)(Ee,i2osp(1,1),be));for(let G=1;G<=me;G++){const ne=[strxor(Ee,Te[G-1]),i2osp(G+1,1),be];Te[G]=pe((0,K.concatBytes)(...ne))}return(0,K.concatBytes)(...Te).slice(0,ue)}function expand_message_xof(G,ne,ue,pe,he){if(isBytes(G),isBytes(ne),isNum(ue),ne.length>255){const G=Math.ceil(2*pe/8);ne=he.create({dkLen:G}).update((0,K.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(ne).digest()}if(ue>65535||ne.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return he.create({dkLen:ue}).update(G).update(i2osp(ue,2)).update(ne).update(i2osp(ne.length,1)).digest()}function hash_to_field(ue,pe,he){(0,K.validateObject)(he,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:ye,k:me,m:be,hash:ve,expand:_e,DST:Te}=he;isBytes(ue),isNum(pe);const Ee=function validateDST(G){if(G instanceof Uint8Array)return G;if("string"==typeof G)return(0,K.utf8ToBytes)(G);throw new Error("DST must be Uint8Array or string")}(Te),Pe=ye.toString(2).length,Se=Math.ceil((Pe+me)/8),Ce=pe*be*Se;let ke;if("xmd"===_e)ke=expand_message_xmd(ue,Ee,Ce,ve);else if("xof"===_e)ke=expand_message_xof(ue,Ee,Ce,me,ve);else{if("_internal_pass"!==_e)throw new Error('expand must be "xmd" or "xof"');ke=ue}const Oe=new Array(pe);for(let K=0;K<pe;K++){const ue=new Array(be);for(let pe=0;pe<be;pe++){const he=Se*(pe+K*be),me=ke.subarray(he,he+Se);ue[pe]=(0,G.mod)(ne(me),ye)}Oe[K]=ue}return Oe}return CB.expand_message_xmd=expand_message_xmd,CB.expand_message_xof=expand_message_xof,CB.hash_to_field=hash_to_field,CB.isogenyMap=function isogenyMap(G,K){const ne=K.map((G=>Array.from(G).reverse()));return(K,ue)=>{const[pe,he,ye,me]=ne.map((ne=>ne.reduce(((ne,ue)=>G.add(G.mul(ne,K),ue)))));return K=G.div(pe,he),ue=G.mul(ue,G.div(ye,me)),{x:K,y:ue}}},CB.createHasher=function createHasher(G,K,ne){if("function"!=typeof K)throw new Error("mapToCurve() must be defined");return{hashToCurve(ue,pe){const he=hash_to_field(ue,2,{...ne,DST:ne.DST,...pe}),ye=G.fromAffine(K(he[0])),me=G.fromAffine(K(he[1])),be=ye.add(me).clearCofactor();return be.assertValidity(),be},encodeToCurve(ue,pe){const he=hash_to_field(ue,1,{...ne,DST:ne.encodeDST,...pe}),ye=G.fromAffine(K(he[0])).clearCofactor();return ye.assertValidity(),ye}}},CB}var RB,kB,OB,xB={},NB={};function require_shortw_utils(){if(kB)return xB;kB=1,Object.defineProperty(xB,"__esModule",{value:!0}),xB.createCurve=xB.getHash=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const G=function requireHmac(){return RB||(RB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.hmac=G.HMAC=void 0;const K=require_assert(),ne=requireUtils$2();class HMAC extends ne.Hash{constructor(G,ue){super(),this.finished=!1,this.destroyed=!1,(0,K.hash)(G);const pe=(0,ne.toBytes)(ue);if(this.iHash=G.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const he=this.blockLen,ye=new Uint8Array(he);ye.set(pe.length>he?G.create().update(pe).digest():pe);for(let G=0;G<ye.length;G++)ye[G]^=54;this.iHash.update(ye),this.oHash=G.create();for(let G=0;G<ye.length;G++)ye[G]^=106;this.oHash.update(ye),ye.fill(0)}update(G){return(0,K.exists)(this),this.iHash.update(G),this}digestInto(G){(0,K.exists)(this),(0,K.bytes)(G,this.outputLen),this.finished=!0,this.iHash.digestInto(G),this.oHash.update(G),this.oHash.digestInto(G),this.destroy()}digest(){const G=new Uint8Array(this.oHash.outputLen);return this.digestInto(G),G}_cloneInto(G){G||(G=Object.create(Object.getPrototypeOf(this),{}));const{oHash:K,iHash:ne,finished:ue,destroyed:pe,blockLen:he,outputLen:ye}=this;return G.finished=ue,G.destroyed=pe,G.blockLen=he,G.outputLen=ye,G.oHash=K._cloneInto(G.oHash),G.iHash=ne._cloneInto(G.iHash),G}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}G.HMAC=HMAC,G.hmac=(G,K,ne)=>new HMAC(G,K).update(ne).digest(),G.hmac.create=(G,K)=>new HMAC(G,K)}(NB)),NB}(),K=requireUtils$2(),ne=requireWeierstrass();function getHash(ne){return{hash:ne,hmac:(ue,...pe)=>(0,G.hmac)(ne,ue,(0,K.concatBytes)(...pe)),randomBytes:K.randomBytes}}return xB.getHash=getHash,xB.createCurve=function createCurve(G,K){const create=K=>(0,ne.weierstrass)({...G,...getHash(K)});return Object.freeze({...create(K),create:create})},xB}function requireSecp256k1(){return OB||(OB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.encodeToCurve=G.hashToCurve=G.schnorr=G.secp256k1=void 0;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const K=function requireSha256(){if(mB)return uB;mB=1,Object.defineProperty(uB,"__esModule",{value:!0}),uB.sha224=uB.sha256=void 0;const G=require_sha2(),K=requireUtils$2(),Chi=(G,K,ne)=>G&K^~G&ne,Maj=(G,K,ne)=>G&K^G&ne^K&ne,ne=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]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pe=new Uint32Array(64);class SHA256 extends G.SHA2{constructor(){super(64,32,8,!1),this.A=0|ue[0],this.B=0|ue[1],this.C=0|ue[2],this.D=0|ue[3],this.E=0|ue[4],this.F=0|ue[5],this.G=0|ue[6],this.H=0|ue[7]}get(){const{A:G,B:K,C:ne,D:ue,E:pe,F:he,G:ye,H:me}=this;return[G,K,ne,ue,pe,he,ye,me]}set(G,K,ne,ue,pe,he,ye,me){this.A=0|G,this.B=0|K,this.C=0|ne,this.D=0|ue,this.E=0|pe,this.F=0|he,this.G=0|ye,this.H=0|me}undefined(G,ue){for(let K=0;K<16;K++,ue+=4)pe[K]=G.getUint32(ue,!1);for(let G=16;G<64;G++){const ne=pe[G-15],ue=pe[G-2],he=(0,K.rotr)(ne,7)^(0,K.rotr)(ne,18)^ne>>>3,ye=(0,K.rotr)(ue,17)^(0,K.rotr)(ue,19)^ue>>>10;pe[G]=ye+pe[G-7]+he+pe[G-16]|0}let{A:he,B:ye,C:me,D:be,E:ve,F:_e,G:Te,H:Ee}=this;for(let G=0;G<64;G++){const ue=Ee+((0,K.rotr)(ve,6)^(0,K.rotr)(ve,11)^(0,K.rotr)(ve,25))+Chi(ve,_e,Te)+ne[G]+pe[G]|0,Pe=((0,K.rotr)(he,2)^(0,K.rotr)(he,13)^(0,K.rotr)(he,22))+Maj(he,ye,me)|0;Ee=Te,Te=_e,_e=ve,ve=be+ue|0,be=me,me=ye,ye=he,he=ue+Pe|0}he=he+this.A|0,ye=ye+this.B|0,me=me+this.C|0,be=be+this.D|0,ve=ve+this.E|0,_e=_e+this.F|0,Te=Te+this.G|0,Ee=Ee+this.H|0,this.set(he,ye,me,be,ve,_e,Te,Ee)}roundClean(){pe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return uB.sha256=(0,K.wrapConstructor)((()=>new SHA256)),uB.sha224=(0,K.wrapConstructor)((()=>new SHA224)),uB}(),ne=requireUtils$2(),ue=requireModular(),pe=requireWeierstrass(),he=requireUtils$1(),ye=requireHashToCurve(),me=require_shortw_utils(),be=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ve=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_e=BigInt(1),Te=BigInt(2),divNearest=(G,K)=>(G+K/Te)/K;function sqrtMod(G){const K=be,ne=BigInt(3),pe=BigInt(6),he=BigInt(11),ye=BigInt(22),me=BigInt(23),ve=BigInt(44),_e=BigInt(88),Pe=G*G*G%K,Se=Pe*Pe*G%K,Ce=(0,ue.pow2)(Se,ne,K)*Se%K,ke=(0,ue.pow2)(Ce,ne,K)*Se%K,Oe=(0,ue.pow2)(ke,Te,K)*Pe%K,xe=(0,ue.pow2)(Oe,he,K)*Oe%K,Ne=(0,ue.pow2)(xe,ye,K)*xe%K,Me=(0,ue.pow2)(Ne,ve,K)*Ne%K,Be=(0,ue.pow2)(Me,_e,K)*Me%K,Fe=(0,ue.pow2)(Be,ve,K)*Ne%K,De=(0,ue.pow2)(Fe,ne,K)*Se%K,Le=(0,ue.pow2)(De,me,K)*xe%K,Ue=(0,ue.pow2)(Le,pe,K)*Pe%K,je=(0,ue.pow2)(Ue,Te,K);if(!Ee.eql(Ee.sqr(je),G))throw new Error("Cannot find square root");return je}const Ee=(0,ue.Field)(be,void 0,void 0,{sqrt:sqrtMod});G.secp256k1=(0,me.createCurve)({a:BigInt(0),b:BigInt(7),Fp:Ee,n:ve,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:G=>{const K=ve,ne=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),pe=-_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),he=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ye=ne,me=BigInt("0x100000000000000000000000000000000"),be=divNearest(ye*G,K),Te=divNearest(-pe*G,K);let Ee=(0,ue.mod)(G-be*ne-Te*he,K),Pe=(0,ue.mod)(-be*pe-Te*ye,K);const Se=Ee>me,Ce=Pe>me;if(Se&&(Ee=K-Ee),Ce&&(Pe=K-Pe),Ee>me||Pe>me)throw new Error("splitScalar: Endomorphism failed, k="+G);return{k1neg:Se,k1:Ee,k2neg:Ce,k2:Pe}}}},K.sha256);const Pe=BigInt(0),fe=G=>"bigint"==typeof G&&Pe<G&&G<be,ge=G=>"bigint"==typeof G&&Pe<G&&G<ve,Se={};function taggedHash(G,...ne){let ue=Se[G];if(void 0===ue){const ne=(0,K.sha256)(Uint8Array.from(G,(G=>G.charCodeAt(0))));ue=(0,he.concatBytes)(ne,ne),Se[G]=ue}return(0,K.sha256)((0,he.concatBytes)(ue,...ne))}const pointToBytes=G=>G.toRawBytes(!0).slice(1),numTo32b=G=>(0,he.numberToBytesBE)(G,32),modP=G=>(0,ue.mod)(G,be),modN=G=>(0,ue.mod)(G,ve),Ce=G.secp256k1.ProjectivePoint,GmulAdd=(G,K,ne)=>Ce.BASE.multiplyAndAddUnsafe(G,K,ne);function schnorrGetExtPubKey(K){let ne=G.secp256k1.utils.normPrivateKeyToScalar(K),ue=Ce.fromPrivateKey(ne);return{scalar:ue.hasEvenY()?ne:modN(-ne),bytes:pointToBytes(ue)}}function lift_x(G){if(!fe(G))throw new Error("bad x: need 0 < x < p");const K=modP(G*G);let ne=sqrtMod(modP(K*G+BigInt(7)));ne%Te!==Pe&&(ne=modP(-ne));const ue=new Ce(G,ne,_e);return ue.assertValidity(),ue}function challenge(...G){return modN((0,he.bytesToNumberBE)(taggedHash("BIP0340/challenge",...G)))}function schnorrGetPublicKey(G){return schnorrGetExtPubKey(G).bytes}function schnorrSign(G,K,ue=(0,ne.randomBytes)(32)){const pe=(0,he.ensureBytes)("message",G),{bytes:ye,scalar:me}=schnorrGetExtPubKey(K),be=(0,he.ensureBytes)("auxRand",ue,32),ve=numTo32b(me^(0,he.bytesToNumberBE)(taggedHash("BIP0340/aux",be))),_e=taggedHash("BIP0340/nonce",ve,ye,pe),Te=modN((0,he.bytesToNumberBE)(_e));if(Te===Pe)throw new Error("sign failed: k is zero");const{bytes:Ee,scalar:Se}=schnorrGetExtPubKey(Te),Ce=challenge(Ee,ye,pe),ke=new Uint8Array(64);if(ke.set(Ee,0),ke.set(numTo32b(modN(Se+Ce*me)),32),!schnorrVerify(ke,pe,ye))throw new Error("sign: Invalid signature produced");return ke}function schnorrVerify(G,K,ne){const ue=(0,he.ensureBytes)("signature",G,64),pe=(0,he.ensureBytes)("message",K),ye=(0,he.ensureBytes)("publicKey",ne,32);try{const G=lift_x((0,he.bytesToNumberBE)(ye)),K=(0,he.bytesToNumberBE)(ue.subarray(0,32));if(!fe(K))return!1;const ne=(0,he.bytesToNumberBE)(ue.subarray(32,64));if(!ge(ne))return!1;const me=challenge(numTo32b(K),pointToBytes(G),pe),be=GmulAdd(G,ne,modN(-me));return!(!be||!be.hasEvenY()||be.toAffine().x!==K)}catch(G){return!1}}G.schnorr={getPublicKey:schnorrGetPublicKey,sign:schnorrSign,verify:schnorrVerify,utils:{randomPrivateKey:G.secp256k1.utils.randomPrivateKey,lift_x:lift_x,pointToBytes:pointToBytes,numberToBytesBE:he.numberToBytesBE,bytesToNumberBE:he.bytesToNumberBE,taggedHash:taggedHash,mod:ue.mod}};const ke=(()=>(0,ye.isogenyMap)(Ee,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((G=>G.map((G=>BigInt(G)))))))(),Oe=(()=>(0,pe.mapToCurveSimpleSWU)(Ee,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Ee.create(BigInt("-11"))}))(),xe=(()=>(0,ye.createHasher)(G.secp256k1.ProjectivePoint,(G=>{const{x:K,y:ne}=Oe(Ee.create(G[0]));return ke(K,ne)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Ee.ORDER,m:1,k:128,expand:"xmd",hash:K.sha256}))();G.hashToCurve=xe.hashToCurve,G.encodeToCurve=xe.encodeToCurve}(dB)),dB}var MB,BB={},FB={},DB={};function requireAddresses(){return MB||(MB=1,Object.defineProperty(DB,"__esModule",{value:!0}),DB.ZeroAddress=void 0,DB.ZeroAddress="0x0000000000000000000000000000000000000000"),DB}var LB,UB={};var $B,qB={};var GB,jB,HB,WB,zB,VB,KB={};function requireConstants(){return jB||(jB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.MessagePrefix=G.EtherSymbol=G.MaxInt256=G.MinInt256=G.MaxUint256=G.WeiPerEther=G.N=G.ZeroHash=G.ZeroAddress=void 0;var K=requireAddresses();Object.defineProperty(G,"ZeroAddress",{enumerable:!0,get:function(){return K.ZeroAddress}});var ne=function requireHashes(){return LB||(LB=1,Object.defineProperty(UB,"__esModule",{value:!0}),UB.ZeroHash=void 0,UB.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),UB}();Object.defineProperty(G,"ZeroHash",{enumerable:!0,get:function(){return ne.ZeroHash}});var ue=function requireNumbers(){return $B||($B=1,Object.defineProperty(qB,"__esModule",{value:!0}),qB.MaxInt256=qB.MinInt256=qB.MaxUint256=qB.WeiPerEther=qB.N=void 0,qB.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),qB.WeiPerEther=BigInt("1000000000000000000"),qB.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),qB.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),qB.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),qB}();Object.defineProperty(G,"N",{enumerable:!0,get:function(){return ue.N}}),Object.defineProperty(G,"WeiPerEther",{enumerable:!0,get:function(){return ue.WeiPerEther}}),Object.defineProperty(G,"MaxUint256",{enumerable:!0,get:function(){return ue.MaxUint256}}),Object.defineProperty(G,"MinInt256",{enumerable:!0,get:function(){return ue.MinInt256}}),Object.defineProperty(G,"MaxInt256",{enumerable:!0,get:function(){return ue.MaxInt256}});var pe=function requireStrings(){return GB||(GB=1,Object.defineProperty(KB,"__esModule",{value:!0}),KB.MessagePrefix=KB.EtherSymbol=void 0,KB.EtherSymbol="Ξ",KB.MessagePrefix="Ethereum Signed Message:\n"),KB}();Object.defineProperty(G,"EtherSymbol",{enumerable:!0,get:function(){return pe.EtherSymbol}}),Object.defineProperty(G,"MessagePrefix",{enumerable:!0,get:function(){return pe.MessagePrefix}})}(FB)),FB}function requireSignature(){if(HB)return BB;HB=1,Object.defineProperty(BB,"__esModule",{value:!0}),BB.Signature=void 0;const G=requireConstants(),K=requireUtils$4(),ne=BigInt(0),ue=BigInt(1),pe=BigInt(2),he=BigInt(27),ye=BigInt(28),me=BigInt(35),be={};function toUint256(G){return(0,K.zeroPadValue)((0,K.toBeArray)(G),32)}var ve=new WeakMap,_e=new WeakMap,Te=new WeakMap,Ee=new WeakMap;class Signature{get r(){return _classPrivateFieldGet2(ve,this)}set r(G){(0,K.assertArgument)(32===(0,K.dataLength)(G),"invalid r","value",G),_classPrivateFieldSet2(ve,this,(0,K.hexlify)(G))}get s(){return _classPrivateFieldGet2(_e,this)}set s(G){(0,K.assertArgument)(32===(0,K.dataLength)(G),"invalid s","value",G);const ne=(0,K.hexlify)(G);(0,K.assertArgument)(parseInt(ne.substring(0,3))<8,"non-canonical s","value",ne),_classPrivateFieldSet2(_e,this,ne)}get v(){return _classPrivateFieldGet2(Te,this)}set v(G){const ne=(0,K.getNumber)(G,"value");(0,K.assertArgument)(27===ne||28===ne,"invalid v","v",G),_classPrivateFieldSet2(Te,this,ne)}get networkV(){return _classPrivateFieldGet2(Ee,this)}get legacyChainId(){const G=this.networkV;return null==G?null:Signature.getChainId(G)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const G=(0,K.getBytes)(this.s);return this.yParity&&(G[0]|=128),(0,K.hexlify)(G)}get compactSerialized(){return(0,K.concat)([this.r,this.yParityAndS])}get serialized(){return(0,K.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(G,ne,ue,pe){_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldInitSpec(this,_e,void 0),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldInitSpec(this,Ee,void 0),(0,K.assertPrivate)(G,be,"Signature"),_classPrivateFieldSet2(ve,this,ne),_classPrivateFieldSet2(_e,this,ue),_classPrivateFieldSet2(Te,this,pe),_classPrivateFieldSet2(Ee,this,null)}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const G=new Signature(be,this.r,this.s,this.v);return this.networkV&&_classPrivateFieldSet2(Ee,G,this.networkV),G}toJSON(){const G=this.networkV;return{_type:"signature",networkV:null!=G?G.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(G){const ue=(0,K.getBigInt)(G,"v");return ue==he||ue==ye?ne:((0,K.assertArgument)(ue>=me,"invalid EIP-155 v","v",G),(ue-me)/pe)}static getChainIdV(G,ne){return(0,K.getBigInt)(G)*pe+BigInt(35+ne-27)}static getNormalizedV(G){const pe=(0,K.getBigInt)(G);return pe===ne||pe===he?27:pe===ue||pe===ye?28:((0,K.assertArgument)(pe>=me,"invalid v","v",G),pe&ue?27:28)}static from(ne){function assertError(G,ue){(0,K.assertArgument)(G,ue,"signature",ne)}if(null==ne)return new Signature(be,G.ZeroHash,G.ZeroHash,27);if("string"==typeof ne){const G=(0,K.getBytes)(ne,"signature");if(64===G.length){const ne=(0,K.hexlify)(G.slice(0,32)),ue=G.slice(32,64),pe=128&ue[0]?28:27;return ue[0]&=127,new Signature(be,ne,(0,K.hexlify)(ue),pe)}if(65===G.length){const ne=(0,K.hexlify)(G.slice(0,32)),ue=G.slice(32,64);assertError(0==(128&ue[0]),"non-canonical s");const pe=Signature.getNormalizedV(G[64]);return new Signature(be,ne,(0,K.hexlify)(ue),pe)}assertError(!1,"invalid raw signature length")}if(ne instanceof Signature)return ne.clone();const ue=ne.r;assertError(null!=ue,"missing r");const pe=toUint256(ue),he=function(G,ne){if(null!=G)return toUint256(G);if(null!=ne){assertError((0,K.isHexString)(ne,32),"invalid yParityAndS");const G=(0,K.getBytes)(ne);return G[0]&=127,(0,K.hexlify)(G)}assertError(!1,"missing s")}(ne.s,ne.yParityAndS);assertError(0==(128&(0,K.getBytes)(he)[0]),"non-canonical s");const{networkV:ye,v:ve}=function(G,ne,ue){if(null!=G){const ne=(0,K.getBigInt)(G);return{networkV:ne>=me?ne:void 0,v:Signature.getNormalizedV(ne)}}if(null!=ne)return assertError((0,K.isHexString)(ne,32),"invalid yParityAndS"),{v:128&(0,K.getBytes)(ne)[0]?28:27};if(null!=ue){switch((0,K.getNumber)(ue,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}assertError(!1,"invalid yParity")}assertError(!1,"missing v")}(ne.v,ne.yParityAndS,ne.yParity),_e=new Signature(be,pe,he,ve);return ye&&_classPrivateFieldSet2(Ee,_e,ye),assertError(null==ne.yParity||(0,K.getNumber)(ne.yParity,"sig.yParity")===_e.yParity,"yParity mismatch"),assertError(null==ne.yParityAndS||ne.yParityAndS===_e.yParityAndS,"yParityAndS mismatch"),_e}}return BB.Signature=Signature,BB}function requireCrypto(){return zB||(zB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.lock=G.Signature=G.SigningKey=G.scryptSync=G.scrypt=G.pbkdf2=G.sha512=G.sha256=G.ripemd160=G.keccak256=G.randomBytes=G.computeHmac=void 0;const K=function requireHmac$1(){if($M)return TM;$M=1,Object.defineProperty(TM,"__esModule",{value:!0}),TM.computeHmac=void 0;const G=requireCryptoBrowser(),K=requireUtils$4();let ne=!1;const _computeHmac=function(K,ne,ue){return(0,G.createHmac)(K,ne).update(ue).digest()};let ue=_computeHmac;function computeHmac(G,ne,pe){const he=(0,K.getBytes)(ne,"key"),ye=(0,K.getBytes)(pe,"data");return(0,K.hexlify)(ue(G,he,ye))}return TM.computeHmac=computeHmac,computeHmac._=_computeHmac,computeHmac.lock=function(){ne=!0},computeHmac.register=function(G){if(ne)throw new Error("computeHmac is locked");ue=G},Object.freeze(computeHmac),TM}();Object.defineProperty(G,"computeHmac",{enumerable:!0,get:function(){return K.computeHmac}});const ne=requireKeccak();Object.defineProperty(G,"keccak256",{enumerable:!0,get:function(){return ne.keccak256}});const ue=function requireRipemd160(){if(KM)return JM;KM=1,Object.defineProperty(JM,"__esModule",{value:!0}),JM.ripemd160=void 0;const G=requireRipemd160$1(),K=requireUtils$4();let ne=!1;const _ripemd160=function(K){return(0,G.ripemd160)(K)};let ue=_ripemd160;function ripemd160(G){const ne=(0,K.getBytes)(G,"data");return(0,K.hexlify)(ue(ne))}return JM.ripemd160=ripemd160,ripemd160._=_ripemd160,ripemd160.lock=function(){ne=!0},ripemd160.register=function(G){if(ne)throw new TypeError("ripemd160 is locked");ue=G},Object.freeze(ripemd160),JM}();Object.defineProperty(G,"ripemd160",{enumerable:!0,get:function(){return ue.ripemd160}});const pe=function requirePbkdf2(){if(QM)return ZM;QM=1,Object.defineProperty(ZM,"__esModule",{value:!0}),ZM.pbkdf2=void 0;const G=requireCryptoBrowser(),K=requireUtils$4();let ne=!1;const _pbkdf2=function(K,ne,ue,pe,he){return(0,G.pbkdf2Sync)(K,ne,ue,pe,he)};let ue=_pbkdf2;function pbkdf2$1(G,ne,pe,he,ye){const me=(0,K.getBytes)(G,"password"),be=(0,K.getBytes)(ne,"salt");return(0,K.hexlify)(ue(me,be,pe,he,ye))}return ZM.pbkdf2=pbkdf2$1,pbkdf2$1._=_pbkdf2,pbkdf2$1.lock=function(){ne=!0},pbkdf2$1.register=function(G){if(ne)throw new Error("pbkdf2 is locked");ue=G},Object.freeze(pbkdf2$1),ZM}();Object.defineProperty(G,"pbkdf2",{enumerable:!0,get:function(){return pe.pbkdf2}});const he=function requireRandom(){if(YM)return eB;YM=1,Object.defineProperty(eB,"__esModule",{value:!0}),eB.randomBytes=void 0;const G=requireCryptoBrowser();let K=!1;const _randomBytes=function(K){return new Uint8Array((0,G.randomBytes)(K))};let ne=_randomBytes;function randomBytes(G){return ne(G)}return eB.randomBytes=randomBytes,randomBytes._=_randomBytes,randomBytes.lock=function(){K=!0},randomBytes.register=function(G){if(K)throw new Error("randomBytes is locked");ne=G},Object.freeze(randomBytes),eB}();Object.defineProperty(G,"randomBytes",{enumerable:!0,get:function(){return he.randomBytes}});const ye=function requireScrypt(){if(rB)return nB;rB=1,Object.defineProperty(nB,"__esModule",{value:!0}),nB.scryptSync=nB.scrypt=void 0;const G=requireScrypt$1(),K=requireUtils$4();let ne=!1,ue=!1;const _scryptAsync=async function(K,ne,ue,pe,he,ye,me){return await(0,G.scryptAsync)(K,ne,{N:ue,r:pe,p:he,dkLen:ye,onProgress:me})},_scryptSync=function(K,ne,ue,pe,he,ye){return(0,G.scrypt)(K,ne,{N:ue,r:pe,p:he,dkLen:ye})};let pe=_scryptAsync,he=_scryptSync;async function scrypt(G,ne,ue,he,ye,me,be){const ve=(0,K.getBytes)(G,"passwd"),_e=(0,K.getBytes)(ne,"salt");return(0,K.hexlify)(await pe(ve,_e,ue,he,ye,me,be))}function scryptSync(G,ne,ue,pe,ye,me){const be=(0,K.getBytes)(G,"passwd"),ve=(0,K.getBytes)(ne,"salt");return(0,K.hexlify)(he(be,ve,ue,pe,ye,me))}return nB.scrypt=scrypt,scrypt._=_scryptAsync,scrypt.lock=function(){ue=!0},scrypt.register=function(G){if(ue)throw new Error("scrypt is locked");pe=G},Object.freeze(scrypt),nB.scryptSync=scryptSync,scryptSync._=_scryptSync,scryptSync.lock=function(){ne=!0},scryptSync.register=function(G){if(ne)throw new Error("scryptSync is locked");he=G},Object.freeze(scryptSync),nB}();Object.defineProperty(G,"scrypt",{enumerable:!0,get:function(){return ye.scrypt}}),Object.defineProperty(G,"scryptSync",{enumerable:!0,get:function(){return ye.scryptSync}});const me=function requireSha2(){if(iB)return sB;iB=1,Object.defineProperty(sB,"__esModule",{value:!0}),sB.sha512=sB.sha256=void 0;const G=requireCryptoBrowser(),K=requireUtils$4(),_sha256=function(K){return(0,G.createHash)("sha256").update(K).digest()},_sha512=function(K){return(0,G.createHash)("sha512").update(K).digest()};let ne=_sha256,ue=_sha512,pe=!1,he=!1;function sha256(G){const ue=(0,K.getBytes)(G,"data");return(0,K.hexlify)(ne(ue))}function sha512(G){const ne=(0,K.getBytes)(G,"data");return(0,K.hexlify)(ue(ne))}return sB.sha256=sha256,sha256._=_sha256,sha256.lock=function(){pe=!0},sha256.register=function(G){if(pe)throw new Error("sha256 is locked");ne=G},Object.freeze(sha256),sB.sha512=sha512,sha512._=_sha512,sha512.lock=function(){he=!0},sha512.register=function(G){if(he)throw new Error("sha512 is locked");ue=G},Object.freeze(sha256),sB}();Object.defineProperty(G,"sha256",{enumerable:!0,get:function(){return me.sha256}}),Object.defineProperty(G,"sha512",{enumerable:!0,get:function(){return me.sha512}});var be=function requireSigningKey(){if(WB)return cB;WB=1,Object.defineProperty(cB,"__esModule",{value:!0}),cB.SigningKey=void 0;const G=requireSecp256k1(),K=requireUtils$4(),ne=requireSignature();var ue=new WeakMap;class SigningKey{constructor(G){_classPrivateFieldInitSpec(this,ue,void 0),(0,K.assertArgument)(32===(0,K.dataLength)(G),"invalid private key","privateKey","[REDACTED]"),_classPrivateFieldSet2(ue,this,(0,K.hexlify)(G))}get privateKey(){return _classPrivateFieldGet2(ue,this)}get publicKey(){return SigningKey.computePublicKey(_classPrivateFieldGet2(ue,this))}get compressedPublicKey(){return SigningKey.computePublicKey(_classPrivateFieldGet2(ue,this),!0)}sign(pe){(0,K.assertArgument)(32===(0,K.dataLength)(pe),"invalid digest length","digest",pe);const he=G.secp256k1.sign((0,K.getBytesCopy)(pe),(0,K.getBytesCopy)(_classPrivateFieldGet2(ue,this)),{lowS:!0});return ne.Signature.from({r:(0,K.toBeHex)(he.r,32),s:(0,K.toBeHex)(he.s,32),v:he.recovery?28:27})}computeSharedSecret(ne){const pe=SigningKey.computePublicKey(ne);return(0,K.hexlify)(G.secp256k1.getSharedSecret((0,K.getBytesCopy)(_classPrivateFieldGet2(ue,this)),(0,K.getBytes)(pe),!1))}static computePublicKey(ne,ue){let pe=(0,K.getBytes)(ne,"key");if(32===pe.length){const ne=G.secp256k1.getPublicKey(pe,!!ue);return(0,K.hexlify)(ne)}if(64===pe.length){const G=new Uint8Array(65);G[0]=4,G.set(pe,1),pe=G}const he=G.secp256k1.ProjectivePoint.fromHex(pe);return(0,K.hexlify)(he.toRawBytes(ue))}static recoverPublicKey(ue,pe){(0,K.assertArgument)(32===(0,K.dataLength)(ue),"invalid digest length","digest",ue);const he=ne.Signature.from(pe);let ye=G.secp256k1.Signature.fromCompact((0,K.getBytesCopy)((0,K.concat)([he.r,he.s])));ye=ye.addRecoveryBit(he.yParity);const me=ye.recoverPublicKey((0,K.getBytesCopy)(ue));return(0,K.assertArgument)(null!=me,"invalid signautre for digest","signature",pe),"0x"+me.toHex(!1)}static addPoints(K,ne,ue){const pe=G.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(K).substring(2)),he=G.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(ne).substring(2));return"0x"+pe.add(he).toHex(!!ue)}}return cB.SigningKey=SigningKey,cB}();Object.defineProperty(G,"SigningKey",{enumerable:!0,get:function(){return be.SigningKey}});var ve=requireSignature();Object.defineProperty(G,"Signature",{enumerable:!0,get:function(){return ve.Signature}}),G.lock=function lock(){K.computeHmac.lock(),ne.keccak256.lock(),pe.pbkdf2.lock(),he.randomBytes.lock(),ue.ripemd160.lock(),ye.scrypt.lock(),ye.scryptSync.lock(),me.sha256.lock(),me.sha512.lock(),he.randomBytes.lock()}}(_M)),_M}function requireAddress$3(){if(VB)return wM;VB=1,Object.defineProperty(wM,"__esModule",{value:!0}),wM.getIcapAddress=wM.getAddress=void 0;const G=requireCrypto(),K=requireUtils$4(),ne=BigInt(0),ue=BigInt(36);function getChecksumAddress(ne){const ue=(ne=ne.toLowerCase()).substring(2).split(""),pe=new Uint8Array(40);for(let G=0;G<40;G++)pe[G]=ue[G].charCodeAt(0);const he=(0,K.getBytes)((0,G.keccak256)(pe));for(let G=0;G<40;G+=2)he[G>>1]>>4>=8&&(ue[G]=ue[G].toUpperCase()),(15&he[G>>1])>=8&&(ue[G+1]=ue[G+1].toUpperCase());return"0x"+ue.join("")}const pe={};for(let G=0;G<10;G++)pe[String(G)]=String(G);for(let G=0;G<26;G++)pe[String.fromCharCode(65+G)]=String(10+G);const he=15;function ibanChecksum(G){let K=(G=(G=G.toUpperCase()).substring(4)+G.substring(0,2)+"00").split("").map((G=>pe[G])).join("");for(;K.length>=he;){let G=K.substring(0,he);K=parseInt(G,10)%97+K.substring(G.length)}let ne=String(98-parseInt(K,10)%97);for(;ne.length<2;)ne="0"+ne;return ne}const ye=function(){const G={};for(let K=0;K<36;K++){G["0123456789abcdefghijklmnopqrstuvwxyz"[K]]=BigInt(K)}return G}();function getAddress(G){if((0,K.assertArgument)("string"==typeof G,"invalid address","address",G),G.match(/^(0x)?[0-9a-fA-F]{40}$/)){G.startsWith("0x")||(G="0x"+G);const ne=getChecksumAddress(G);return(0,K.assertArgument)(!G.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||ne===G,"bad address checksum","address",G),ne}if(G.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,K.assertArgument)(G.substring(2,4)===ibanChecksum(G),"bad icap checksum","address",G);let pe=function fromBase36(G){G=G.toLowerCase();let K=ne;for(let ne=0;ne<G.length;ne++)K=K*ue+ye[G[ne]];return K}(G.substring(4)).toString(16);for(;pe.length<40;)pe="0"+pe;return getChecksumAddress("0x"+pe)}(0,K.assertArgument)(!1,"invalid address","address",G)}return wM.getAddress=getAddress,wM.getIcapAddress=function getIcapAddress(G){let K=BigInt(getAddress(G)).toString(36).toUpperCase();for(;K.length<30;)K="0"+K;return"XE"+ibanChecksum("XE00"+K)+K},wM}var JB,XB={};var QB,ZB,YB={};function requireAddress$2(){return ZB||(ZB=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.resolveAddress=G.isAddress=G.isAddressable=G.getCreate2Address=G.getCreateAddress=G.getIcapAddress=G.getAddress=void 0;var K=requireAddress$3();Object.defineProperty(G,"getAddress",{enumerable:!0,get:function(){return K.getAddress}}),Object.defineProperty(G,"getIcapAddress",{enumerable:!0,get:function(){return K.getIcapAddress}});var ne=function requireContractAddress(){if(JB)return XB;JB=1,Object.defineProperty(XB,"__esModule",{value:!0}),XB.getCreate2Address=XB.getCreateAddress=void 0;const G=requireCrypto(),K=requireUtils$4(),ne=requireAddress$3();return XB.getCreateAddress=function getCreateAddress(ue){const pe=(0,ne.getAddress)(ue.from);let he=(0,K.getBigInt)(ue.nonce,"tx.nonce").toString(16);return he="0"===he?"0x":he.length%2?"0x0"+he:"0x"+he,(0,ne.getAddress)((0,K.dataSlice)((0,G.keccak256)((0,K.encodeRlp)([pe,he])),12))},XB.getCreate2Address=function getCreate2Address(ue,pe,he){const ye=(0,ne.getAddress)(ue),me=(0,K.getBytes)(pe,"salt"),be=(0,K.getBytes)(he,"initCodeHash");return(0,K.assertArgument)(32===me.length,"salt must be 32 bytes","salt",pe),(0,K.assertArgument)(32===be.length,"initCodeHash must be 32 bytes","initCodeHash",he),(0,ne.getAddress)((0,K.dataSlice)((0,G.keccak256)((0,K.concat)(["0xff",ye,me,be])),12))},XB}();Object.defineProperty(G,"getCreateAddress",{enumerable:!0,get:function(){return ne.getCreateAddress}}),Object.defineProperty(G,"getCreate2Address",{enumerable:!0,get:function(){return ne.getCreate2Address}});var ue=function requireChecks(){if(QB)return YB;QB=1,Object.defineProperty(YB,"__esModule",{value:!0}),YB.resolveAddress=YB.isAddress=YB.isAddressable=void 0;const G=requireUtils$4(),K=requireAddress$3();function isAddressable(G){return G&&"function"==typeof G.getAddress}async function checkAddress(ne,ue){const pe=await ue;return null!=pe&&"0x0000000000000000000000000000000000000000"!==pe||((0,G.assert)("string"!=typeof ne,"unconfigured name","UNCONFIGURED_NAME",{value:ne}),(0,G.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",ne)),(0,K.getAddress)(pe)}return YB.isAddressable=isAddressable,YB.isAddress=function isAddress(G){try{return(0,K.getAddress)(G),!0}catch(G){}return!1},YB.resolveAddress=function resolveAddress(ne,ue){return"string"==typeof ne?ne.match(/^0x[0-9a-f]{40}$/i)?(0,K.getAddress)(ne):((0,G.assert)(null!=ue,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),checkAddress(ne,ue.resolveName(ne))):isAddressable(ne)?checkAddress(ne,ne.getAddress()):ne&&"function"==typeof ne.then?checkAddress(ne,ne):void(0,G.assertArgument)(!1,"unsupported addressable value","target",ne)},YB}();Object.defineProperty(G,"isAddressable",{enumerable:!0,get:function(){return ue.isAddressable}}),Object.defineProperty(G,"isAddress",{enumerable:!0,get:function(){return ue.isAddress}}),Object.defineProperty(G,"resolveAddress",{enumerable:!0,get:function(){return ue.resolveAddress}})}(vM)),vM}var eF,tF,rF={};function requireTyped(){if(eF)return rF;eF=1,Object.defineProperty(rF,"__esModule",{value:!0}),rF.Typed=void 0;const G=requireUtils$4(),K={};function n(G,ne){let ue=!1;return ne<0&&(ue=!0,ne*=-1),new Typed(K,`${ue?"":"u"}int${ne}`,G,{signed:ue,width:ne})}function b(G,ne){return new Typed(K,`bytes${ne||""}`,G,{size:ne})}const ne=Symbol.for("_ethers_typed");var ue=new WeakMap;class Typed{constructor(pe,he,ye,me){_defineProperty(this,"type",void 0),_defineProperty(this,"value",void 0),_classPrivateFieldInitSpec(this,ue,void 0),_defineProperty(this,"_typedSymbol",void 0),null==me&&(me=null),(0,G.assertPrivate)(K,pe,"Typed"),(0,G.defineProperties)(this,{_typedSymbol:ne,type:he,value:ye}),_classPrivateFieldSet2(ue,this,me),this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((G=>G.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"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return _classPrivateFieldGet2(ue,this)}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===_classPrivateFieldGet2(ue,this)?-1:!1===_classPrivateFieldGet2(ue,this)?this.value.length:null}static from(G,ne){return new Typed(K,G,ne)}static uint8(G){return n(G,8)}static uint16(G){return n(G,16)}static uint24(G){return n(G,24)}static uint32(G){return n(G,32)}static uint40(G){return n(G,40)}static uint48(G){return n(G,48)}static uint56(G){return n(G,56)}static uint64(G){return n(G,64)}static uint72(G){return n(G,72)}static uint80(G){return n(G,80)}static uint88(G){return n(G,88)}static uint96(G){return n(G,96)}static uint104(G){return n(G,104)}static uint112(G){return n(G,112)}static uint120(G){return n(G,120)}static uint128(G){return n(G,128)}static uint136(G){return n(G,136)}static uint144(G){return n(G,144)}static uint152(G){return n(G,152)}static uint160(G){return n(G,160)}static uint168(G){return n(G,168)}static uint176(G){return n(G,176)}static uint184(G){return n(G,184)}static uint192(G){return n(G,192)}static uint200(G){return n(G,200)}static uint208(G){return n(G,208)}static uint216(G){return n(G,216)}static uint224(G){return n(G,224)}static uint232(G){return n(G,232)}static uint240(G){return n(G,240)}static uint248(G){return n(G,248)}static uint256(G){return n(G,256)}static uint(G){return n(G,256)}static int8(G){return n(G,-8)}static int16(G){return n(G,-16)}static int24(G){return n(G,-24)}static int32(G){return n(G,-32)}static int40(G){return n(G,-40)}static int48(G){return n(G,-48)}static int56(G){return n(G,-56)}static int64(G){return n(G,-64)}static int72(G){return n(G,-72)}static int80(G){return n(G,-80)}static int88(G){return n(G,-88)}static int96(G){return n(G,-96)}static int104(G){return n(G,-104)}static int112(G){return n(G,-112)}static int120(G){return n(G,-120)}static int128(G){return n(G,-128)}static int136(G){return n(G,-136)}static int144(G){return n(G,-144)}static int152(G){return n(G,-152)}static int160(G){return n(G,-160)}static int168(G){return n(G,-168)}static int176(G){return n(G,-176)}static int184(G){return n(G,-184)}static int192(G){return n(G,-192)}static int200(G){return n(G,-200)}static int208(G){return n(G,-208)}static int216(G){return n(G,-216)}static int224(G){return n(G,-224)}static int232(G){return n(G,-232)}static int240(G){return n(G,-240)}static int248(G){return n(G,-248)}static int256(G){return n(G,-256)}static int(G){return n(G,-256)}static bytes1(G){return b(G,1)}static bytes2(G){return b(G,2)}static bytes3(G){return b(G,3)}static bytes4(G){return b(G,4)}static bytes5(G){return b(G,5)}static bytes6(G){return b(G,6)}static bytes7(G){return b(G,7)}static bytes8(G){return b(G,8)}static bytes9(G){return b(G,9)}static bytes10(G){return b(G,10)}static bytes11(G){return b(G,11)}static bytes12(G){return b(G,12)}static bytes13(G){return b(G,13)}static bytes14(G){return b(G,14)}static bytes15(G){return b(G,15)}static bytes16(G){return b(G,16)}static bytes17(G){return b(G,17)}static bytes18(G){return b(G,18)}static bytes19(G){return b(G,19)}static bytes20(G){return b(G,20)}static bytes21(G){return b(G,21)}static bytes22(G){return b(G,22)}static bytes23(G){return b(G,23)}static bytes24(G){return b(G,24)}static bytes25(G){return b(G,25)}static bytes26(G){return b(G,26)}static bytes27(G){return b(G,27)}static bytes28(G){return b(G,28)}static bytes29(G){return b(G,29)}static bytes30(G){return b(G,30)}static bytes31(G){return b(G,31)}static bytes32(G){return b(G,32)}static address(G){return new Typed(K,"address",G)}static bool(G){return new Typed(K,"bool",!!G)}static bytes(G){return new Typed(K,"bytes",G)}static string(G){return new Typed(K,"string",G)}static array(G,K){throw new Error("not implemented yet")}static tuple(G,K){throw new Error("not implemented yet")}static overrides(G){return new Typed(K,"overrides",Object.assign({},G))}static isTyped(G){return G&&"object"==typeof G&&"_typedSymbol"in G&&G._typedSymbol===ne}static dereference(G,K){if(Typed.isTyped(G)){if(G.type!==K)throw new Error(`invalid type: expecetd ${K}, got ${G.type}`);return G.value}return G}}return rF.Typed=Typed,rF}var nF,aF,iF={},sF={};function requireArray(){if(aF)return iF;aF=1,Object.defineProperty(iF,"__esModule",{value:!0}),iF.ArrayCoder=iF.unpack=iF.pack=void 0;const G=requireUtils$4(),K=requireTyped(),ne=requireAbstractCoder(),ue=function requireAnonymous(){if(nF)return sF;nF=1,Object.defineProperty(sF,"__esModule",{value:!0}),sF.AnonymousCoder=void 0;const G=requireAbstractCoder();class AnonymousCoder extends G.Coder{constructor(G){super(G.name,G.type,"_",G.dynamic),_defineProperty(this,"coder",void 0),this.coder=G}defaultValue(){return this.coder.defaultValue()}encode(G,K){return this.coder.encode(G,K)}decode(G){return this.coder.decode(G)}}return sF.AnonymousCoder=AnonymousCoder,sF}();function pack(K,ue,pe){let he=[];if(Array.isArray(pe))he=pe;else if(pe&&"object"==typeof pe){let K={};he=ue.map((ne=>{const ue=ne.localName;return(0,G.assert)(ue,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:ne},value:pe}),(0,G.assert)(!K[ue],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:ne},value:pe}),K[ue]=!0,pe[ue]}))}else(0,G.assertArgument)(!1,"invalid tuple value","tuple",pe);(0,G.assertArgument)(ue.length===he.length,"types/value length mismatch","tuple",pe);let ye=new ne.Writer,me=new ne.Writer,be=[];ue.forEach(((G,K)=>{let ne=he[K];if(G.dynamic){let K=me.length;G.encode(me,ne);let ue=ye.writeUpdatableValue();be.push((G=>{ue(G+K)}))}else G.encode(ye,ne)})),be.forEach((G=>{G(ye.length)}));let ve=K.appendWriter(ye);return ve+=K.appendWriter(me),ve}function unpack(K,ue){let pe=[],he=[],ye=K.subReader(0);return ue.forEach((ne=>{let ue=null;if(ne.dynamic){let pe=K.readIndex(),he=ye.subReader(pe);try{ue=ne.decode(he)}catch(K){if((0,G.isError)(K,"BUFFER_OVERRUN"))throw K;ue=K,ue.baseType=ne.name,ue.name=ne.localName,ue.type=ne.type}}else try{ue=ne.decode(K)}catch(K){if((0,G.isError)(K,"BUFFER_OVERRUN"))throw K;ue=K,ue.baseType=ne.name,ue.name=ne.localName,ue.type=ne.type}if(null==ue)throw new Error("investigate");pe.push(ue),he.push(ne.localName||null)})),ne.Result.fromItems(pe,he)}iF.pack=pack,iF.unpack=unpack;class ArrayCoder extends ne.Coder{constructor(K,ne,ue){super("array",K.type+"["+(ne>=0?ne:"")+"]",ue,-1===ne||K.dynamic),_defineProperty(this,"coder",void 0),_defineProperty(this,"length",void 0),(0,G.defineProperties)(this,{coder:K,length:ne})}defaultValue(){const G=this.coder.defaultValue(),K=[];for(let ne=0;ne<this.length;ne++)K.push(G);return K}encode(ne,ue){const pe=K.Typed.dereference(ue,"array");Array.isArray(pe)||this._throwError("expected array value",pe);let he=this.length;-1===he&&(he=pe.length,ne.writeValue(pe.length)),(0,G.assertArgumentCount)(pe.length,he,"coder array"+(this.localName?" "+this.localName:""));let ye=[];for(let G=0;G<pe.length;G++)ye.push(this.coder);return pack(ne,ye,pe)}decode(K){let pe=this.length;-1===pe&&(pe=K.readIndex(),(0,G.assert)(pe*ne.WordSize<=K.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:K.bytes,offset:pe*ne.WordSize,length:K.dataLength}));let he=[];for(let G=0;G<pe;G++)he.push(new ue.AnonymousCoder(this.coder));return unpack(K,he)}}return iF.ArrayCoder=ArrayCoder,iF}var oF,cF={};var dF,uF={};function requireBytes(){if(dF)return uF;dF=1,Object.defineProperty(uF,"__esModule",{value:!0}),uF.BytesCoder=uF.DynamicBytesCoder=void 0;const G=requireUtils$4(),K=requireAbstractCoder();class DynamicBytesCoder extends K.Coder{constructor(G,K){super(G,G,K,!0)}defaultValue(){return"0x"}encode(K,ne){ne=(0,G.getBytesCopy)(ne);let ue=K.writeValue(ne.length);return ue+=K.writeBytes(ne),ue}decode(G){return G.readBytes(G.readIndex(),!0)}}uF.DynamicBytesCoder=DynamicBytesCoder;return uF.BytesCoder=class BytesCoder extends DynamicBytesCoder{constructor(G){super("bytes",G)}decode(K){return(0,G.hexlify)(super.decode(K))}},uF}var fF,lF={};var pF,hF={};var yF,mF={};var bF,gF={};var vF,wF={};var _F,TF={},AF={},EF={};function requireId(){if(_F)return EF;_F=1,Object.defineProperty(EF,"__esModule",{value:!0}),EF.id=void 0;const G=requireCrypto(),K=requireUtils$4();return EF.id=function id(ne){return(0,G.keccak256)((0,K.toUtf8Bytes)(ne))},EF}var PF,SF,IF={},CF={};function requireDist(){if(PF)return CF;PF=1;var G="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const K=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),ne=4;function read_compressed_payload(G){return function read_payload(G){let K=0;return()=>G[K++]}(function decode_arithmetic(G){let K=0;function u16(){return G[K++]<<8|G[K++]}let ne=u16(),ue=1,pe=[0,1];for(let G=1;G<ne;G++)pe.push(ue+=u16());let he=u16(),ye=K;K+=he;let me=0,be=0;function read_bit(){return 0==me&&(be=be<<8|G[K++],me=8),be>>--me&1}const ve=2**31,_e=ve>>>1,Te=ve-1;let Ee=0;for(let G=0;G<31;G++)Ee=Ee<<1|read_bit();let Pe=[],Se=0,Ce=ve;for(;;){let G=Math.floor(((Ee-Se+1)*ue-1)/Ce),K=0,he=ne;for(;he-K>1;){let ne=K+he>>>1;G<pe[ne]?he=ne:K=ne}if(0==K)break;Pe.push(K);let ye=Se+Math.floor(Ce*pe[K]/ue),me=Se+Math.floor(Ce*pe[K+1]/ue)-1;for(;0==((ye^me)&_e);)Ee=Ee<<1&Te|read_bit(),ye=ye<<1&Te,me=me<<1&Te|1;for(;ye&~me&536870912;)Ee=Ee&_e|Ee<<1&Te>>>1|read_bit(),ye=ye<<1^_e,me=(me^_e)<<1|_e|1;Se=ye,Ce=1+me-ye}let ke=ne-4;return Pe.map((K=>{switch(K-ke){case 3:return ke+65792+(G[ye++]<<16|G[ye++]<<8|G[ye++]);case 2:return ke+256+(G[ye++]<<8|G[ye++]);case 1:return ke+G[ye++];default:return K-1}}))}(function unsafe_atob(G){let K=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((G,ne)=>K[G.charCodeAt(0)]=ne));let ne=G.length,ue=new Uint8Array(6*ne>>3);for(let pe=0,he=0,ye=0,me=0;pe<ne;pe++)me=me<<6|K[G.charCodeAt(pe)],ye+=6,ye>=8&&(ue[he++]=me>>(ye-=8));return ue}(G)))}function signed(G){return 1&G?~G>>1:G>>1}function read_deltas(G,K){let ne=Array(G);for(let ue=0,pe=0;ue<G;ue++)ne[ue]=pe+=signed(K());return ne}function read_sorted(G,K=0){let ne=[];for(;;){let ue=G(),pe=G();if(!pe)break;K+=ue;for(let G=0;G<pe;G++)ne.push(K+G);K+=pe+1}return ne}function read_sorted_arrays(G){return read_array_while((()=>{let K=read_sorted(G);if(K.length)return K}))}function read_mapped(G){let K=[];for(;;){let ne=G();if(0==ne)break;K.push(read_linear_table(ne,G))}for(;;){let ne=G()-1;if(ne<0)break;K.push(read_replacement_table(ne,G))}return K.flat()}function read_array_while(G){let K=[];for(;;){let ne=G(K.length);if(!ne)break;K.push(ne)}return K}function read_transposed(G,K,ne){let ue=Array(G).fill().map((()=>[]));for(let pe=0;pe<K;pe++)read_deltas(G,ne).forEach(((G,K)=>ue[K].push(G)));return ue}function read_linear_table(G,K){let ne=1+K(),ue=K(),pe=read_array_while(K);return read_transposed(pe.length,1+G,K).flatMap(((G,K)=>{let[he,...ye]=G;return Array(pe[K]).fill().map(((G,K)=>{let pe=K*ue;return[he+K*ne,ye.map((G=>G+pe))]}))}))}function read_replacement_table(G,K){return read_transposed(1+K(),1+G,K).map((G=>[G[0],G.slice(1)]))}function quote_cp(G){return`{${function hex_cp(G){return G.toString(16).toUpperCase().padStart(2,"0")}(G)}}`}function explode_cp(G){let K=[];for(let ne=0,ue=G.length;ne<ue;){let ue=G.codePointAt(ne);ne+=ue<65536?1:2,K.push(ue)}return K}function str_from_cps(G){let K=G.length;if(K<4096)return String.fromCodePoint(...G);let ne=[];for(let ue=0;ue<K;)ne.push(String.fromCodePoint(...G.slice(ue,ue+=4096)));return ne.join("")}function compare_arrays(G,K){let ne=G.length,ue=ne-K.length;for(let pe=0;0==ue&&pe<ne;pe++)ue=G[pe]-K[pe];return ue}var ue="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const pe=44032,he=4352,ye=4449,me=4519,be=28,ve=21*be,_e=pe+19*ve,Te=he+19,Ee=ye+21,Pe=me+be;function unpack_cc(G){return G>>24&255}function unpack_cp(G){return 16777215&G}let Se,Ce,ke,Oe;function is_hangul(G){return G>=pe&&G<_e}function compose_pair(G,K){if(G>=he&&G<Te&&K>=ye&&K<Ee)return pe+(G-he)*ve+(K-ye)*be;if(is_hangul(G)&&K>me&&K<Pe&&(G-pe)%be==0)return G+(K-me);{let ne=Oe.get(G);return ne&&(ne=ne.get(K),ne)?ne:-1}}function decomposed(G){Se||function init$1(){let G=read_compressed_payload(ue);Se=new Map(read_sorted_arrays(G).flatMap(((G,K)=>G.map((G=>[G,K+1<<24]))))),Ce=new Set(read_sorted(G)),ke=new Map,Oe=new Map;for(let[K,ne]of read_mapped(G)){if(!Ce.has(K)&&2==ne.length){let[G,ue]=ne,pe=Oe.get(G);pe||(pe=new Map,Oe.set(G,pe)),pe.set(ue,K)}ke.set(K,ne.reverse())}}();let K=[],ne=[],_e=!1;function add(G){let ne=Se.get(G);ne&&(_e=!0,G|=ne),K.push(G)}for(let ue of G)for(;;){if(ue<128)K.push(ue);else if(is_hangul(ue)){let G=ue-pe,K=G%ve/be|0,ne=G%be;add(he+(G/ve|0)),add(ye+K),ne>0&&add(me+ne)}else{let G=ke.get(ue);G?ne.push(...G):add(ue)}if(!ne.length)break;ue=ne.pop()}if(_e&&K.length>1){let G=unpack_cc(K[0]);for(let ne=1;ne<K.length;ne++){let ue=unpack_cc(K[ne]);if(0==ue||G<=ue){G=ue;continue}let pe=ne-1;for(;;){let ne=K[pe+1];if(K[pe+1]=K[pe],K[pe]=ne,!pe)break;if(G=unpack_cc(K[--pe]),G<=ue)break}G=unpack_cc(K[ne])}}return K}function nfd(G){return decomposed(G).map(unpack_cp)}function nfc(G){return function composed_from_decomposed(G){let K=[],ne=[],ue=-1,pe=0;for(let he of G){let G=unpack_cc(he),ye=unpack_cp(he);if(-1==ue)0==G?ue=ye:K.push(ye);else if(pe>0&&pe>=G)0==G?(K.push(ue,...ne),ne.length=0,ue=ye):ne.push(ye),pe=G;else{let he=compose_pair(ue,ye);he>=0?ue=he:0==pe&&0==G?(K.push(ue),ue=ye):(ne.push(ye),pe=G)}}return ue>=0&&K.push(ue,...ne),K}(decomposed(G))}const xe=45,Ne=".",Me=65039,Be=1,Array_from=G=>Array.from(G);function group_has_cp(G,K){return G.P.has(K)||G.Q.has(K)}class Emoji extends Array{get is_emoji(){return!0}}let Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye,et,tt;function init(){if(Fe)return;let K=read_compressed_payload(G);const read_sorted_array=()=>read_sorted(K),read_sorted_set=()=>new Set(read_sorted_array()),set_add_many=(G,K)=>K.forEach((K=>G.add(K)));Fe=new Map(read_mapped(K)),De=read_sorted_set(),Le=read_sorted_array(),Ue=new Set(read_sorted_array().map((G=>Le[G]))),Le=new Set(Le),je=read_sorted_set(),ze=read_sorted_set();let ne=read_sorted_arrays(K),ue=K();const read_chunked=()=>{let G=new Set;return read_sorted_array().forEach((K=>set_add_many(G,ne[K]))),set_add_many(G,read_sorted_array()),G};Je=read_array_while((G=>{let ne=read_array_while(K).map((G=>G+96));if(ne.length){let pe=G>=ue;return ne[0]-=32,ne=str_from_cps(ne),pe&&(ne=`Restricted[${ne}]`),{N:ne,P:read_chunked(),Q:read_chunked(),M:!K(),R:pe}}})),Xe=read_sorted_set(),Qe=new Map;let pe=read_sorted_array().concat(Array_from(Xe)).sort(((G,K)=>G-K));pe.forEach(((G,ne)=>{let ue=K(),he=pe[ne]=ue?pe[ne-ue]:{V:[],M:new Map};he.V.push(G),Xe.has(G)||Qe.set(G,he)}));for(let{V:G,M:K}of new Set(Qe.values())){let ne=[];for(let K of G){let G=Je.filter((G=>group_has_cp(G,K))),ue=ne.find((({G:K})=>G.some((G=>K.has(G)))));ue||(ue={G:new Set,V:[]},ne.push(ue)),ue.V.push(K),set_add_many(ue.G,G)}let ue=ne.flatMap((G=>Array_from(G.G)));for(let{G:G,V:pe}of ne){let ne=new Set(ue.filter((K=>!G.has(K))));for(let G of pe)K.set(G,ne)}}Ye=new Set;let he=new Set;const add_to_union=G=>Ye.has(G)?he.add(G):Ye.add(G);for(let G of Je){for(let K of G.P)add_to_union(K);for(let K of G.Q)add_to_union(K)}for(let G of Ye)Qe.has(G)||he.has(G)||Qe.set(G,Be);set_add_many(Ye,nfd(Ye)),et=function read_trie(G){let K=[],ne=read_sorted(G);return function expand({S:G,B:ne},ue,pe){if(!(4&G&&pe===ue[ue.length-1])){2&G&&(pe=ue[ue.length-1]),1&G&&K.push(ue);for(let G of ne)for(let K of G.Q)expand(G,[...ue,K],pe)}}(function decode(K){let ue=G(),pe=read_array_while((()=>{let K=read_sorted(G).map((G=>ne[G]));if(K.length)return decode(K)}));return{S:ue,B:pe,Q:K}}([]),[]),K}(K).map((G=>Emoji.from(G))).sort(compare_arrays),tt=new Map;for(let G of et){let K=[tt];for(let ne of G){let G=K.map((G=>{let K=G.get(ne);return K||(K=new Map,G.set(ne,K)),K}));ne===Me?K.push(...G):K=G}for(let ne of K)ne.V=G}}function quoted_cp(G){return(should_escape(G)?"":`${bidi_qq(safe_str_from_cps([G]))} `)+quote_cp(G)}function bidi_qq(G){return`"${G}"‎`}function safe_str_from_cps(G,K=1/0,ne=quote_cp){let ue=[];is_combining_mark(G[0])&&ue.push("◌"),G.length>K&&(K>>=1,G=[...G.slice(0,K),8230,...G.slice(-K)]);let pe=0,he=G.length;for(let K=0;K<he;K++){let he=G[K];should_escape(he)&&(ue.push(str_from_cps(G.slice(pe,K))),ue.push(ne(he)),pe=K+1)}return ue.push(str_from_cps(G.slice(pe,he))),ue.join("")}function is_combining_mark(G){return init(),Le.has(G)}function should_escape(G){return init(),je.has(G)}function array_replace(G,K,ne){let ue=0;for(;;){let pe=G.indexOf(K,ue);if(pe<0)break;G[pe]=ne,ue=pe+1}}function split(G,ue,pe){if(!G)return[];init();let he=0;return G.split(Ne).map((G=>{let ye=explode_cp(G),me={input:ye,offset:he};he+=ye.length+1;try{let G,he=me.tokens=tokens_from_str(ye,ue,pe),be=he.length;if(!be)throw new Error("empty label");let ve=me.output=he.flat();if(function check_leading_underscore(G){for(let K=G.lastIndexOf(95);K>0;)if(95!==G[--K])throw new Error("underscore allowed only at start")}(ve),!(me.emoji=be>1||he[0].is_emoji)&&ve.every((G=>G<128)))!function check_label_extension(G){if(G.length>=4&&G[2]==xe&&G[3]==xe)throw new Error(`invalid label extension: "${str_from_cps(G.slice(0,4))}"`)}(ve),G="ASCII";else{let ue=he.flatMap((G=>G.is_emoji?[]:G));if(ue.length){if(Le.has(ve[0]))throw error_placement("leading combining mark");for(let G=1;G<be;G++){let K=he[G];if(!K.is_emoji&&Le.has(K[0]))throw error_placement(`emoji + combining mark: "${str_from_cps(he[G-1])} + ${safe_str_from_cps([K[0]])}"`)}!function check_fenced(G){let ne=G[0],ue=K.get(ne);if(ue)throw error_placement(`leading ${ue}`);let pe=G.length,he=-1;for(let ye=1;ye<pe;ye++){ne=G[ye];let pe=K.get(ne);if(pe){if(he==ye)throw error_placement(`${ue} + ${pe}`);he=ye+1,ue=pe}}if(he==pe)throw error_placement(`trailing ${ue}`)}(ve);let pe=Array_from(new Set(ue)),[ye]=function determine_group(G){let K=Je;for(let ne of G){let G=K.filter((G=>group_has_cp(G,ne)));if(!G.length)throw Je.some((G=>group_has_cp(G,ne)))?error_group_member(K[0],ne):error_disallowed(ne);if(K=G,1==G.length)break}return K}(pe);!function check_group(G,K){for(let ne of K)if(!group_has_cp(G,ne))throw error_group_member(G,ne);if(G.M){let G=nfd(K);for(let K=1,ue=G.length;K<ue;K++)if(Ue.has(G[K])){let pe=K+1;for(let ne;pe<ue&&Ue.has(ne=G[pe]);pe++)for(let ue=K;ue<pe;ue++)if(G[ue]==ne)throw new Error(`duplicate non-spacing marks: ${quoted_cp(ne)}`);if(pe-K>ne)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(G.slice(K-1,pe)))} (${pe-K}/${ne})`);K=pe}}}(ye,ue),function check_whole(G,K){let ne,ue=[];for(let G of K){let K=Qe.get(G);if(K===Be)return;if(K){let ue=K.M.get(G);if(ne=ne?ne.filter((G=>ue.has(G))):Array_from(ue),!ne.length)return}else ue.push(G)}if(ne)for(let K of ne)if(ue.every((G=>group_has_cp(K,G))))throw new Error(`whole-script confusable: ${G.N}/${K.N}`)}(ye,pe),G=ye.N}else G="Emoji"}me.type=G}catch(G){me.error=G}return me}))}function flatten(G){return G.map((({input:K,error:ne,output:ue})=>{if(ne){let ue=ne.message;throw new Error(1==G.length?ue:`Invalid label ${bidi_qq(safe_str_from_cps(K,63))}: ${ue}`)}return str_from_cps(ue)})).join(Ne)}function error_disallowed(G){return new Error(`disallowed character: ${quoted_cp(G)}`)}function error_group_member(G,K){let ne=quoted_cp(K),ue=Je.find((G=>G.P.has(K)));return ue&&(ne=`${ue.N} ${ne}`),new Error(`illegal mixture: ${G.N} + ${ne}`)}function error_placement(G){return new Error(`illegal placement: ${G}`)}function tokens_from_str(G,K,ne){let ue=[],pe=[];for(G=G.slice().reverse();G.length;){let he=consume_emoji_reversed(G);if(he)pe.length&&(ue.push(K(pe)),pe=[]),ue.push(ne(he));else{let K=G.pop();if(Ye.has(K))pe.push(K);else{let G=Fe.get(K);if(G)pe.push(...G);else if(!De.has(K))throw error_disallowed(K)}}}return pe.length&&ue.push(K(pe)),ue}function filter_fe0f(G){return G.filter((G=>G!=Me))}function consume_emoji_reversed(G,K){let ne,ue=tt,pe=G.length;for(;pe&&(ue=ue.get(G[--pe]),ue);){let{V:he}=ue;he&&(ne=he,K&&K.push(...G.slice(pe).reverse()),G.length=pe)}return ne}const rt="valid",nt="mapped",at="ignored";function is_valid_or_mapped(G){return G==rt||G==nt}function requires_check(G){return G.some((G=>ze.has(G)))}function collapse_valid_tokens(G){for(let K=0;K<G.length;K++)if(G[K].type==rt){let ne=K+1;for(;ne<G.length&&G[ne].type==rt;)ne++;G.splice(K,ne-K,{type:rt,cps:G.slice(K,ne).flatMap((G=>G.cps))})}return G}return CF.ens_beautify=function ens_beautify(G){let K=split(G,nfc,(G=>G));for(let{type:G,output:ne,error:ue}of K){if(ue)break;"Greek"!==G&&array_replace(ne,958,926)}return flatten(K)},CF.ens_emoji=function ens_emoji(){return init(),et.map((G=>G.slice()))},CF.ens_normalize=function ens_normalize(G){return flatten(split(G,nfc,filter_fe0f))},CF.ens_normalize_fragment=function ens_normalize_fragment(G,K){init();let ne=K?nfd:nfc;return G.split(Ne).map((G=>str_from_cps(tokens_from_str(explode_cp(G),ne,filter_fe0f).flat()))).join(Ne)},CF.ens_split=function ens_split(G,K){return split(G,nfc,K?G=>G.slice():filter_fe0f)},CF.ens_tokenize=function ens_tokenize(G,{nf:K=!0}={}){init();let ne=explode_cp(G).reverse(),ue=[],pe=[];for(;ne.length;){let G=consume_emoji_reversed(ne,ue);if(G)pe.push({type:"emoji",emoji:G.slice(),input:ue,cps:filter_fe0f(G)}),ue=[];else{let G=ne.pop();if(46==G)pe.push({type:"stop",cp:G});else if(Ye.has(G))pe.push({type:rt,cps:[G]});else if(De.has(G))pe.push({type:at,cp:G});else{let K=Fe.get(G);K?pe.push({type:nt,cp:G,cps:K.slice()}):pe.push({type:"disallowed",cp:G})}}}if(K)for(let G=0,K=-1;G<pe.length;G++){let ne=pe[G];if(is_valid_or_mapped(ne.type))if(requires_check(ne.cps)){let ne=G+1;for(let G=ne;G<pe.length;G++){let{type:K,cps:ue}=pe[G];if(is_valid_or_mapped(K)){if(!requires_check(ue))break;ne=G+1}else if(K!==at)break}K<0&&(K=G);let ue=pe.slice(K,ne),he=ue.flatMap((G=>is_valid_or_mapped(G.type)?G.cps:[])),ye=nfc(he);compare_arrays(ye,he)?(pe.splice(K,ne-K,{type:"nfc",input:he,cps:ye,tokens0:collapse_valid_tokens(ue),tokens:ens_tokenize(str_from_cps(ye),{nf:!1})}),G=K):G=ne-1,K=-1}else K=G;else ne.type!==at&&(K=-1)}return collapse_valid_tokens(pe)},CF.is_combining_mark=is_combining_mark,CF.nfc=nfc,CF.nfd=nfd,CF.safe_str_from_cps=safe_str_from_cps,CF.should_escape=should_escape,CF}var RF,kF={},OF={},xF={};function requireAccesslist(){if(RF)return xF;RF=1,Object.defineProperty(xF,"__esModule",{value:!0}),xF.accessListify=void 0;const G=requireAddress$2(),K=requireUtils$4();function accessSetify(ne,ue){return{address:(0,G.getAddress)(ne),storageKeys:ue.map(((G,ne)=>((0,K.assertArgument)((0,K.isHexString)(G,32),"invalid slot",`storageKeys[${ne}]`,G),G.toLowerCase())))}}return xF.accessListify=function accessListify(G){if(Array.isArray(G))return G.map(((ne,ue)=>Array.isArray(ne)?((0,K.assertArgument)(2===ne.length,"invalid slot set",`value[${ue}]`,ne),accessSetify(ne[0],ne[1])):((0,K.assertArgument)(null!=ne&&"object"==typeof ne,"invalid address-slot set","value",G),accessSetify(ne.address,ne.storageKeys))));(0,K.assertArgument)(null!=G&&"object"==typeof G,"invalid access list","value",G);const ne=Object.keys(G).map((K=>{const ne=G[K].reduce(((G,K)=>(G[K]=!0,G)),{});return accessSetify(K,Object.keys(ne).sort())}));return ne.sort(((G,K)=>G.address.localeCompare(K.address))),ne},xF}var NF,MF={};function requireAddress(){if(NF)return MF;NF=1,Object.defineProperty(MF,"__esModule",{value:!0}),MF.recoverAddress=MF.computeAddress=void 0;const G=requireAddress$2(),K=requireCrypto();function computeAddress(ne){let ue;return ue="string"==typeof ne?K.SigningKey.computePublicKey(ne,!1):ne.publicKey,(0,G.getAddress)((0,K.keccak256)("0x"+ue.substring(4)).substring(26))}return MF.computeAddress=computeAddress,MF.recoverAddress=function recoverAddress(G,ne){return computeAddress(K.SigningKey.recoverPublicKey(G,ne))},MF}var BF,DF,LF,UF={};function requireTransaction$1(){if(BF)return UF;BF=1,Object.defineProperty(UF,"__esModule",{value:!0}),UF.Transaction=void 0;const G=requireAddress$2(),K=requireAddresses(),ne=requireCrypto(),ue=requireUtils$4(),pe=requireAccesslist(),he=requireAddress(),ye=BigInt(0),me=BigInt(2),be=BigInt(27),ve=BigInt(28),_e=BigInt(35),Te=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function handleAddress(K){return"0x"===K?null:(0,G.getAddress)(K)}function handleAccessList(G,K){try{return(0,pe.accessListify)(G)}catch(ne){(0,ue.assertArgument)(!1,ne.message,K,G)}}function handleNumber(G,K){return"0x"===G?0:(0,ue.getNumber)(G,K)}function handleUint(G,K){if("0x"===G)return ye;const ne=(0,ue.getBigInt)(G,K);return(0,ue.assertArgument)(ne<=Te,"value exceeds uint size",K,ne),ne}function formatNumber(G,K){const ne=(0,ue.getBigInt)(G,"value"),pe=(0,ue.toBeArray)(ne);return(0,ue.assertArgument)(pe.length<=32,"value too large",`tx.${K}`,ne),pe}function formatAccessList(G){return(0,pe.accessListify)(G).map((G=>[G.address,G.storageKeys]))}function formatHashes(G,K){(0,ue.assertArgument)(Array.isArray(G),`invalid ${K}`,"value",G);for(let K=0;K<G.length;K++)(0,ue.assertArgument)((0,ue.isHexString)(G[K],32),"invalid ${ param } hash",`value[${K}]`,G[K]);return G}function _serializeLegacy(G,K){const pe=[formatNumber(G.nonce,"nonce"),formatNumber(G.gasPrice||0,"gasPrice"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data];let he=ye;if(G.chainId!=ye)he=(0,ue.getBigInt)(G.chainId,"tx.chainId"),(0,ue.assertArgument)(!K||null==K.networkV||K.legacyChainId===he,"tx.chainId/sig.v mismatch","sig",K);else if(G.signature){const K=G.signature.legacyChainId;null!=K&&(he=K)}if(!K)return he!==ye&&(pe.push((0,ue.toBeArray)(he)),pe.push("0x"),pe.push("0x")),(0,ue.encodeRlp)(pe);let me=BigInt(27+K.yParity);return he!==ye?me=ne.Signature.getChainIdV(he,K.v):BigInt(K.v)!==me&&(0,ue.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",K),pe.push((0,ue.toBeArray)(me)),pe.push((0,ue.toBeArray)(K.r)),pe.push((0,ue.toBeArray)(K.s)),(0,ue.encodeRlp)(pe)}function _parseEipSignature(G,K){let pe;try{if(pe=handleNumber(K[0],"yParity"),0!==pe&&1!==pe)throw new Error("bad yParity")}catch(G){(0,ue.assertArgument)(!1,"invalid yParity","yParity",K[0])}const he=(0,ue.zeroPadValue)(K[1],32),ye=(0,ue.zeroPadValue)(K[2],32),me=ne.Signature.from({r:he,s:ye,yParity:pe});G.signature=me}function _serializeEip1559(G,K){const ne=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(G.maxFeePerGas||0,"maxFeePerGas"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[])];return K&&(ne.push(formatNumber(K.yParity,"yParity")),ne.push((0,ue.toBeArray)(K.r)),ne.push((0,ue.toBeArray)(K.s))),(0,ue.concat)(["0x02",(0,ue.encodeRlp)(ne)])}function _serializeEip2930(G,K){const ne=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.gasPrice||0,"gasPrice"),formatNumber(G.gasLimit,"gasLimit"),G.to||"0x",formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[])];return K&&(ne.push(formatNumber(K.yParity,"recoveryParam")),ne.push((0,ue.toBeArray)(K.r)),ne.push((0,ue.toBeArray)(K.s))),(0,ue.concat)(["0x01",(0,ue.encodeRlp)(ne)])}function _serializeEip4844(G,ne){const pe=[formatNumber(G.chainId,"chainId"),formatNumber(G.nonce,"nonce"),formatNumber(G.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(G.maxFeePerGas||0,"maxFeePerGas"),formatNumber(G.gasLimit,"gasLimit"),G.to||K.ZeroAddress,formatNumber(G.value,"value"),G.data,formatAccessList(G.accessList||[]),formatNumber(G.maxFeePerBlobGas||0,"maxFeePerBlobGas"),formatHashes(G.blobVersionedHashes||[],"blobVersionedHashes")];return ne&&(pe.push(formatNumber(ne.yParity,"yParity")),pe.push((0,ue.toBeArray)(ne.r)),pe.push((0,ue.toBeArray)(ne.s))),(0,ue.concat)(["0x03",(0,ue.encodeRlp)(pe)])}var Ee=new WeakMap,Pe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Be=new WeakMap,Fe=new WeakMap,De=new WeakMap,Le=new WeakMap,Ue=new WeakMap;class Transaction{get type(){return _classPrivateFieldGet2(Ee,this)}set type(G){switch(G){case null:_classPrivateFieldSet2(Ee,this,null);break;case 0:case"legacy":_classPrivateFieldSet2(Ee,this,0);break;case 1:case"berlin":case"eip-2930":_classPrivateFieldSet2(Ee,this,1);break;case 2:case"london":case"eip-1559":_classPrivateFieldSet2(Ee,this,2);break;case 3:case"cancun":case"eip-4844":_classPrivateFieldSet2(Ee,this,3);break;default:(0,ue.assertArgument)(!1,"unsupported transaction type","type",G)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const G=_classPrivateFieldGet2(Pe,this);return null==G&&3===this.type?K.ZeroAddress:G}set to(K){_classPrivateFieldSet2(Pe,this,null==K?null:(0,G.getAddress)(K))}get nonce(){return _classPrivateFieldGet2(Ce,this)}set nonce(G){_classPrivateFieldSet2(Ce,this,(0,ue.getNumber)(G,"value"))}get gasLimit(){return _classPrivateFieldGet2(ke,this)}set gasLimit(G){_classPrivateFieldSet2(ke,this,(0,ue.getBigInt)(G))}get gasPrice(){const G=_classPrivateFieldGet2(Oe,this);return null!=G||0!==this.type&&1!==this.type?G:ye}set gasPrice(G){_classPrivateFieldSet2(Oe,this,null==G?null:(0,ue.getBigInt)(G,"gasPrice"))}get maxPriorityFeePerGas(){const G=_classPrivateFieldGet2(xe,this);return null==G?2===this.type||3===this.type?ye:null:G}set maxPriorityFeePerGas(G){_classPrivateFieldSet2(xe,this,null==G?null:(0,ue.getBigInt)(G,"maxPriorityFeePerGas"))}get maxFeePerGas(){const G=_classPrivateFieldGet2(Ne,this);return null==G?2===this.type||3===this.type?ye:null:G}set maxFeePerGas(G){_classPrivateFieldSet2(Ne,this,null==G?null:(0,ue.getBigInt)(G,"maxFeePerGas"))}get data(){return _classPrivateFieldGet2(Se,this)}set data(G){_classPrivateFieldSet2(Se,this,(0,ue.hexlify)(G))}get value(){return _classPrivateFieldGet2(Me,this)}set value(G){_classPrivateFieldSet2(Me,this,(0,ue.getBigInt)(G,"value"))}get chainId(){return _classPrivateFieldGet2(Be,this)}set chainId(G){_classPrivateFieldSet2(Be,this,(0,ue.getBigInt)(G))}get signature(){return _classPrivateFieldGet2(Fe,this)||null}set signature(G){_classPrivateFieldSet2(Fe,this,null==G?null:ne.Signature.from(G))}get accessList(){const G=_classPrivateFieldGet2(De,this)||null;return null==G?1===this.type||2===this.type||3===this.type?[]:null:G}set accessList(G){_classPrivateFieldSet2(De,this,null==G?null:(0,pe.accessListify)(G))}get maxFeePerBlobGas(){const G=_classPrivateFieldGet2(Le,this);return null==G&&3===this.type?ye:G}set maxFeePerBlobGas(G){_classPrivateFieldSet2(Le,this,null==G?null:(0,ue.getBigInt)(G,"maxFeePerBlobGas"))}get blobVersionedHashes(){let G=_classPrivateFieldGet2(Ue,this);return null==G&&3===this.type?[]:G}set blobVersionedHashes(G){if(null!=G){(0,ue.assertArgument)(Array.isArray(G),"blobVersionedHashes must be an Array","value",G),G=G.slice();for(let K=0;K<G.length;K++)(0,ue.assertArgument)((0,ue.isHexString)(G[K],32),"invalid blobVersionedHash",`value[${K}]`,G[K])}_classPrivateFieldSet2(Ue,this,G)}constructor(){_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0),_classPrivateFieldInitSpec(this,Se,void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldInitSpec(this,xe,void 0),_classPrivateFieldInitSpec(this,Ne,void 0),_classPrivateFieldInitSpec(this,Me,void 0),_classPrivateFieldInitSpec(this,Be,void 0),_classPrivateFieldInitSpec(this,Fe,void 0),_classPrivateFieldInitSpec(this,De,void 0),_classPrivateFieldInitSpec(this,Le,void 0),_classPrivateFieldInitSpec(this,Ue,void 0),_classPrivateFieldSet2(Ee,this,null),_classPrivateFieldSet2(Pe,this,null),_classPrivateFieldSet2(Ce,this,0),_classPrivateFieldSet2(ke,this,ye),_classPrivateFieldSet2(Oe,this,null),_classPrivateFieldSet2(xe,this,null),_classPrivateFieldSet2(Ne,this,null),_classPrivateFieldSet2(Se,this,"0x"),_classPrivateFieldSet2(Me,this,ye),_classPrivateFieldSet2(Be,this,ye),_classPrivateFieldSet2(Fe,this,null),_classPrivateFieldSet2(De,this,null),_classPrivateFieldSet2(Le,this,null),_classPrivateFieldSet2(Ue,this,null)}get hash(){return null==this.signature?null:(0,ne.keccak256)(this.serialized)}get unsignedHash(){return(0,ne.keccak256)(this.unsignedSerialized)}get from(){return null==this.signature?null:(0,he.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:ne.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}get serialized(){switch((0,ue.assert)(null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return _serializeLegacy(this,this.signature);case 1:return _serializeEip2930(this,this.signature);case 2:return _serializeEip1559(this,this.signature);case 3:return _serializeEip4844(this,this.signature)}(0,ue.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return _serializeLegacy(this);case 1:return _serializeEip2930(this);case 2:return _serializeEip1559(this);case 3:return _serializeEip4844(this)}(0,ue.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){const G=this.inferTypes();return G.indexOf(2)>=0?2:G.pop()}inferTypes(){const G=null!=this.gasPrice,K=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,ne=null!=this.accessList,pe=null!=_classPrivateFieldGet2(Le,this)||_classPrivateFieldGet2(Ue,this);null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,ue.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,ue.assert)(!K||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,ue.assert)(0!==this.type||!ne,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const he=[];return null!=this.type?he.push(this.type):K?he.push(2):G?(he.push(1),ne||he.push(0)):ne?(he.push(1),he.push(2)):(pe&&this.to||(he.push(0),he.push(1),he.push(2)),he.push(3)),he.sort(),he}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return Transaction.from(this)}toJSON(){const s=G=>null==G?null:G.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:s(this.gasLimit),gasPrice:s(this.gasPrice),maxPriorityFeePerGas:s(this.maxPriorityFeePerGas),maxFeePerGas:s(this.maxFeePerGas),value:s(this.value),chainId:s(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(G){if(null==G)return new Transaction;if("string"==typeof G){const K=(0,ue.getBytes)(G);if(K[0]>=127)return Transaction.from(function _parseLegacy(G){const K=(0,ue.decodeRlp)(G);(0,ue.assertArgument)(Array.isArray(K)&&(9===K.length||6===K.length),"invalid field count for legacy transaction","data",G);const pe={type:0,nonce:handleNumber(K[0],"nonce"),gasPrice:handleUint(K[1],"gasPrice"),gasLimit:handleUint(K[2],"gasLimit"),to:handleAddress(K[3]),value:handleUint(K[4],"value"),data:(0,ue.hexlify)(K[5]),chainId:ye};if(6===K.length)return pe;const he=handleUint(K[6],"v"),Te=handleUint(K[7],"r"),Ee=handleUint(K[8],"s");if(Te===ye&&Ee===ye)pe.chainId=he;else{let Te=(he-_e)/me;Te<ye&&(Te=ye),pe.chainId=Te,(0,ue.assertArgument)(Te!==ye||he===be||he===ve,"non-canonical legacy v","v",K[6]),pe.signature=ne.Signature.from({r:(0,ue.zeroPadValue)(K[7],32),s:(0,ue.zeroPadValue)(K[8],32),v:he}),pe.hash=(0,ne.keccak256)(G)}return pe}(K));switch(K[0]){case 1:return Transaction.from(function _parseEip2930(G){const K=(0,ue.decodeRlp)((0,ue.getBytes)(G).slice(1));(0,ue.assertArgument)(Array.isArray(K)&&(8===K.length||11===K.length),"invalid field count for transaction type: 1","data",(0,ue.hexlify)(G));const pe={type:1,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),gasPrice:handleUint(K[2],"gasPrice"),gasLimit:handleUint(K[3],"gasLimit"),to:handleAddress(K[4]),value:handleUint(K[5],"value"),data:(0,ue.hexlify)(K[6]),accessList:handleAccessList(K[7],"accessList")};return 8===K.length||(pe.hash=(0,ne.keccak256)(G),_parseEipSignature(pe,K.slice(8))),pe}(K));case 2:return Transaction.from(function _parseEip1559(G){const K=(0,ue.decodeRlp)((0,ue.getBytes)(G).slice(1));(0,ue.assertArgument)(Array.isArray(K)&&(9===K.length||12===K.length),"invalid field count for transaction type: 2","data",(0,ue.hexlify)(G));const pe={type:2,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),maxPriorityFeePerGas:handleUint(K[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(K[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(K[4],"gasLimit"),to:handleAddress(K[5]),value:handleUint(K[6],"value"),data:(0,ue.hexlify)(K[7]),accessList:handleAccessList(K[8],"accessList")};return 9===K.length||(pe.hash=(0,ne.keccak256)(G),_parseEipSignature(pe,K.slice(9))),pe}(K));case 3:return Transaction.from(function _parseEip4844(G){const K=(0,ue.decodeRlp)((0,ue.getBytes)(G).slice(1));(0,ue.assertArgument)(Array.isArray(K)&&(11===K.length||14===K.length),"invalid field count for transaction type: 3","data",(0,ue.hexlify)(G));const pe={type:3,chainId:handleUint(K[0],"chainId"),nonce:handleNumber(K[1],"nonce"),maxPriorityFeePerGas:handleUint(K[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(K[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(K[4],"gasLimit"),to:handleAddress(K[5]),value:handleUint(K[6],"value"),data:(0,ue.hexlify)(K[7]),accessList:handleAccessList(K[8],"accessList"),maxFeePerBlobGas:handleUint(K[9],"maxFeePerBlobGas"),blobVersionedHashes:K[10]};(0,ue.assertArgument)(null!=pe.to,"invalid address for transaction type: 3","data",G),(0,ue.assertArgument)(Array.isArray(pe.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",G);for(let K=0;K<pe.blobVersionedHashes.length;K++)(0,ue.assertArgument)((0,ue.isHexString)(pe.blobVersionedHashes[K],32),`invalid blobVersionedHash at index ${K}: must be length 32`,"data",G);return 11===K.length||(pe.hash=(0,ne.keccak256)(G),_parseEipSignature(pe,K.slice(11))),pe}(K))}(0,ue.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const K=new Transaction;return null!=G.type&&(K.type=G.type),null!=G.to&&(K.to=G.to),null!=G.nonce&&(K.nonce=G.nonce),null!=G.gasLimit&&(K.gasLimit=G.gasLimit),null!=G.gasPrice&&(K.gasPrice=G.gasPrice),null!=G.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas),null!=G.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null!=G.maxFeePerBlobGas&&(K.maxFeePerBlobGas=G.maxFeePerBlobGas),null!=G.data&&(K.data=G.data),null!=G.value&&(K.value=G.value),null!=G.chainId&&(K.chainId=G.chainId),null!=G.signature&&(K.signature=ne.Signature.from(G.signature)),null!=G.accessList&&(K.accessList=G.accessList),null!=G.blobVersionedHashes&&(K.blobVersionedHashes=G.blobVersionedHashes),null!=G.hash&&((0,ue.assertArgument)(K.isSigned(),"unsigned transaction cannot define hash","tx",G),(0,ue.assertArgument)(K.hash===G.hash,"hash mismatch","tx",G)),null!=G.from&&((0,ue.assertArgument)(K.isSigned(),"unsigned transaction cannot define from","tx",G),(0,ue.assertArgument)(K.from.toLowerCase()===(G.from||"").toLowerCase(),"from mismatch","tx",G)),K}}return UF.Transaction=Transaction,UF}function requireTransaction(){return DF||(DF=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Transaction=G.recoverAddress=G.computeAddress=G.accessListify=void 0;var K=requireAccesslist();Object.defineProperty(G,"accessListify",{enumerable:!0,get:function(){return K.accessListify}});var ne=requireAddress();Object.defineProperty(G,"computeAddress",{enumerable:!0,get:function(){return ne.computeAddress}}),Object.defineProperty(G,"recoverAddress",{enumerable:!0,get:function(){return ne.recoverAddress}});var ue=requireTransaction$1();Object.defineProperty(G,"Transaction",{enumerable:!0,get:function(){return ue.Transaction}})}(OF)),OF}var $F,qF={};function requireSolidity(){if($F)return qF;$F=1,Object.defineProperty(qF,"__esModule",{value:!0}),qF.solidityPackedSha256=qF.solidityPackedKeccak256=qF.solidityPacked=void 0;const G=requireAddress$2(),K=requireCrypto(),ne=requireUtils$4(),ue=new RegExp("^bytes([0-9]+)$"),pe=new RegExp("^(u?int)([0-9]*)$"),he=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(K,ye,me){switch(K){case"address":return me?(0,ne.getBytes)((0,ne.zeroPadValue)(ye,32)):(0,ne.getBytes)((0,G.getAddress)(ye));case"string":return(0,ne.toUtf8Bytes)(ye);case"bytes":return(0,ne.getBytes)(ye);case"bool":return ye=ye?"0x01":"0x00",me?(0,ne.getBytes)((0,ne.zeroPadValue)(ye,32)):(0,ne.getBytes)(ye)}let be=K.match(pe);if(be){let G="int"===be[1],ue=parseInt(be[2]||"256");return(0,ne.assertArgument)((!be[2]||be[2]===String(ue))&&ue%8==0&&0!==ue&&ue<=256,"invalid number type","type",K),me&&(ue=256),G&&(ye=(0,ne.toTwos)(ye,ue)),(0,ne.getBytes)((0,ne.zeroPadValue)((0,ne.toBeArray)(ye),ue/8))}if(be=K.match(ue),be){const G=parseInt(be[1]);return(0,ne.assertArgument)(String(G)===be[1]&&0!==G&&G<=32,"invalid bytes type","type",K),(0,ne.assertArgument)((0,ne.dataLength)(ye)===G,`invalid value for ${K}`,"value",ye),me?(0,ne.getBytes)((0,ne.zeroPadBytes)(ye,32)):ye}if(be=K.match(he),be&&Array.isArray(ye)){const G=be[1],ue=parseInt(be[2]||String(ye.length));(0,ne.assertArgument)(ue===ye.length,`invalid array length for ${K}`,"value",ye);const pe=[];return ye.forEach((function(K){pe.push(_pack(G,K,!0))})),(0,ne.getBytes)((0,ne.concat)(pe))}(0,ne.assertArgument)(!1,"invalid type","type",K)}function solidityPacked(G,K){(0,ne.assertArgument)(G.length===K.length,"wrong number of values; expected ${ types.length }","values",K);const ue=[];return G.forEach((function(G,ne){ue.push(_pack(G,K[ne]))})),(0,ne.hexlify)((0,ne.concat)(ue))}return qF.solidityPacked=solidityPacked,qF.solidityPackedKeccak256=function solidityPackedKeccak256(G,ne){return(0,K.keccak256)(solidityPacked(G,ne))},qF.solidityPackedSha256=function solidityPackedSha256(G,ne){return(0,K.sha256)(solidityPacked(G,ne))},qF}var GF,jF,HF,WF,zF={};function requireTypedData(){if(GF)return zF;GF=1,Object.defineProperty(zF,"__esModule",{value:!0}),zF.verifyTypedData=zF.TypedDataEncoder=void 0;const G=requireAddress$2(),K=requireCrypto(),ne=requireTransaction(),ue=requireUtils$4(),pe=requireId(),he=new Uint8Array(32);he.fill(0);const ye=BigInt(-1),me=BigInt(0),be=BigInt(1),ve=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const _e=(0,ue.toBeHex)(be,32),Te=(0,ue.toBeHex)(me,32),Ee={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Pe=["name","version","chainId","verifyingContract","salt"];function checkString(G){return function(K){return(0,ue.assertArgument)("string"==typeof K,`invalid domain value for ${JSON.stringify(G)}`,`domain.${G}`,K),K}}const Se={name:checkString("name"),version:checkString("version"),chainId:function(G){const K=(0,ue.getBigInt)(G,"domain.chainId");return(0,ue.assertArgument)(K>=0,"invalid chain ID","domain.chainId",G),Number.isSafeInteger(K)?Number(K):(0,ue.toQuantity)(K)},verifyingContract:function(K){try{return(0,G.getAddress)(K).toLowerCase()}catch(G){}(0,ue.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",K)},salt:function(G){const K=(0,ue.getBytes)(G,"domain.salt");return(0,ue.assertArgument)(32===K.length,'invalid domain value "salt"',"domain.salt",G),(0,ue.hexlify)(K)}};function getBaseEncoder(ne){{const G=ne.match(/^(u?)int(\d+)$/);if(G){const K=""===G[1],pe=parseInt(G[2]);(0,ue.assertArgument)(pe%8==0&&0!==pe&&pe<=256&&G[2]===String(pe),"invalid numeric width","type",ne);const he=(0,ue.mask)(ve,K?pe-1:pe),_e=K?(he+be)*ye:me;return function(G){const pe=(0,ue.getBigInt)(G,"value");return(0,ue.assertArgument)(pe>=_e&&pe<=he,`value out-of-bounds for ${ne}`,"value",pe),(0,ue.toBeHex)(K?(0,ue.toTwos)(pe,256):pe,32)}}}{const G=ne.match(/^bytes(\d+)$/);if(G){const K=parseInt(G[1]);return(0,ue.assertArgument)(0!==K&&K<=32&&G[1]===String(K),"invalid bytes width","type",ne),function(G){const pe=(0,ue.getBytes)(G);return(0,ue.assertArgument)(pe.length===K,`invalid length for ${ne}`,"value",G),function hexPadRight(G){const K=(0,ue.getBytes)(G),ne=K.length%32;return ne?(0,ue.concat)([K,he.slice(ne)]):(0,ue.hexlify)(K)}(G)}}}switch(ne){case"address":return function(K){return(0,ue.zeroPadValue)((0,G.getAddress)(K),32)};case"bool":return function(G){return G?_e:Te};case"bytes":return function(G){return(0,K.keccak256)(G)};case"string":return function(G){return(0,pe.id)(G)}}return null}function encodeType(G,K){return`${G}(${K.map((({name:G,type:K})=>K+" "+G)).join(",")})`}function splitArray(G){const K=G.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return K?{base:K[1],index:K[2]+K[4],array:{base:K[1],prefix:K[1]+K[2],count:K[5]?parseInt(K[5]):-1}}:{base:G}}var Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakSet;class TypedDataEncoder{get types(){return JSON.parse(_classPrivateFieldGet2(Ce,this))}constructor(G){_classPrivateMethodInitSpec(this,xe),_defineProperty(this,"primaryType",void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldSet2(ke,this,new Map),_classPrivateFieldSet2(Oe,this,new Map);const K=new Map,ne=new Map,pe=new Map,he={};Object.keys(G).forEach((ue=>{he[ue]=G[ue].map((({name:K,type:ne})=>{let{base:ue,index:pe}=splitArray(ne);return"int"!==ue||G.int||(ue="int256"),"uint"!==ue||G.uint||(ue="uint256"),{name:K,type:ue+(pe||"")}})),K.set(ue,new Set),ne.set(ue,[]),pe.set(ue,new Set)})),_classPrivateFieldSet2(Ce,this,JSON.stringify(he));for(const pe in he){const ye=new Set;for(const me of he[pe]){(0,ue.assertArgument)(!ye.has(me.name),`duplicate variable name ${JSON.stringify(me.name)} in ${JSON.stringify(pe)}`,"types",G),ye.add(me.name);const he=splitArray(me.type).base;(0,ue.assertArgument)(he!==pe,`circular type reference to ${JSON.stringify(he)}`,"types",G);getBaseEncoder(he)||((0,ue.assertArgument)(ne.has(he),`unknown type ${JSON.stringify(he)}`,"types",G),ne.get(he).push(pe),K.get(pe).add(he))}}const ye=Array.from(ne.keys()).filter((G=>0===ne.get(G).length));(0,ue.assertArgument)(0!==ye.length,"missing primary type","types",G),(0,ue.assertArgument)(1===ye.length,`ambiguous primary types or unused types: ${ye.map((G=>JSON.stringify(G))).join(", ")}`,"types",G),(0,ue.defineProperties)(this,{primaryType:ye[0]}),function checkCircular(he,ye){(0,ue.assertArgument)(!ye.has(he),`circular type reference to ${JSON.stringify(he)}`,"types",G),ye.add(he);for(const G of K.get(he))if(ne.has(G)){checkCircular(G,ye);for(const K of ye)pe.get(K).add(G)}ye.delete(he)}(this.primaryType,new Set);for(const[G,K]of pe){const ne=Array.from(K);ne.sort(),_classPrivateFieldGet2(ke,this).set(G,encodeType(G,he[G])+ne.map((G=>encodeType(G,he[G]))).join(""))}}getEncoder(G){let K=_classPrivateFieldGet2(Oe,this).get(G);return K||(K=_assertClassBrand(xe,this,_getEncoder).call(this,G),_classPrivateFieldGet2(Oe,this).set(G,K)),K}encodeType(G){const K=_classPrivateFieldGet2(ke,this).get(G);return(0,ue.assertArgument)(K,`unknown type: ${JSON.stringify(G)}`,"name",G),K}encodeData(G,K){return this.getEncoder(G)(K)}hashStruct(G,ne){return(0,K.keccak256)(this.encodeData(G,ne))}encode(G){return this.encodeData(this.primaryType,G)}hash(G){return this.hashStruct(this.primaryType,G)}_visit(G,K,ne){if(getBaseEncoder(G))return ne(G,K);const pe=splitArray(G).array;if(pe)return(0,ue.assertArgument)(-1===pe.count||pe.count===K.length,`array length mismatch; expected length ${pe.count}`,"value",K),K.map((G=>this._visit(pe.prefix,G,ne)));const he=this.types[G];if(he)return he.reduce(((G,{name:ue,type:pe})=>(G[ue]=this._visit(pe,K[ue],ne),G)),{});(0,ue.assertArgument)(!1,`unknown type: ${G}`,"type",G)}visit(G,K){return this._visit(this.primaryType,G,K)}static from(G){return new TypedDataEncoder(G)}static getPrimaryType(G){return TypedDataEncoder.from(G).primaryType}static hashStruct(G,K,ne){return TypedDataEncoder.from(K).hashStruct(G,ne)}static hashDomain(G){const K=[];for(const ne in G){if(null==G[ne])continue;const pe=Ee[ne];(0,ue.assertArgument)(pe,`invalid typed-data domain key: ${JSON.stringify(ne)}`,"domain",G),K.push({name:ne,type:pe})}return K.sort(((G,K)=>Pe.indexOf(G.name)-Pe.indexOf(K.name))),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:K},G)}static encode(G,K,ne){return(0,ue.concat)(["0x1901",TypedDataEncoder.hashDomain(G),TypedDataEncoder.from(K).hash(ne)])}static hash(G,ne,ue){return(0,K.keccak256)(TypedDataEncoder.encode(G,ne,ue))}static async resolveNames(G,K,ne,pe){G=Object.assign({},G);for(const K in G)null==G[K]&&delete G[K];const he={};G.verifyingContract&&!(0,ue.isHexString)(G.verifyingContract,20)&&(he[G.verifyingContract]="0x");const ye=TypedDataEncoder.from(K);ye.visit(ne,((G,K)=>("address"!==G||(0,ue.isHexString)(K,20)||(he[K]="0x"),K)));for(const G in he)he[G]=await pe(G);return G.verifyingContract&&he[G.verifyingContract]&&(G.verifyingContract=he[G.verifyingContract]),{domain:G,value:ne=ye.visit(ne,((G,K)=>"address"===G&&he[K]?he[K]:K))}}static getPayload(G,K,ne){TypedDataEncoder.hashDomain(G);const pe={},he=[];Pe.forEach((K=>{const ne=G[K];null!=ne&&(pe[K]=Se[K](ne),he.push({name:K,type:Ee[K]}))}));const ye=TypedDataEncoder.from(K);K=ye.types;const me=Object.assign({},K);return(0,ue.assertArgument)(null==me.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",K),me.EIP712Domain=he,ye.encode(ne),{types:me,domain:pe,primaryType:ye.primaryType,message:ye.visit(ne,((G,K)=>{if(G.match(/^bytes(\d*)/))return(0,ue.hexlify)((0,ue.getBytes)(K));if(G.match(/^u?int/))return(0,ue.getBigInt)(K).toString();switch(G){case"address":return K.toLowerCase();case"bool":return!!K;case"string":return(0,ue.assertArgument)("string"==typeof K,"invalid string","value",K),K}(0,ue.assertArgument)(!1,"unsupported type","type",G)}))}}}function _getEncoder(G){{const K=getBaseEncoder(G);if(K)return K}const ne=splitArray(G).array;if(ne){const G=ne.prefix,pe=this.getEncoder(G);return he=>{(0,ue.assertArgument)(-1===ne.count||ne.count===he.length,`array length mismatch; expected length ${ne.count}`,"value",he);let ye=he.map(pe);return _classPrivateFieldGet2(ke,this).has(G)&&(ye=ye.map(K.keccak256)),(0,K.keccak256)((0,ue.concat)(ye))}}const he=this.types[G];if(he){const ne=(0,pe.id)(_classPrivateFieldGet2(ke,this).get(G));return G=>{const pe=he.map((({name:ne,type:ue})=>{const pe=this.getEncoder(ue)(G[ne]);return _classPrivateFieldGet2(ke,this).has(ue)?(0,K.keccak256)(pe):pe}));return pe.unshift(ne),(0,ue.concat)(pe)}}(0,ue.assertArgument)(!1,`unknown type: ${G}`,"type",G)}return zF.TypedDataEncoder=TypedDataEncoder,zF.verifyTypedData=function verifyTypedData(G,K,ue,pe){return(0,ne.recoverAddress)(TypedDataEncoder.hash(G,K,ue),pe)},zF}function requireHash(){return jF||(jF=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.verifyTypedData=G.TypedDataEncoder=G.solidityPackedSha256=G.solidityPackedKeccak256=G.solidityPacked=G.verifyMessage=G.hashMessage=G.dnsEncode=G.namehash=G.isValidName=G.ensNormalize=G.id=void 0;var K=requireId();Object.defineProperty(G,"id",{enumerable:!0,get:function(){return K.id}});var ne=function requireNamehash(){if(SF)return IF;SF=1,Object.defineProperty(IF,"__esModule",{value:!0}),IF.dnsEncode=IF.namehash=IF.isValidName=IF.ensNormalize=void 0;const G=requireCrypto(),K=requireUtils$4(),ne=requireDist(),ue=new Uint8Array(32);function checkComponent(G){return(0,K.assertArgument)(0!==G.length,"invalid ENS name; empty component","comp",G),G}function ensNameSplit(G){const ne=(0,K.toUtf8Bytes)(ensNormalize(G)),ue=[];if(0===G.length)return ue;let pe=0;for(let G=0;G<ne.length;G++)46===ne[G]&&(ue.push(checkComponent(ne.slice(pe,G))),pe=G+1);return(0,K.assertArgument)(pe<ne.length,"invalid ENS name; empty component","name",G),ue.push(checkComponent(ne.slice(pe))),ue}function ensNormalize(G){try{if(0===G.length)throw new Error("empty label");return(0,ne.ens_normalize)(G)}catch(ne){(0,K.assertArgument)(!1,`invalid ENS name (${ne.message})`,"name",G)}}return ue.fill(0),IF.ensNormalize=ensNormalize,IF.isValidName=function isValidName(G){try{return 0!==ensNameSplit(G).length}catch(G){}return!1},IF.namehash=function namehash$1(ne){(0,K.assertArgument)("string"==typeof ne,"invalid ENS name; not a string","name",ne),(0,K.assertArgument)(ne.length,"invalid ENS name (empty label)","name",ne);let pe=ue;const he=ensNameSplit(ne);for(;he.length;)pe=(0,G.keccak256)((0,K.concat)([pe,(0,G.keccak256)(he.pop())]));return(0,K.hexlify)(pe)},IF.dnsEncode=function dnsEncode(G,ne){const ue=null!=ne?ne:63;return(0,K.assertArgument)(ue<=255,"DNS encoded label cannot exceed 255","length",ue),(0,K.hexlify)((0,K.concat)(ensNameSplit(G).map((ne=>{(0,K.assertArgument)(ne.length<=ue,`label ${JSON.stringify(G)} exceeds ${ue} bytes`,"name",G);const pe=new Uint8Array(ne.length+1);return pe.set(ne,1),pe[0]=pe.length-1,pe}))))+"00"},IF}();Object.defineProperty(G,"ensNormalize",{enumerable:!0,get:function(){return ne.ensNormalize}}),Object.defineProperty(G,"isValidName",{enumerable:!0,get:function(){return ne.isValidName}}),Object.defineProperty(G,"namehash",{enumerable:!0,get:function(){return ne.namehash}}),Object.defineProperty(G,"dnsEncode",{enumerable:!0,get:function(){return ne.dnsEncode}});var ue=function requireMessage(){if(LF)return kF;LF=1,Object.defineProperty(kF,"__esModule",{value:!0}),kF.verifyMessage=kF.hashMessage=void 0;const G=requireCrypto(),K=requireConstants(),ne=requireTransaction(),ue=requireUtils$4();function hashMessage(ne){return"string"==typeof ne&&(ne=(0,ue.toUtf8Bytes)(ne)),(0,G.keccak256)((0,ue.concat)([(0,ue.toUtf8Bytes)(K.MessagePrefix),(0,ue.toUtf8Bytes)(String(ne.length)),ne]))}return kF.hashMessage=hashMessage,kF.verifyMessage=function verifyMessage(G,K){const ue=hashMessage(G);return(0,ne.recoverAddress)(ue,K)},kF}();Object.defineProperty(G,"hashMessage",{enumerable:!0,get:function(){return ue.hashMessage}}),Object.defineProperty(G,"verifyMessage",{enumerable:!0,get:function(){return ue.verifyMessage}});var pe=requireSolidity();Object.defineProperty(G,"solidityPacked",{enumerable:!0,get:function(){return pe.solidityPacked}}),Object.defineProperty(G,"solidityPackedKeccak256",{enumerable:!0,get:function(){return pe.solidityPackedKeccak256}}),Object.defineProperty(G,"solidityPackedSha256",{enumerable:!0,get:function(){return pe.solidityPackedSha256}});var he=requireTypedData();Object.defineProperty(G,"TypedDataEncoder",{enumerable:!0,get:function(){return he.TypedDataEncoder}}),Object.defineProperty(G,"verifyTypedData",{enumerable:!0,get:function(){return he.verifyTypedData}})}(AF)),AF}function requireFragments(){var G;if(HF)return TF;HF=1,Object.defineProperty(TF,"__esModule",{value:!0}),TF.StructFragment=TF.FunctionFragment=TF.FallbackFragment=TF.ConstructorFragment=TF.EventFragment=TF.ErrorFragment=TF.NamedFragment=TF.Fragment=TF.ParamType=void 0;const K=requireUtils$4(),ne=requireHash();function setify(G){const K=new Set;return G.forEach((G=>K.add(G))),Object.freeze(K)}const ue=setify("external public payable override".split(" ")),pe="constant external internal payable private public pure view override",he=setify(pe.split(" ")),ye="constructor error event fallback function receive struct",me=setify(ye.split(" ")),be="calldata memory storage payable indexed",ve=setify(be.split(" ")),_e=setify([ye,be,"tuple returns",pe].join(" ").split(" ")),Te={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Ee=new RegExp("^(\\s*)"),Pe=new RegExp("^([0-9]+)"),Se=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Ce=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),ke=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Oe=new WeakMap,xe=new WeakMap,Ne=new WeakSet;class TokenString{get offset(){return _classPrivateFieldGet2(Oe,this)}get length(){return _classPrivateFieldGet2(xe,this).length-_classPrivateFieldGet2(Oe,this)}constructor(G){_classPrivateMethodInitSpec(this,Ne),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldInitSpec(this,xe,void 0),_classPrivateFieldSet2(Oe,this,0),_classPrivateFieldSet2(xe,this,G.slice())}clone(){return new TokenString(_classPrivateFieldGet2(xe,this))}reset(){_classPrivateFieldSet2(Oe,this,0)}popKeyword(G){const K=this.peek();if("KEYWORD"!==K.type||!G.has(K.text))throw new Error(`expected keyword ${K.text}`);return this.pop().text}popType(G){if(this.peek().type!==G){const K=this.peek();throw new Error(`expected ${G}; got ${K.type} ${JSON.stringify(K.text)}`)}return this.pop().text}popParen(){const G=this.peek();if("OPEN_PAREN"!==G.type)throw new Error("bad start");const K=_assertClassBrand(Ne,this,_subTokenString).call(this,_classPrivateFieldGet2(Oe,this)+1,G.match+1);return _classPrivateFieldSet2(Oe,this,G.match+1),K}popParams(){const G=this.peek();if("OPEN_PAREN"!==G.type)throw new Error("bad start");const K=[];for(;_classPrivateFieldGet2(Oe,this)<G.match-1;){const G=this.peek().linkNext;K.push(_assertClassBrand(Ne,this,_subTokenString).call(this,_classPrivateFieldGet2(Oe,this)+1,G)),_classPrivateFieldSet2(Oe,this,G)}return _classPrivateFieldSet2(Oe,this,G.match+1),K}peek(){if(_classPrivateFieldGet2(Oe,this)>=_classPrivateFieldGet2(xe,this).length)throw new Error("out-of-bounds");return _classPrivateFieldGet2(xe,this)[_classPrivateFieldGet2(Oe,this)]}peekKeyword(G){const K=this.peekType("KEYWORD");return null!=K&&G.has(K)?K:null}peekType(G){if(0===this.length)return null;const K=this.peek();return K.type===G?K.text:null}pop(){var G;const K=this.peek();return _classPrivateFieldSet2(Oe,this,(G=_classPrivateFieldGet2(Oe,this),++G)),K}toString(){const G=[];for(let K=_classPrivateFieldGet2(Oe,this);K<_classPrivateFieldGet2(xe,this).length;K++){const ne=_classPrivateFieldGet2(xe,this)[K];G.push(`${ne.type}:${ne.text}`)}return`<TokenString ${G.join(" ")}>`}}function _subTokenString(K=0,ne=0){return new G(_classPrivateFieldGet2(xe,this).slice(K,ne).map((G=>Object.freeze(Object.assign({},G,{match:G.match-K,linkBack:G.linkBack-K,linkNext:G.linkNext-K})))))}function lex(G){const ne=[],throwError=K=>{const ne=he<G.length?JSON.stringify(G[he]):"$EOI";throw new Error(`invalid token ${ne} at ${he}: ${K}`)};let ue=[],pe=[],he=0;for(;he<G.length;){let ye=G.substring(he),me=ye.match(Ee);me&&(he+=me[1].length,ye=G.substring(he));const be={depth:ue.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:he,value:-1};ne.push(be);let ve=Te[ye[0]]||"";if(ve){if(be.type=ve,be.text=ye[0],he++,"OPEN_PAREN"===ve)ue.push(ne.length-1),pe.push(ne.length-1);else if("CLOSE_PAREN"==ve)0===ue.length&&throwError("no matching open bracket"),be.match=ue.pop(),ne[be.match].match=ne.length-1,be.depth--,be.linkBack=pe.pop(),ne[be.linkBack].linkNext=ne.length-1;else if("COMMA"===ve)be.linkBack=pe.pop(),ne[be.linkBack].linkNext=ne.length-1,pe.push(ne.length-1);else if("OPEN_BRACKET"===ve)be.type="BRACKET";else if("CLOSE_BRACKET"===ve){let G=ne.pop().text;if(ne.length>0&&"NUMBER"===ne[ne.length-1].type){const ue=ne.pop().text;G=ue+G,ne[ne.length-1].value=(0,K.getNumber)(ue)}if(0===ne.length||"BRACKET"!==ne[ne.length-1].type)throw new Error("missing opening bracket");ne[ne.length-1].text+=G}}else if(me=ye.match(Se),me){if(be.text=me[1],he+=be.text.length,_e.has(be.text)){be.type="KEYWORD";continue}if(be.text.match(ke)){be.type="TYPE";continue}be.type="ID"}else{if(me=ye.match(Pe),!me)throw new Error(`unexpected token ${JSON.stringify(ye[0])} at position ${he}`);be.text=me[1],be.type="NUMBER",he+=be.text.length}}return new TokenString(ne.map((G=>Object.freeze(G))))}function allowSingle(G,K){let ne=[];for(const ue in K.keys())G.has(ue)&&ne.push(ue);if(ne.length>1)throw new Error(`conflicting types: ${ne.join(", ")}`)}function consumeName(G,K){if(K.peekKeyword(me)){const ne=K.pop().text;if(ne!==G)throw new Error(`expected ${G}, got ${ne}`)}return K.popType("ID")}function consumeKeywords(G,K){const ne=new Set;for(;;){const ue=G.peekType("KEYWORD");if(null==ue||K&&!K.has(ue))break;if(G.pop(),ne.has(ue))throw new Error(`duplicate keywords: ${JSON.stringify(ue)}`);ne.add(ue)}return Object.freeze(ne)}function consumeMutability(G){let K=consumeKeywords(G,he);return allowSingle(K,setify("constant payable nonpayable".split(" "))),allowSingle(K,setify("pure view payable nonpayable".split(" "))),K.has("view")?"view":K.has("pure")?"pure":K.has("payable")?"payable":K.has("nonpayable")?"nonpayable":K.has("constant")?"view":"nonpayable"}function consumeParams(G,K){return G.popParams().map((G=>ParamType.from(G,K)))}function consumeGas(G){if(G.peekType("AT")){if(G.pop(),G.peekType("NUMBER"))return(0,K.getBigInt)(G.pop().text);throw new Error("invalid gas")}return null}function consumeEoi(G){if(G.length)throw new Error(`unexpected tokens at offset ${G.offset}: ${G.toString()}`)}G=TokenString;const Me=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(G){const ne=G.match(ke);if((0,K.assertArgument)(ne,"invalid type","type",G),"uint"===G)return"uint256";if("int"===G)return"int256";if(ne[2]){const ue=parseInt(ne[2]);(0,K.assertArgument)(0!==ue&&ue<=32,"invalid bytes length","type",G)}else if(ne[3]){const ue=parseInt(ne[3]);(0,K.assertArgument)(0!==ue&&ue<=256&&ue%8==0,"invalid numeric width","type",G)}return G}const Be={},Fe=Symbol.for("_ethers_internal"),De="_ParamTypeInternal",Le="_ErrorInternal",Ue="_EventInternal",je="_ConstructorInternal",ze="_FallbackInternal",Je="_FunctionInternal",Xe="_StructInternal";var Qe=new WeakSet;class ParamType{constructor(G,ne,ue,pe,he,ye,me,be){if(_classPrivateMethodInitSpec(this,Qe),_defineProperty(this,"name",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"baseType",void 0),_defineProperty(this,"indexed",void 0),_defineProperty(this,"components",void 0),_defineProperty(this,"arrayLength",void 0),_defineProperty(this,"arrayChildren",void 0),(0,K.assertPrivate)(G,Be,"ParamType"),Object.defineProperty(this,Fe,{value:De}),ye&&(ye=Object.freeze(ye.slice())),"array"===pe){if(null==me||null==be)throw new Error("")}else if(null!=me||null!=be)throw new Error("");if("tuple"===pe){if(null==ye)throw new Error("")}else if(null!=ye)throw new Error("");(0,K.defineProperties)(this,{name:ne,type:ue,baseType:pe,indexed:he,components:ye,arrayLength:me,arrayChildren:be})}format(G){if(null==G&&(G="sighash"),"json"===G){const K=this.name||"";if(this.isArray()){const G=JSON.parse(this.arrayChildren.format("json"));return G.name=K,G.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(G)}const ne={type:"tuple"===this.baseType?"tuple":this.type,name:K};return"boolean"==typeof this.indexed&&(ne.indexed=this.indexed),this.isTuple()&&(ne.components=this.components.map((K=>JSON.parse(K.format(G))))),JSON.stringify(ne)}let K="";return this.isArray()?(K+=this.arrayChildren.format(G),K+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?K+="("+this.components.map((K=>K.format(G))).join("full"===G?", ":",")+")":K+=this.type,"sighash"!==G&&(!0===this.indexed&&(K+=" indexed"),"full"===G&&this.name&&(K+=" "+this.name)),K}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(G,K){if(this.isArray()){if(!Array.isArray(G))throw new Error("invalid array value");if(-1!==this.arrayLength&&G.length!==this.arrayLength)throw new Error("array is wrong length");const ne=this;return G.map((G=>ne.arrayChildren.walk(G,K)))}if(this.isTuple()){if(!Array.isArray(G))throw new Error("invalid tuple value");if(G.length!==this.components.length)throw new Error("array is wrong length");const ne=this;return G.map(((G,ue)=>ne.components[ue].walk(G,K)))}return K(this.type,G)}async walkAsync(G,K){const ne=[],ue=[G];return _assertClassBrand(Qe,this,_walkAsync).call(this,ne,G,K,(G=>{ue[0]=G})),ne.length&&await Promise.all(ne),ue[0]}static from(G,ne){if(ParamType.isParamType(G))return G;if("string"==typeof G)try{return ParamType.from(lex(G),ne)}catch(ne){(0,K.assertArgument)(!1,"invalid param type","obj",G)}else if(G instanceof TokenString){let K="",ue="",pe=null;consumeKeywords(G,setify(["tuple"])).has("tuple")||G.peekType("OPEN_PAREN")?(ue="tuple",pe=G.popParams().map((G=>ParamType.from(G))),K=`tuple(${pe.map((G=>G.format())).join(",")})`):(K=verifyBasicType(G.popType("TYPE")),ue=K);let he=null,ye=null;for(;G.length&&G.peekType("BRACKET");){const ne=G.pop();he=new ParamType(Be,"",K,ue,null,pe,ye,he),ye=ne.value,K+=ne.text,ue="array",pe=null}let me=null;if(consumeKeywords(G,ve).has("indexed")){if(!ne)throw new Error("");me=!0}const be=G.peekType("ID")?G.pop().text:"";if(G.length)throw new Error("leftover tokens");return new ParamType(Be,be,K,ue,me,pe,ye,he)}const ue=G.name;(0,K.assertArgument)(!ue||"string"==typeof ue&&ue.match(Ce),"invalid name","obj.name",ue);let pe=G.indexed;null!=pe&&((0,K.assertArgument)(ne,"parameter cannot be indexed","obj.indexed",G.indexed),pe=!!pe);let he=G.type,ye=he.match(Me);if(ye){const K=parseInt(ye[2]||"-1"),ne=ParamType.from({type:ye[1],components:G.components});return new ParamType(Be,ue||"",he,"array",pe,null,K,ne)}if("tuple"===he||he.startsWith("tuple(")||he.startsWith("(")){const K=null!=G.components?G.components.map((G=>ParamType.from(G))):null;return new ParamType(Be,ue||"",he,"tuple",pe,K,null,null)}return he=verifyBasicType(G.type),new ParamType(Be,ue||"",he,he,pe,null,null,null)}static isParamType(G){return G&&G[Fe]===De}}function _walkAsync(G,K,ne,ue){if(this.isArray()){if(!Array.isArray(K))throw new Error("invalid array value");if(-1!==this.arrayLength&&K.length!==this.arrayLength)throw new Error("array is wrong length");const pe=this.arrayChildren,he=K.slice();return he.forEach(((K,ue)=>{_assertClassBrand(Qe,pe,_walkAsync).call(pe,G,K,ne,(G=>{he[ue]=G}))})),void ue(he)}if(this.isTuple()){const pe=this.components;let he;if(Array.isArray(K))he=K.slice();else{if(null==K||"object"!=typeof K)throw new Error("invalid tuple value");he=pe.map((G=>{if(!G.name)throw new Error("cannot use object value with unnamed components");if(!(G.name in K))throw new Error(`missing value for component ${G.name}`);return K[G.name]}))}if(he.length!==this.components.length)throw new Error("array is wrong length");return he.forEach(((K,ue)=>{var ye;_assertClassBrand(Qe,ye=pe[ue],_walkAsync).call(ye,G,K,ne,(G=>{he[ue]=G}))})),void ue(he)}const pe=ne(this.type,K);pe.then?G.push(async function(){ue(await pe)}()):ue(pe)}TF.ParamType=ParamType;class Fragment{constructor(G,ne,ue){_defineProperty(this,"type",void 0),_defineProperty(this,"inputs",void 0),(0,K.assertPrivate)(G,Be,"Fragment"),ue=Object.freeze(ue.slice()),(0,K.defineProperties)(this,{type:ne,inputs:ue})}static from(G){if("string"==typeof G){try{Fragment.from(JSON.parse(G))}catch(G){}return Fragment.from(lex(G))}if(G instanceof TokenString){switch(G.peekKeyword(me)){case"constructor":return ConstructorFragment.from(G);case"error":return ErrorFragment.from(G);case"event":return EventFragment.from(G);case"fallback":case"receive":return FallbackFragment.from(G);case"function":return FunctionFragment.from(G);case"struct":return StructFragment.from(G)}}else if("object"==typeof G){switch(G.type){case"constructor":return ConstructorFragment.from(G);case"error":return ErrorFragment.from(G);case"event":return EventFragment.from(G);case"fallback":case"receive":return FallbackFragment.from(G);case"function":return FunctionFragment.from(G);case"struct":return StructFragment.from(G)}(0,K.assert)(!1,`unsupported type: ${G.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,K.assertArgument)(!1,"unsupported frgament object","obj",G)}static isConstructor(G){return ConstructorFragment.isFragment(G)}static isError(G){return ErrorFragment.isFragment(G)}static isEvent(G){return EventFragment.isFragment(G)}static isFunction(G){return FunctionFragment.isFragment(G)}static isStruct(G){return StructFragment.isFragment(G)}}TF.Fragment=Fragment;class NamedFragment extends Fragment{constructor(G,ne,ue,pe){super(G,ne,pe),_defineProperty(this,"name",void 0),(0,K.assertArgument)("string"==typeof ue&&ue.match(Ce),"invalid identifier","name",ue),pe=Object.freeze(pe.slice()),(0,K.defineProperties)(this,{name:ue})}}function joinParams(G,K){return"("+K.map((K=>K.format(G))).join("full"===G?", ":",")+")"}TF.NamedFragment=NamedFragment;class ErrorFragment extends NamedFragment{constructor(G,K,ne){super(G,"error",K,ne),Object.defineProperty(this,Fe,{value:Le})}get selector(){return(0,ne.id)(this.format("sighash")).substring(0,10)}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("error"),K.push(this.name+joinParams(G,this.inputs)),K.join(" ")}static from(G){if(ErrorFragment.isFragment(G))return G;if("string"==typeof G)return ErrorFragment.from(lex(G));if(G instanceof TokenString){const K=consumeName("error",G),ne=consumeParams(G);return consumeEoi(G),new ErrorFragment(Be,K,ne)}return new ErrorFragment(Be,G.name,G.inputs?G.inputs.map(ParamType.from):[])}static isFragment(G){return G&&G[Fe]===Le}}TF.ErrorFragment=ErrorFragment;class EventFragment extends NamedFragment{constructor(G,ne,ue,pe){super(G,"event",ne,ue),_defineProperty(this,"anonymous",void 0),Object.defineProperty(this,Fe,{value:Ue}),(0,K.defineProperties)(this,{anonymous:pe})}get topicHash(){return(0,ne.id)(this.format("sighash"))}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("event"),K.push(this.name+joinParams(G,this.inputs)),"sighash"!==G&&this.anonymous&&K.push("anonymous"),K.join(" ")}static getTopicHash(G,K){K=(K||[]).map((G=>ParamType.from(G)));return new EventFragment(Be,G,K,!1).topicHash}static from(G){if(EventFragment.isFragment(G))return G;if("string"==typeof G)try{return EventFragment.from(lex(G))}catch(ne){(0,K.assertArgument)(!1,"invalid event fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("event",G),ne=consumeParams(G,!0),ue=!!consumeKeywords(G,setify(["anonymous"])).has("anonymous");return consumeEoi(G),new EventFragment(Be,K,ne,ue)}return new EventFragment(Be,G.name,G.inputs?G.inputs.map((G=>ParamType.from(G,!0))):[],!!G.anonymous)}static isFragment(G){return G&&G[Fe]===Ue}}TF.EventFragment=EventFragment;class ConstructorFragment extends Fragment{constructor(G,ne,ue,pe,he){super(G,ne,ue),_defineProperty(this,"payable",void 0),_defineProperty(this,"gas",void 0),Object.defineProperty(this,Fe,{value:je}),(0,K.defineProperties)(this,{payable:pe,gas:he})}format(G){if((0,K.assert)(null!=G&&"sighash"!==G,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===G)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});const ne=[`constructor${joinParams(G,this.inputs)}`];return this.payable&&ne.push("payable"),null!=this.gas&&ne.push(`@${this.gas.toString()}`),ne.join(" ")}static from(G){if(ConstructorFragment.isFragment(G))return G;if("string"==typeof G)try{return ConstructorFragment.from(lex(G))}catch(ne){(0,K.assertArgument)(!1,"invalid constuctor fragment","obj",G)}else if(G instanceof TokenString){consumeKeywords(G,setify(["constructor"]));const K=consumeParams(G),ne=!!consumeKeywords(G,ue).has("payable"),pe=consumeGas(G);return consumeEoi(G),new ConstructorFragment(Be,"constructor",K,ne,pe)}return new ConstructorFragment(Be,"constructor",G.inputs?G.inputs.map(ParamType.from):[],!!G.payable,null!=G.gas?G.gas:null)}static isFragment(G){return G&&G[Fe]===je}}TF.ConstructorFragment=ConstructorFragment;class FallbackFragment extends Fragment{constructor(G,ne,ue){super(G,"fallback",ne),_defineProperty(this,"payable",void 0),Object.defineProperty(this,Fe,{value:ze}),(0,K.defineProperties)(this,{payable:ue})}format(G){const K=0===this.inputs.length?"receive":"fallback";if("json"===G){const G=this.payable?"payable":"nonpayable";return JSON.stringify({type:K,stateMutability:G})}return`${K}()${this.payable?" payable":""}`}static from(G){if(FallbackFragment.isFragment(G))return G;if("string"==typeof G)try{return FallbackFragment.from(lex(G))}catch(ne){(0,K.assertArgument)(!1,"invalid fallback fragment","obj",G)}else if(G instanceof TokenString){const ne=G.toString(),ue=G.peekKeyword(setify(["fallback","receive"]));(0,K.assertArgument)(ue,"type must be fallback or receive","obj",ne);if("receive"===G.popKeyword(setify(["fallback","receive"]))){const ne=consumeParams(G);return(0,K.assertArgument)(0===ne.length,"receive cannot have arguments","obj.inputs",ne),consumeKeywords(G,setify(["payable"])),consumeEoi(G),new FallbackFragment(Be,[],!0)}let pe=consumeParams(G);pe.length?(0,K.assertArgument)(1===pe.length&&"bytes"===pe[0].type,"invalid fallback inputs","obj.inputs",pe.map((G=>G.format("minimal"))).join(", ")):pe=[ParamType.from("bytes")];const he=consumeMutability(G);if((0,K.assertArgument)("nonpayable"===he||"payable"===he,"fallback cannot be constants","obj.stateMutability",he),consumeKeywords(G,setify(["returns"])).has("returns")){const ne=consumeParams(G);(0,K.assertArgument)(1===ne.length&&"bytes"===ne[0].type,"invalid fallback outputs","obj.outputs",ne.map((G=>G.format("minimal"))).join(", "))}return consumeEoi(G),new FallbackFragment(Be,pe,"payable"===he)}if("receive"===G.type)return new FallbackFragment(Be,[],!0);if("fallback"===G.type){const K=[ParamType.from("bytes")],ne="payable"===G.stateMutability;return new FallbackFragment(Be,K,ne)}(0,K.assertArgument)(!1,"invalid fallback description","obj",G)}static isFragment(G){return G&&G[Fe]===ze}}TF.FallbackFragment=FallbackFragment;class FunctionFragment extends NamedFragment{constructor(G,ne,ue,pe,he,ye){super(G,"function",ne,pe),_defineProperty(this,"constant",void 0),_defineProperty(this,"outputs",void 0),_defineProperty(this,"stateMutability",void 0),_defineProperty(this,"payable",void 0),_defineProperty(this,"gas",void 0),Object.defineProperty(this,Fe,{value:Je}),he=Object.freeze(he.slice());const me="view"===ue||"pure"===ue,be="payable"===ue;(0,K.defineProperties)(this,{constant:me,gas:ye,outputs:he,payable:be,stateMutability:ue})}get selector(){return(0,ne.id)(this.format("sighash")).substring(0,10)}format(G){if(null==G&&(G="sighash"),"json"===G)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G)))),outputs:this.outputs.map((K=>JSON.parse(K.format(G))))});const K=[];return"sighash"!==G&&K.push("function"),K.push(this.name+joinParams(G,this.inputs)),"sighash"!==G&&("nonpayable"!==this.stateMutability&&K.push(this.stateMutability),this.outputs&&this.outputs.length&&(K.push("returns"),K.push(joinParams(G,this.outputs))),null!=this.gas&&K.push(`@${this.gas.toString()}`)),K.join(" ")}static getSelector(G,K){K=(K||[]).map((G=>ParamType.from(G)));return new FunctionFragment(Be,G,"view",K,[],null).selector}static from(G){if(FunctionFragment.isFragment(G))return G;if("string"==typeof G)try{return FunctionFragment.from(lex(G))}catch(ne){(0,K.assertArgument)(!1,"invalid function fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("function",G),ne=consumeParams(G),ue=consumeMutability(G);let pe=[];consumeKeywords(G,setify(["returns"])).has("returns")&&(pe=consumeParams(G));const he=consumeGas(G);return consumeEoi(G),new FunctionFragment(Be,K,ue,ne,pe,he)}let ne=G.stateMutability;return null==ne&&(ne="payable","boolean"==typeof G.constant?(ne="view",G.constant||(ne="payable","boolean"!=typeof G.payable||G.payable||(ne="nonpayable"))):"boolean"!=typeof G.payable||G.payable||(ne="nonpayable")),new FunctionFragment(Be,G.name,ne,G.inputs?G.inputs.map(ParamType.from):[],G.outputs?G.outputs.map(ParamType.from):[],null!=G.gas?G.gas:null)}static isFragment(G){return G&&G[Fe]===Je}}TF.FunctionFragment=FunctionFragment;class StructFragment extends NamedFragment{constructor(G,K,ne){super(G,"struct",K,ne),Object.defineProperty(this,Fe,{value:Xe})}format(){throw new Error("@TODO")}static from(G){if("string"==typeof G)try{return StructFragment.from(lex(G))}catch(ne){(0,K.assertArgument)(!1,"invalid struct fragment","obj",G)}else if(G instanceof TokenString){const K=consumeName("struct",G),ne=consumeParams(G);return consumeEoi(G),new StructFragment(Be,K,ne)}return new StructFragment(Be,G.name,G.inputs?G.inputs.map(ParamType.from):[])}static isFragment(G){return G&&G[Fe]===Xe}}return TF.StructFragment=StructFragment,TF}function requireAbiCoder(){if(WF)return UN;WF=1,Object.defineProperty(UN,"__esModule",{value:!0}),UN.AbiCoder=void 0;const G=requireUtils$4(),K=requireAbstractCoder(),ne=function requireAddress$1(){if(tF)return gM;tF=1,Object.defineProperty(gM,"__esModule",{value:!0}),gM.AddressCoder=void 0;const G=requireAddress$2(),K=requireMaths(),ne=requireTyped(),ue=requireAbstractCoder();class AddressCoder extends ue.Coder{constructor(G){super("address","address",G,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(K,ue){let pe=ne.Typed.dereference(ue,"string");try{pe=(0,G.getAddress)(pe)}catch(G){return this._throwError(G.message,ue)}return K.writeValue(pe)}decode(ne){return(0,G.getAddress)((0,K.toBeHex)(ne.readValue(),20))}}return gM.AddressCoder=AddressCoder,gM}(),ue=requireArray(),pe=function requireBoolean(){if(oF)return cF;oF=1,Object.defineProperty(cF,"__esModule",{value:!0}),cF.BooleanCoder=void 0;const G=requireTyped(),K=requireAbstractCoder();class BooleanCoder extends K.Coder{constructor(G){super("bool","bool",G,!1)}defaultValue(){return!1}encode(K,ne){const ue=G.Typed.dereference(ne,"bool");return K.writeValue(ue?1:0)}decode(G){return!!G.readValue()}}return cF.BooleanCoder=BooleanCoder,cF}(),he=requireBytes(),ye=function requireFixedBytes(){if(fF)return lF;fF=1,Object.defineProperty(lF,"__esModule",{value:!0}),lF.FixedBytesCoder=void 0;const G=requireUtils$4(),K=requireTyped(),ne=requireAbstractCoder();class FixedBytesCoder extends ne.Coder{constructor(K,ne){let ue="bytes"+String(K);super(ue,ue,ne,!1),_defineProperty(this,"size",void 0),(0,G.defineProperties)(this,{size:K},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(ne,ue){let pe=(0,G.getBytesCopy)(K.Typed.dereference(ue,this.type));return pe.length!==this.size&&this._throwError("incorrect data length",ue),ne.writeBytes(pe)}decode(K){return(0,G.hexlify)(K.readBytes(this.size))}}return lF.FixedBytesCoder=FixedBytesCoder,lF}(),me=function require_null(){if(pF)return hF;pF=1,Object.defineProperty(hF,"__esModule",{value:!0}),hF.NullCoder=void 0;const G=requireAbstractCoder(),K=new Uint8Array([]);class NullCoder extends G.Coder{constructor(G){super("null","",G,!1)}defaultValue(){return null}encode(G,ne){return null!=ne&&this._throwError("not null",ne),G.writeBytes(K)}decode(G){return G.readBytes(0),null}}return hF.NullCoder=NullCoder,hF}(),be=function requireNumber(){if(yF)return mF;yF=1,Object.defineProperty(mF,"__esModule",{value:!0}),mF.NumberCoder=void 0;const G=requireUtils$4(),K=requireTyped(),ne=requireAbstractCoder(),ue=BigInt(0),pe=BigInt(1),he=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class NumberCoder extends ne.Coder{constructor(K,ne,ue){const pe=(ne?"int":"uint")+8*K;super(pe,pe,ue,!1),_defineProperty(this,"size",void 0),_defineProperty(this,"signed",void 0),(0,G.defineProperties)(this,{size:K,signed:ne},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(ye,me){let be=(0,G.getBigInt)(K.Typed.dereference(me,this.type)),ve=(0,G.mask)(he,8*ne.WordSize);if(this.signed){let K=(0,G.mask)(ve,8*this.size-1);(be>K||be<-(K+pe))&&this._throwError("value out-of-bounds",me),be=(0,G.toTwos)(be,8*ne.WordSize)}else(be<ue||be>(0,G.mask)(ve,8*this.size))&&this._throwError("value out-of-bounds",me);return ye.writeValue(be)}decode(K){let ne=(0,G.mask)(K.readValue(),8*this.size);return this.signed&&(ne=(0,G.fromTwos)(ne,8*this.size)),ne}}return mF.NumberCoder=NumberCoder,mF}(),ve=function requireString(){if(bF)return gF;bF=1,Object.defineProperty(gF,"__esModule",{value:!0}),gF.StringCoder=void 0;const G=requireUtf8(),K=requireTyped(),ne=requireBytes();class StringCoder extends ne.DynamicBytesCoder{constructor(G){super("string",G)}defaultValue(){return""}encode(ne,ue){return super.encode(ne,(0,G.toUtf8Bytes)(K.Typed.dereference(ue,"string")))}decode(K){return(0,G.toUtf8String)(super.decode(K))}}return gF.StringCoder=StringCoder,gF}(),_e=function requireTuple(){if(vF)return wF;vF=1,Object.defineProperty(wF,"__esModule",{value:!0}),wF.TupleCoder=void 0;const G=requireProperties(),K=requireTyped(),ne=requireAbstractCoder(),ue=requireArray();class TupleCoder extends ne.Coder{constructor(K,ne){let ue=!1;const pe=[];K.forEach((G=>{G.dynamic&&(ue=!0),pe.push(G.type)})),super("tuple","tuple("+pe.join(",")+")",ne,ue),_defineProperty(this,"coders",void 0),(0,G.defineProperties)(this,{coders:Object.freeze(K.slice())})}defaultValue(){const G=[];this.coders.forEach((K=>{G.push(K.defaultValue())}));const K=this.coders.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});return this.coders.forEach(((ne,ue)=>{let pe=ne.localName;pe&&1===K[pe]&&("length"===pe&&(pe="_length"),null==G[pe]&&(G[pe]=G[ue]))})),Object.freeze(G)}encode(G,ne){const pe=K.Typed.dereference(ne,"tuple");return(0,ue.pack)(G,this.coders,pe)}decode(G){return(0,ue.unpack)(G,this.coders)}}return wF.TupleCoder=TupleCoder,wF}(),Te=requireFragments(),Ee=requireAddress$2(),Pe=requireUtils$4(),Se=new Map;Se.set(0,"GENERIC_PANIC"),Se.set(1,"ASSERT_FALSE"),Se.set(17,"OVERFLOW"),Se.set(18,"DIVIDE_BY_ZERO"),Se.set(33,"ENUM_RANGE_ERROR"),Se.set(34,"BAD_STORAGE_DATA"),Se.set(49,"STACK_UNDERFLOW"),Se.set(50,"ARRAY_RANGE_ERROR"),Se.set(65,"OUT_OF_MEMORY"),Se.set(81,"UNINITIALIZED_FUNCTION_CALL");const Ce=new RegExp(/^bytes([0-9]*)$/),ke=new RegExp(/^(u?int)([0-9]*)$/);let Oe=null,xe=1024;var Ne=new WeakSet;class AbiCoder{constructor(){_classPrivateMethodInitSpec(this,Ne)}getDefaultValue(G){const K=G.map((G=>_assertClassBrand(Ne,this,_getCoder).call(this,Te.ParamType.from(G))));return new _e.TupleCoder(K,"_").defaultValue()}encode(ne,ue){(0,G.assertArgumentCount)(ue.length,ne.length,"types/values length mismatch");const pe=ne.map((G=>_assertClassBrand(Ne,this,_getCoder).call(this,Te.ParamType.from(G)))),he=new _e.TupleCoder(pe,"_"),ye=new K.Writer;return he.encode(ye,ue),ye.data}decode(G,ne,ue){const pe=G.map((G=>_assertClassBrand(Ne,this,_getCoder).call(this,Te.ParamType.from(G))));return new _e.TupleCoder(pe,"_").decode(new K.Reader(ne,ue,xe))}static _setDefaultMaxInflation(K){(0,G.assertArgument)("number"==typeof K&&Number.isInteger(K),"invalid defaultMaxInflation factor","value",K),xe=K}static defaultAbiCoder(){return null==Oe&&(Oe=new AbiCoder),Oe}static getBuiltinCallException(G,K,ne){return function getBuiltinCallException(G,K,ne,ue){let pe="missing revert data",he=null,ye=null;if(ne){pe="execution reverted";const G=(0,Pe.getBytes)(ne);if(ne=(0,Pe.hexlify)(ne),0===G.length)pe+=" (no data present; likely require(false) occurred",he="require(false)";else if(G.length%32!=4)pe+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,Pe.hexlify)(G.slice(0,4)))try{he=ue.decode(["string"],G.slice(4))[0],ye={signature:"Error(string)",name:"Error",args:[he]},pe+=`: ${JSON.stringify(he)}`}catch(G){pe+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,Pe.hexlify)(G.slice(0,4)))try{const K=Number(ue.decode(["uint256"],G.slice(4))[0]);ye={signature:"Panic(uint256)",name:"Panic",args:[K]},he=`Panic due to ${Se.get(K)||"UNKNOWN"}(${K})`,pe+=`: ${he}`}catch(G){pe+=" (could not decode panic code)"}else pe+=" (unknown custom error)"}const me={to:K.to?(0,Ee.getAddress)(K.to):null,data:K.data||"0x"};return K.from&&(me.from=(0,Ee.getAddress)(K.from)),(0,Pe.makeError)(pe,"CALL_EXCEPTION",{action:G,data:ne,reason:he,transaction:me,invocation:null,revert:ye})}(G,K,ne,AbiCoder.defaultAbiCoder())}}function _getCoder(K){if(K.isArray())return new ue.ArrayCoder(_assertClassBrand(Ne,this,_getCoder).call(this,K.arrayChildren),K.arrayLength,K.name);if(K.isTuple())return new _e.TupleCoder(K.components.map((G=>_assertClassBrand(Ne,this,_getCoder).call(this,G))),K.name);switch(K.baseType){case"address":return new ne.AddressCoder(K.name);case"bool":return new pe.BooleanCoder(K.name);case"string":return new ve.StringCoder(K.name);case"bytes":return new he.BytesCoder(K.name);case"":return new me.NullCoder(K.name)}let Te=K.type.match(ke);if(Te){let ne=parseInt(Te[2]||"256");return(0,G.assertArgument)(0!==ne&&ne<=256&&ne%8==0,"invalid "+Te[1]+" bit length","param",K),new be.NumberCoder(ne/8,"int"===Te[1],K.name)}if(Te=K.type.match(Ce),Te){let ne=parseInt(Te[1]);return(0,G.assertArgument)(0!==ne&&ne<=32,"invalid bytes length","param",K),new ye.FixedBytesCoder(ne,K.name)}(0,G.assertArgument)(!1,"invalid type","type",K.type)}return UN.AbiCoder=AbiCoder,UN}var VF,KF={};var JF,XF,QF={};function requireAbi(){return XF||(XF=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Typed=G.Result=G.TransactionDescription=G.LogDescription=G.ErrorDescription=G.Interface=G.Indexed=G.checkResultErrors=G.StructFragment=G.ParamType=G.NamedFragment=G.FunctionFragment=G.Fragment=G.FallbackFragment=G.EventFragment=G.ErrorFragment=G.ConstructorFragment=G.encodeBytes32String=G.decodeBytes32String=G.AbiCoder=void 0;var K=requireAbiCoder();Object.defineProperty(G,"AbiCoder",{enumerable:!0,get:function(){return K.AbiCoder}});var ne=function requireBytes32(){if(VF)return KF;VF=1,Object.defineProperty(KF,"__esModule",{value:!0}),KF.decodeBytes32String=KF.encodeBytes32String=void 0;const G=requireUtils$4();return KF.encodeBytes32String=function encodeBytes32String(K){const ne=(0,G.toUtf8Bytes)(K);if(ne.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,G.zeroPadBytes)(ne,32)},KF.decodeBytes32String=function decodeBytes32String(K){const ne=(0,G.getBytes)(K,"bytes");if(32!==ne.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==ne[31])throw new Error("invalid bytes32 string - no null terminator");let ue=31;for(;0===ne[ue-1];)ue--;return(0,G.toUtf8String)(ne.slice(0,ue))},KF}();Object.defineProperty(G,"decodeBytes32String",{enumerable:!0,get:function(){return ne.decodeBytes32String}}),Object.defineProperty(G,"encodeBytes32String",{enumerable:!0,get:function(){return ne.encodeBytes32String}});var ue=requireFragments();Object.defineProperty(G,"ConstructorFragment",{enumerable:!0,get:function(){return ue.ConstructorFragment}}),Object.defineProperty(G,"ErrorFragment",{enumerable:!0,get:function(){return ue.ErrorFragment}}),Object.defineProperty(G,"EventFragment",{enumerable:!0,get:function(){return ue.EventFragment}}),Object.defineProperty(G,"FallbackFragment",{enumerable:!0,get:function(){return ue.FallbackFragment}}),Object.defineProperty(G,"Fragment",{enumerable:!0,get:function(){return ue.Fragment}}),Object.defineProperty(G,"FunctionFragment",{enumerable:!0,get:function(){return ue.FunctionFragment}}),Object.defineProperty(G,"NamedFragment",{enumerable:!0,get:function(){return ue.NamedFragment}}),Object.defineProperty(G,"ParamType",{enumerable:!0,get:function(){return ue.ParamType}}),Object.defineProperty(G,"StructFragment",{enumerable:!0,get:function(){return ue.StructFragment}});var pe=function require_interface(){return JF||(JF=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Interface=G.Indexed=G.ErrorDescription=G.TransactionDescription=G.LogDescription=G.Result=G.checkResultErrors=void 0;const K=requireCrypto(),ne=requireHash(),ue=requireUtils$4(),pe=requireAbiCoder(),he=requireAbstractCoder();Object.defineProperty(G,"checkResultErrors",{enumerable:!0,get:function(){return he.checkResultErrors}}),Object.defineProperty(G,"Result",{enumerable:!0,get:function(){return he.Result}});const ye=requireFragments(),me=requireTyped();class LogDescription{constructor(G,K,ne){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"topic",void 0),_defineProperty(this,"args",void 0);const pe=G.name,he=G.format();(0,ue.defineProperties)(this,{fragment:G,name:pe,signature:he,topic:K,args:ne})}}G.LogDescription=LogDescription;class TransactionDescription{constructor(G,K,ne,pe){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"args",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"selector",void 0),_defineProperty(this,"value",void 0);const he=G.name,ye=G.format();(0,ue.defineProperties)(this,{fragment:G,name:he,args:ne,signature:ye,selector:K,value:pe})}}G.TransactionDescription=TransactionDescription;class ErrorDescription{constructor(G,K,ne){_defineProperty(this,"fragment",void 0),_defineProperty(this,"name",void 0),_defineProperty(this,"args",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"selector",void 0);const pe=G.name,he=G.format();(0,ue.defineProperties)(this,{fragment:G,name:pe,args:ne,signature:he,selector:K})}}G.ErrorDescription=ErrorDescription;class Indexed{static isIndexed(G){return!(!G||!G._isIndexed)}constructor(G){_defineProperty(this,"hash",void 0),_defineProperty(this,"_isIndexed",void 0),(0,ue.defineProperties)(this,{hash:G,_isIndexed:!0})}}G.Indexed=Indexed;const be={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"},ve={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:G=>`reverted with reason string ${JSON.stringify(G)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:G=>{let K="unknown panic code";return G>=0&&G<=255&&be[G.toString()]&&(K=be[G.toString()]),`reverted with panic code 0x${G.toString(16)} (${K})`}}};var _e=new WeakMap,Te=new WeakMap,Ee=new WeakMap,Pe=new WeakMap,Se=new WeakSet;class Interface{constructor(G){_classPrivateMethodInitSpec(this,Se),_defineProperty(this,"fragments",void 0),_defineProperty(this,"deploy",void 0),_defineProperty(this,"fallback",void 0),_defineProperty(this,"receive",void 0),_classPrivateFieldInitSpec(this,_e,void 0),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0);let K=[];K="string"==typeof G?JSON.parse(G):G,_classPrivateFieldSet2(Ee,this,new Map),_classPrivateFieldSet2(_e,this,new Map),_classPrivateFieldSet2(Te,this,new Map);const ne=[];for(const G of K)try{ne.push(ye.Fragment.from(G))}catch(K){console.log(`[Warning] Invalid Fragment ${JSON.stringify(G)}:`,K.message)}(0,ue.defineProperties)(this,{fragments:Object.freeze(ne)});let pe=null,he=!1;_classPrivateFieldSet2(Pe,this,this.getAbiCoder()),this.fragments.forEach(((G,K)=>{let ne;switch(G.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,ue.defineProperties)(this,{deploy:G});case"fallback":return void(0===G.inputs.length?he=!0:((0,ue.assertArgument)(!pe||G.payable!==pe.payable,"conflicting fallback fragments",`fragments[${K}]`,G),pe=G,he=pe.payable));case"function":ne=_classPrivateFieldGet2(Ee,this);break;case"event":ne=_classPrivateFieldGet2(Te,this);break;case"error":ne=_classPrivateFieldGet2(_e,this);break;default:return}const ye=G.format();ne.has(ye)||ne.set(ye,G)})),this.deploy||(0,ue.defineProperties)(this,{deploy:ye.ConstructorFragment.from("constructor()")}),(0,ue.defineProperties)(this,{fallback:pe,receive:he})}format(G){const K=G?"minimal":"full",ne=this.fragments.map((G=>G.format(K)));return ne}formatJson(){const G=this.fragments.map((G=>G.format("json")));return JSON.stringify(G.map((G=>JSON.parse(G))))}getAbiCoder(){return pe.AbiCoder.defaultAbiCoder()}getFunctionName(G){const K=_assertClassBrand(Se,this,_getFunction).call(this,G,null,!1);return(0,ue.assertArgument)(K,"no matching function","key",G),K.name}hasFunction(G){return!!_assertClassBrand(Se,this,_getFunction).call(this,G,null,!1)}getFunction(G,K){return _assertClassBrand(Se,this,_getFunction).call(this,G,K||null,!0)}forEachFunction(G){const K=Array.from(_classPrivateFieldGet2(Ee,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(Ee,this).get(ue),ne)}}getEventName(G){const K=_assertClassBrand(Se,this,_getEvent).call(this,G,null,!1);return(0,ue.assertArgument)(K,"no matching event","key",G),K.name}hasEvent(G){return!!_assertClassBrand(Se,this,_getEvent).call(this,G,null,!1)}getEvent(G,K){return _assertClassBrand(Se,this,_getEvent).call(this,G,K||null,!0)}forEachEvent(G){const K=Array.from(_classPrivateFieldGet2(Te,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(Te,this).get(ue),ne)}}getError(G,K){if((0,ue.isHexString)(G)){const K=G.toLowerCase();if(ve[K])return ye.ErrorFragment.from(ve[K].signature);for(const G of _classPrivateFieldGet2(_e,this).values())if(K===G.selector)return G;return null}if(-1===G.indexOf("(")){const K=[];for(const[ne,ue]of _classPrivateFieldGet2(_e,this))ne.split("(")[0]===G&&K.push(ue);if(0===K.length)return"Error"===G?ye.ErrorFragment.from("error Error(string)"):"Panic"===G?ye.ErrorFragment.from("error Panic(uint256)"):null;if(K.length>1){const ne=K.map((G=>JSON.stringify(G.format()))).join(", ");(0,ue.assertArgument)(!1,`ambiguous error description (i.e. ${ne})`,"name",G)}return K[0]}if("Error(string)"===(G=ye.ErrorFragment.from(G).format()))return ye.ErrorFragment.from("error Error(string)");if("Panic(uint256)"===G)return ye.ErrorFragment.from("error Panic(uint256)");return _classPrivateFieldGet2(_e,this).get(G)||null}forEachError(G){const K=Array.from(_classPrivateFieldGet2(_e,this).keys());K.sort(((G,K)=>G.localeCompare(K)));for(let ne=0;ne<K.length;ne++){const ue=K[ne];G(_classPrivateFieldGet2(_e,this).get(ue),ne)}}_decodeParams(G,K){return _classPrivateFieldGet2(Pe,this).decode(G,K)}_encodeParams(G,K){return _classPrivateFieldGet2(Pe,this).encode(G,K)}encodeDeploy(G){return this._encodeParams(this.deploy.inputs,G||[])}decodeErrorResult(G,K){if("string"==typeof G){const K=this.getError(G);(0,ue.assertArgument)(K,"unknown error","fragment",G),G=K}return(0,ue.assertArgument)((0,ue.dataSlice)(K,0,4)===G.selector,`data signature does not match error ${G.name}.`,"data",K),this._decodeParams(G.inputs,(0,ue.dataSlice)(K,4))}encodeErrorResult(G,K){if("string"==typeof G){const K=this.getError(G);(0,ue.assertArgument)(K,"unknown error","fragment",G),G=K}return(0,ue.concat)([G.selector,this._encodeParams(G.inputs,K||[])])}decodeFunctionData(G,K){if("string"==typeof G){const K=this.getFunction(G);(0,ue.assertArgument)(K,"unknown function","fragment",G),G=K}return(0,ue.assertArgument)((0,ue.dataSlice)(K,0,4)===G.selector,`data signature does not match function ${G.name}.`,"data",K),this._decodeParams(G.inputs,(0,ue.dataSlice)(K,4))}encodeFunctionData(G,K){if("string"==typeof G){const K=this.getFunction(G);(0,ue.assertArgument)(K,"unknown function","fragment",G),G=K}return(0,ue.concat)([G.selector,this._encodeParams(G.inputs,K||[])])}decodeFunctionResult(G,K){if("string"==typeof G){const K=this.getFunction(G);(0,ue.assertArgument)(K,"unknown function","fragment",G),G=K}let ne="invalid length for result data";const pe=(0,ue.getBytesCopy)(K);if(pe.length%32==0)try{return _classPrivateFieldGet2(Pe,this).decode(G.outputs,pe)}catch(G){ne="could not decode result data"}(0,ue.assert)(!1,ne,"BAD_DATA",{value:(0,ue.hexlify)(pe),info:{method:G.name,signature:G.format()}})}makeError(G,K){const ne=(0,ue.getBytes)(G,"data"),he=pe.AbiCoder.getBuiltinCallException("call",K,ne);if(he.message.startsWith("execution reverted (unknown custom error)")){const G=(0,ue.hexlify)(ne.slice(0,4)),K=this.getError(G);if(K)try{const G=_classPrivateFieldGet2(Pe,this).decode(K.inputs,ne.slice(4));he.revert={name:K.name,signature:K.format(),args:G},he.reason=he.revert.signature,he.message=`execution reverted: ${he.reason}`}catch(G){he.message="execution reverted (coult not decode custom error)"}}const ye=this.parseTransaction(K);return ye&&(he.invocation={method:ye.name,signature:ye.signature,args:ye.args}),he}encodeFunctionResult(G,K){if("string"==typeof G){const K=this.getFunction(G);(0,ue.assertArgument)(K,"unknown function","fragment",G),G=K}return(0,ue.hexlify)(_classPrivateFieldGet2(Pe,this).encode(G.outputs,K||[]))}encodeFilterTopics(G,pe){if("string"==typeof G){const K=this.getEvent(G);(0,ue.assertArgument)(K,"unknown event","eventFragment",G),G=K}(0,ue.assert)(pe.length<=G.inputs.length,`too many arguments for ${G.format()}`,"UNEXPECTED_ARGUMENT",{count:pe.length,expectedCount:G.inputs.length});const he=[];G.anonymous||he.push(G.topicHash);const encodeTopic=(G,pe)=>"string"===G.type?(0,ne.id)(pe):"bytes"===G.type?(0,K.keccak256)((0,ue.hexlify)(pe)):("bool"===G.type&&"boolean"==typeof pe?pe=pe?"0x01":"0x00":G.type.match(/^u?int/)?pe=(0,ue.toBeHex)(pe):G.type.match(/^bytes/)?pe=(0,ue.zeroPadBytes)(pe,32):"address"===G.type&&_classPrivateFieldGet2(Pe,this).encode(["address"],[pe]),(0,ue.zeroPadValue)((0,ue.hexlify)(pe),32));for(pe.forEach(((K,ne)=>{const pe=G.inputs[ne];pe.indexed?null==K?he.push(null):"array"===pe.baseType||"tuple"===pe.baseType?(0,ue.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+pe.name,K):Array.isArray(K)?he.push(K.map((G=>encodeTopic(pe,G)))):he.push(encodeTopic(pe,K)):(0,ue.assertArgument)(null==K,"cannot filter non-indexed parameters; must be null","contract."+pe.name,K)}));he.length&&null===he[he.length-1];)he.pop();return he}encodeEventLog(G,pe){if("string"==typeof G){const K=this.getEvent(G);(0,ue.assertArgument)(K,"unknown event","eventFragment",G),G=K}const he=[],ye=[],me=[];return G.anonymous||he.push(G.topicHash),(0,ue.assertArgument)(pe.length===G.inputs.length,"event arguments/values mismatch","values",pe),G.inputs.forEach(((G,ue)=>{const be=pe[ue];if(G.indexed)if("string"===G.type)he.push((0,ne.id)(be));else if("bytes"===G.type)he.push((0,K.keccak256)(be));else{if("tuple"===G.baseType||"array"===G.baseType)throw new Error("not implemented");he.push(_classPrivateFieldGet2(Pe,this).encode([G.type],[be]))}else ye.push(G),me.push(be)})),{data:_classPrivateFieldGet2(Pe,this).encode(ye,me),topics:he}}decodeEventLog(G,K,ne){if("string"==typeof G){const K=this.getEvent(G);(0,ue.assertArgument)(K,"unknown event","eventFragment",G),G=K}if(null!=ne&&!G.anonymous){const K=G.topicHash;(0,ue.assertArgument)((0,ue.isHexString)(ne[0],32)&&ne[0].toLowerCase()===K,"fragment/topic mismatch","topics[0]",ne[0]),ne=ne.slice(1)}const pe=[],me=[],be=[];G.inputs.forEach(((G,K)=>{G.indexed?"string"===G.type||"bytes"===G.type||"tuple"===G.baseType||"array"===G.baseType?(pe.push(ye.ParamType.from({type:"bytes32",name:G.name})),be.push(!0)):(pe.push(G),be.push(!1)):(me.push(G),be.push(!1))}));const ve=null!=ne?_classPrivateFieldGet2(Pe,this).decode(pe,(0,ue.concat)(ne)):null,_e=_classPrivateFieldGet2(Pe,this).decode(me,K,!0),Te=[],Ee=[];let Se=0,Ce=0;return G.inputs.forEach(((G,K)=>{let ne=null;if(G.indexed)if(null==ve)ne=new Indexed(null);else if(be[K])ne=new Indexed(ve[Ce++]);else try{ne=ve[Ce++]}catch(G){ne=G}else try{ne=_e[Se++]}catch(G){ne=G}Te.push(ne),Ee.push(G.name||null)})),he.Result.fromItems(Te,Ee)}parseTransaction(G){const K=(0,ue.getBytes)(G.data,"tx.data"),ne=(0,ue.getBigInt)(null!=G.value?G.value:0,"tx.value"),pe=this.getFunction((0,ue.hexlify)(K.slice(0,4)));if(!pe)return null;const he=_classPrivateFieldGet2(Pe,this).decode(pe.inputs,K.slice(4));return new TransactionDescription(pe,pe.selector,he,ne)}parseCallResult(G){throw new Error("@TODO")}parseLog(G){const K=this.getEvent(G.topics[0]);return!K||K.anonymous?null:new LogDescription(K,K.topicHash,this.decodeEventLog(K,G.data,G.topics))}parseError(G){const K=(0,ue.hexlify)(G),ne=this.getError((0,ue.dataSlice)(K,0,4));if(!ne)return null;const pe=_classPrivateFieldGet2(Pe,this).decode(ne.inputs,(0,ue.dataSlice)(K,4));return new ErrorDescription(ne,ne.selector,pe)}static from(G){return G instanceof Interface?G:"string"==typeof G?new Interface(JSON.parse(G)):"function"==typeof G.format?new Interface(G.format("json")):new Interface(G)}}function _getFunction(G,K,ne){if((0,ue.isHexString)(G)){const K=G.toLowerCase();for(const G of _classPrivateFieldGet2(Ee,this).values())if(K===G.selector)return G;return null}if(-1===G.indexOf("(")){const pe=[];for(const[K,ne]of _classPrivateFieldGet2(Ee,this))K.split("(")[0]===G&&pe.push(ne);if(K){const G=K.length>0?K[K.length-1]:null;let ne=K.length,ue=!0;me.Typed.isTyped(G)&&"overrides"===G.type&&(ue=!1,ne--);for(let G=pe.length-1;G>=0;G--){const K=pe[G].inputs.length;K===ne||ue&&K===ne-1||pe.splice(G,1)}for(let G=pe.length-1;G>=0;G--){const ne=pe[G].inputs;for(let ue=0;ue<K.length;ue++)if(me.Typed.isTyped(K[ue])){if(ue>=ne.length){if("overrides"===K[ue].type)continue;pe.splice(G,1);break}if(K[ue].type!==ne[ue].baseType){pe.splice(G,1);break}}}}if(1===pe.length&&K&&K.length!==pe[0].inputs.length){const G=K[K.length-1];(null==G||Array.isArray(G)||"object"!=typeof G)&&pe.splice(0,1)}if(0===pe.length)return null;if(pe.length>1&&ne){const K=pe.map((G=>JSON.stringify(G.format()))).join(", ");(0,ue.assertArgument)(!1,`ambiguous function description (i.e. matches ${K})`,"key",G)}return pe[0]}return _classPrivateFieldGet2(Ee,this).get(ye.FunctionFragment.from(G).format())||null}function _getEvent(G,K,ne){if((0,ue.isHexString)(G)){const K=G.toLowerCase();for(const G of _classPrivateFieldGet2(Te,this).values())if(K===G.topicHash)return G;return null}if(-1===G.indexOf("(")){const pe=[];for(const[K,ne]of _classPrivateFieldGet2(Te,this))K.split("(")[0]===G&&pe.push(ne);if(K){for(let G=pe.length-1;G>=0;G--)pe[G].inputs.length<K.length&&pe.splice(G,1);for(let G=pe.length-1;G>=0;G--){const ne=pe[G].inputs;for(let ue=0;ue<K.length;ue++)if(me.Typed.isTyped(K[ue])&&K[ue].type!==ne[ue].baseType){pe.splice(G,1);break}}}if(0===pe.length)return null;if(pe.length>1&&ne){const K=pe.map((G=>JSON.stringify(G.format()))).join(", ");(0,ue.assertArgument)(!1,`ambiguous event description (i.e. matches ${K})`,"key",G)}return pe[0]}return _classPrivateFieldGet2(Te,this).get(ye.EventFragment.from(G).format())||null}G.Interface=Interface}(QF)),QF}();Object.defineProperty(G,"checkResultErrors",{enumerable:!0,get:function(){return pe.checkResultErrors}}),Object.defineProperty(G,"Indexed",{enumerable:!0,get:function(){return pe.Indexed}}),Object.defineProperty(G,"Interface",{enumerable:!0,get:function(){return pe.Interface}}),Object.defineProperty(G,"ErrorDescription",{enumerable:!0,get:function(){return pe.ErrorDescription}}),Object.defineProperty(G,"LogDescription",{enumerable:!0,get:function(){return pe.LogDescription}}),Object.defineProperty(G,"TransactionDescription",{enumerable:!0,get:function(){return pe.TransactionDescription}}),Object.defineProperty(G,"Result",{enumerable:!0,get:function(){return pe.Result}});var he=requireTyped();Object.defineProperty(G,"Typed",{enumerable:!0,get:function(){return he.Typed}})}(LN)),LN}var ZF,YF={},eD={},tD={};function requireProvider(){if(ZF)return tD;ZF=1,Object.defineProperty(tD,"__esModule",{value:!0}),tD.TransactionResponse=tD.TransactionReceipt=tD.Log=tD.Block=tD.copyRequest=tD.FeeData=void 0;const G=requireUtils$4(),K=requireTransaction(),ne=BigInt(0);function getValue(G){return null==G?null:G}function toJson(G){return null==G?null:G.toString()}tD.FeeData=class FeeData{constructor(K,ne,ue){_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"maxFeePerGas",void 0),_defineProperty(this,"maxPriorityFeePerGas",void 0),(0,G.defineProperties)(this,{gasPrice:getValue(K),maxFeePerGas:getValue(ne),maxPriorityFeePerGas:getValue(ue)})}toJSON(){const{gasPrice:G,maxFeePerGas:K,maxPriorityFeePerGas:ne}=this;return{_type:"FeeData",gasPrice:toJson(G),maxFeePerGas:toJson(K),maxPriorityFeePerGas:toJson(ne)}}},tD.copyRequest=function copyRequest(ne){const ue={};ne.to&&(ue.to=ne.to),ne.from&&(ue.from=ne.from),ne.data&&(ue.data=(0,G.hexlify)(ne.data));const pe="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const K of pe)K in ne&&null!=ne[K]&&(ue[K]=(0,G.getBigInt)(ne[K],`request.${K}`));const he="type,nonce".split(/,/);for(const K of he)K in ne&&null!=ne[K]&&(ue[K]=(0,G.getNumber)(ne[K],`request.${K}`));return ne.accessList&&(ue.accessList=(0,K.accessListify)(ne.accessList)),"blockTag"in ne&&(ue.blockTag=ne.blockTag),"enableCcipRead"in ne&&(ue.enableCcipRead=!!ne.enableCcipRead),"customData"in ne&&(ue.customData=ne.customData),ue};var ue=new WeakMap;class Block{constructor(K,ne){_defineProperty(this,"provider",void 0),_defineProperty(this,"number",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"timestamp",void 0),_defineProperty(this,"parentHash",void 0),_defineProperty(this,"parentBeaconBlockRoot",void 0),_defineProperty(this,"nonce",void 0),_defineProperty(this,"difficulty",void 0),_defineProperty(this,"gasLimit",void 0),_defineProperty(this,"gasUsed",void 0),_defineProperty(this,"stateRoot",void 0),_defineProperty(this,"receiptsRoot",void 0),_defineProperty(this,"blobGasUsed",void 0),_defineProperty(this,"excessBlobGas",void 0),_defineProperty(this,"miner",void 0),_defineProperty(this,"extraData",void 0),_defineProperty(this,"baseFeePerGas",void 0),_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldSet2(ue,this,K.transactions.map((G=>"string"!=typeof G?new TransactionResponse(G,ne):G))),(0,G.defineProperties)(this,{provider:ne,hash:getValue(K.hash),number:K.number,timestamp:K.timestamp,parentHash:K.parentHash,parentBeaconBlockRoot:K.parentBeaconBlockRoot,nonce:K.nonce,difficulty:K.difficulty,gasLimit:K.gasLimit,gasUsed:K.gasUsed,blobGasUsed:K.blobGasUsed,excessBlobGas:K.excessBlobGas,miner:K.miner,extraData:K.extraData,baseFeePerGas:getValue(K.baseFeePerGas),stateRoot:K.stateRoot,receiptsRoot:K.receiptsRoot})}get transactions(){return _classPrivateFieldGet2(ue,this).map((G=>"string"==typeof G?G:G.hash))}get prefetchedTransactions(){const K=_classPrivateFieldGet2(ue,this).slice();return 0===K.length?[]:((0,G.assert)("object"==typeof K[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),K)}toJSON(){const{baseFeePerGas:G,difficulty:K,extraData:ne,gasLimit:ue,gasUsed:pe,hash:he,miner:ye,nonce:me,number:be,parentHash:ve,parentBeaconBlockRoot:_e,stateRoot:Te,receiptsRoot:Ee,timestamp:Pe,transactions:Se}=this;return{_type:"Block",baseFeePerGas:toJson(G),difficulty:toJson(K),extraData:ne,gasLimit:toJson(ue),gasUsed:toJson(pe),blobGasUsed:toJson(this.blobGasUsed),excessBlobGas:toJson(this.excessBlobGas),hash:he,miner:ye,nonce:me,number:be,parentHash:ve,timestamp:Pe,parentBeaconBlockRoot:_e,stateRoot:Te,receiptsRoot:Ee,transactions:Se}}[Symbol.iterator](){let G=0;const K=this.transactions;return{next:()=>G<this.length?{value:K[G++],done:!1}:{value:void 0,done:!0}}}get length(){return _classPrivateFieldGet2(ue,this).length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(G){let K;if("number"==typeof G)K=_classPrivateFieldGet2(ue,this)[G];else{const ne=G.toLowerCase();for(const G of _classPrivateFieldGet2(ue,this)){if("string"==typeof G){if(G!==ne)continue;K=G;break}if(G.hash!==ne){K=G;break}}}if(null==K)throw new Error("no such tx");return"string"==typeof K?await this.provider.getTransaction(K):K}getPrefetchedTransaction(K){const ne=this.prefetchedTransactions;if("number"==typeof K)return ne[K];K=K.toLowerCase();for(const G of ne)if(G.hash===K)return G;(0,G.assertArgument)(!1,"no matching transaction","indexOrHash",K)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return function createOrphanedBlockFilter(G){return{orphan:"drop-block",hash:G.hash,number:G.number}}(this)}}tD.Block=Block;class Log{constructor(K,ne){_defineProperty(this,"provider",void 0),_defineProperty(this,"transactionHash",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"removed",void 0),_defineProperty(this,"address",void 0),_defineProperty(this,"data",void 0),_defineProperty(this,"topics",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"transactionIndex",void 0),this.provider=ne;const ue=Object.freeze(K.topics.slice());(0,G.defineProperties)(this,{transactionHash:K.transactionHash,blockHash:K.blockHash,blockNumber:K.blockNumber,removed:K.removed,address:K.address,data:K.data,topics:ue,index:K.index,transactionIndex:K.transactionIndex})}toJSON(){const{address:G,blockHash:K,blockNumber:ne,data:ue,index:pe,removed:he,topics:ye,transactionHash:me,transactionIndex:be}=this;return{_type:"log",address:G,blockHash:K,blockNumber:ne,data:ue,index:pe,removed:he,topics:ye,transactionHash:me,transactionIndex:be}}async getBlock(){const K=await this.provider.getBlock(this.blockHash);return(0,G.assert)(!!K,"failed to find transaction","UNKNOWN_ERROR",{}),K}async getTransaction(){const K=await this.provider.getTransaction(this.transactionHash);return(0,G.assert)(!!K,"failed to find transaction","UNKNOWN_ERROR",{}),K}async getTransactionReceipt(){const K=await this.provider.getTransactionReceipt(this.transactionHash);return(0,G.assert)(!!K,"failed to find transaction receipt","UNKNOWN_ERROR",{}),K}removedEvent(){return function createRemovedLogFilter(G){return{orphan:"drop-log",log:{transactionHash:G.transactionHash,blockHash:G.blockHash,blockNumber:G.blockNumber,address:G.address,data:G.data,topics:Object.freeze(G.topics.slice()),index:G.index}}}(this)}}tD.Log=Log;var pe=new WeakMap;class TransactionReceipt{constructor(K,ue){_defineProperty(this,"provider",void 0),_defineProperty(this,"to",void 0),_defineProperty(this,"from",void 0),_defineProperty(this,"contractAddress",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"logsBloom",void 0),_defineProperty(this,"gasUsed",void 0),_defineProperty(this,"blobGasUsed",void 0),_defineProperty(this,"cumulativeGasUsed",void 0),_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"blobGasPrice",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"status",void 0),_defineProperty(this,"root",void 0),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldSet2(pe,this,Object.freeze(K.logs.map((G=>new Log(G,ue)))));let he=ne;null!=K.effectiveGasPrice?he=K.effectiveGasPrice:null!=K.gasPrice&&(he=K.gasPrice),(0,G.defineProperties)(this,{provider:ue,to:K.to,from:K.from,contractAddress:K.contractAddress,hash:K.hash,index:K.index,blockHash:K.blockHash,blockNumber:K.blockNumber,logsBloom:K.logsBloom,gasUsed:K.gasUsed,cumulativeGasUsed:K.cumulativeGasUsed,blobGasUsed:K.blobGasUsed,gasPrice:he,blobGasPrice:K.blobGasPrice,type:K.type,status:K.status,root:K.root})}get logs(){return _classPrivateFieldGet2(pe,this)}toJSON(){const{to:G,from:K,contractAddress:ne,hash:ue,index:pe,blockHash:he,blockNumber:ye,logsBloom:me,logs:be,status:ve,root:_e}=this;return{_type:"TransactionReceipt",blockHash:he,blockNumber:ye,contractAddress:ne,cumulativeGasUsed:toJson(this.cumulativeGasUsed),from:K,gasPrice:toJson(this.gasPrice),blobGasUsed:toJson(this.blobGasUsed),blobGasPrice:toJson(this.blobGasPrice),gasUsed:toJson(this.gasUsed),hash:ue,index:pe,logs:be,logsBloom:me,root:_e,status:ve,to:G}}get length(){return this.logs.length}[Symbol.iterator](){let G=0;return{next:()=>G<this.length?{value:this.logs[G++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const G=await this.provider.getBlock(this.blockHash);if(null==G)throw new Error("TODO");return G}async getTransaction(){const G=await this.provider.getTransaction(this.hash);if(null==G)throw new Error("TODO");return G}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return createRemovedTransactionFilter(this)}reorderedEvent(K){return(0,G.assert)(!K||K.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),createReorderedTransactionFilter(this,K)}}tD.TransactionReceipt=TransactionReceipt;var he=new WeakMap;class TransactionResponse{constructor(G,K){_defineProperty(this,"provider",void 0),_defineProperty(this,"blockNumber",void 0),_defineProperty(this,"blockHash",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"hash",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"to",void 0),_defineProperty(this,"from",void 0),_defineProperty(this,"nonce",void 0),_defineProperty(this,"gasLimit",void 0),_defineProperty(this,"gasPrice",void 0),_defineProperty(this,"maxPriorityFeePerGas",void 0),_defineProperty(this,"maxFeePerGas",void 0),_defineProperty(this,"maxFeePerBlobGas",void 0),_defineProperty(this,"data",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"chainId",void 0),_defineProperty(this,"signature",void 0),_defineProperty(this,"accessList",void 0),_defineProperty(this,"blobVersionedHashes",void 0),_classPrivateFieldInitSpec(this,he,void 0),this.provider=K,this.blockNumber=null!=G.blockNumber?G.blockNumber:null,this.blockHash=null!=G.blockHash?G.blockHash:null,this.hash=G.hash,this.index=G.index,this.type=G.type,this.from=G.from,this.to=G.to||null,this.gasLimit=G.gasLimit,this.nonce=G.nonce,this.data=G.data,this.value=G.value,this.gasPrice=G.gasPrice,this.maxPriorityFeePerGas=null!=G.maxPriorityFeePerGas?G.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=G.maxFeePerGas?G.maxFeePerGas:null,this.maxFeePerBlobGas=null!=G.maxFeePerBlobGas?G.maxFeePerBlobGas:null,this.chainId=G.chainId,this.signature=G.signature,this.accessList=null!=G.accessList?G.accessList:null,this.blobVersionedHashes=null!=G.blobVersionedHashes?G.blobVersionedHashes:null,_classPrivateFieldSet2(he,this,-1)}toJSON(){const{blockNumber:G,blockHash:K,index:ne,hash:ue,type:pe,to:he,from:ye,nonce:me,data:be,signature:ve,accessList:_e,blobVersionedHashes:Te}=this;return{_type:"TransactionResponse",accessList:_e,blockNumber:G,blockHash:K,blobVersionedHashes:Te,chainId:toJson(this.chainId),data:be,from:ye,gasLimit:toJson(this.gasLimit),gasPrice:toJson(this.gasPrice),hash:ue,maxFeePerGas:toJson(this.maxFeePerGas),maxPriorityFeePerGas:toJson(this.maxPriorityFeePerGas),maxFeePerBlobGas:toJson(this.maxFeePerBlobGas),nonce:me,signature:ve,to:he,index:ne,type:pe,value:toJson(this.value)}}async getBlock(){let G=this.blockNumber;if(null==G){const K=await this.getTransaction();K&&(G=K.blockNumber)}if(null==G)return null;const K=this.provider.getBlock(G);if(null==K)throw new Error("TODO");return K}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:K,blockNumber:ne}=await(0,G.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==K||null==K.blockNumber?0:ne-K.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(K,ue){const pe=null==K?1:K,ye=null==ue?0:ue;let me=_classPrivateFieldGet2(he,this),be=-1,ve=-1===me;const checkReplacement=async()=>{if(ve)return null;const{blockNumber:K,nonce:ue}=await(0,G.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(ue<this.nonce)return void(me=K);if(ve)return null;const ye=await this.getTransaction();if(!ye||null==ye.blockNumber)for(-1===be&&(be=me-3,be<_classPrivateFieldGet2(he,this)&&(be=_classPrivateFieldGet2(he,this)));be<=K;){if(ve)return null;const ue=await this.provider.getBlock(be,!0);if(null==ue)return;for(const G of ue)if(G===this.hash)return;for(let he=0;he<ue.length;he++){const ye=await ue.getTransaction(he);if(ye.from===this.from&&ye.nonce===this.nonce){if(ve)return null;const ue=await this.provider.getTransactionReceipt(ye.hash);if(null==ue)return;if(K-ue.blockNumber+1<pe)return;let he="replaced";ye.data===this.data&&ye.to===this.to&&ye.value===this.value?he="repriced":"0x"===ye.data&&ye.from===ye.to&&ye.value===ne&&(he="cancelled"),(0,G.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===he||"cancelled"===he,reason:he,replacement:ye.replaceableTransaction(me),hash:ye.hash,receipt:ue})}}be++}},checkReceipt=K=>{if(null==K||0!==K.status)return K;(0,G.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:K.to,from:K.from,data:""},receipt:K})},_e=await this.provider.getTransactionReceipt(this.hash);if(0===pe)return checkReceipt(_e);if(_e){if(await _e.confirmations()>=pe)return checkReceipt(_e)}else if(await checkReplacement(),0===pe)return null;const Te=new Promise(((K,ne)=>{const ue=[],cancel=()=>{ue.forEach((G=>G()))};if(ue.push((()=>{ve=!0})),ye>0){const K=setTimeout((()=>{cancel(),ne((0,G.makeError)("wait for transaction timeout","TIMEOUT"))}),ye);ue.push((()=>{clearTimeout(K)}))}const txListener=async G=>{if(await G.confirmations()>=pe){cancel();try{K(checkReceipt(G))}catch(G){ne(G)}}};if(ue.push((()=>{this.provider.off(this.hash,txListener)})),this.provider.on(this.hash,txListener),me>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(K){if((0,G.isError)(K,"TRANSACTION_REPLACED"))return cancel(),void ne(K)}ve||this.provider.once("block",replaceListener)};ue.push((()=>{this.provider.off("block",replaceListener)})),this.provider.once("block",replaceListener)}}));return await Te}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,G.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),createRemovedTransactionFilter(this)}reorderedEvent(K){return(0,G.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,G.assert)(!K||K.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),createReorderedTransactionFilter(this,K)}replaceableTransaction(K){(0,G.assertArgument)(Number.isInteger(K)&&K>=0,"invalid startBlock","startBlock",K);const ne=new TransactionResponse(this,this.provider);return _classPrivateFieldSet2(he,ne,K),ne}}function createReorderedTransactionFilter(G,K){return{orphan:"reorder-transaction",tx:G,other:K}}function createRemovedTransactionFilter(G){return{orphan:"drop-transaction",tx:G}}return tD.TransactionResponse=TransactionResponse,tD}var rD,nD,aD={};function requireWrappers(){if(rD)return aD;rD=1,Object.defineProperty(aD,"__esModule",{value:!0}),aD.ContractEventPayload=aD.ContractUnknownEventPayload=aD.ContractTransactionResponse=aD.ContractTransactionReceipt=aD.UndecodedEventLog=aD.EventLog=void 0;const G=requireProvider(),K=requireUtils$4();class EventLog extends G.Log{constructor(G,ne,ue){super(G,G.provider),_defineProperty(this,"interface",void 0),_defineProperty(this,"fragment",void 0),_defineProperty(this,"args",void 0);const pe=ne.decodeEventLog(ue,G.data,G.topics);(0,K.defineProperties)(this,{args:pe,fragment:ue,interface:ne})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}aD.EventLog=EventLog;class UndecodedEventLog extends G.Log{constructor(G,ne){super(G,G.provider),_defineProperty(this,"error",void 0),(0,K.defineProperties)(this,{error:ne})}}aD.UndecodedEventLog=UndecodedEventLog;var ne=new WeakMap;class ContractTransactionReceipt extends G.TransactionReceipt{constructor(G,K,ue){super(ue,K),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldSet2(ne,this,G)}get logs(){return super.logs.map((G=>{const K=G.topics.length?_classPrivateFieldGet2(ne,this).getEvent(G.topics[0]):null;if(K)try{return new EventLog(G,_classPrivateFieldGet2(ne,this),K)}catch(K){return new UndecodedEventLog(G,K)}return G}))}}aD.ContractTransactionReceipt=ContractTransactionReceipt;var ue=new WeakMap;class ContractTransactionResponse extends G.TransactionResponse{constructor(G,K,ne){super(ne,K),_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldSet2(ue,this,G)}async wait(G,K){const ne=await super.wait(G,K);return null==ne?null:new ContractTransactionReceipt(_classPrivateFieldGet2(ue,this),this.provider,ne)}}aD.ContractTransactionResponse=ContractTransactionResponse;class ContractUnknownEventPayload extends K.EventPayload{constructor(G,ne,ue,pe){super(G,ne,ue),_defineProperty(this,"log",void 0),(0,K.defineProperties)(this,{log:pe})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}aD.ContractUnknownEventPayload=ContractUnknownEventPayload;return aD.ContractEventPayload=class ContractEventPayload extends ContractUnknownEventPayload{constructor(G,ne,ue,pe,he){super(G,ne,ue,new EventLog(he,G.interface,pe));const ye=G.interface.decodeEventLog(pe,this.log.data,this.log.topics);(0,K.defineProperties)(this,{args:ye,fragment:pe})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},aD}function requireContract$1(){if(nD)return eD;nD=1,Object.defineProperty(eD,"__esModule",{value:!0}),eD.Contract=eD.BaseContract=eD.resolveArgs=eD.copyOverrides=void 0;const G=requireAbi(),K=requireAddress$2(),ne=requireProvider(),ue=requireUtils$4(),pe=requireWrappers(),he=BigInt(0);function canCall(G){return G&&"function"==typeof G.call}function canEstimate(G){return G&&"function"==typeof G.estimateGas}function canResolve(G){return G&&"function"==typeof G.resolveName}function canSend(G){return G&&"function"==typeof G.sendTransaction}function getResolver(G){if(null!=G){if(canResolve(G))return G;if(G.provider)return G.provider}}var ye=new WeakMap;class PreparedTopicFilter{constructor(G,ne,pe){if(_classPrivateFieldInitSpec(this,ye,void 0),_defineProperty(this,"fragment",void 0),(0,ue.defineProperties)(this,{fragment:ne}),ne.inputs.length<pe.length)throw new Error("too many arguments");const he=getRunner(G.runner,"resolveName"),me=canResolve(he)?he:null;_classPrivateFieldSet2(ye,this,async function(){const ue=await Promise.all(ne.inputs.map(((G,ne)=>null==pe[ne]?null:G.walkAsync(pe[ne],((G,ne)=>"address"===G?Array.isArray(ne)?Promise.all(ne.map((G=>(0,K.resolveAddress)(G,me)))):(0,K.resolveAddress)(ne,me):ne)))));return G.interface.encodeFilterTopics(ne,ue)}())}getTopicFilter(){return _classPrivateFieldGet2(ye,this)}}function getRunner(G,K){return null==G?null:"function"==typeof G[K]?G:G.provider&&"function"==typeof G.provider[K]?G.provider:null}function getProvider(G){return null==G?null:G.provider||null}async function copyOverrides(K,pe){const he=G.Typed.dereference(K,"overrides");(0,ue.assertArgument)("object"==typeof he,"invalid overrides parameter","overrides",K);const ye=(0,ne.copyRequest)(he);return(0,ue.assertArgument)(null==ye.to||(pe||[]).indexOf("to")>=0,"cannot override to","overrides.to",ye.to),(0,ue.assertArgument)(null==ye.data||(pe||[]).indexOf("data")>=0,"cannot override data","overrides.data",ye.data),ye.from&&(ye.from=ye.from),ye}async function resolveArgs(ne,ue,pe){const he=getRunner(ne,"resolveName"),ye=canResolve(he)?he:null;return await Promise.all(ue.map(((ne,ue)=>ne.walkAsync(pe[ue],((ne,ue)=>(ue=G.Typed.dereference(ue,ne),"address"===ne?(0,K.resolveAddress)(ue,ye):ue))))))}function buildWrappedFallback(G){const populateTransaction=async function(ne){const pe=await copyOverrides(ne,["data"]);pe.to=await G.getAddress(),pe.from&&(pe.from=await(0,K.resolveAddress)(pe.from,getResolver(G.runner)));const ye=G.interface,me=(0,ue.getBigInt)(pe.value||he,"overrides.value")===he,be="0x"===(pe.data||"0x");!ye.fallback||ye.fallback.payable||!ye.receive||be||me||(0,ue.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",ne),(0,ue.assertArgument)(ye.fallback||be,"cannot send data to receive-only contract","overrides.data",pe.data);const ve=ye.receive||ye.fallback&&ye.fallback.payable;return(0,ue.assertArgument)(ve||me,"cannot send value to non-payable fallback","overrides.value",pe.value),(0,ue.assertArgument)(ye.fallback||be,"cannot send data to receive-only contract","overrides.data",pe.data),pe},send=async function(K){const ne=G.runner;(0,ue.assert)(canSend(ne),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const he=await ne.sendTransaction(await populateTransaction(K)),ye=getProvider(G.runner);return new pe.ContractTransactionResponse(G.interface,ye,he)},method=async G=>await send(G);return(0,ue.defineProperties)(method,{_contract:G,estimateGas:async function(K){const ne=getRunner(G.runner,"estimateGas");return(0,ue.assert)(canEstimate(ne),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await ne.estimateGas(await populateTransaction(K))},populateTransaction:populateTransaction,send:send,staticCall:async function(K){const ne=getRunner(G.runner,"call");(0,ue.assert)(canCall(ne),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const pe=await populateTransaction(K);try{return await ne.call(pe)}catch(K){if((0,ue.isCallException)(K)&&K.data)throw G.interface.makeError(K.data,pe);throw K}}}),method}eD.copyOverrides=copyOverrides,eD.resolveArgs=resolveArgs;const me=Symbol.for("_ethersInternal_contract"),be=new WeakMap;function getInternal(G){return be.get(G[me])}async function getSubInfo(G,K){let ne,pe=null;if(Array.isArray(K)){const topicHashify=function(K){if((0,ue.isHexString)(K,32))return K;const ne=G.interface.getEvent(K);return(0,ue.assertArgument)(ne,"unknown fragment","name",K),ne.topicHash};ne=K.map((G=>null==G?null:Array.isArray(G)?G.map(topicHashify):topicHashify(G)))}else"*"===K?ne=[null]:"string"==typeof K?(0,ue.isHexString)(K,32)?ne=[K]:(pe=G.interface.getEvent(K),(0,ue.assertArgument)(pe,"unknown fragment","event",K),ne=[pe.topicHash]):!function isDeferred(G){return G&&"object"==typeof G&&"getTopicFilter"in G&&"function"==typeof G.getTopicFilter&&G.fragment}(K)?"fragment"in K?(pe=K.fragment,ne=[pe.topicHash]):(0,ue.assertArgument)(!1,"unknown event name","event",K):ne=await K.getTopicFilter();ne=ne.map((G=>{if(null==G)return null;if(Array.isArray(G)){const K=Array.from(new Set(G.map((G=>G.toLowerCase()))).values());return 1===K.length?K[0]:(K.sort(),K)}return G.toLowerCase()}));const he=ne.map((G=>null==G?"null":Array.isArray(G)?G.join("|"):G)).join("&");return{fragment:pe,tag:he,topics:ne}}async function hasSub(G,K){const{subs:ne}=getInternal(G);return ne.get((await getSubInfo(G,K)).tag)||null}async function getSub(G,K,ne){const he=getProvider(G.runner);(0,ue.assert)(he,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:K});const{fragment:ye,tag:me,topics:be}=await getSubInfo(G,ne),{addr:ve,subs:_e}=getInternal(G);let Te=_e.get(me);if(!Te){const K={address:ve||G,topics:be},listener=K=>{let ue=ye;if(null==ue)try{ue=G.interface.getEvent(K.topics[0])}catch(G){}if(ue){const he=ue,me=ye?G.interface.decodeEventLog(ye,K.data,K.topics):[];emit(G,ne,me,(ue=>new pe.ContractEventPayload(G,ue,ne,he,K)))}else emit(G,ne,[],(ue=>new pe.ContractUnknownEventPayload(G,ue,ne,K)))};let ue=[];Te={tag:me,listeners:[],start:()=>{ue.length||ue.push(he.on(K,listener))},stop:async()=>{if(0==ue.length)return;let G=ue;ue=[],await Promise.all(G),he.off(K,listener)}},_e.set(me,Te)}return Te}let ve=Promise.resolve();async function emit(G,K,ne,ue){try{await ve}catch(G){}const pe=async function _emit(G,K,ne,ue){await ve;const pe=await hasSub(G,K);if(!pe)return!1;const he=pe.listeners.length;return pe.listeners=pe.listeners.filter((({listener:K,once:pe})=>{const he=Array.from(ne);ue&&he.push(ue(pe?null:K));try{K.call(G,...he)}catch(G){}return!pe})),0===pe.listeners.length&&(pe.stop(),getInternal(G).subs.delete(pe.tag)),he>0}(G,K,ne,ue);return ve=pe,await pe}const _e=["then"];class BaseContract{constructor(ne,he,ye,ve){_defineProperty(this,"target",void 0),_defineProperty(this,"interface",void 0),_defineProperty(this,"runner",void 0),_defineProperty(this,"filters",void 0),_defineProperty(this,me,void 0),_defineProperty(this,"fallback",void 0),(0,ue.assertArgument)("string"==typeof ne||(0,K.isAddressable)(ne),"invalid value for Contract target","target",ne),null==ye&&(ye=null);const Te=G.Interface.from(he);let Ee;(0,ue.defineProperties)(this,{target:ne,runner:ye,interface:Te}),Object.defineProperty(this,me,{value:{}});let Pe=null,Se=null;if(ve){const G=getProvider(ye);Se=new pe.ContractTransactionResponse(this.interface,G,ve)}let Ce=new Map;if("string"==typeof ne)if((0,ue.isHexString)(ne))Pe=ne,Ee=Promise.resolve(ne);else{const G=getRunner(ye,"resolveName");if(!canResolve(G))throw(0,ue.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});Ee=G.resolveName(ne).then((G=>{if(null==G)throw(0,ue.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:ne});return getInternal(this).addr=G,G}))}else Ee=ne.getAddress().then((G=>{if(null==G)throw new Error("TODO");return getInternal(this).addr=G,G}));!function setInternal(G,K){be.set(G[me],K)}(this,{addrPromise:Ee,addr:Pe,deployTx:Se,subs:Ce});const ke=new Proxy({},{get:(G,K,ne)=>{if("symbol"==typeof K||_e.indexOf(K)>=0)return Reflect.get(G,K,ne);try{return this.getEvent(K)}catch(G){if(!(0,ue.isError)(G,"INVALID_ARGUMENT")||"key"!==G.argument)throw G}},has:(G,K)=>_e.indexOf(K)>=0?Reflect.has(G,K):Reflect.has(G,K)||this.interface.hasEvent(String(K))});return(0,ue.defineProperties)(this,{filters:ke}),(0,ue.defineProperties)(this,{fallback:Te.receive||Te.fallback?buildWrappedFallback(this):null}),new Proxy(this,{get:(G,K,ne)=>{if("symbol"==typeof K||K in G||_e.indexOf(K)>=0)return Reflect.get(G,K,ne);try{return G.getFunction(K)}catch(G){if(!(0,ue.isError)(G,"INVALID_ARGUMENT")||"key"!==G.argument)throw G}},has:(G,K)=>"symbol"==typeof K||K in G||_e.indexOf(K)>=0?Reflect.has(G,K):G.interface.hasFunction(K)})}connect(G){return new BaseContract(this.target,this.interface,G)}attach(G){return new BaseContract(G,this.interface,this.runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const G=getProvider(this.runner);(0,ue.assert)(G,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const K=await G.getCode(await this.getAddress());return"0x"===K?null:K}async waitForDeployment(){const G=this.deploymentTransaction();if(G)return await G.wait(),this;if(null!=await this.getDeployedCode())return this;const K=getProvider(this.runner);return(0,ue.assert)(null!=K,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((G,ne)=>{const checkCode=async()=>{try{if(null!=await this.getDeployedCode())return G(this);K.once("block",checkCode)}catch(G){ne(G)}};checkCode()}))}deploymentTransaction(){return getInternal(this).deployTx}getFunction(G){"string"!=typeof G&&(G=G.format());const ne=function buildWrappedMethod(G,ne){const getFragment=function(...K){const pe=G.interface.getFunction(ne,K);return(0,ue.assert)(pe,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:ne,args:K}}),pe},populateTransaction=async function(...ne){const pe=getFragment(...ne);let he={};if(pe.inputs.length+1===ne.length&&(he=await copyOverrides(ne.pop()),he.from&&(he.from=await(0,K.resolveAddress)(he.from,getResolver(G.runner)))),pe.inputs.length!==ne.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const ye=await resolveArgs(G.runner,pe.inputs,ne);return Object.assign({},he,await(0,ue.resolveProperties)({to:G.getAddress(),data:G.interface.encodeFunctionData(pe,ye)}))},staticCall=async function(...G){const K=await staticCallResult(...G);return 1===K.length?K[0]:K},send=async function(...K){const ne=G.runner;(0,ue.assert)(canSend(ne),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const he=await ne.sendTransaction(await populateTransaction(...K)),ye=getProvider(G.runner);return new pe.ContractTransactionResponse(G.interface,ye,he)},staticCallResult=async function(...K){const ne=getRunner(G.runner,"call");(0,ue.assert)(canCall(ne),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const pe=await populateTransaction(...K);let he="0x";try{he=await ne.call(pe)}catch(K){if((0,ue.isCallException)(K)&&K.data)throw G.interface.makeError(K.data,pe);throw K}const ye=getFragment(...K);return G.interface.decodeFunctionResult(ye,he)},method=async(...G)=>getFragment(...G).constant?await staticCall(...G):await send(...G);return(0,ue.defineProperties)(method,{name:G.interface.getFunctionName(ne),_contract:G,_key:ne,getFragment:getFragment,estimateGas:async function(...K){const ne=getRunner(G.runner,"estimateGas");return(0,ue.assert)(canEstimate(ne),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await ne.estimateGas(await populateTransaction(...K))},populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult}),Object.defineProperty(method,"fragment",{configurable:!1,enumerable:!0,get:()=>{const K=G.interface.getFunction(ne);return(0,ue.assert)(K,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:ne}}),K}}),method}(this,G);return ne}getEvent(G){return"string"!=typeof G&&(G=G.format()),function buildWrappedEvent(G,K){const getFragment=function(...ne){const pe=G.interface.getEvent(K,ne);return(0,ue.assert)(pe,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K,args:ne}}),pe},method=function(...K){return new PreparedTopicFilter(G,getFragment(...K),K)};return(0,ue.defineProperties)(method,{name:G.interface.getEventName(K),_contract:G,_key:K,getFragment:getFragment}),Object.defineProperty(method,"fragment",{configurable:!1,enumerable:!0,get:()=>{const ne=G.interface.getEvent(K);return(0,ue.assert)(ne,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:K}}),ne}}),method}(this,G)}async queryTransaction(G){throw new Error("@TODO")}async queryFilter(G,K,he){null==K&&(K=0),null==he&&(he="latest");const{addr:ye,addrPromise:me}=getInternal(this),be=ye||await me,{fragment:ve,topics:_e}=await getSubInfo(this,G),Te={address:be,topics:_e,fromBlock:K,toBlock:he},Ee=getProvider(this.runner);return(0,ue.assert)(Ee,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await Ee.getLogs(Te)).map((G=>{let K=ve;if(null==K)try{K=this.interface.getEvent(G.topics[0])}catch(G){}if(K)try{return new pe.EventLog(G,this.interface,K)}catch(K){return new pe.UndecodedEventLog(G,K)}return new ne.Log(G,Ee)}))}async on(G,K){const ne=await getSub(this,"on",G);return ne.listeners.push({listener:K,once:!1}),ne.start(),this}async once(G,K){const ne=await getSub(this,"once",G);return ne.listeners.push({listener:K,once:!0}),ne.start(),this}async emit(G,...K){return await emit(this,G,K,null)}async listenerCount(G){if(G){const K=await hasSub(this,G);return K?K.listeners.length:0}const{subs:K}=getInternal(this);let ne=0;for(const{listeners:G}of K.values())ne+=G.length;return ne}async listeners(G){if(G){const K=await hasSub(this,G);return K?K.listeners.map((({listener:G})=>G)):[]}const{subs:K}=getInternal(this);let ne=[];for(const{listeners:G}of K.values())ne=ne.concat(G.map((({listener:G})=>G)));return ne}async off(G,K){const ne=await hasSub(this,G);if(!ne)return this;if(K){const G=ne.listeners.map((({listener:G})=>G)).indexOf(K);G>=0&&ne.listeners.splice(G,1)}return null!=K&&0!==ne.listeners.length||(ne.stop(),getInternal(this).subs.delete(ne.tag)),this}async removeAllListeners(G){if(G){const K=await hasSub(this,G);if(!K)return this;K.stop(),getInternal(this).subs.delete(K.tag)}else{const{subs:G}=getInternal(this);for(const{tag:K,stop:ne}of G.values())ne(),G.delete(K)}return this}async addListener(G,K){return await this.on(G,K)}async removeListener(G,K){return await this.off(G,K)}static buildClass(G){return class CustomContract extends BaseContract{constructor(K,ne=null){super(K,G,ne)}}}static from(G,K,ne){null==ne&&(ne=null);return new this(G,K,ne)}}eD.BaseContract=BaseContract;class Contract extends(function _ContractBase(){return BaseContract}()){}return eD.Contract=Contract,eD}var iD,sD,oD={};function requireContract(){return sD||(sD=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.UndecodedEventLog=G.EventLog=G.ContractTransactionResponse=G.ContractTransactionReceipt=G.ContractUnknownEventPayload=G.ContractEventPayload=G.ContractFactory=G.Contract=G.BaseContract=void 0;var K=requireContract$1();Object.defineProperty(G,"BaseContract",{enumerable:!0,get:function(){return K.BaseContract}}),Object.defineProperty(G,"Contract",{enumerable:!0,get:function(){return K.Contract}});var ne=function requireFactory(){if(iD)return oD;iD=1,Object.defineProperty(oD,"__esModule",{value:!0}),oD.ContractFactory=void 0;const G=requireAbi(),K=requireAddress$2(),ne=requireUtils$4(),ue=requireContract$1();class ContractFactory{constructor(K,ue,pe){_defineProperty(this,"interface",void 0),_defineProperty(this,"bytecode",void 0),_defineProperty(this,"runner",void 0);const he=G.Interface.from(K);ue instanceof Uint8Array||("object"==typeof ue&&(ue=ue.object),ue.startsWith("0x")||(ue="0x"+ue)),ue=(0,ne.hexlify)((0,ne.getBytes)(ue)),(0,ne.defineProperties)(this,{bytecode:ue,interface:he,runner:pe||null})}attach(G){return new ue.BaseContract(G,this.interface,this.runner)}async getDeployTransaction(...G){let K={};const pe=this.interface.deploy;if(pe.inputs.length+1===G.length&&(K=await(0,ue.copyOverrides)(G.pop())),pe.inputs.length!==G.length)throw new Error("incorrect number of arguments to constructor");const he=await(0,ue.resolveArgs)(this.runner,pe.inputs,G),ye=(0,ne.concat)([this.bytecode,this.interface.encodeDeploy(he)]);return Object.assign({},K,{data:ye})}async deploy(...G){const pe=await this.getDeployTransaction(...G);(0,ne.assert)(this.runner&&"function"==typeof this.runner.sendTransaction,"factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const he=await this.runner.sendTransaction(pe),ye=(0,K.getCreateAddress)(he);return new ue.BaseContract(ye,this.interface,this.runner,he)}connect(G){return new ContractFactory(this.interface,this.bytecode,G)}static fromSolidity(G,K){(0,ne.assertArgument)(null!=G,"bad compiler output","output",G),"string"==typeof G&&(G=JSON.parse(G));const ue=G.abi;let pe="";return G.bytecode?pe=G.bytecode:G.evm&&G.evm.bytecode&&(pe=G.evm.bytecode),new this(ue,pe,K)}}return oD.ContractFactory=ContractFactory,oD}();Object.defineProperty(G,"ContractFactory",{enumerable:!0,get:function(){return ne.ContractFactory}});var ue=requireWrappers();Object.defineProperty(G,"ContractEventPayload",{enumerable:!0,get:function(){return ue.ContractEventPayload}}),Object.defineProperty(G,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return ue.ContractUnknownEventPayload}}),Object.defineProperty(G,"ContractTransactionReceipt",{enumerable:!0,get:function(){return ue.ContractTransactionReceipt}}),Object.defineProperty(G,"ContractTransactionResponse",{enumerable:!0,get:function(){return ue.ContractTransactionResponse}}),Object.defineProperty(G,"EventLog",{enumerable:!0,get:function(){return ue.EventLog}}),Object.defineProperty(G,"UndecodedEventLog",{enumerable:!0,get:function(){return ue.UndecodedEventLog}})}(YF)),YF}var cD,dD={},uD={},fD={};function requireEnsResolver(){var G;if(cD)return fD;cD=1,Object.defineProperty(fD,"__esModule",{value:!0}),fD.EnsResolver=fD.BasicMulticoinProviderPlugin=fD.MulticoinProviderPlugin=void 0;const K=requireAddress$2(),ne=requireConstants(),ue=requireContract(),pe=requireHash(),he=requireUtils$4();function getIpfsLink(G){return G.match(/^ipfs:\/\/ipfs\//i)?G=G.substring(12):G.match(/^ipfs:\/\//i)?G=G.substring(7):(0,he.assertArgument)(!1,"unsupported IPFS format","link",G),`https://gateway.ipfs.io/ipfs/${G}`}class MulticoinProviderPlugin{constructor(G){_defineProperty(this,"name",void 0),(0,he.defineProperties)(this,{name:G})}connect(G){return this}supportsCoinType(G){return!1}async encodeAddress(G,K){throw new Error("unsupported coin")}async decodeAddress(G,K){throw new Error("unsupported coin")}}fD.MulticoinProviderPlugin=MulticoinProviderPlugin;fD.BasicMulticoinProviderPlugin=class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin{constructor(){super("org.ethers.plugins.provider.BasicMulticoin")}};const ye=new RegExp("^(ipfs)://(.*)$","i"),me=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ye,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var be=new WeakMap,ve=new WeakMap,_e=new WeakSet;class EnsResolver{constructor(G,K,ne){_classPrivateMethodInitSpec(this,_e),_defineProperty(this,"provider",void 0),_defineProperty(this,"address",void 0),_defineProperty(this,"name",void 0),_classPrivateFieldInitSpec(this,be,void 0),_classPrivateFieldInitSpec(this,ve,void 0),(0,he.defineProperties)(this,{provider:G,address:K,name:ne}),_classPrivateFieldSet2(be,this,null),_classPrivateFieldSet2(ve,this,new ue.Contract(K,["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)"],G))}async supportsWildcard(){return null==_classPrivateFieldGet2(be,this)&&_classPrivateFieldSet2(be,this,(async()=>{try{return await _classPrivateFieldGet2(ve,this).supportsInterface("0x9061b923")}catch(G){if((0,he.isError)(G,"CALL_EXCEPTION"))return!1;throw _classPrivateFieldSet2(be,this,null),G}})()),await _classPrivateFieldGet2(be,this)}async getAddress(G){if(null==G&&(G=60),60===G)try{const G=await _assertClassBrand(_e,this,_fetch).call(this,"addr(bytes32)");return null==G||G===ne.ZeroAddress?null:G}catch(G){if((0,he.isError)(G,"CALL_EXCEPTION"))return null;throw G}if(G>=0&&G<2147483648){let ne=G+2147483648;const ue=await _assertClassBrand(_e,this,_fetch).call(this,"addr(bytes32,uint)",[ne]);if((0,he.isHexString)(ue,20))return(0,K.getAddress)(ue)}let ue=null;for(const K of this.provider.plugins)if(K instanceof MulticoinProviderPlugin&&K.supportsCoinType(G)){ue=K;break}if(null==ue)return null;const pe=await _assertClassBrand(_e,this,_fetch).call(this,"addr(bytes32,uint)",[G]);if(null==pe||"0x"===pe)return null;const ye=await ue.decodeAddress(G,pe);if(null!=ye)return ye;(0,he.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${G})`,info:{coinType:G,data:pe}})}async getText(G){const K=await _assertClassBrand(_e,this,_fetch).call(this,"text(bytes32,string)",[G]);return null==K||"0x"===K?null:K}async getContentHash(){const G=await _assertClassBrand(_e,this,_fetch).call(this,"contenthash(bytes32)");if(null==G||"0x"===G)return null;const K=G.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(K){const G="e3010170"===K[1]?"ipfs":"ipns",ne=parseInt(K[4],16);if(K[5].length===2*ne)return`${G}://${(0,he.encodeBase58)("0x"+K[2])}`}const ne=G.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(ne&&64===ne[1].length)return`bzz://${ne[1]}`;(0,he.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:G}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const G=[{type:"name",value:this.name}];try{const K=await this.getText("avatar");if(null==K)return G.push({type:"!avatar",value:""}),{url:null,linkage:G};G.push({type:"avatar",value:K});for(let ne=0;ne<me.length;ne++){const pe=K.match(me[ne]);if(null==pe)continue;const be=pe[1].toLowerCase();switch(be){case"https":case"data":return G.push({type:"url",value:K}),{linkage:G,url:K};case"ipfs":{const ne=getIpfsLink(K);return G.push({type:"ipfs",value:K}),G.push({type:"url",value:ne}),{linkage:G,url:ne}}case"erc721":case"erc1155":{const ne="erc721"===be?"tokenURI(uint256)":"uri(uint256)";G.push({type:be,value:K});const me=await this.getAddress();if(null==me)return G.push({type:"!owner",value:""}),{url:null,linkage:G};const ve=(pe[2]||"").split("/");if(2!==ve.length)return G.push({type:`!${be}caip`,value:pe[2]||""}),{url:null,linkage:G};const _e=ve[1],Te=new ue.Contract(ve[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===be){const K=await Te.ownerOf(_e);if(me!==K)return G.push({type:"!owner",value:K}),{url:null,linkage:G};G.push({type:"owner",value:K})}else if("erc1155"===be){const K=await Te.balanceOf(me,_e);if(!K)return G.push({type:"!balance",value:"0"}),{url:null,linkage:G};G.push({type:"balance",value:K.toString()})}let Ee=await Te[ne](_e);if(null==Ee||"0x"===Ee)return G.push({type:"!metadata-url",value:""}),{url:null,linkage:G};G.push({type:"metadata-url-base",value:Ee}),"erc1155"===be&&(Ee=Ee.replace("{id}",(0,he.toBeHex)(_e,32).substring(2)),G.push({type:"metadata-url-expanded",value:Ee})),Ee.match(/^ipfs:/i)&&(Ee=getIpfsLink(Ee)),G.push({type:"metadata-url",value:Ee});let Pe={};const Se=await new he.FetchRequest(Ee).send();Se.assertOk();try{Pe=Se.bodyJson}catch(K){try{G.push({type:"!metadata",value:Se.bodyText})}catch(K){const ne=Se.body;return ne&&G.push({type:"!metadata",value:(0,he.hexlify)(ne)}),{url:null,linkage:G}}return{url:null,linkage:G}}if(!Pe)return G.push({type:"!metadata",value:""}),{url:null,linkage:G};G.push({type:"metadata",value:JSON.stringify(Pe)});let Ce=Pe.image;if("string"!=typeof Ce)return G.push({type:"!imageUrl",value:""}),{url:null,linkage:G};if(Ce.match(/^(https:\/\/|data:)/i));else{if(null==Ce.match(ye))return G.push({type:"!imageUrl-ipfs",value:Ce}),{url:null,linkage:G};G.push({type:"imageUrl-ipfs",value:Ce}),Ce=getIpfsLink(Ce)}return G.push({type:"url",value:Ce}),{linkage:G,url:Ce}}}}}catch(G){}return{linkage:G,url:null}}static async getEnsAddress(G){const K=await G.getNetwork(),ne=K.getPlugin("org.ethers.plugins.network.Ens");return(0,he.assert)(ne,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:K}}),ne.address}static async fromName(G,K){let ne=K;for(;;){if(""===ne||"."===ne)return null;if("eth"!==K&&"eth"===ne)return null;const ue=await _getResolver.call(EnsResolver,G,ne);if(null!=ue){const pe=new EnsResolver(G,ue,K);return ne===K||await pe.supportsWildcard()?pe:null}ne=ne.split(".").slice(1).join(".")}}}async function _fetch(G,K){K=(K||[]).slice();const ne=_classPrivateFieldGet2(ve,this).interface;K.unshift((0,pe.namehash)(this.name));let ue=null;await this.supportsWildcard()&&(ue=ne.getFunction(G),(0,he.assert)(ue,"missing fragment","UNKNOWN_ERROR",{info:{funcName:G}}),K=[(0,pe.dnsEncode)(this.name,255),ne.encodeFunctionData(ue,K)],G="resolve(bytes,bytes)"),K.push({enableCcipRead:!0});try{const pe=await _classPrivateFieldGet2(ve,this)[G](...K);return ue?ne.decodeFunctionResult(ue,pe)[0]:pe}catch(G){if(!(0,he.isError)(G,"CALL_EXCEPTION"))throw G}return null}async function _getResolver(K,he){const ye=await G.getEnsAddress(K);try{const G=new ue.Contract(ye,["function resolver(bytes32) view returns (address)"],K),me=await G.resolver((0,pe.namehash)(he),{enableCcipRead:!0});return me===ne.ZeroAddress?null:me}catch(G){throw G}return null}return G=EnsResolver,fD.EnsResolver=EnsResolver,fD}var lD,pD={};var hD,yD,mD={},bD={};function requirePluginsNetwork(){if(hD)return bD;hD=1,Object.defineProperty(bD,"__esModule",{value:!0}),bD.FetchUrlFeeDataNetworkPlugin=bD.FeeDataNetworkPlugin=bD.EnsPlugin=bD.GasCostPlugin=bD.NetworkPlugin=void 0;const G=requireProperties(),K=requireUtils$4();class NetworkPlugin{constructor(K){_defineProperty(this,"name",void 0),(0,G.defineProperties)(this,{name:K})}clone(){return new NetworkPlugin(this.name)}}bD.NetworkPlugin=NetworkPlugin;class GasCostPlugin extends NetworkPlugin{constructor(ne,ue){null==ne&&(ne=0),super(`org.ethers.network.plugins.GasCost#${ne||0}`),_defineProperty(this,"effectiveBlock",void 0),_defineProperty(this,"txBase",void 0),_defineProperty(this,"txCreate",void 0),_defineProperty(this,"txDataZero",void 0),_defineProperty(this,"txDataNonzero",void 0),_defineProperty(this,"txAccessListStorageKey",void 0),_defineProperty(this,"txAccessListAddress",void 0);const pe={effectiveBlock:ne};function set(G,ne){let he=(ue||{})[G];null==he&&(he=ne),(0,K.assertArgument)("number"==typeof he,`invalud value for ${G}`,"costs",ue),pe[G]=he}set("txBase",21e3),set("txCreate",32e3),set("txDataZero",4),set("txDataNonzero",16),set("txAccessListStorageKey",1900),set("txAccessListAddress",2400),(0,G.defineProperties)(this,pe)}clone(){return new GasCostPlugin(this.effectiveBlock,this)}}bD.GasCostPlugin=GasCostPlugin;class EnsPlugin extends NetworkPlugin{constructor(K,ne){super("org.ethers.plugins.network.Ens"),_defineProperty(this,"address",void 0),_defineProperty(this,"targetNetwork",void 0),(0,G.defineProperties)(this,{address:K||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==ne?1:ne})}clone(){return new EnsPlugin(this.address,this.targetNetwork)}}bD.EnsPlugin=EnsPlugin;var ne=new WeakMap;class FeeDataNetworkPlugin extends NetworkPlugin{get feeDataFunc(){return _classPrivateFieldGet2(ne,this)}constructor(G){super("org.ethers.plugins.network.FeeData"),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldSet2(ne,this,G)}async getFeeData(G){return await _classPrivateFieldGet2(ne,this).call(this,G)}clone(){return new FeeDataNetworkPlugin(_classPrivateFieldGet2(ne,this))}}bD.FeeDataNetworkPlugin=FeeDataNetworkPlugin;var ue=new WeakMap,pe=new WeakMap;return bD.FetchUrlFeeDataNetworkPlugin=class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin{get url(){return _classPrivateFieldGet2(ue,this)}get processFunc(){return _classPrivateFieldGet2(pe,this)}constructor(G,K){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldSet2(ue,this,G),_classPrivateFieldSet2(pe,this,K)}clone(){return this}},bD}function requireNetwork(){if(yD)return mD;yD=1,Object.defineProperty(mD,"__esModule",{value:!0}),mD.Network=void 0;const G=requireTransaction(),K=requireUtils$4(),ne=requirePluginsNetwork(),ue=new Map;var pe=new WeakMap,he=new WeakMap,ye=new WeakMap;class Network{constructor(G,ne){_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldInitSpec(this,he,void 0),_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldSet2(pe,this,G),_classPrivateFieldSet2(he,this,(0,K.getBigInt)(ne)),_classPrivateFieldSet2(ye,this,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return _classPrivateFieldGet2(pe,this)}set name(G){_classPrivateFieldSet2(pe,this,G)}get chainId(){return _classPrivateFieldGet2(he,this)}set chainId(G){_classPrivateFieldSet2(he,this,(0,K.getBigInt)(G,"chainId"))}matches(G){if(null==G)return!1;if("string"==typeof G){try{return this.chainId===(0,K.getBigInt)(G)}catch(G){}return this.name===G}if("number"==typeof G||"bigint"==typeof G){try{return this.chainId===(0,K.getBigInt)(G)}catch(G){}return!1}if("object"==typeof G){if(null!=G.chainId){try{return this.chainId===(0,K.getBigInt)(G.chainId)}catch(G){}return!1}return null!=G.name&&this.name===G.name}return!1}get plugins(){return Array.from(_classPrivateFieldGet2(ye,this).values())}attachPlugin(G){if(_classPrivateFieldGet2(ye,this).get(G.name))throw new Error(`cannot replace existing plugin: ${G.name} `);return _classPrivateFieldGet2(ye,this).set(G.name,G.clone()),this}getPlugin(G){return _classPrivateFieldGet2(ye,this).get(G)||null}getPlugins(G){return this.plugins.filter((K=>K.name.split("#")[0]===G))}clone(){const G=new Network(this.name,this.chainId);return this.plugins.forEach((K=>{G.attachPlugin(K.clone())})),G}computeIntrinsicGas(K){const ue=this.getPlugin("org.ethers.plugins.network.GasCost")||new ne.GasCostPlugin;let pe=ue.txBase;if(null==K.to&&(pe+=ue.txCreate),K.data)for(let G=2;G<K.data.length;G+=2)"00"===K.data.substring(G,G+2)?pe+=ue.txDataZero:pe+=ue.txDataNonzero;if(K.accessList){const ne=(0,G.accessListify)(K.accessList);for(const G in ne)pe+=ue.txAccessListAddress+ue.txAccessListStorageKey*ne[G].storageKeys.length}return pe}static from(G){if(function injectCommonNetworks(){if(me)return;function registerEth(G,K,ue){const func=function(){const pe=new Network(G,K);return null!=ue.ensNetwork&&pe.attachPlugin(new ne.EnsPlugin(null,ue.ensNetwork)),pe.attachPlugin(new ne.GasCostPlugin),(ue.plugins||[]).forEach((G=>{pe.attachPlugin(G)})),pe};Network.register(G,func),Network.register(K,func),ue.altNames&&ue.altNames.forEach((G=>{Network.register(G,func)}))}me=!0,registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),registerEth("ropsten",3,{ensNetwork:3}),registerEth("rinkeby",4,{ensNetwork:4}),registerEth("goerli",5,{ensNetwork:5}),registerEth("kovan",42,{ensNetwork:42}),registerEth("sepolia",11155111,{ensNetwork:11155111}),registerEth("holesky",17e3,{ensNetwork:17e3}),registerEth("classic",61,{}),registerEth("classicKotti",6,{}),registerEth("arbitrum",42161,{ensNetwork:1}),registerEth("arbitrum-goerli",421613,{}),registerEth("arbitrum-sepolia",421614,{}),registerEth("base",8453,{ensNetwork:1}),registerEth("base-goerli",84531,{}),registerEth("base-sepolia",84532,{}),registerEth("bnb",56,{ensNetwork:1}),registerEth("bnbt",97,{}),registerEth("linea",59144,{ensNetwork:1}),registerEth("linea-goerli",59140,{}),registerEth("matic",137,{ensNetwork:1,plugins:[getGasStationPlugin("https://gasstation.polygon.technology/v2")]}),registerEth("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")]}),registerEth("optimism",10,{ensNetwork:1,plugins:[]}),registerEth("optimism-goerli",420,{}),registerEth("optimism-sepolia",11155420,{}),registerEth("xdai",100,{ensNetwork:1})}(),null==G)return Network.from("mainnet");if("number"==typeof G&&(G=BigInt(G)),"string"==typeof G||"bigint"==typeof G){const ne=ue.get(G);if(ne)return ne();if("bigint"==typeof G)return new Network("unknown",G);(0,K.assertArgument)(!1,"unknown network","network",G)}if("function"==typeof G.clone){return G.clone()}if("object"==typeof G){(0,K.assertArgument)("string"==typeof G.name&&"number"==typeof G.chainId,"invalid network object name or chainId","network",G);const ue=new Network(G.name,G.chainId);return(G.ensAddress||null!=G.ensNetwork)&&ue.attachPlugin(new ne.EnsPlugin(G.ensAddress,G.ensNetwork)),ue}(0,K.assertArgument)(!1,"invalid network","network",G)}static register(G,ne){"number"==typeof G&&(G=BigInt(G));const pe=ue.get(G);pe&&(0,K.assertArgument)(!1,`conflicting network for ${JSON.stringify(pe.name)}`,"nameOrChainId",G),ue.set(G,ne)}}function parseUnits(G,K){const ne=String(G);if(!ne.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${G}`);const ue=ne.split(".");if(1===ue.length&&ue.push(""),2!==ue.length)throw new Error(`invalid gwei value: ${G}`);for(;ue[1].length<K;)ue[1]+="0";if(ue[1].length>9){let G=BigInt(ue[1].substring(0,9));ue[1].substring(9).match(/^0+$/)||G++,ue[1]=G.toString()}return BigInt(ue[0]+ue[1])}function getGasStationPlugin(G){return new ne.FetchUrlFeeDataNetworkPlugin(G,(async(G,ne,ue)=>{let pe;ue.setHeader("User-Agent","ethers");try{const[K,ne]=await Promise.all([ue.send(),G()]);pe=K;const he=pe.bodyJson.standard;return{gasPrice:ne.gasPrice,maxFeePerGas:parseUnits(he.maxFee,9),maxPriorityFeePerGas:parseUnits(he.maxPriorityFee,9)}}catch(G){(0,K.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(ue.url)})`,"SERVER_ERROR",{request:ue,response:pe,error:G})}}))}mD.Network=Network;let me=!1;return mD}var gD,vD,wD={};function requireSubscriberPolling(){if(gD)return wD;gD=1,Object.defineProperty(wD,"__esModule",{value:!0}),wD.PollingEventSubscriber=wD.PollingTransactionSubscriber=wD.PollingOrphanSubscriber=wD.PollingBlockTagSubscriber=wD.OnBlockSubscriber=wD.PollingBlockSubscriber=wD.getPollingSubscriber=void 0;const G=requireUtils$4();function copy(G){return JSON.parse(JSON.stringify(G))}wD.getPollingSubscriber=function getPollingSubscriber(K,ne){return"block"===ne?new PollingBlockSubscriber(K):(0,G.isHexString)(ne,32)?new PollingTransactionSubscriber(K,ne):void(0,G.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:ne}})};var K=new WeakMap,ne=new WeakMap,ue=new WeakMap,pe=new WeakMap,he=new WeakSet;class PollingBlockSubscriber{constructor(G){_classPrivateMethodInitSpec(this,he),_classPrivateFieldInitSpec(this,K,void 0),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldSet2(K,this,G),_classPrivateFieldSet2(ne,this,null),_classPrivateFieldSet2(ue,this,4e3),_classPrivateFieldSet2(pe,this,-2)}get pollingInterval(){return _classPrivateFieldGet2(ue,this)}set pollingInterval(G){_classPrivateFieldSet2(ue,this,G)}start(){_classPrivateFieldGet2(ne,this)||(_classPrivateFieldSet2(ne,this,_classPrivateFieldGet2(K,this)._setTimeout(_assertClassBrand(he,this,_poll).bind(this),_classPrivateFieldGet2(ue,this))),_assertClassBrand(he,this,_poll).call(this))}stop(){_classPrivateFieldGet2(ne,this)&&(_classPrivateFieldGet2(K,this)._clearTimeout(_classPrivateFieldGet2(ne,this)),_classPrivateFieldSet2(ne,this,null))}pause(G){this.stop(),G&&_classPrivateFieldSet2(pe,this,-2)}resume(){this.start()}}async function _poll(){try{const G=await _classPrivateFieldGet2(K,this).getBlockNumber();if(-2===_classPrivateFieldGet2(pe,this))return void _classPrivateFieldSet2(pe,this,G);if(G!==_classPrivateFieldGet2(pe,this)){for(let ue=_classPrivateFieldGet2(pe,this)+1;ue<=G;ue++){if(null==_classPrivateFieldGet2(ne,this))return;await _classPrivateFieldGet2(K,this).emit("block",ue)}_classPrivateFieldSet2(pe,this,G)}}catch(G){}null!=_classPrivateFieldGet2(ne,this)&&_classPrivateFieldSet2(ne,this,_classPrivateFieldGet2(K,this)._setTimeout(_assertClassBrand(he,this,_poll).bind(this),_classPrivateFieldGet2(ue,this)))}wD.PollingBlockSubscriber=PollingBlockSubscriber;var ye=new WeakMap,me=new WeakMap,be=new WeakMap;class OnBlockSubscriber{constructor(G){_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldInitSpec(this,me,void 0),_classPrivateFieldInitSpec(this,be,void 0),_classPrivateFieldSet2(ye,this,G),_classPrivateFieldSet2(be,this,!1),_classPrivateFieldSet2(me,this,(G=>{this._poll(G,_classPrivateFieldGet2(ye,this))}))}async _poll(G,K){throw new Error("sub-classes must override this")}start(){_classPrivateFieldGet2(be,this)||(_classPrivateFieldSet2(be,this,!0),_classPrivateFieldGet2(me,this).call(this,-2),_classPrivateFieldGet2(ye,this).on("block",_classPrivateFieldGet2(me,this)))}stop(){_classPrivateFieldGet2(be,this)&&(_classPrivateFieldSet2(be,this,!1),_classPrivateFieldGet2(ye,this).off("block",_classPrivateFieldGet2(me,this)))}pause(G){this.stop()}resume(){this.start()}}wD.OnBlockSubscriber=OnBlockSubscriber;var ve=new WeakMap,_e=new WeakMap;wD.PollingBlockTagSubscriber=class PollingBlockTagSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldInitSpec(this,_e,void 0),_classPrivateFieldSet2(ve,this,K),_classPrivateFieldSet2(_e,this,-2)}pause(G){G&&_classPrivateFieldSet2(_e,this,-2),super.pause(G)}async _poll(G,K){const ne=await K.getBlock(_classPrivateFieldGet2(ve,this));null!=ne&&(-2===_classPrivateFieldGet2(_e,this)?_classPrivateFieldSet2(_e,this,ne.number):ne.number>_classPrivateFieldGet2(_e,this)&&(K.emit(_classPrivateFieldGet2(ve,this),ne.number),_classPrivateFieldSet2(_e,this,ne.number)))}};var Te=new WeakMap;wD.PollingOrphanSubscriber=class PollingOrphanSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldSet2(Te,this,copy(K))}async _poll(G,K){throw new Error("@TODO")}};var Ee=new WeakMap;class PollingTransactionSubscriber extends OnBlockSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldSet2(Ee,this,K)}async _poll(G,K){const ne=await K.getTransactionReceipt(_classPrivateFieldGet2(Ee,this));ne&&K.emit(_classPrivateFieldGet2(Ee,this),ne)}}wD.PollingTransactionSubscriber=PollingTransactionSubscriber;var Pe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakSet;async function _poll3(G){if(-2===_classPrivateFieldGet2(Oe,this))return;const K=copy(_classPrivateFieldGet2(Se,this));K.fromBlock=_classPrivateFieldGet2(Oe,this)+1,K.toBlock=G;const ne=await _classPrivateFieldGet2(Pe,this).getLogs(K);if(0!==ne.length)for(const G of ne)_classPrivateFieldGet2(Pe,this).emit(_classPrivateFieldGet2(Se,this),G),_classPrivateFieldSet2(Oe,this,G.blockNumber);else _classPrivateFieldGet2(Oe,this)<G-60&&_classPrivateFieldSet2(Oe,this,G-60)}return wD.PollingEventSubscriber=class PollingEventSubscriber{constructor(G,K){_classPrivateMethodInitSpec(this,xe),_classPrivateFieldInitSpec(this,Pe,void 0),_classPrivateFieldInitSpec(this,Se,void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldSet2(Pe,this,G),_classPrivateFieldSet2(Se,this,copy(K)),_classPrivateFieldSet2(Ce,this,_assertClassBrand(xe,this,_poll3).bind(this)),_classPrivateFieldSet2(ke,this,!1),_classPrivateFieldSet2(Oe,this,-2)}start(){_classPrivateFieldGet2(ke,this)||(_classPrivateFieldSet2(ke,this,!0),-2===_classPrivateFieldGet2(Oe,this)&&_classPrivateFieldGet2(Pe,this).getBlockNumber().then((G=>{_classPrivateFieldSet2(Oe,this,G)})),_classPrivateFieldGet2(Pe,this).on("block",_classPrivateFieldGet2(Ce,this)))}stop(){_classPrivateFieldGet2(ke,this)&&(_classPrivateFieldSet2(ke,this,!1),_classPrivateFieldGet2(Pe,this).off("block",_classPrivateFieldGet2(Ce,this)))}pause(G){this.stop(),G&&_classPrivateFieldSet2(Oe,this,-2)}resume(){this.start()}},wD}function requireAbstractProvider(){if(vD)return uD;vD=1,Object.defineProperty(uD,"__esModule",{value:!0}),uD.AbstractProvider=uD.UnmanagedSubscriber=void 0;const G=requireAddress$2(),K=requireConstants(),ne=requireContract(),ue=requireHash(),pe=requireTransaction(),he=requireUtils$4(),ye=requireEnsResolver(),me=function requireFormat(){if(lD)return pD;lD=1,Object.defineProperty(pD,"__esModule",{value:!0}),pD.formatTransactionResponse=pD.formatTransactionReceipt=pD.formatReceiptLog=pD.formatBlock=pD.formatLog=pD.formatUint256=pD.formatHash=pD.formatData=pD.formatBoolean=pD.object=pD.arrayOf=pD.allowNull=void 0;const G=requireAddress$2(),K=requireCrypto(),ne=requireTransaction(),ue=requireUtils$4(),pe=BigInt(0);function allowNull(G,K){return function(ne){return null==ne?K:G(ne)}}function arrayOf(G,K){return ne=>{if(K&&null==ne)return null;if(!Array.isArray(ne))throw new Error("not an array");return ne.map((K=>G(K)))}}function object(G,K){return ne=>{const pe={};for(const he in G){let ye=he;if(K&&he in K&&!(ye in ne))for(const G of K[he])if(G in ne){ye=G;break}try{const K=G[he](ne[ye]);void 0!==K&&(pe[he]=K)}catch(G){const K=G instanceof Error?G.message:"not-an-error";(0,ue.assert)(!1,`invalid value for value.${he} (${K})`,"BAD_DATA",{value:ne})}}return pe}}function formatBoolean(G){switch(G){case!0:case"true":return!0;case!1:case"false":return!1}(0,ue.assertArgument)(!1,`invalid boolean; ${JSON.stringify(G)}`,"value",G)}function formatData(G){return(0,ue.assertArgument)((0,ue.isHexString)(G,!0),"invalid data","value",G),G}function formatHash(G){return(0,ue.assertArgument)((0,ue.isHexString)(G,32),"invalid hash","value",G),G}pD.allowNull=allowNull,pD.arrayOf=arrayOf,pD.object=object,pD.formatBoolean=formatBoolean,pD.formatData=formatData,pD.formatHash=formatHash,pD.formatUint256=function formatUint256(G){if(!(0,ue.isHexString)(G))throw new Error("invalid uint256");return(0,ue.zeroPadValue)(G,32)};const he=object({address:G.getAddress,blockHash:formatHash,blockNumber:ue.getNumber,data:formatData,index:ue.getNumber,removed:allowNull(formatBoolean,!1),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:ue.getNumber},{index:["logIndex"]});pD.formatLog=function formatLog(G){return he(G)};const ye=object({hash:allowNull(formatHash),parentHash:formatHash,parentBeaconBlockRoot:allowNull(formatHash,null),number:ue.getNumber,timestamp:ue.getNumber,nonce:allowNull(formatData),difficulty:ue.getBigInt,gasLimit:ue.getBigInt,gasUsed:ue.getBigInt,stateRoot:allowNull(formatHash,null),receiptsRoot:allowNull(formatHash,null),blobGasUsed:allowNull(ue.getBigInt,null),excessBlobGas:allowNull(ue.getBigInt,null),miner:allowNull(G.getAddress),extraData:formatData,baseFeePerGas:allowNull(ue.getBigInt)});pD.formatBlock=function formatBlock(G){const K=ye(G);return K.transactions=G.transactions.map((G=>"string"==typeof G?G:formatTransactionResponse(G))),K};const me=object({transactionIndex:ue.getNumber,blockNumber:ue.getNumber,transactionHash:formatHash,address:G.getAddress,topics:arrayOf(formatHash),data:formatData,index:ue.getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(G){return me(G)}pD.formatReceiptLog=formatReceiptLog;const be=object({to:allowNull(G.getAddress,null),from:allowNull(G.getAddress,null),contractAddress:allowNull(G.getAddress,null),index:ue.getNumber,root:allowNull(ue.hexlify),gasUsed:ue.getBigInt,blobGasUsed:allowNull(ue.getBigInt,null),logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:ue.getNumber,cumulativeGasUsed:ue.getBigInt,effectiveGasPrice:allowNull(ue.getBigInt),blobGasPrice:allowNull(ue.getBigInt,null),status:allowNull(ue.getNumber),type:allowNull(ue.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionResponse(he){he.to&&(0,ue.getBigInt)(he.to)===pe&&(he.to="0x0000000000000000000000000000000000000000");const ye=object({hash:formatHash,index:allowNull(ue.getNumber,void 0),type:G=>"0x"===G||null==G?0:(0,ue.getNumber)(G),accessList:allowNull(ne.accessListify,null),blobVersionedHashes:allowNull(arrayOf(formatHash,!0),null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(ue.getNumber,null),transactionIndex:allowNull(ue.getNumber,null),from:G.getAddress,gasPrice:allowNull(ue.getBigInt),maxPriorityFeePerGas:allowNull(ue.getBigInt),maxFeePerGas:allowNull(ue.getBigInt),maxFeePerBlobGas:allowNull(ue.getBigInt,null),gasLimit:ue.getBigInt,to:allowNull(G.getAddress,null),value:ue.getBigInt,nonce:ue.getNumber,data:formatData,creates:allowNull(G.getAddress,null),chainId:allowNull(ue.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(he);if(null==ye.to&&null==ye.creates&&(ye.creates=(0,G.getCreateAddress)(ye)),1!==he.type&&2!==he.type||null!=he.accessList||(ye.accessList=[]),he.signature?ye.signature=K.Signature.from(he.signature):ye.signature=K.Signature.from(he),null==ye.chainId){const G=ye.signature.legacyChainId;null!=G&&(ye.chainId=G)}return ye.blockHash&&(0,ue.getBigInt)(ye.blockHash)===pe&&(ye.blockHash=null),ye}return pD.formatTransactionReceipt=function formatTransactionReceipt(G){return be(G)},pD.formatTransactionResponse=formatTransactionResponse,pD}(),be=requireNetwork(),ve=requireProvider(),_e=requireSubscriberPolling(),Te=BigInt(2);function isPromise(G){return G&&"function"==typeof G.then}function getTag(G,K){return G+":"+JSON.stringify(K,((G,K)=>{if(null==K)return"null";if("bigint"==typeof K)return`bigint:${K.toString()}`;if("string"==typeof K)return K.toLowerCase();if("object"==typeof K&&!Array.isArray(K)){const G=Object.keys(K);return G.sort(),G.reduce(((G,ne)=>(G[ne]=K[ne],G)),{})}return K}))}class UnmanagedSubscriber{constructor(G){_defineProperty(this,"name",void 0),(0,he.defineProperties)(this,{name:G})}start(){}stop(){}pause(G){}resume(){}}function concisify(G){return(G=Array.from(new Set(G).values())).sort(),G}async function getSubscription(K,ne){if(null==K)throw new Error("invalid event");if(Array.isArray(K)&&(K={topics:K}),"string"==typeof K)switch(K){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:K,tag:K}}if((0,he.isHexString)(K,32)){const G=K.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:G}),hash:G}}if(K.orphan){const G=K;return{type:"orphan",tag:getTag("orphan",G),filter:(ue=G,JSON.parse(JSON.stringify(ue)))}}var ue;if(K.address||K.topics){const ue=K,pe={topics:(ue.topics||[]).map((G=>null==G?null:Array.isArray(G)?concisify(G.map((G=>G.toLowerCase()))):G.toLowerCase()))};if(ue.address){const K=[],ye=[],addAddress=ue=>{(0,he.isHexString)(ue)?K.push(ue):ye.push((async()=>{K.push(await(0,G.resolveAddress)(ue,ne))})())};Array.isArray(ue.address)?ue.address.forEach(addAddress):addAddress(ue.address),ye.length&&await Promise.all(ye),pe.address=concisify(K.map((G=>G.toLowerCase())))}return{filter:pe,tag:getTag("event",pe),type:"event"}}(0,he.assertArgument)(!1,"unknown ProviderEvent","event",K)}function getTime(){return(new Date).getTime()}uD.UnmanagedSubscriber=UnmanagedSubscriber;const Ee={cacheTimeout:250,pollingInterval:4e3};var Pe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Be=new WeakMap,Fe=new WeakMap,De=new WeakMap,Le=new WeakMap,Ue=new WeakSet;async function _perform(G){const K=_classPrivateFieldGet2(Le,this).cacheTimeout;if(K<0)return await this._perform(G);const ne=getTag(G.method,G);let ue=_classPrivateFieldGet2(Ne,this).get(ne);return ue||(ue=this._perform(G),_classPrivateFieldGet2(Ne,this).set(ne,ue),setTimeout((()=>{_classPrivateFieldGet2(Ne,this).get(ne)===ue&&_classPrivateFieldGet2(Ne,this).delete(ne)}),K)),await ue}async function _call(K,ne,ue){(0,he.assert)(ue<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},K,{blockTag:ne,enableCcipRead:!0})});const pe=(0,ve.copyRequest)(K);try{return(0,he.hexlify)(await this._perform({method:"call",transaction:pe,blockTag:ne}))}catch(K){if(!this.disableCcipRead&&(0,he.isCallException)(K)&&K.data&&ue>=0&&"latest"===ne&&null!=pe.to&&"0x556f1830"===(0,he.dataSlice)(K.data,0,4)){const ye=K.data,me=await(0,G.resolveAddress)(pe.to,this);let be;try{be=function parseOffchainLookup(G){const K={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,he.assert)((0,he.dataLength)(G)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const ne=(0,he.dataSlice)(G,0,32);(0,he.assert)((0,he.dataSlice)(ne,0,12)===(0,he.dataSlice)(ze,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),K.sender=(0,he.dataSlice)(ne,12);try{const ne=[],ue=(0,he.getNumber)((0,he.dataSlice)(G,32,64)),pe=(0,he.getNumber)((0,he.dataSlice)(G,ue,ue+32)),ye=(0,he.dataSlice)(G,ue+32);for(let G=0;G<pe;G++){const K=_parseString(ye,32*G);if(null==K)throw new Error("abort");ne.push(K)}K.urls=ne}catch(G){(0,he.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const ne=_parseBytes(G,64);if(null==ne)throw new Error("abort");K.calldata=ne}catch(G){(0,he.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,he.assert)((0,he.dataSlice)(G,100,128)===(0,he.dataSlice)(ze,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),K.selector=(0,he.dataSlice)(G,96,100);try{const ne=_parseBytes(G,128);if(null==ne)throw new Error("abort");K.extraData=ne}catch(G){(0,he.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return K.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map((G=>K[G])),K}((0,he.dataSlice)(K.data,4))}catch(G){(0,he.assert)(!1,G.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:pe,info:{data:ye}})}(0,he.assert)(be.sender.toLowerCase()===me.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:ye,reason:"OffchainLookup",transaction:pe,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:be.errorArgs}});const ve=await this.ccipReadFetch(pe,be.calldata,be.urls);(0,he.assert)(null!=ve,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:pe,info:{data:K.data,errorArgs:be.errorArgs}});const _e={to:me,data:(0,he.concat)([be.selector,encodeBytes([ve,be.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:_e});try{const G=await _assertClassBrand(Ue,this,_call).call(this,_e,ne,ue+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},_e),result:G}),G}catch(G){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},_e),error:G}),G}}throw K}}async function _checkNetwork(G){const{value:K}=await(0,he.resolveProperties)({network:this.getNetwork(),value:G});return K}async function _getAccountValue(G,K,ne){let ue=this._getAddress(K),pe=this._getBlockTag(ne);return"string"==typeof ue&&"string"==typeof pe||([ue,pe]=await Promise.all([ue,pe])),await _assertClassBrand(Ue,this,_checkNetwork).call(this,_assertClassBrand(Ue,this,_perform).call(this,Object.assign(G,{address:ue,blockTag:pe})))}async function _getBlock(G,K){if((0,he.isHexString)(G,32))return await _assertClassBrand(Ue,this,_perform).call(this,{method:"getBlock",blockHash:G,includeTransactions:K});let ne=this._getBlockTag(G);return"string"!=typeof ne&&(ne=await ne),await _assertClassBrand(Ue,this,_perform).call(this,{method:"getBlock",blockTag:ne,includeTransactions:K})}async function _hasSub(G,K){let ne=await getSubscription(G,this);return"event"===ne.type&&K&&K.length>0&&!0===K[0].removed&&(ne=await getSubscription({orphan:"drop-log",log:K[0]},this)),_classPrivateFieldGet2(Pe,this).get(ne.tag)||null}async function _getSub(G){const K=await getSubscription(G,this),ne=K.tag;let ue=_classPrivateFieldGet2(Pe,this).get(ne);if(!ue){ue={subscriber:this._getSubscriber(K),tag:ne,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},_classPrivateFieldGet2(Pe,this).set(ne,ue)}return ue}function _parseString(G,K){try{const ne=_parseBytes(G,K);if(ne)return(0,he.toUtf8String)(ne)}catch(G){}return null}function _parseBytes(G,K){if("0x"===G)return null;try{const ne=(0,he.getNumber)((0,he.dataSlice)(G,K,K+32)),ue=(0,he.getNumber)((0,he.dataSlice)(G,ne,ne+32));return(0,he.dataSlice)(G,ne+32,ne+32+ue)}catch(G){}return null}function numPad(G){const K=(0,he.toBeArray)(G);if(K.length>32)throw new Error("internal; should not happen");const ne=new Uint8Array(32);return ne.set(K,32-K.length),ne}function bytesPad(G){if(G.length%32==0)return G;const K=new Uint8Array(32*Math.ceil(G.length/32));return K.set(G),K}uD.AbstractProvider=class AbstractProvider{constructor(G,K){if(_classPrivateMethodInitSpec(this,Ue),_classPrivateFieldInitSpec(this,Pe,void 0),_classPrivateFieldInitSpec(this,Se,void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldInitSpec(this,xe,void 0),_classPrivateFieldInitSpec(this,Ne,void 0),_classPrivateFieldInitSpec(this,Me,void 0),_classPrivateFieldInitSpec(this,Be,void 0),_classPrivateFieldInitSpec(this,Fe,void 0),_classPrivateFieldInitSpec(this,De,void 0),_classPrivateFieldInitSpec(this,Le,void 0),_classPrivateFieldSet2(Le,this,Object.assign({},Ee,K||{})),"any"===G)_classPrivateFieldSet2(xe,this,!0),_classPrivateFieldSet2(Oe,this,null);else if(G){const K=be.Network.from(G);_classPrivateFieldSet2(xe,this,!1),_classPrivateFieldSet2(Oe,this,Promise.resolve(K)),setTimeout((()=>{this.emit("network",K,null)}),0)}else _classPrivateFieldSet2(xe,this,!1),_classPrivateFieldSet2(Oe,this,null);_classPrivateFieldSet2(Me,this,-1),_classPrivateFieldSet2(Ne,this,new Map),_classPrivateFieldSet2(Pe,this,new Map),_classPrivateFieldSet2(Se,this,new Map),_classPrivateFieldSet2(Ce,this,null),_classPrivateFieldSet2(ke,this,!1),_classPrivateFieldSet2(Be,this,1),_classPrivateFieldSet2(Fe,this,new Map),_classPrivateFieldSet2(De,this,!1)}get pollingInterval(){return _classPrivateFieldGet2(Le,this).pollingInterval}get provider(){return this}get plugins(){return Array.from(_classPrivateFieldGet2(Se,this).values())}attachPlugin(G){if(_classPrivateFieldGet2(Se,this).get(G.name))throw new Error(`cannot replace existing plugin: ${G.name} `);return _classPrivateFieldGet2(Se,this).set(G.name,G.connect(this)),this}getPlugin(G){return _classPrivateFieldGet2(Se,this).get(G)||null}get disableCcipRead(){return _classPrivateFieldGet2(De,this)}set disableCcipRead(G){_classPrivateFieldSet2(De,this,!!G)}async ccipReadFetch(G,K,ne){if(this.disableCcipRead||0===ne.length||null==G.to)return null;const ue=G.to.toLowerCase(),pe=K.toLowerCase(),ye=[];for(let K=0;K<ne.length;K++){const me=ne[K],be=me.replace("{sender}",ue).replace("{data}",pe),ve=new he.FetchRequest(be);-1===me.indexOf("{data}")&&(ve.body={data:pe,sender:ue}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:ve,index:K,urls:ne});let _e="unknown error";const Te=await ve.send();try{const G=Te.bodyJson;if(G.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:ve,result:G}),G.data;G.message&&(_e=G.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:ve,result:G})}catch(G){}(0,he.assert)(Te.statusCode<400||Te.statusCode>=500,`response not found during CCIP fetch: ${_e}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:G,info:{url:me,errorMessage:_e}}),ye.push(_e)}(0,he.assert)(!1,`error encountered during CCIP fetch: ${ye.map((G=>JSON.stringify(G))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:G,info:{urls:ne,errorMessages:ye}})}_wrapBlock(G,K){return new ve.Block((0,me.formatBlock)(G),this)}_wrapLog(G,K){return new ve.Log((0,me.formatLog)(G),this)}_wrapTransactionReceipt(G,K){return new ve.TransactionReceipt((0,me.formatTransactionReceipt)(G),this)}_wrapTransactionResponse(G,K){return new ve.TransactionResponse((0,me.formatTransactionResponse)(G),this)}_detectNetwork(){(0,he.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(G){(0,he.assert)(!1,`unsupported method: ${G.method}`,"UNSUPPORTED_OPERATION",{operation:G.method,info:G})}async getBlockNumber(){const G=(0,he.getNumber)(await _assertClassBrand(Ue,this,_perform).call(this,{method:"getBlockNumber"}),"%response");return _classPrivateFieldGet2(Me,this)>=0&&_classPrivateFieldSet2(Me,this,G),G}_getAddress(K){return(0,G.resolveAddress)(K,this)}_getBlockTag(G){if(null==G)return"latest";switch(G){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return G}return(0,he.isHexString)(G)?(0,he.isHexString)(G,32)?G:(0,he.toQuantity)(G):("bigint"==typeof G&&(G=(0,he.getNumber)(G,"blockTag")),"number"==typeof G?G>=0?(0,he.toQuantity)(G):_classPrivateFieldGet2(Me,this)>=0?(0,he.toQuantity)(_classPrivateFieldGet2(Me,this)+G):this.getBlockNumber().then((K=>(0,he.toQuantity)(K+G))):void(0,he.assertArgument)(!1,"invalid blockTag","blockTag",G))}_getFilter(G){const K=(G.topics||[]).map((G=>null==G?null:Array.isArray(G)?concisify(G.map((G=>G.toLowerCase()))):G.toLowerCase())),ne="blockHash"in G?G.blockHash:void 0,resolve=(G,ue,pe)=>{let he;switch(G.length){case 0:break;case 1:he=G[0];break;default:G.sort(),he=G}if(ne&&(null!=ue||null!=pe))throw new Error("invalid filter");const ye={};return he&&(ye.address=he),K.length&&(ye.topics=K),ue&&(ye.fromBlock=ue),pe&&(ye.toBlock=pe),ne&&(ye.blockHash=ne),ye};let ue,pe,he=[];if(G.address)if(Array.isArray(G.address))for(const K of G.address)he.push(this._getAddress(K));else he.push(this._getAddress(G.address));return"fromBlock"in G&&(ue=this._getBlockTag(G.fromBlock)),"toBlock"in G&&(pe=this._getBlockTag(G.toBlock)),he.filter((G=>"string"!=typeof G)).length||null!=ue&&"string"!=typeof ue||null!=pe&&"string"!=typeof pe?Promise.all([Promise.all(he),ue,pe]).then((G=>resolve(G[0],G[1],G[2]))):resolve(he,ue,pe)}_getTransactionRequest(K){const ne=(0,ve.copyRequest)(K),ue=[];if(["to","from"].forEach((K=>{if(null==ne[K])return;const pe=(0,G.resolveAddress)(ne[K],this);isPromise(pe)?ue.push(async function(){ne[K]=await pe}()):ne[K]=pe})),null!=ne.blockTag){const G=this._getBlockTag(ne.blockTag);isPromise(G)?ue.push(async function(){ne.blockTag=await G}()):ne.blockTag=G}return ue.length?async function(){return await Promise.all(ue),ne}():ne}async getNetwork(){if(null==_classPrivateFieldGet2(Oe,this)){const G=(async()=>{try{const G=await this._detectNetwork();return this.emit("network",G,null),G}catch(K){throw _classPrivateFieldGet2(Oe,this)===G&&_classPrivateFieldSet2(Oe,this,null),K}})();return _classPrivateFieldSet2(Oe,this,G),(await G).clone()}const G=_classPrivateFieldGet2(Oe,this),[K,ne]=await Promise.all([G,this._detectNetwork()]);return K.chainId!==ne.chainId&&(_classPrivateFieldGet2(xe,this)?(this.emit("network",ne,K),_classPrivateFieldGet2(Oe,this)===G&&_classPrivateFieldSet2(Oe,this,Promise.resolve(ne))):(0,he.assert)(!1,`network changed: ${K.chainId} => ${ne.chainId} `,"NETWORK_ERROR",{event:"changed"})),K.clone()}async getFeeData(){const G=await this.getNetwork(),getFeeDataFunc=async()=>{const{_block:K,gasPrice:ne,priorityFee:ue}=await(0,he.resolveProperties)({_block:_assertClassBrand(Ue,this,_getBlock).call(this,"latest",!1),gasPrice:(async()=>{try{const G=await _assertClassBrand(Ue,this,_perform).call(this,{method:"getGasPrice"});return(0,he.getBigInt)(G,"%response")}catch(G){}return null})(),priorityFee:(async()=>{try{const G=await _assertClassBrand(Ue,this,_perform).call(this,{method:"getPriorityFee"});return(0,he.getBigInt)(G,"%response")}catch(G){}return null})()});let pe=null,ye=null;const me=this._wrapBlock(K,G);return me&&me.baseFeePerGas&&(ye=null!=ue?ue:BigInt("1000000000"),pe=me.baseFeePerGas*Te+ye),new ve.FeeData(ne,pe,ye)},K=G.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(K){const G=new he.FetchRequest(K.url),ne=await K.processFunc(getFeeDataFunc,this,G);return new ve.FeeData(ne.gasPrice,ne.maxFeePerGas,ne.maxPriorityFeePerGas)}return await getFeeDataFunc()}async estimateGas(G){let K=this._getTransactionRequest(G);return isPromise(K)&&(K=await K),(0,he.getBigInt)(await _assertClassBrand(Ue,this,_perform).call(this,{method:"estimateGas",transaction:K}),"%response")}async call(G){const{tx:K,blockTag:ne}=await(0,he.resolveProperties)({tx:this._getTransactionRequest(G),blockTag:this._getBlockTag(G.blockTag)});return await _assertClassBrand(Ue,this,_checkNetwork).call(this,_assertClassBrand(Ue,this,_call).call(this,K,ne,G.enableCcipRead?0:-1))}async getBalance(G,K){return(0,he.getBigInt)(await _assertClassBrand(Ue,this,_getAccountValue).call(this,{method:"getBalance"},G,K),"%response")}async getTransactionCount(G,K){return(0,he.getNumber)(await _assertClassBrand(Ue,this,_getAccountValue).call(this,{method:"getTransactionCount"},G,K),"%response")}async getCode(G,K){return(0,he.hexlify)(await _assertClassBrand(Ue,this,_getAccountValue).call(this,{method:"getCode"},G,K))}async getStorage(G,K,ne){const ue=(0,he.getBigInt)(K,"position");return(0,he.hexlify)(await _assertClassBrand(Ue,this,_getAccountValue).call(this,{method:"getStorage",position:ue},G,ne))}async broadcastTransaction(G){const{blockNumber:K,hash:ne,network:ue}=await(0,he.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:G}),network:this.getNetwork()}),ye=pe.Transaction.from(G);if(ye.hash!==ne)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(ye,ue).replaceableTransaction(K)}async getBlock(G,K){const{network:ne,params:ue}=await(0,he.resolveProperties)({network:this.getNetwork(),params:_assertClassBrand(Ue,this,_getBlock).call(this,G,!!K)});return null==ue?null:this._wrapBlock(ue,ne)}async getTransaction(G){const{network:K,params:ne}=await(0,he.resolveProperties)({network:this.getNetwork(),params:_assertClassBrand(Ue,this,_perform).call(this,{method:"getTransaction",hash:G})});return null==ne?null:this._wrapTransactionResponse(ne,K)}async getTransactionReceipt(G){const{network:K,params:ne}=await(0,he.resolveProperties)({network:this.getNetwork(),params:_assertClassBrand(Ue,this,_perform).call(this,{method:"getTransactionReceipt",hash:G})});if(null==ne)return null;if(null==ne.gasPrice&&null==ne.effectiveGasPrice){const K=await _assertClassBrand(Ue,this,_perform).call(this,{method:"getTransaction",hash:G});if(null==K)throw new Error("report this; could not find tx or effectiveGasPrice");ne.effectiveGasPrice=K.gasPrice}return this._wrapTransactionReceipt(ne,K)}async getTransactionResult(G){const{result:K}=await(0,he.resolveProperties)({network:this.getNetwork(),result:_assertClassBrand(Ue,this,_perform).call(this,{method:"getTransactionResult",hash:G})});return null==K?null:(0,he.hexlify)(K)}async getLogs(G){let K=this._getFilter(G);isPromise(K)&&(K=await K);const{network:ne,params:ue}=await(0,he.resolveProperties)({network:this.getNetwork(),params:_assertClassBrand(Ue,this,_perform).call(this,{method:"getLogs",filter:K})});return ue.map((G=>this._wrapLog(G,ne)))}_getProvider(G){(0,he.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(G){return await ye.EnsResolver.fromName(this,G)}async getAvatar(G){const K=await this.getResolver(G);return K?await K.getAvatar():null}async resolveName(G){const K=await this.getResolver(G);return K?await K.getAddress():null}async lookupAddress(pe){pe=(0,G.getAddress)(pe);const me=(0,ue.namehash)(pe.substring(2).toLowerCase()+".addr.reverse");try{const G=await ye.EnsResolver.getEnsAddress(this),ue=new ne.Contract(G,["function resolver(bytes32) view returns (address)"],this),he=await ue.resolver(me);if(null==he||he===K.ZeroAddress)return null;const be=new ne.Contract(he,["function name(bytes32) view returns (string)"],this),ve=await be.name(me);return await this.resolveName(ve)!==pe?null:ve}catch(G){if((0,he.isError)(G,"BAD_DATA")&&"0x"===G.value)return null;if((0,he.isError)(G,"CALL_EXCEPTION"))return null;throw G}return null}async waitForTransaction(G,K,ne){const ue=null!=K?K:1;return 0===ue?this.getTransactionReceipt(G):new Promise((async(K,pe)=>{let ye=null;const listener=async ne=>{try{const pe=await this.getTransactionReceipt(G);if(null!=pe&&ne-pe.blockNumber+1>=ue)return K(pe),void(ye&&(clearTimeout(ye),ye=null))}catch(G){console.log("EEE",G)}this.once("block",listener)};null!=ne&&(ye=setTimeout((()=>{null!=ye&&(ye=null,this.off("block",listener),pe((0,he.makeError)("timeout","TIMEOUT",{reason:"timeout"})))}),ne)),listener(await this.getBlockNumber())}))}async waitForBlock(G){(0,he.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(G){const K=_classPrivateFieldGet2(Fe,this).get(G);K&&(K.timer&&clearTimeout(K.timer),_classPrivateFieldGet2(Fe,this).delete(G))}_setTimeout(G,K){var ne,ue;null==K&&(K=0);const pe=(_classPrivateFieldSet2(Be,this,(ne=_classPrivateFieldGet2(Be,this),ue=ne++,ne)),ue),func=()=>{_classPrivateFieldGet2(Fe,this).delete(pe),G()};if(this.paused)_classPrivateFieldGet2(Fe,this).set(pe,{timer:null,func:func,time:K});else{const G=setTimeout(func,K);_classPrivateFieldGet2(Fe,this).set(pe,{timer:G,func:func,time:getTime()})}return pe}_forEachSubscriber(G){for(const K of _classPrivateFieldGet2(Pe,this).values())G(K.subscriber)}_getSubscriber(G){switch(G.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(G.type);case"block":{const G=new _e.PollingBlockSubscriber(this);return G.pollingInterval=this.pollingInterval,G}case"safe":case"finalized":return new _e.PollingBlockTagSubscriber(this,G.type);case"event":return new _e.PollingEventSubscriber(this,G.filter);case"transaction":return new _e.PollingTransactionSubscriber(this,G.hash);case"orphan":return new _e.PollingOrphanSubscriber(this,G.filter)}throw new Error(`unsupported event: ${G.type}`)}_recoverSubscriber(G,K){for(const ne of _classPrivateFieldGet2(Pe,this).values())if(ne.subscriber===G){ne.started&&ne.subscriber.stop(),ne.subscriber=K,ne.started&&K.start(),null!=_classPrivateFieldGet2(Ce,this)&&K.pause(_classPrivateFieldGet2(Ce,this));break}}async on(G,K){const ne=await _assertClassBrand(Ue,this,_getSub).call(this,G);return ne.listeners.push({listener:K,once:!1}),ne.started||(ne.subscriber.start(),ne.started=!0,null!=_classPrivateFieldGet2(Ce,this)&&ne.subscriber.pause(_classPrivateFieldGet2(Ce,this))),this}async once(G,K){const ne=await _assertClassBrand(Ue,this,_getSub).call(this,G);return ne.listeners.push({listener:K,once:!0}),ne.started||(ne.subscriber.start(),ne.started=!0,null!=_classPrivateFieldGet2(Ce,this)&&ne.subscriber.pause(_classPrivateFieldGet2(Ce,this))),this}async emit(G,...K){const ne=await _assertClassBrand(Ue,this,_hasSub).call(this,G,K);if(!ne||0===ne.listeners.length)return!1;const ue=ne.listeners.length;return ne.listeners=ne.listeners.filter((({listener:ne,once:ue})=>{const pe=new he.EventPayload(this,ue?null:ne,G);try{ne.call(this,...K,pe)}catch(G){}return!ue})),0===ne.listeners.length&&(ne.started&&ne.subscriber.stop(),_classPrivateFieldGet2(Pe,this).delete(ne.tag)),ue>0}async listenerCount(G){if(G){const K=await _assertClassBrand(Ue,this,_hasSub).call(this,G);return K?K.listeners.length:0}let K=0;for(const{listeners:G}of _classPrivateFieldGet2(Pe,this).values())K+=G.length;return K}async listeners(G){if(G){const K=await _assertClassBrand(Ue,this,_hasSub).call(this,G);return K?K.listeners.map((({listener:G})=>G)):[]}let K=[];for(const{listeners:G}of _classPrivateFieldGet2(Pe,this).values())K=K.concat(G.map((({listener:G})=>G)));return K}async off(G,K){const ne=await _assertClassBrand(Ue,this,_hasSub).call(this,G);if(!ne)return this;if(K){const G=ne.listeners.map((({listener:G})=>G)).indexOf(K);G>=0&&ne.listeners.splice(G,1)}return K&&0!==ne.listeners.length||(ne.started&&ne.subscriber.stop(),_classPrivateFieldGet2(Pe,this).delete(ne.tag)),this}async removeAllListeners(G){if(G){const{tag:K,started:ne,subscriber:ue}=await _assertClassBrand(Ue,this,_getSub).call(this,G);ne&&ue.stop(),_classPrivateFieldGet2(Pe,this).delete(K)}else for(const[G,{started:K,subscriber:ne}]of _classPrivateFieldGet2(Pe,this))K&&ne.stop(),_classPrivateFieldGet2(Pe,this).delete(G);return this}async addListener(G,K){return await this.on(G,K)}async removeListener(G,K){return this.off(G,K)}get destroyed(){return _classPrivateFieldGet2(ke,this)}destroy(){this.removeAllListeners();for(const G of _classPrivateFieldGet2(Fe,this).keys())this._clearTimeout(G);_classPrivateFieldSet2(ke,this,!0)}get paused(){return null!=_classPrivateFieldGet2(Ce,this)}set paused(G){!!G!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(G){if(_classPrivateFieldSet2(Me,this,-1),null!=_classPrivateFieldGet2(Ce,this)){if(_classPrivateFieldGet2(Ce,this)==!!G)return;(0,he.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((K=>K.pause(G))),_classPrivateFieldSet2(Ce,this,!!G);for(const G of _classPrivateFieldGet2(Fe,this).values())G.timer&&clearTimeout(G.timer),G.time=getTime()-G.time}resume(){if(null!=_classPrivateFieldGet2(Ce,this)){this._forEachSubscriber((G=>G.resume())),_classPrivateFieldSet2(Ce,this,null);for(const G of _classPrivateFieldGet2(Fe,this).values()){let K=G.time;K<0&&(K=0),G.time=getTime(),setTimeout(G.func,K)}}}};const je=new Uint8Array([]);function encodeBytes(G){const K=[];let ne=0;for(let ue=0;ue<G.length;ue++)K.push(je),ne+=32;for(let ue=0;ue<G.length;ue++){const pe=(0,he.getBytes)(G[ue]);K[ue]=numPad(ne),K.push(numPad(pe.length)),K.push(bytesPad(pe)),ne+=32+32*Math.ceil(pe.length/32)}return(0,he.concat)(K)}const ze="0x0000000000000000000000000000000000000000000000000000000000000000";return uD}var _D,TD={};function requireAbstractSigner(){if(_D)return TD;_D=1,Object.defineProperty(TD,"__esModule",{value:!0}),TD.VoidSigner=TD.AbstractSigner=void 0;const G=requireAddress$2(),K=requireTransaction(),ne=requireUtils$4(),ue=requireProvider();function checkProvider(G,K){if(G.provider)return G.provider;(0,ne.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:K})}async function populate(K,pe){let he=(0,ue.copyRequest)(pe);if(null!=he.to&&(he.to=(0,G.resolveAddress)(he.to,K)),null!=he.from){const ue=he.from;he.from=Promise.all([K.getAddress(),(0,G.resolveAddress)(ue,K)]).then((([G,K])=>((0,ne.assertArgument)(G.toLowerCase()===K.toLowerCase(),"transaction from mismatch","tx.from",K),G)))}else he.from=K.getAddress();return await(0,ne.resolveProperties)(he)}class AbstractSigner{constructor(G){_defineProperty(this,"provider",void 0),(0,ne.defineProperties)(this,{provider:G||null})}async getNonce(G){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),G)}async populateCall(G){return await populate(this,G)}async populateTransaction(G){const K=checkProvider(this,"populateTransaction"),ue=await populate(this,G);null==ue.nonce&&(ue.nonce=await this.getNonce("pending")),null==ue.gasLimit&&(ue.gasLimit=await this.estimateGas(ue));const pe=await this.provider.getNetwork();if(null!=ue.chainId){const K=(0,ne.getBigInt)(ue.chainId);(0,ne.assertArgument)(K===pe.chainId,"transaction chainId mismatch","tx.chainId",G.chainId)}else ue.chainId=pe.chainId;const he=null!=ue.maxFeePerGas||null!=ue.maxPriorityFeePerGas;if(null==ue.gasPrice||2!==ue.type&&!he?0!==ue.type&&1!==ue.type||!he||(0,ne.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",G):(0,ne.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",G),2!==ue.type&&null!=ue.type||null==ue.maxFeePerGas||null==ue.maxPriorityFeePerGas)if(0===ue.type||1===ue.type){const G=await K.getFeeData();(0,ne.assert)(null!=G.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==ue.gasPrice&&(ue.gasPrice=G.gasPrice)}else{const G=await K.getFeeData();if(null==ue.type)if(null!=G.maxFeePerGas&&null!=G.maxPriorityFeePerGas)if(ue.type=2,null!=ue.gasPrice){const G=ue.gasPrice;delete ue.gasPrice,ue.maxFeePerGas=G,ue.maxPriorityFeePerGas=G}else null==ue.maxFeePerGas&&(ue.maxFeePerGas=G.maxFeePerGas),null==ue.maxPriorityFeePerGas&&(ue.maxPriorityFeePerGas=G.maxPriorityFeePerGas);else null!=G.gasPrice?((0,ne.assert)(!he,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==ue.gasPrice&&(ue.gasPrice=G.gasPrice),ue.type=0):(0,ne.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2===ue.type&&(null==ue.maxFeePerGas&&(ue.maxFeePerGas=G.maxFeePerGas),null==ue.maxPriorityFeePerGas&&(ue.maxPriorityFeePerGas=G.maxPriorityFeePerGas))}else ue.type=2;return await(0,ne.resolveProperties)(ue)}async estimateGas(G){return checkProvider(this,"estimateGas").estimateGas(await this.populateCall(G))}async call(G){return checkProvider(this,"call").call(await this.populateCall(G))}async resolveName(G){const K=checkProvider(this,"resolveName");return await K.resolveName(G)}async sendTransaction(G){const ne=checkProvider(this,"sendTransaction"),ue=await this.populateTransaction(G);delete ue.from;const pe=K.Transaction.from(ue);return await ne.broadcastTransaction(await this.signTransaction(pe))}}TD.AbstractSigner=AbstractSigner;var pe=new WeakSet;class VoidSigner extends AbstractSigner{constructor(G,K){super(K),_classPrivateMethodInitSpec(this,pe),_defineProperty(this,"address",void 0),(0,ne.defineProperties)(this,{address:G})}async getAddress(){return this.address}connect(G){return new VoidSigner(this.address,G)}async signTransaction(G){_assertClassBrand(pe,this,_throwUnsupported).call(this,"transactions","signTransaction")}async signMessage(G){_assertClassBrand(pe,this,_throwUnsupported).call(this,"messages","signMessage")}async signTypedData(G,K,ne){_assertClassBrand(pe,this,_throwUnsupported).call(this,"typed-data","signTypedData")}}function _throwUnsupported(G,K){(0,ne.assert)(!1,`VoidSigner cannot sign ${G}`,"UNSUPPORTED_OPERATION",{operation:K})}return TD.VoidSigner=VoidSigner,TD}var AD,ED={};function requireCommunity(){if(AD)return ED;AD=1,Object.defineProperty(ED,"__esModule",{value:!0}),ED.showThrottleMessage=void 0;const G=new Set;return ED.showThrottleMessage=function showThrottleMessage(K){G.has(K)||(G.add(K),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${K} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))},ED}var PD,SD,ID,CD={},RD={},kD={},OD={};function requireSubscriberFilterid(){if(PD)return OD;PD=1,Object.defineProperty(OD,"__esModule",{value:!0}),OD.FilterIdPendingSubscriber=OD.FilterIdEventSubscriber=OD.FilterIdSubscriber=void 0;const G=requireUtils$4(),K=requireSubscriberPolling();var ne=new WeakMap,ue=new WeakMap,pe=new WeakMap,he=new WeakMap,ye=new WeakMap,me=new WeakMap,be=new WeakSet;class FilterIdSubscriber{constructor(G){_classPrivateMethodInitSpec(this,be),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldInitSpec(this,he,void 0),_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldInitSpec(this,me,void 0),_classPrivateFieldSet2(ne,this,G),_classPrivateFieldSet2(ue,this,null),_classPrivateFieldSet2(pe,this,_assertClassBrand(be,this,_poll).bind(this)),_classPrivateFieldSet2(he,this,!1),_classPrivateFieldSet2(ye,this,null),_classPrivateFieldSet2(me,this,!1)}_subscribe(G){throw new Error("subclasses must override this")}_emitResults(G,K){throw new Error("subclasses must override this")}_recover(G){throw new Error("subclasses must override this")}start(){_classPrivateFieldGet2(he,this)||(_classPrivateFieldSet2(he,this,!0),_assertClassBrand(be,this,_poll).call(this,-2))}stop(){_classPrivateFieldGet2(he,this)&&(_classPrivateFieldSet2(he,this,!1),_classPrivateFieldSet2(me,this,!0),_assertClassBrand(be,this,_teardown).call(this),_classPrivateFieldGet2(ne,this).off("block",_classPrivateFieldGet2(pe,this)))}pause(G){G&&_assertClassBrand(be,this,_teardown).call(this),_classPrivateFieldGet2(ne,this).off("block",_classPrivateFieldGet2(pe,this))}resume(){this.start()}}async function _poll(K){try{null==_classPrivateFieldGet2(ue,this)&&_classPrivateFieldSet2(ue,this,this._subscribe(_classPrivateFieldGet2(ne,this)));let K=null;try{K=await _classPrivateFieldGet2(ue,this)}catch(K){if(!(0,G.isError)(K,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==K.operation)throw K}if(null==K)return _classPrivateFieldSet2(ue,this,null),void _classPrivateFieldGet2(ne,this)._recoverSubscriber(this,this._recover(_classPrivateFieldGet2(ne,this)));const pe=await _classPrivateFieldGet2(ne,this).getNetwork();if(_classPrivateFieldGet2(ye,this)||_classPrivateFieldSet2(ye,this,pe),_classPrivateFieldGet2(ye,this).chainId!==pe.chainId)throw new Error("chaid changed");if(_classPrivateFieldGet2(me,this))return;const he=await _classPrivateFieldGet2(ne,this).send("eth_getFilterChanges",[K]);await this._emitResults(_classPrivateFieldGet2(ne,this),he)}catch(G){console.log("@TODO",G)}_classPrivateFieldGet2(ne,this).once("block",_classPrivateFieldGet2(pe,this))}function _teardown(){const G=_classPrivateFieldGet2(ue,this);G&&(_classPrivateFieldSet2(ue,this,null),G.then((G=>{_classPrivateFieldGet2(ne,this).send("eth_uninstallFilter",[G])})))}OD.FilterIdSubscriber=FilterIdSubscriber;var ve=new WeakMap;OD.FilterIdEventSubscriber=class FilterIdEventSubscriber extends FilterIdSubscriber{constructor(G,K){super(G),_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldSet2(ve,this,function copy(G){return JSON.parse(JSON.stringify(G))}(K))}_recover(G){return new K.PollingEventSubscriber(G,_classPrivateFieldGet2(ve,this))}async _subscribe(G){return await G.send("eth_newFilter",[_classPrivateFieldGet2(ve,this)])}async _emitResults(G,K){for(const ne of K)G.emit(_classPrivateFieldGet2(ve,this),G._wrapLog(ne,G._network))}};return OD.FilterIdPendingSubscriber=class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(G){return await G.send("eth_newPendingTransactionFilter",[])}async _emitResults(G,K){for(const ne of K)G.emit("pending",ne)}},OD}function requireProviderJsonrpc(){if(SD)return kD;SD=1,Object.defineProperty(kD,"__esModule",{value:!0}),kD.JsonRpcProvider=kD.JsonRpcApiPollingProvider=kD.JsonRpcApiProvider=kD.JsonRpcSigner=void 0;const G=requireAbi(),K=requireAddress$2(),ne=requireHash(),ue=requireTransaction(),pe=requireUtils$4(),he=requireAbstractProvider(),ye=requireAbstractSigner(),me=requireNetwork(),be=requireSubscriberFilterid(),ve=requireSubscriberPolling(),_e="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(G){if(null==G||_e.indexOf(typeof G)>=0)return G;if("function"==typeof G.getAddress)return G;if(Array.isArray(G))return G.map(deepCopy);if("object"==typeof G)return Object.keys(G).reduce(((K,ne)=>(K[ne]=G[ne],K)),{});throw new Error(`should not happen: ${G} (${typeof G})`)}function stall(G){return new Promise((K=>{setTimeout(K,G)}))}function getLowerCase(G){return G?G.toLowerCase():G}function isPollable(G){return G&&"number"==typeof G.pollingInterval}const Te={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class JsonRpcSigner extends ye.AbstractSigner{constructor(G,ne){super(G),_defineProperty(this,"address",void 0),ne=(0,K.getAddress)(ne),(0,pe.defineProperties)(this,{address:ne})}connect(G){(0,pe.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(G){return await this.populateCall(G)}async sendUncheckedTransaction(G){const ne=deepCopy(G),ue=[];if(ne.from){const he=ne.from;ue.push((async()=>{const ue=await(0,K.resolveAddress)(he,this.provider);(0,pe.assertArgument)(null!=ue&&ue.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",G),ne.from=ue})())}else ne.from=this.address;if(null==ne.gasLimit&&ue.push((async()=>{ne.gasLimit=await this.provider.estimateGas({...ne,from:this.address})})()),null!=ne.to){const G=ne.to;ue.push((async()=>{ne.to=await(0,K.resolveAddress)(G,this.provider)})())}ue.length&&await Promise.all(ue);const he=this.provider.getRpcTransaction(ne);return this.provider.send("eth_sendTransaction",[he])}async sendTransaction(G){const K=await this.provider.getBlockNumber(),ne=await this.sendUncheckedTransaction(G);return await new Promise(((G,ue)=>{const he=[1e3,100];let ye=0;const checkTx=async()=>{try{const ue=await this.provider.getTransaction(ne);if(null!=ue)return void G(ue.replaceableTransaction(K))}catch(G){if((0,pe.isError)(G,"CANCELLED")||(0,pe.isError)(G,"BAD_DATA")||(0,pe.isError)(G,"NETWORK_ERROR"))return null==G.info&&(G.info={}),G.info.sendTransactionHash=ne,void ue(G);if((0,pe.isError)(G,"INVALID_ARGUMENT")&&(ye++,null==G.info&&(G.info={}),G.info.sendTransactionHash=ne,ye>10))return void ue(G);this.provider.emit("error",(0,pe.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:G}))}this.provider._setTimeout((()=>{checkTx()}),he.pop()||4e3)};checkTx()}))}async signTransaction(G){const ne=deepCopy(G);if(ne.from){const ue=await(0,K.resolveAddress)(ne.from,this.provider);(0,pe.assertArgument)(null!=ue&&ue.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",G),ne.from=ue}else ne.from=this.address;const ue=this.provider.getRpcTransaction(ne);return await this.provider.send("eth_signTransaction",[ue])}async signMessage(G){const K="string"==typeof G?(0,pe.toUtf8Bytes)(G):G;return await this.provider.send("personal_sign",[(0,pe.hexlify)(K),this.address.toLowerCase()])}async signTypedData(G,ue,he){const ye=deepCopy(he),me=await ne.TypedDataEncoder.resolveNames(G,ue,ye,(async G=>{const ne=await(0,K.resolveAddress)(G);return(0,pe.assertArgument)(null!=ne,"TypedData does not support null address","value",G),ne}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ne.TypedDataEncoder.getPayload(me.domain,ue,me.value))])}async unlock(G){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),G,null])}async _legacySignMessage(G){const K="string"==typeof G?(0,pe.toUtf8Bytes)(G):G;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,pe.hexlify)(K)])}}kD.JsonRpcSigner=JsonRpcSigner;var Ee=new WeakMap,Pe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Oe=new WeakMap,xe=new WeakMap,Ne=new WeakSet;class JsonRpcApiProvider extends he.AbstractProvider{constructor(G,K){super(G,K),_classPrivateMethodInitSpec(this,Ne),_classPrivateFieldInitSpec(this,Ee,void 0),_classPrivateFieldInitSpec(this,Pe,void 0),_classPrivateFieldInitSpec(this,Se,void 0),_classPrivateFieldInitSpec(this,Ce,void 0),_classPrivateFieldInitSpec(this,ke,void 0),_classPrivateFieldInitSpec(this,Oe,void 0),_classPrivateFieldInitSpec(this,xe,void 0),_classPrivateFieldSet2(Pe,this,1),_classPrivateFieldSet2(Ee,this,Object.assign({},Te,K||{})),_classPrivateFieldSet2(Se,this,[]),_classPrivateFieldSet2(Ce,this,null),_classPrivateFieldSet2(Oe,this,null),_classPrivateFieldSet2(xe,this,null);{let G=null;const K=new Promise((K=>{G=K}));_classPrivateFieldSet2(ke,this,{promise:K,resolve:G})}const ne=this._getOption("staticNetwork");"boolean"==typeof ne?((0,pe.assertArgument)(!ne||"any"!==G,"staticNetwork cannot be used on special network 'any'","options",K),ne&&null!=G&&_classPrivateFieldSet2(Oe,this,me.Network.from(G))):ne&&((0,pe.assertArgument)(null==G||ne.matches(G),"staticNetwork MUST match network object","options",K),_classPrivateFieldSet2(Oe,this,ne))}_getOption(G){return _classPrivateFieldGet2(Ee,this)[G]}get _network(){return(0,pe.assert)(_classPrivateFieldGet2(Oe,this),"network is not available yet","NETWORK_ERROR"),_classPrivateFieldGet2(Oe,this)}async _perform(G){if("call"===G.method||"estimateGas"===G.method){let K=G.transaction;if(K&&null!=K.type&&(0,pe.getBigInt)(K.type)&&null==K.maxFeePerGas&&null==K.maxPriorityFeePerGas){const ne=await this.getFeeData();null==ne.maxFeePerGas&&null==ne.maxPriorityFeePerGas&&(G=Object.assign({},G,{transaction:Object.assign({},K,{type:void 0})}))}}const K=this.getRpcRequest(G);return null!=K?await this.send(K.method,K.args):super._perform(G)}async _detectNetwork(){const G=this._getOption("staticNetwork");if(G){if(!0!==G)return G;if(_classPrivateFieldGet2(Oe,this))return _classPrivateFieldGet2(Oe,this)}return _classPrivateFieldGet2(xe,this)?await _classPrivateFieldGet2(xe,this):this.ready?(_classPrivateFieldSet2(xe,this,(async()=>{try{const G=me.Network.from((0,pe.getBigInt)(await this.send("eth_chainId",[])));return _classPrivateFieldSet2(xe,this,null),G}catch(G){throw _classPrivateFieldSet2(xe,this,null),G}})()),await _classPrivateFieldGet2(xe,this)):(_classPrivateFieldSet2(xe,this,(async(G,K)=>{const ne={id:(_classPrivateFieldSet2(Pe,this,(G=_classPrivateFieldGet2(Pe,this),K=G++,G)),K),method:"eth_chainId",params:[],jsonrpc:"2.0"};let ue;this.emit("debug",{action:"sendRpcPayload",payload:ne});try{ue=(await this._send(ne))[0],_classPrivateFieldSet2(xe,this,null)}catch(G){throw _classPrivateFieldSet2(xe,this,null),this.emit("debug",{action:"receiveRpcError",error:G}),G}if(this.emit("debug",{action:"receiveRpcResult",result:ue}),"result"in ue)return me.Network.from((0,pe.getBigInt)(ue.result));throw this.getRpcError(ne,ue)})()),await _classPrivateFieldGet2(xe,this))}_start(){null!=_classPrivateFieldGet2(ke,this)&&null!=_classPrivateFieldGet2(ke,this).resolve&&(_classPrivateFieldGet2(ke,this).resolve(),_classPrivateFieldSet2(ke,this,null),(async()=>{for(;null==_classPrivateFieldGet2(Oe,this)&&!this.destroyed;)try{_classPrivateFieldSet2(Oe,this,await this._detectNetwork())}catch(G){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,pe.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:G}})),await stall(1e3)}_assertClassBrand(Ne,this,_scheduleDrain).call(this)})())}async _waitUntilReady(){if(null!=_classPrivateFieldGet2(ke,this))return await _classPrivateFieldGet2(ke,this).promise}_getSubscriber(G){return"pending"===G.type?new be.FilterIdPendingSubscriber(this):"event"===G.type?this._getOption("polling")?new ve.PollingEventSubscriber(this,G.filter):new be.FilterIdEventSubscriber(this,G.filter):"orphan"===G.type&&"drop-log"===G.filter.orphan?new he.UnmanagedSubscriber("orphan"):super._getSubscriber(G)}get ready(){return null==_classPrivateFieldGet2(ke,this)}getRpcTransaction(G){const K={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((ne=>{if(null==G[ne])return;let ue=ne;"gasLimit"===ne&&(ue="gas"),K[ue]=(0,pe.toQuantity)((0,pe.getBigInt)(G[ne],`tx.${ne}`))})),["from","to","data"].forEach((ne=>{null!=G[ne]&&(K[ne]=(0,pe.hexlify)(G[ne]))})),G.accessList&&(K.accessList=(0,ue.accessListify)(G.accessList)),K}getRpcRequest(G){switch(G.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[getLowerCase(G.address),G.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[getLowerCase(G.address),G.blockTag]};case"getCode":return{method:"eth_getCode",args:[getLowerCase(G.address),G.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[getLowerCase(G.address),"0x"+G.position.toString(16),G.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[G.signedTransaction]};case"getBlock":if("blockTag"in G)return{method:"eth_getBlockByNumber",args:[G.blockTag,!!G.includeTransactions]};if("blockHash"in G)return{method:"eth_getBlockByHash",args:[G.blockHash,!!G.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[G.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[G.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(G.transaction),G.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(G.transaction)]};case"getLogs":return G.filter&&null!=G.filter.address&&(Array.isArray(G.filter.address)?G.filter.address=G.filter.address.map(getLowerCase):G.filter.address=getLowerCase(G.filter.address)),{method:"eth_getLogs",args:[G.filter]}}return null}getRpcError(K,ne){const{method:ue}=K,{error:he}=ne;if("eth_estimateGas"===ue&&he.message){const G=he.message;if(!G.match(/revert/i)&&G.match(/insufficient funds/i))return(0,pe.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:K.params[0],info:{payload:K,error:he}})}if("eth_call"===ue||"eth_estimateGas"===ue){const ne=spelunkData(he),pe=G.AbiCoder.getBuiltinCallException("eth_call"===ue?"call":"estimateGas",K.params[0],ne?ne.data:null);return pe.info={error:he,payload:K},pe}const ye=JSON.stringify(function spelunkMessage(G){const K=[];return _spelunkMessage(G,K),K}(he));if("string"==typeof he.message&&he.message.match(/user denied|ethers-user-denied/i)){const G={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,pe.makeError)("user rejected action","ACTION_REJECTED",{action:G[ue]||"unknown",reason:"rejected",info:{payload:K,error:he}})}if("eth_sendRawTransaction"===ue||"eth_sendTransaction"===ue){const G=K.params[0];if(ye.match(/insufficient funds|base fee exceeds gas limit/i))return(0,pe.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:G,info:{error:he}});if(ye.match(/nonce/i)&&ye.match(/too low/i))return(0,pe.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:G,info:{error:he}});if(ye.match(/replacement transaction/i)&&ye.match(/underpriced/i))return(0,pe.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:G,info:{error:he}});if(ye.match(/only replay-protected/i))return(0,pe.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:ue,info:{transaction:G,info:{error:he}}})}let me=!!ye.match(/the method .* does not exist/i);return me||he&&he.details&&he.details.startsWith("Unauthorized method:")&&(me=!0),me?(0,pe.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:K.method,info:{error:he,payload:K}}):(0,pe.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:he,payload:K})}send(G,K){var ne,ue;if(this.destroyed)return Promise.reject((0,pe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:G}));const he=(_classPrivateFieldSet2(Pe,this,(ne=_classPrivateFieldGet2(Pe,this),ue=ne++,ne)),ue),ye=new Promise(((ne,ue)=>{_classPrivateFieldGet2(Se,this).push({resolve:ne,reject:ue,payload:{method:G,params:K,id:he,jsonrpc:"2.0"}})}));return _assertClassBrand(Ne,this,_scheduleDrain).call(this),ye}async getSigner(G){null==G&&(G=0);const ne=this.send("eth_accounts",[]);if("number"==typeof G){const K=await ne;if(G>=K.length)throw new Error("no such account");return new JsonRpcSigner(this,K[G])}const{accounts:ue}=await(0,pe.resolveProperties)({network:this.getNetwork(),accounts:ne});G=(0,K.getAddress)(G);for(const ne of ue)if((0,K.getAddress)(ne)===G)return new JsonRpcSigner(this,G);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((G=>new JsonRpcSigner(this,G)))}destroy(){_classPrivateFieldGet2(Ce,this)&&(clearTimeout(_classPrivateFieldGet2(Ce,this)),_classPrivateFieldSet2(Ce,this,null));for(const{payload:G,reject:K}of _classPrivateFieldGet2(Se,this))K((0,pe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:G.method}));_classPrivateFieldSet2(Se,this,[]),super.destroy()}}function _scheduleDrain(){if(_classPrivateFieldGet2(Ce,this))return;const G=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");_classPrivateFieldSet2(Ce,this,setTimeout((()=>{_classPrivateFieldSet2(Ce,this,null);const G=_classPrivateFieldGet2(Se,this);for(_classPrivateFieldSet2(Se,this,[]);G.length;){const K=[G.shift()];for(;G.length&&K.length!==_classPrivateFieldGet2(Ee,this).batchMaxCount;){K.push(G.shift());const ne=JSON.stringify(K.map((G=>G.payload)));if(ne.length>_classPrivateFieldGet2(Ee,this).batchMaxSize){G.unshift(K.pop());break}}(async()=>{const G=1===K.length?K[0].payload:K.map((G=>G.payload));this.emit("debug",{action:"sendRpcPayload",payload:G});try{const ne=await this._send(G);this.emit("debug",{action:"receiveRpcResult",result:ne});for(const{resolve:G,reject:ue,payload:he}of K){if(this.destroyed){ue((0,pe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:he.method}));continue}const K=ne.filter((G=>G.id===he.id))[0];if(null!=K)"error"in K?ue(this.getRpcError(he,K)):G(K.result);else{const G=(0,pe.makeError)("missing response for request","BAD_DATA",{value:ne,info:{payload:he}});this.emit("error",G),ue(G)}}}catch(G){this.emit("debug",{action:"receiveRpcError",error:G});for(const{reject:ne}of K)ne(G)}})()}}),G))}kD.JsonRpcApiProvider=JsonRpcApiProvider;var Me=new WeakMap;class JsonRpcApiPollingProvider extends JsonRpcApiProvider{constructor(G,K){super(G,K),_classPrivateFieldInitSpec(this,Me,void 0),_classPrivateFieldSet2(Me,this,4e3)}_getSubscriber(G){const K=super._getSubscriber(G);return isPollable(K)&&(K.pollingInterval=_classPrivateFieldGet2(Me,this)),K}get pollingInterval(){return _classPrivateFieldGet2(Me,this)}set pollingInterval(G){if(!Number.isInteger(G)||G<0)throw new Error("invalid interval");_classPrivateFieldSet2(Me,this,G),this._forEachSubscriber((G=>{isPollable(G)&&(G.pollingInterval=_classPrivateFieldGet2(Me,this))}))}}kD.JsonRpcApiPollingProvider=JsonRpcApiPollingProvider;var Be=new WeakMap;function spelunkData(G){if(null==G)return null;if("string"==typeof G.message&&G.message.match(/revert/i)&&(0,pe.isHexString)(G.data))return{message:G.message,data:G.data};if("object"==typeof G){for(const K in G){const ne=spelunkData(G[K]);if(ne)return ne}return null}if("string"==typeof G)try{return spelunkData(JSON.parse(G))}catch(G){}return null}function _spelunkMessage(G,K){if(null!=G){if("string"==typeof G.message&&K.push(G.message),"object"==typeof G)for(const ne in G)_spelunkMessage(G[ne],K);if("string"==typeof G)try{return _spelunkMessage(JSON.parse(G),K)}catch(G){}}}return kD.JsonRpcProvider=class JsonRpcProvider extends JsonRpcApiPollingProvider{constructor(G,K,ne){null==G&&(G="http://localhost:8545"),super(K,ne),_classPrivateFieldInitSpec(this,Be,void 0),_classPrivateFieldSet2(Be,this,"string"==typeof G?new pe.FetchRequest(G):G.clone())}_getConnection(){return _classPrivateFieldGet2(Be,this).clone()}async send(G,K){return await this._start(),await super.send(G,K)}async _send(G){const K=this._getConnection();K.body=JSON.stringify(G),K.setHeader("content-type","application/json");const ne=await K.send();ne.assertOk();let ue=ne.bodyJson;return Array.isArray(ue)||(ue=[ue]),ue}},kD}function requireProviderAnkr(){if(ID)return RD;ID=1,Object.defineProperty(RD,"__esModule",{value:!0}),RD.AnkrProvider=void 0;const G=requireUtils$4(),K=requireCommunity(),ne=requireNetwork(),ue=requireProviderJsonrpc(),pe="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class AnkrProvider extends ue.JsonRpcProvider{constructor(K,ue){null==K&&(K="mainnet");const he=ne.Network.from(K);null==ue&&(ue=pe);const ye={polling:!0,staticNetwork:he};super(AnkrProvider.getRequest(he,ue),he,ye),_defineProperty(this,"apiKey",void 0),(0,G.defineProperties)(this,{apiKey:ue})}_getProvider(G){try{return new AnkrProvider(G,this.apiKey)}catch(G){}return super._getProvider(G)}static getRequest(ne,ue){null==ue&&(ue=pe);const he=new G.FetchRequest(`https://${function getHost(K){switch(K){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,G.assertArgument)(!1,"unsupported network","network",K)}(ne.name)}/${ue}`);return he.allowGzip=!0,ue===pe&&(he.retryFunc=async(G,ne,ue)=>((0,K.showThrottleMessage)("AnkrProvider"),!0)),he}getRpcError(G,K){return"eth_sendRawTransaction"===G.method&&K&&K.error&&"INTERNAL_ERROR: could not replace existing tx"===K.error.message&&(K.error.message="replacement transaction underpriced"),super.getRpcError(G,K)}isCommunityResource(){return this.apiKey===pe}}return RD.AnkrProvider=AnkrProvider,RD}var xD,ND={};function requireProviderAlchemy(){if(xD)return ND;xD=1,Object.defineProperty(ND,"__esModule",{value:!0}),ND.AlchemyProvider=void 0;const G=requireUtils$4(),K=requireCommunity(),ne=requireNetwork(),ue=requireProviderJsonrpc(),pe="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class AlchemyProvider extends ue.JsonRpcProvider{constructor(K,ue){null==K&&(K="mainnet");const he=ne.Network.from(K);null==ue&&(ue=pe);super(AlchemyProvider.getRequest(he,ue),he,{staticNetwork:he}),_defineProperty(this,"apiKey",void 0),(0,G.defineProperties)(this,{apiKey:ue})}_getProvider(G){try{return new AlchemyProvider(G,this.apiKey)}catch(G){}return super._getProvider(G)}async _perform(K){if("getTransactionResult"===K.method){const{trace:ne,tx:ue}=await(0,G.resolveProperties)({trace:this.send("trace_transaction",[K.hash]),tx:this.getTransaction(K.hash)});if(null==ne||null==ue)return null;let pe,he=!1;try{pe=ne[0].result.output,he="Reverted"===ne[0].error}catch(G){}if(pe)return(0,G.assert)(!he,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:pe,reason:null,transaction:ue,invocation:null,revert:null}),pe;(0,G.assert)(!1,"could not parse trace result","BAD_DATA",{value:ne})}return await super._perform(K)}isCommunityResource(){return this.apiKey===pe}static getRequest(ne,ue){null==ue&&(ue=pe);const he=new G.FetchRequest(`https://${function getHost(K){switch(K){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,G.assertArgument)(!1,"unsupported network","network",K)}(ne.name)}/v2/${ue}`);return he.allowGzip=!0,ue===pe&&(he.retryFunc=async(G,ne,ue)=>((0,K.showThrottleMessage)("alchemy"),!0)),he}}return ND.AlchemyProvider=AlchemyProvider,ND}var MD,BD={};function requireProviderCloudflare(){if(MD)return BD;MD=1,Object.defineProperty(BD,"__esModule",{value:!0}),BD.CloudflareProvider=void 0;const G=requireUtils$4(),K=requireNetwork(),ne=requireProviderJsonrpc();class CloudflareProvider extends ne.JsonRpcProvider{constructor(ne){null==ne&&(ne="mainnet");const ue=K.Network.from(ne);(0,G.assertArgument)("mainnet"===ue.name,"unsupported network","network",ne),super("https://cloudflare-eth.com/",ue,{staticNetwork:ue})}}return BD.CloudflareProvider=CloudflareProvider,BD}var FD,DD={};function requireProviderEtherscan(){if(FD)return DD;FD=1,Object.defineProperty(DD,"__esModule",{value:!0}),DD.EtherscanProvider=DD.EtherscanPlugin=void 0;const G=requireAbi(),K=requireContract(),ne=requireTransaction(),ue=requireUtils$4(),pe=requireAbstractProvider(),he=requireNetwork(),ye=requirePluginsNetwork(),me=requireCommunity();const be="org.ethers.plugins.provider.Etherscan";class EtherscanPlugin extends ye.NetworkPlugin{constructor(G){super(be),_defineProperty(this,"baseUrl",void 0),(0,ue.defineProperties)(this,{baseUrl:G})}clone(){return new EtherscanPlugin(this.baseUrl)}}DD.EtherscanPlugin=EtherscanPlugin;const ve=["enableCcipRead"];let _e=1;var Te=new WeakMap;class EtherscanProvider extends pe.AbstractProvider{constructor(G,K){const ne=null!=K?K:null;super(),_defineProperty(this,"network",void 0),_defineProperty(this,"apiKey",void 0),_classPrivateFieldInitSpec(this,Te,void 0);const pe=he.Network.from(G);_classPrivateFieldSet2(Te,this,pe.getPlugin(be)),(0,ue.defineProperties)(this,{apiKey:ne,network:pe}),this.getBaseUrl()}getBaseUrl(){if(_classPrivateFieldGet2(Te,this))return _classPrivateFieldGet2(Te,this).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}(0,ue.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(G,K){const ne=Object.keys(K).reduce(((G,ne)=>{const ue=K[ne];return null!=ue&&(G+=`&${ne}=${ue}`),G}),""),ue=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${G}${ne}${ue}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(G,K){return K.module=G,K.apikey=this.apiKey,K}async detectNetwork(){return this.network}async fetch(G,K,ne){const pe=_e++,he=ne?this.getPostUrl():this.getUrl(G,K),ye=ne?this.getPostData(G,K):null;this.emit("debug",{action:"sendRequest",id:pe,url:he,payload:ye});const be=new ue.FetchRequest(he);be.setThrottleParams({slotInterval:1e3}),be.retryFunc=(G,K,ne)=>(this.isCommunityResource()&&(0,me.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),be.processFunc=async(K,ne)=>{const he=ne.hasBody()?JSON.parse((0,ue.toUtf8String)(ne.body)):{},ye=("string"==typeof he.result?he.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===G?he&&0==he.status&&"NOTOK"==he.message&&ye&&(this.emit("debug",{action:"receiveError",id:pe,reason:"proxy-NOTOK",error:he}),ne.throwThrottleError(he.result,2e3)):ye&&(this.emit("debug",{action:"receiveError",id:pe,reason:"null result",error:he.result}),ne.throwThrottleError(he.result,2e3)),ne},ye&&(be.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),be.body=Object.keys(ye).map((G=>`${G}=${ye[G]}`)).join("&"));const ve=await be.send();try{ve.assertOk()}catch(G){this.emit("debug",{action:"receiveError",id:pe,error:G,reason:"assertOk"}),(0,ue.assert)(!1,"response error","SERVER_ERROR",{request:be,response:ve})}ve.hasBody()||(this.emit("debug",{action:"receiveError",id:pe,error:"missing body",reason:"null body"}),(0,ue.assert)(!1,"missing response","SERVER_ERROR",{request:be,response:ve}));const Te=JSON.parse((0,ue.toUtf8String)(ve.body));return"proxy"===G?("2.0"!=Te.jsonrpc&&(this.emit("debug",{action:"receiveError",id:pe,result:Te,reason:"invalid JSON-RPC"}),(0,ue.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:be,response:ve,info:{result:Te}})),Te.error&&(this.emit("debug",{action:"receiveError",id:pe,result:Te,reason:"JSON-RPC error"}),(0,ue.assert)(!1,"error response","SERVER_ERROR",{request:be,response:ve,info:{result:Te}})),this.emit("debug",{action:"receiveRequest",id:pe,result:Te}),Te.result):0!=Te.status||"No records found"!==Te.message&&"No transactions found"!==Te.message?((1!=Te.status||"string"==typeof Te.message&&!Te.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:pe,result:Te}),(0,ue.assert)(!1,"error response","SERVER_ERROR",{request:be,response:ve,info:{result:Te}})),this.emit("debug",{action:"receiveRequest",id:pe,result:Te}),Te.result):(this.emit("debug",{action:"receiveRequest",id:pe,result:Te}),Te.result)}_getTransactionPostData(G){const K={};for(let pe in G){if(ve.indexOf(pe)>=0)continue;if(null==G[pe])continue;let he=G[pe];"type"===pe&&0===he||("blockTag"===pe&&"latest"===he||(he={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[pe]?(0,ue.toQuantity)(he):"accessList"===pe?"["+(0,ne.accessListify)(he).map((G=>`{address:"${G.address}",storageKeys:["${G.storageKeys.join('","')}"]}`)).join(",")+"]":(0,ue.hexlify)(he),K[pe]=he))}return K}_checkError(K,pe,he){let ye="";if((0,ue.isError)(pe,"SERVER_ERROR")){try{ye=pe.info.result.error.message}catch(G){}if(!ye)try{ye=pe.info.message}catch(G){}}if("estimateGas"===K.method&&!ye.match(/revert/i)&&ye.match(/insufficient funds/i)&&(0,ue.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:K.transaction}),("call"===K.method||"estimateGas"===K.method)&&ye.match(/execution reverted/i)){let ne="";try{ne=pe.info.result.error.data}catch(pe){}const ue=G.AbiCoder.getBuiltinCallException(K.method,K.transaction,ne);throw ue.info={request:K,error:pe},ue}if(ye&&"broadcastTransaction"===K.method){const G=ne.Transaction.from(K.signedTransaction);ye.match(/replacement/i)&&ye.match(/underpriced/i)&&(0,ue.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:G}),ye.match(/insufficient funds/)&&(0,ue.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:G}),ye.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,ue.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:G})}throw pe}async _detectNetwork(){return this.network}async _perform(G){switch(G.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if("mainnet"===this.network.name)return"1000000000";if("optimism"===this.network.name)return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:G.address,tag:G.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:G.address,tag:G.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:G.address,tag:G.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:G.address,position:G.position,tag:G.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:G.signedTransaction},!0).catch((K=>this._checkError(G,K,G.signedTransaction)));case"getBlock":if("blockTag"in G)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:G.blockTag,boolean:G.includeTransactions?"true":"false"});(0,ue.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:G.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:G.hash});case"call":{if("latest"!==G.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const K=this._getTransactionPostData(G.transaction);K.module="proxy",K.action="eth_call";try{return await this.fetch("proxy",K,!0)}catch(K){return this._checkError(G,K,G.transaction)}}case"estimateGas":{const K=this._getTransactionPostData(G.transaction);K.module="proxy",K.action="eth_estimateGas";try{return await this.fetch("proxy",K,!0)}catch(K){return this._checkError(G,K,G.transaction)}}}return super._perform(G)}async getNetwork(){return this.network}async getEtherPrice(){return"mainnet"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(G){let ne=this._getAddress(G);(function isPromise(G){return G&&"function"==typeof G.then})(ne)&&(ne=await ne);try{const G=await this.fetch("contract",{action:"getabi",address:ne}),ue=JSON.parse(G);return new K.Contract(ne,ue,this)}catch(G){return null}}isCommunityResource(){return null==this.apiKey}}return DD.EtherscanProvider=EtherscanProvider,DD}var LD,UD={},$D={},qD={};var GD,jD,HD,WD={};function requireProviderSocket(){if(GD)return WD;GD=1,Object.defineProperty(WD,"__esModule",{value:!0}),WD.SocketProvider=WD.SocketEventSubscriber=WD.SocketPendingSubscriber=WD.SocketBlockSubscriber=WD.SocketSubscriber=void 0;const G=requireAbstractProvider(),K=requireUtils$4(),ne=requireProviderJsonrpc();var ue=new WeakMap,pe=new WeakMap,he=new WeakMap,ye=new WeakMap,me=new WeakMap;class SocketSubscriber{get filter(){return JSON.parse(_classPrivateFieldGet2(pe,this))}constructor(G,K){_classPrivateFieldInitSpec(this,ue,void 0),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldInitSpec(this,he,void 0),_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldInitSpec(this,me,void 0),_classPrivateFieldSet2(ue,this,G),_classPrivateFieldSet2(pe,this,JSON.stringify(K)),_classPrivateFieldSet2(he,this,null),_classPrivateFieldSet2(ye,this,null),_classPrivateFieldSet2(me,this,null)}start(){_classPrivateFieldSet2(he,this,_classPrivateFieldGet2(ue,this).send("eth_subscribe",this.filter).then((G=>(_classPrivateFieldGet2(ue,this)._register(G,this),G))))}stop(){_classPrivateFieldGet2(he,this).then((G=>{_classPrivateFieldGet2(ue,this).send("eth_unsubscribe",[G])})),_classPrivateFieldSet2(he,this,null)}pause(G){(0,K.assert)(G,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),_classPrivateFieldSet2(ye,this,!!G)}resume(){_classPrivateFieldSet2(ye,this,null)}_handleMessage(G){if(null!=_classPrivateFieldGet2(he,this)&&null===_classPrivateFieldGet2(ye,this)){let K=_classPrivateFieldGet2(me,this);K=null==K?this._emit(_classPrivateFieldGet2(ue,this),G):K.then((async()=>{await this._emit(_classPrivateFieldGet2(ue,this),G)})),_classPrivateFieldSet2(me,this,K.then((()=>{_classPrivateFieldGet2(me,this)===K&&_classPrivateFieldSet2(me,this,null)})))}}async _emit(G,K){throw new Error("sub-classes must implemente this; _emit")}}WD.SocketSubscriber=SocketSubscriber;class SocketBlockSubscriber extends SocketSubscriber{constructor(G){super(G,["newHeads"])}async _emit(G,K){G.emit("block",parseInt(K.number))}}WD.SocketBlockSubscriber=SocketBlockSubscriber;class SocketPendingSubscriber extends SocketSubscriber{constructor(G){super(G,["newPendingTransactions"])}async _emit(G,K){G.emit("pending",K)}}WD.SocketPendingSubscriber=SocketPendingSubscriber;var be=new WeakMap;class SocketEventSubscriber extends SocketSubscriber{get logFilter(){return JSON.parse(_classPrivateFieldGet2(be,this))}constructor(G,K){super(G,["logs",K]),_classPrivateFieldInitSpec(this,be,void 0),_classPrivateFieldSet2(be,this,JSON.stringify(K))}async _emit(G,K){G.emit(this.logFilter,G._wrapLog(K,G._network))}}WD.SocketEventSubscriber=SocketEventSubscriber;var ve=new WeakMap,_e=new WeakMap,Te=new WeakMap;class SocketProvider extends ne.JsonRpcApiProvider{constructor(G,ne){const ue=Object.assign({},null!=ne?ne:{});(0,K.assertArgument)(null==ue.batchMaxCount||1===ue.batchMaxCount,"sockets-based providers do not support batches","options.batchMaxCount",ne),ue.batchMaxCount=1,null==ue.staticNetwork&&(ue.staticNetwork=!0),super(G,ue),_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldInitSpec(this,_e,void 0),_classPrivateFieldInitSpec(this,Te,void 0),_classPrivateFieldSet2(ve,this,new Map),_classPrivateFieldSet2(_e,this,new Map),_classPrivateFieldSet2(Te,this,new Map)}_getSubscriber(K){switch(K.type){case"close":return new G.UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,K.filter);case"orphan":if("drop-log"===K.filter.orphan)return new G.UnmanagedSubscriber("drop-log")}return super._getSubscriber(K)}_register(G,K){_classPrivateFieldGet2(_e,this).set(G,K);const ne=_classPrivateFieldGet2(Te,this).get(G);if(ne){for(const G of ne)K._handleMessage(G);_classPrivateFieldGet2(Te,this).delete(G)}}async _send(G){(0,K.assertArgument)(!Array.isArray(G),"WebSocket does not support batch send","payload",G);const ne=new Promise(((K,ne)=>{_classPrivateFieldGet2(ve,this).set(G.id,{payload:G,resolve:K,reject:ne})}));return await this._waitUntilReady(),await this._write(JSON.stringify(G)),[await ne]}async _processMessage(G){const ne=JSON.parse(G);if(ne&&"object"==typeof ne&&"id"in ne){const G=_classPrivateFieldGet2(ve,this).get(ne.id);if(null==G)return void this.emit("error",(0,K.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:ne}));_classPrivateFieldGet2(ve,this).delete(ne.id),G.resolve(ne)}else{if(!ne||"eth_subscription"!==ne.method)return void this.emit("error",(0,K.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:ne}));{const G=ne.params.subscription,K=_classPrivateFieldGet2(_e,this).get(G);if(K)K._handleMessage(ne.params.result);else{let K=_classPrivateFieldGet2(Te,this).get(G);null==K&&(K=[],_classPrivateFieldGet2(Te,this).set(G,K)),K.push(ne.params.result)}}}}async _write(G){throw new Error("sub-classes must override this")}}return WD.SocketProvider=SocketProvider,WD}function requireProviderWebsocket(){if(jD)return $D;jD=1,Object.defineProperty($D,"__esModule",{value:!0}),$D.WebSocketProvider=void 0;const G=function requireWsBrowser(){if(LD)return qD;LD=1,Object.defineProperty(qD,"__esModule",{value:!0}),qD.WebSocket=void 0;const G=function getGlobal(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==pn)return pn;throw new Error("unable to locate global object")}().WebSocket;return qD.WebSocket=G,qD}(),K=requireProviderSocket();var ne=new WeakMap,ue=new WeakMap;class WebSocketProvider extends K.SocketProvider{get websocket(){if(null==_classPrivateFieldGet2(ue,this))throw new Error("websocket closed");return _classPrivateFieldGet2(ue,this)}constructor(K,pe,he){super(pe,he),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldInitSpec(this,ue,void 0),"string"==typeof K?(_classPrivateFieldSet2(ne,this,(()=>new G.WebSocket(K))),_classPrivateFieldSet2(ue,this,_classPrivateFieldGet2(ne,this).call(this))):"function"==typeof K?(_classPrivateFieldSet2(ne,this,K),_classPrivateFieldSet2(ue,this,K())):(_classPrivateFieldSet2(ne,this,null),_classPrivateFieldSet2(ue,this,K)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(G){console.log("failed to start WebsocketProvider",G)}},this.websocket.onmessage=G=>{this._processMessage(G.data)}}async _write(G){this.websocket.send(G)}async destroy(){null!=_classPrivateFieldGet2(ue,this)&&(_classPrivateFieldGet2(ue,this).close(),_classPrivateFieldSet2(ue,this,null)),super.destroy()}}return $D.WebSocketProvider=WebSocketProvider,$D}function requireProviderInfura(){if(HD)return UD;HD=1,Object.defineProperty(UD,"__esModule",{value:!0}),UD.InfuraProvider=UD.InfuraWebSocketProvider=void 0;const G=requireUtils$4(),K=requireCommunity(),ne=requireNetwork(),ue=requireProviderJsonrpc(),pe=requireProviderWebsocket(),he="84842078b09946638c03157f83405213";class InfuraWebSocketProvider extends pe.WebSocketProvider{constructor(K,ne){const ue=new InfuraProvider(K,ne),pe=ue._getConnection();(0,G.assert)(!pe.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});super(pe.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),K),_defineProperty(this,"projectId",void 0),_defineProperty(this,"projectSecret",void 0),(0,G.defineProperties)(this,{projectId:ue.projectId,projectSecret:ue.projectSecret})}isCommunityResource(){return this.projectId===he}}UD.InfuraWebSocketProvider=InfuraWebSocketProvider;class InfuraProvider extends ue.JsonRpcProvider{constructor(K,ue,pe){null==K&&(K="mainnet");const ye=ne.Network.from(K);null==ue&&(ue=he),null==pe&&(pe=null);super(InfuraProvider.getRequest(ye,ue,pe),ye,{staticNetwork:ye}),_defineProperty(this,"projectId",void 0),_defineProperty(this,"projectSecret",void 0),(0,G.defineProperties)(this,{projectId:ue,projectSecret:pe})}_getProvider(G){try{return new InfuraProvider(G,this.projectId,this.projectSecret)}catch(G){}return super._getProvider(G)}isCommunityResource(){return this.projectId===he}static getWebSocketProvider(G,K){return new InfuraWebSocketProvider(G,K)}static getRequest(ne,ue,pe){null==ue&&(ue=he),null==pe&&(pe=null);const ye=new G.FetchRequest(`https://${function getHost(K){switch(K){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,G.assertArgument)(!1,"unsupported network","network",K)}(ne.name)}/v3/${ue}`);return ye.allowGzip=!0,pe&&ye.setCredentials("",pe),ue===he&&(ye.retryFunc=async(G,ne,ue)=>((0,K.showThrottleMessage)("InfuraProvider"),!0)),ye}}return UD.InfuraProvider=InfuraProvider,UD}var zD,VD={};function requireProviderQuicknode(){if(zD)return VD;zD=1,Object.defineProperty(VD,"__esModule",{value:!0}),VD.QuickNodeProvider=void 0;const G=requireUtils$4(),K=requireCommunity(),ne=requireNetwork(),ue=requireProviderJsonrpc(),pe="919b412a057b5e9c9b6dce193c5a60242d6efadb";class QuickNodeProvider extends ue.JsonRpcProvider{constructor(K,ue){null==K&&(K="mainnet");const he=ne.Network.from(K);null==ue&&(ue=pe);super(QuickNodeProvider.getRequest(he,ue),he,{staticNetwork:he}),_defineProperty(this,"token",void 0),(0,G.defineProperties)(this,{token:ue})}_getProvider(G){try{return new QuickNodeProvider(G,this.token)}catch(G){}return super._getProvider(G)}isCommunityResource(){return this.token===pe}static getRequest(ne,ue){null==ue&&(ue=pe);const he=new G.FetchRequest(`https://${function getHost(K){switch(K){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,G.assertArgument)(!1,"unsupported network","network",K)}(ne.name)}/${ue}`);return he.allowGzip=!0,ue===pe&&(he.retryFunc=async(G,ne,ue)=>((0,K.showThrottleMessage)("QuickNodeProvider"),!0)),he}}return VD.QuickNodeProvider=QuickNodeProvider,VD}var KD,JD,XD={};function requireProviderFallback(){if(KD)return XD;KD=1,Object.defineProperty(XD,"__esModule",{value:!0}),XD.FallbackProvider=void 0;const G=requireUtils$4(),K=requireAbstractProvider(),ne=requireNetwork(),ue=BigInt("1"),pe=BigInt("2");function getTime(){return(new Date).getTime()}function stringify(G){return JSON.stringify(G,((G,K)=>"bigint"==typeof K?{type:"bigint",value:K.toString()}:K))}const he={stallTimeout:400,priority:1,weight:1},ye={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};function _normalize(G){if(null==G)return"null";if(Array.isArray(G))return"["+G.map(_normalize).join(",")+"]";if("object"==typeof G&&"function"==typeof G.toJSON)return _normalize(G.toJSON());switch(typeof G){case"boolean":case"symbol":return G.toString();case"bigint":case"number":return BigInt(G).toString();case"string":return JSON.stringify(G);case"object":{const K=Object.keys(G);return K.sort(),"{"+K.map((K=>`${JSON.stringify(K)}:${_normalize(G[K])}`)).join(",")+"}"}}throw console.log("Could not serialize",G),new Error("Hmm...")}function normalizeResult(G){if("error"in G){const K=G.error;return{tag:_normalize(K),value:K}}const K=G.result;return{tag:_normalize(K),value:K}}function checkQuorum(G,K){const ne=new Map;for(const{value:G,tag:ue,weight:pe}of K){const K=ne.get(ue)||{value:G,weight:0};K.weight+=pe,ne.set(ue,K)}let ue=null;for(const K of ne.values())K.weight>=G&&(!ue||K.weight>ue.weight)&&(ue=K);if(ue)return ue.value}function getMedian(G,K){let ne=0;const he=new Map;let ye=null;const me=[];for(const{value:G,tag:ue,weight:pe}of K)if(G instanceof Error){const K=he.get(ue)||{value:G,weight:0};K.weight+=pe,he.set(ue,K),(null==ye||K.weight>ye.weight)&&(ye=K)}else me.push(BigInt(G)),ne+=pe;if(ne<G)return ye&&ye.weight>=G?ye.value:void 0;me.sort(((G,K)=>G<K?-1:K>G?1:0));const be=Math.floor(me.length/2);return me.length%2?me[be]:(me[be-1]+me[be]+ue)/pe}function getAnyResult(G,K){const ne=checkQuorum(G,K);if(void 0!==ne)return ne;for(const G of K)if(G.value)return G.value}var me=new WeakMap,be=new WeakMap,ve=new WeakMap,_e=new WeakSet;class FallbackProvider extends K.AbstractProvider{constructor(ne,ue,pe){super(ue,pe),_classPrivateMethodInitSpec(this,_e),_defineProperty(this,"quorum",void 0),_defineProperty(this,"eventQuorum",void 0),_defineProperty(this,"eventWorkers",void 0),_classPrivateFieldInitSpec(this,me,void 0),_classPrivateFieldInitSpec(this,be,void 0),_classPrivateFieldInitSpec(this,ve,void 0),_classPrivateFieldSet2(me,this,ne.map((G=>G instanceof K.AbstractProvider?Object.assign({provider:G},he,ye):Object.assign({},he,G,ye)))),_classPrivateFieldSet2(be,this,-2),_classPrivateFieldSet2(ve,this,null),pe&&null!=pe.quorum?this.quorum=pe.quorum:this.quorum=Math.ceil(_classPrivateFieldGet2(me,this).reduce(((G,K)=>G+=K.weight),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,G.assertArgument)(this.quorum<=_classPrivateFieldGet2(me,this).reduce(((G,K)=>G+K.weight),0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return _classPrivateFieldGet2(me,this).map((G=>{const K=Object.assign({},G);for(const G in K)"_"===G[0]&&delete K[G];return K}))}async _detectNetwork(){return ne.Network.from((0,G.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(G,K){switch(K.method){case"broadcastTransaction":return await G.broadcastTransaction(K.signedTransaction);case"call":return await G.call(Object.assign({},K.transaction,{blockTag:K.blockTag}));case"chainId":return(await G.getNetwork()).chainId;case"estimateGas":return await G.estimateGas(K.transaction);case"getBalance":return await G.getBalance(K.address,K.blockTag);case"getBlock":{const ne="blockHash"in K?K.blockHash:K.blockTag;return await G.getBlock(ne,K.includeTransactions)}case"getBlockNumber":return await G.getBlockNumber();case"getCode":return await G.getCode(K.address,K.blockTag);case"getGasPrice":return(await G.getFeeData()).gasPrice;case"getPriorityFee":return(await G.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await G.getLogs(K.filter);case"getStorage":return await G.getStorage(K.address,K.position,K.blockTag);case"getTransaction":return await G.getTransaction(K.hash);case"getTransactionCount":return await G.getTransactionCount(K.address,K.blockTag);case"getTransactionReceipt":return await G.getTransactionReceipt(K.hash);case"getTransactionResult":return await G.getTransactionResult(K.hash)}}async _perform(K){if("broadcastTransaction"===K.method){const ne=_classPrivateFieldGet2(me,this).map((G=>null)),ue=_classPrivateFieldGet2(me,this).map((async({provider:G,weight:ue},pe)=>{try{const he=await G._perform(K);ne[pe]=Object.assign(normalizeResult({result:he}),{weight:ue})}catch(G){ne[pe]=Object.assign(normalizeResult({error:G}),{weight:ue})}}));for(;;){const K=ne.filter((G=>null!=G));for(const{value:G}of K)if(!(G instanceof Error))return G;const pe=checkQuorum(this.quorum,ne.filter((G=>null!=G)));if((0,G.isError)(pe,"INSUFFICIENT_FUNDS"))throw pe;const he=ue.filter(((G,K)=>null==ne[K]));if(0===he.length)break;await Promise.race(he)}const pe=getAnyResult(this.quorum,ne);if((0,G.assert)(void 0!==pe,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:K,results:ne.map(stringify)}}),pe instanceof Error)throw pe;return pe}await _assertClassBrand(_e,this,_initialSync).call(this);const ne=new Set;let ue=0;for(;;){const G=_assertClassBrand(_e,this,_addRunner).call(this,ne,K);if(null==G)break;if(ue+=G.config.weight,ue>=this.quorum)break}const pe=await _assertClassBrand(_e,this,_waitForQuorum).call(this,ne,K);for(const G of ne)G.perform&&null==G.result&&G.config.lateResponses++;return pe}async destroy(){for(const{provider:G}of _classPrivateFieldGet2(me,this))G.destroy();super.destroy()}}function _getNextConfig(G){const K=Array.from(G).map((G=>G.config)),ne=_classPrivateFieldGet2(me,this).slice();!function shuffle(G){for(let K=G.length-1;K>0;K--){const ne=Math.floor(Math.random()*(K+1)),ue=G[K];G[K]=G[ne],G[ne]=ue}}(ne),ne.sort(((G,K)=>G.priority-K.priority));for(const G of ne)if(!G._lastFatalError&&-1===K.indexOf(G))return G;return null}function _addRunner(G,K){const ne=_assertClassBrand(_e,this,_getNextConfig).call(this,G);if(null==ne)return null;const ue={config:ne,result:null,didBump:!1,perform:null,staller:null},pe=getTime();return ue.perform=(async()=>{try{ne.requests++;const G=await this._translatePerform(ne.provider,K);ue.result={result:G}}catch(G){ne.errorResponses++,ue.result={error:G}}const G=getTime()-pe;ne._totalTime+=G,ne.rollingDuration=.95*ne.rollingDuration+.05*G,ue.perform=null})(),ue.staller=(async()=>{await function stall(G){return new Promise((K=>{setTimeout(K,G)}))}(ne.stallTimeout),ue.staller=null})(),G.add(ue),ue}async function _initialSync(){let K=_classPrivateFieldGet2(ve,this);if(!K){const ne=[];_classPrivateFieldGet2(me,this).forEach((G=>{ne.push((async()=>{await async function waitForSync(G,K){for(;(G.blockNumber<0||G.blockNumber<K)&&(G._updateNumber||(G._updateNumber=(async()=>{try{const K=await G.provider.getBlockNumber();K>G.blockNumber&&(G.blockNumber=K)}catch(K){G.blockNumber=-2,G._lastFatalError=K,G._lastFatalErrorTimestamp=getTime()}G._updateNumber=null})()),await G._updateNumber,G.outOfSync++,!G._lastFatalError););}(G,0),G._lastFatalError||(G._network=await G.provider.getNetwork())})())})),_classPrivateFieldSet2(ve,this,K=(async()=>{await Promise.all(ne);let K=null;for(const ne of _classPrivateFieldGet2(me,this)){if(ne._lastFatalError)continue;const ue=ne._network;null==K?K=ue.chainId:ue.chainId!==K&&(0,G.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await K}async function _checkQuorum(K,ne){const ue=[];for(const G of K)if(null!=G.result){const{tag:K,value:ne}=normalizeResult(G.result);ue.push({tag:K,value:ne,weight:G.config.weight})}if(!(ue.reduce(((G,K)=>G+K.weight),0)<this.quorum)){switch(ne.method){case"getBlockNumber":{-2===_classPrivateFieldGet2(be,this)&&_classPrivateFieldSet2(be,this,Math.ceil((0,G.getNumber)(getMedian(this.quorum,_classPrivateFieldGet2(me,this).filter((G=>!G._lastFatalError)).map((K=>({value:K.blockNumber,tag:(0,G.getNumber)(K.blockNumber).toString(),weight:K.weight})))))));const K=function getFuzzyMode(K,ne){if(1===K)return(0,G.getNumber)(getMedian(K,ne),"%internal");const ue=new Map,add=(G,K)=>{const ne=ue.get(G)||{result:G,weight:0};ne.weight+=K,ue.set(G,ne)};for(const{weight:K,value:ue}of ne){const ne=(0,G.getNumber)(ue);add(ne-1,K),add(ne,K),add(ne+1,K)}let pe,he=0;for(const{weight:G,result:ne}of ue.values())G>=K&&(G>he||null!=pe&&G===he&&ne>pe)&&(he=G,pe=ne);return pe}(this.quorum,ue);if(void 0===K)return;return K>_classPrivateFieldGet2(be,this)&&_classPrivateFieldSet2(be,this,K),_classPrivateFieldGet2(be,this)}case"getGasPrice":case"getPriorityFee":case"estimateGas":return getMedian(this.quorum,ue);case"getBlock":return"blockTag"in ne&&"pending"===ne.blockTag?getAnyResult(this.quorum,ue):checkQuorum(this.quorum,ue);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,ue);case"broadcastTransaction":return getAnyResult(this.quorum,ue)}(0,G.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(ne.method)})`})}}async function _waitForQuorum(K,ne){if(0===K.size)throw new Error("no runners?!");const ue=[];let pe=0;for(const G of K)G.perform&&ue.push(G.perform),G.staller?ue.push(G.staller):G.didBump||(G.didBump=!0,pe++);const he=await _assertClassBrand(_e,this,_checkQuorum).call(this,K,ne);if(void 0!==he){if(he instanceof Error)throw he;return he}for(let G=0;G<pe;G++)_assertClassBrand(_e,this,_addRunner).call(this,K,ne);return(0,G.assert)(ue.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:ne,results:Array.from(K).map((G=>stringify(G.result)))}}),await Promise.race(ue),await _assertClassBrand(_e,this,_waitForQuorum).call(this,K,ne)}return XD.FallbackProvider=FallbackProvider,XD}var QD,ZD={};var YD,eL={};var tL,rL={};function requireProviderPocket(){if(tL)return rL;tL=1,Object.defineProperty(rL,"__esModule",{value:!0}),rL.PocketProvider=void 0;const G=requireUtils$4(),K=requireCommunity(),ne=requireNetwork(),ue=requireProviderJsonrpc(),pe="62e1ad51b37b8e00394bda3b";class PocketProvider extends ue.JsonRpcProvider{constructor(K,ue,he){null==K&&(K="mainnet");const ye=ne.Network.from(K);null==ue&&(ue=pe),null==he&&(he=null);const me={staticNetwork:ye};super(PocketProvider.getRequest(ye,ue,he),ye,me),_defineProperty(this,"applicationId",void 0),_defineProperty(this,"applicationSecret",void 0),(0,G.defineProperties)(this,{applicationId:ue,applicationSecret:he})}_getProvider(G){try{return new PocketProvider(G,this.applicationId,this.applicationSecret)}catch(G){}return super._getProvider(G)}static getRequest(ne,ue,he){null==ue&&(ue=pe);const ye=new G.FetchRequest(`https://${function getHost(K){switch(K){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,G.assertArgument)(!1,"unsupported network","network",K)}(ne.name)}/v1/lb/${ue}`);return ye.allowGzip=!0,he&&ye.setCredentials("",he),ue===pe&&(ye.retryFunc=async(G,ne,ue)=>((0,K.showThrottleMessage)("PocketProvider"),!0)),ye}isCommunityResource(){return this.applicationId===pe}}return rL.PocketProvider=PocketProvider,rL}var nL,aL,iL={};function requireProviders(){return aL||(aL=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.SocketEventSubscriber=G.SocketPendingSubscriber=G.SocketBlockSubscriber=G.SocketSubscriber=G.WebSocketProvider=G.SocketProvider=G.IpcSocketProvider=G.QuickNodeProvider=G.PocketProvider=G.InfuraWebSocketProvider=G.InfuraProvider=G.EtherscanPlugin=G.EtherscanProvider=G.CloudflareProvider=G.AnkrProvider=G.AlchemyProvider=G.BrowserProvider=G.JsonRpcSigner=G.JsonRpcProvider=G.JsonRpcApiProvider=G.FallbackProvider=G.copyRequest=G.TransactionResponse=G.TransactionReceipt=G.Log=G.FeeData=G.Block=G.FetchUrlFeeDataNetworkPlugin=G.FeeDataNetworkPlugin=G.EnsPlugin=G.GasCostPlugin=G.NetworkPlugin=G.NonceManager=G.Network=G.MulticoinProviderPlugin=G.EnsResolver=G.getDefaultProvider=G.showThrottleMessage=G.VoidSigner=G.AbstractSigner=G.UnmanagedSubscriber=G.AbstractProvider=void 0;var K=requireAbstractProvider();Object.defineProperty(G,"AbstractProvider",{enumerable:!0,get:function(){return K.AbstractProvider}}),Object.defineProperty(G,"UnmanagedSubscriber",{enumerable:!0,get:function(){return K.UnmanagedSubscriber}});var ne=requireAbstractSigner();Object.defineProperty(G,"AbstractSigner",{enumerable:!0,get:function(){return ne.AbstractSigner}}),Object.defineProperty(G,"VoidSigner",{enumerable:!0,get:function(){return ne.VoidSigner}});var ue=requireCommunity();Object.defineProperty(G,"showThrottleMessage",{enumerable:!0,get:function(){return ue.showThrottleMessage}});var pe=function requireDefaultProvider(){if(JD)return CD;JD=1,Object.defineProperty(CD,"__esModule",{value:!0}),CD.getDefaultProvider=void 0;const G=requireUtils$4(),K=requireProviderAnkr(),ne=requireProviderAlchemy(),ue=requireProviderCloudflare(),pe=requireProviderEtherscan(),he=requireProviderInfura(),ye=requireProviderQuicknode(),me=requireProviderFallback(),be=requireProviderJsonrpc(),ve=requireNetwork(),_e=requireProviderWebsocket(),Te="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");return CD.getDefaultProvider=function getDefaultProvider(Ee,Pe){null==Pe&&(Pe={});const allowService=G=>"-"!==Pe[G]&&("string"==typeof Pe.exclusive?G===Pe.exclusive:!Array.isArray(Pe.exclusive)||-1!==Pe.exclusive.indexOf(G));if("string"==typeof Ee&&Ee.match(/^https?:/))return new be.JsonRpcProvider(Ee);if("string"==typeof Ee&&Ee.match(/^wss?:/)||function isWebSocketLike(G){return G&&"function"==typeof G.send&&"function"==typeof G.close}(Ee))return new _e.WebSocketProvider(Ee);let Se=null;try{Se=ve.Network.from(Ee)}catch(G){}const Ce=[];if(allowService("publicPolygon")&&Se&&"matic"===Se.name&&Ce.push(new be.JsonRpcProvider("https://polygon-rpc.com/",Se,{staticNetwork:Se})),allowService("alchemy"))try{Ce.push(new ne.AlchemyProvider(Ee,Pe.alchemy))}catch(G){}if(allowService("ankr")&&null!=Pe.ankr)try{Ce.push(new K.AnkrProvider(Ee,Pe.ankr))}catch(G){}if(allowService("cloudflare"))try{Ce.push(new ue.CloudflareProvider(Ee))}catch(G){}if(allowService("etherscan"))try{Ce.push(new pe.EtherscanProvider(Ee,Pe.etherscan))}catch(G){}if(allowService("infura"))try{let G,K=Pe.infura;"object"==typeof K&&(G=K.projectSecret,K=K.projectId),Ce.push(new he.InfuraProvider(Ee,K,G))}catch(G){}if(allowService("quicknode"))try{let G=Pe.quicknode;Ce.push(new ye.QuickNodeProvider(Ee,G))}catch(G){}if((0,G.assert)(Ce.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),1===Ce.length)return Ce[0];let ke=Math.floor(Ce.length/2);return ke>2&&(ke=2),Se&&-1!==Te.indexOf(Se.name)&&(ke=1),Pe&&Pe.quorum&&(ke=Pe.quorum),new me.FallbackProvider(Ce,void 0,{quorum:ke})},CD}();Object.defineProperty(G,"getDefaultProvider",{enumerable:!0,get:function(){return pe.getDefaultProvider}});var he=requireEnsResolver();Object.defineProperty(G,"EnsResolver",{enumerable:!0,get:function(){return he.EnsResolver}}),Object.defineProperty(G,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return he.MulticoinProviderPlugin}});var ye=requireNetwork();Object.defineProperty(G,"Network",{enumerable:!0,get:function(){return ye.Network}});var me=function requireSignerNoncemanager(){if(QD)return ZD;QD=1,Object.defineProperty(ZD,"__esModule",{value:!0}),ZD.NonceManager=void 0;const G=requireUtils$4(),K=requireAbstractSigner();var ne=new WeakMap,ue=new WeakMap;class NonceManager extends K.AbstractSigner{constructor(K){super(K.provider),_defineProperty(this,"signer",void 0),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldInitSpec(this,ue,void 0),(0,G.defineProperties)(this,{signer:K}),_classPrivateFieldSet2(ne,this,null),_classPrivateFieldSet2(ue,this,0)}async getAddress(){return this.signer.getAddress()}connect(G){return new NonceManager(this.signer.connect(G))}async getNonce(G){if("pending"===G){null==_classPrivateFieldGet2(ne,this)&&_classPrivateFieldSet2(ne,this,super.getNonce("pending"));const G=_classPrivateFieldGet2(ue,this);return await _classPrivateFieldGet2(ne,this)+G}return super.getNonce(G)}increment(){var G;_classPrivateFieldSet2(ue,this,(G=_classPrivateFieldGet2(ue,this),++G))}reset(){_classPrivateFieldSet2(ue,this,0),_classPrivateFieldSet2(ne,this,null)}async sendTransaction(G){const K=this.getNonce("pending");return this.increment(),(G=await this.signer.populateTransaction(G)).nonce=await K,await this.signer.sendTransaction(G)}signTransaction(G){return this.signer.signTransaction(G)}signMessage(G){return this.signer.signMessage(G)}signTypedData(G,K,ne){return this.signer.signTypedData(G,K,ne)}}return ZD.NonceManager=NonceManager,ZD}();Object.defineProperty(G,"NonceManager",{enumerable:!0,get:function(){return me.NonceManager}});var be=requirePluginsNetwork();Object.defineProperty(G,"NetworkPlugin",{enumerable:!0,get:function(){return be.NetworkPlugin}}),Object.defineProperty(G,"GasCostPlugin",{enumerable:!0,get:function(){return be.GasCostPlugin}}),Object.defineProperty(G,"EnsPlugin",{enumerable:!0,get:function(){return be.EnsPlugin}}),Object.defineProperty(G,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return be.FeeDataNetworkPlugin}}),Object.defineProperty(G,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return be.FetchUrlFeeDataNetworkPlugin}});var ve=requireProvider();Object.defineProperty(G,"Block",{enumerable:!0,get:function(){return ve.Block}}),Object.defineProperty(G,"FeeData",{enumerable:!0,get:function(){return ve.FeeData}}),Object.defineProperty(G,"Log",{enumerable:!0,get:function(){return ve.Log}}),Object.defineProperty(G,"TransactionReceipt",{enumerable:!0,get:function(){return ve.TransactionReceipt}}),Object.defineProperty(G,"TransactionResponse",{enumerable:!0,get:function(){return ve.TransactionResponse}}),Object.defineProperty(G,"copyRequest",{enumerable:!0,get:function(){return ve.copyRequest}});var _e=requireProviderFallback();Object.defineProperty(G,"FallbackProvider",{enumerable:!0,get:function(){return _e.FallbackProvider}});var Te=requireProviderJsonrpc();Object.defineProperty(G,"JsonRpcApiProvider",{enumerable:!0,get:function(){return Te.JsonRpcApiProvider}}),Object.defineProperty(G,"JsonRpcProvider",{enumerable:!0,get:function(){return Te.JsonRpcProvider}}),Object.defineProperty(G,"JsonRpcSigner",{enumerable:!0,get:function(){return Te.JsonRpcSigner}});var Ee=function requireProviderBrowser(){if(YD)return eL;YD=1,Object.defineProperty(eL,"__esModule",{value:!0}),eL.BrowserProvider=void 0;const G=requireUtils$4(),K=requireProviderJsonrpc();var ne=new WeakMap;class BrowserProvider extends K.JsonRpcApiPollingProvider{constructor(K,ue){(0,G.assertArgument)(K&&K.request,"invalid EIP-1193 provider","ethereum",K),super(ue,{batchMaxCount:1}),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldSet2(ne,this,(async(G,ne)=>{const ue={method:G,params:ne};this.emit("debug",{action:"sendEip1193Request",payload:ue});try{const G=await K.request(ue);return this.emit("debug",{action:"receiveEip1193Result",result:G}),G}catch(G){const K=new Error(G.message);throw K.code=G.code,K.data=G.data,K.payload=ue,this.emit("debug",{action:"receiveEip1193Error",error:K}),K}}))}async send(G,K){return await this._start(),await super.send(G,K)}async _send(K){(0,G.assertArgument)(!Array.isArray(K),"EIP-1193 does not support batch request","payload",K);try{const G=await _classPrivateFieldGet2(ne,this).call(this,K.method,K.params||[]);return[{id:K.id,result:G}]}catch(G){return[{id:K.id,error:{code:G.code,data:G.data,message:G.message}}]}}getRpcError(G,K){switch((K=JSON.parse(JSON.stringify(K))).error.code||-1){case 4001:K.error.message=`ethers-user-denied: ${K.error.message}`;break;case 4200:K.error.message=`ethers-unsupported: ${K.error.message}`}return super.getRpcError(G,K)}async hasSigner(G){null==G&&(G=0);const K=await this.send("eth_accounts",[]);return"number"==typeof G?K.length>G:(G=G.toLowerCase(),0!==K.filter((K=>K.toLowerCase()===G)).length)}async getSigner(G){if(null==G&&(G=0),!await this.hasSigner(G))try{await _classPrivateFieldGet2(ne,this).call(this,"eth_requestAccounts",[])}catch(G){const K=G.payload;throw this.getRpcError(K,{id:K.id,error:G})}return await super.getSigner(G)}}return eL.BrowserProvider=BrowserProvider,eL}();Object.defineProperty(G,"BrowserProvider",{enumerable:!0,get:function(){return Ee.BrowserProvider}});var Pe=requireProviderAlchemy();Object.defineProperty(G,"AlchemyProvider",{enumerable:!0,get:function(){return Pe.AlchemyProvider}});var Se=requireProviderAnkr();Object.defineProperty(G,"AnkrProvider",{enumerable:!0,get:function(){return Se.AnkrProvider}});var Ce=requireProviderCloudflare();Object.defineProperty(G,"CloudflareProvider",{enumerable:!0,get:function(){return Ce.CloudflareProvider}});var ke=requireProviderEtherscan();Object.defineProperty(G,"EtherscanProvider",{enumerable:!0,get:function(){return ke.EtherscanProvider}}),Object.defineProperty(G,"EtherscanPlugin",{enumerable:!0,get:function(){return ke.EtherscanPlugin}});var Oe=requireProviderInfura();Object.defineProperty(G,"InfuraProvider",{enumerable:!0,get:function(){return Oe.InfuraProvider}}),Object.defineProperty(G,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return Oe.InfuraWebSocketProvider}});var xe=requireProviderPocket();Object.defineProperty(G,"PocketProvider",{enumerable:!0,get:function(){return xe.PocketProvider}});var Ne=requireProviderQuicknode();Object.defineProperty(G,"QuickNodeProvider",{enumerable:!0,get:function(){return Ne.QuickNodeProvider}});const Me=function requireProviderIpcsocketBrowser(){return nL||(nL=1,Object.defineProperty(iL,"__esModule",{value:!0}),iL.IpcSocketProvider=void 0,iL.IpcSocketProvider=void 0),iL}();Object.defineProperty(G,"IpcSocketProvider",{enumerable:!0,get:function(){return Me.IpcSocketProvider}});var Be=requireProviderSocket();Object.defineProperty(G,"SocketProvider",{enumerable:!0,get:function(){return Be.SocketProvider}});var Fe=requireProviderWebsocket();Object.defineProperty(G,"WebSocketProvider",{enumerable:!0,get:function(){return Fe.WebSocketProvider}});var De=requireProviderSocket();Object.defineProperty(G,"SocketSubscriber",{enumerable:!0,get:function(){return De.SocketSubscriber}}),Object.defineProperty(G,"SocketBlockSubscriber",{enumerable:!0,get:function(){return De.SocketBlockSubscriber}}),Object.defineProperty(G,"SocketPendingSubscriber",{enumerable:!0,get:function(){return De.SocketPendingSubscriber}}),Object.defineProperty(G,"SocketEventSubscriber",{enumerable:!0,get:function(){return De.SocketEventSubscriber}})}(dD)),dD}var sL,oL={},cL={};function requireBaseWallet(){if(sL)return cL;sL=1,Object.defineProperty(cL,"__esModule",{value:!0}),cL.BaseWallet=void 0;const G=requireAddress$2(),K=requireHash(),ne=requireProviders(),ue=requireTransaction(),pe=requireUtils$4();var he=new WeakMap;class BaseWallet extends ne.AbstractSigner{constructor(G,K){super(K),_defineProperty(this,"address",void 0),_classPrivateFieldInitSpec(this,he,void 0),(0,pe.assertArgument)(G&&"function"==typeof G.sign,"invalid private key","privateKey","[ REDACTED ]"),_classPrivateFieldSet2(he,this,G);const ne=(0,ue.computeAddress)(this.signingKey.publicKey);(0,pe.defineProperties)(this,{address:ne})}get signingKey(){return _classPrivateFieldGet2(he,this)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(G){return new BaseWallet(_classPrivateFieldGet2(he,this),G)}async signTransaction(K){const{to:ne,from:he}=await(0,pe.resolveProperties)({to:K.to?(0,G.resolveAddress)(K.to,this.provider):void 0,from:K.from?(0,G.resolveAddress)(K.from,this.provider):void 0});null!=ne&&(K.to=ne),null!=he&&(K.from=he),null!=K.from&&((0,pe.assertArgument)((0,G.getAddress)(K.from)===this.address,"transaction from address mismatch","tx.from",K.from),delete K.from);const ye=ue.Transaction.from(K);return ye.signature=this.signingKey.sign(ye.unsignedHash),ye.serialized}async signMessage(G){return this.signMessageSync(G)}signMessageSync(G){return this.signingKey.sign((0,K.hashMessage)(G)).serialized}async signTypedData(G,ne,ue){const he=await K.TypedDataEncoder.resolveNames(G,ne,ue,(async G=>{(0,pe.assert)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:G}});const K=await this.provider.resolveName(G);return(0,pe.assert)(null!=K,"unconfigured ENS name","UNCONFIGURED_NAME",{value:G}),K}));return this.signingKey.sign(K.TypedDataEncoder.hash(he.domain,ne,he.value)).serialized}}return cL.BaseWallet=BaseWallet,cL}var dL,uL={},fL={},lL={},pL={};function requireDecodeOwl(){if(dL)return pL;dL=1,Object.defineProperty(pL,"__esModule",{value:!0}),pL.decodeOwl=pL.decode=void 0;const G=requireUtils$4(),K=" !#$%&'()*+,-./<=>?@[]^_`{|}~",ne=/^[a-z]*$/i;function unfold(G,K){let ue=97;return G.reduce(((G,pe)=>(pe===K?ue++:pe.match(ne)?G.push(String.fromCharCode(ue)+pe):(ue=97,G.push(pe)),G)),[])}function decode(G,ne){for(let ue=K.length-1;ue>=0;ue--)G=G.split(K[ue]).join(ne.substring(2*ue,2*ue+2));const ue=[],pe=G.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((G,K,ne,pe)=>{if(ne)for(let G=parseInt(ne);G>=0;G--)ue.push(";");else ue.push(K.toLowerCase());return""}));if(pe)throw new Error(`leftovers: ${JSON.stringify(pe)}`);return unfold(unfold(ue,";"),":")}return pL.decode=decode,pL.decodeOwl=function decodeOwl$1(ne){return(0,G.assertArgument)("0"===ne[0],"unsupported auwl data","data",ne),decode(ne.substring(1+2*K.length),ne.substring(1,1+2*K.length))},pL}var hL,yL,mL,bL={};function requireWordlist(){if(hL)return bL;hL=1,Object.defineProperty(bL,"__esModule",{value:!0}),bL.Wordlist=void 0;const G=requireUtils$4();return bL.Wordlist=class Wordlist{constructor(K){_defineProperty(this,"locale",void 0),(0,G.defineProperties)(this,{locale:K})}split(G){return G.toLowerCase().split(/\s+/g)}join(G){return G.join(" ")}},bL}function requireWordlistOwl(){if(yL)return lL;yL=1,Object.defineProperty(lL,"__esModule",{value:!0}),lL.WordlistOwl=void 0;const G=requireHash(),K=requireUtils$4(),ne=requireDecodeOwl(),ue=requireWordlist();var pe=new WeakMap,he=new WeakMap,ye=new WeakMap,me=new WeakSet;class WordlistOwl extends ue.Wordlist{constructor(G,K,ne){super(G),_classPrivateMethodInitSpec(this,me),_classPrivateFieldInitSpec(this,pe,void 0),_classPrivateFieldInitSpec(this,he,void 0),_classPrivateFieldInitSpec(this,ye,void 0),_classPrivateFieldSet2(pe,this,K),_classPrivateFieldSet2(he,this,ne),_classPrivateFieldSet2(ye,this,null)}get _data(){return _classPrivateFieldGet2(pe,this)}_decodeWords(){return(0,ne.decodeOwl)(_classPrivateFieldGet2(pe,this))}getWord(G){const ne=_assertClassBrand(me,this,_loadWords).call(this);return(0,K.assertArgument)(G>=0&&G<ne.length,`invalid word index: ${G}`,"index",G),ne[G]}getWordIndex(G){return _assertClassBrand(me,this,_loadWords).call(this).indexOf(G)}}function _loadWords(){if(null==_classPrivateFieldGet2(ye,this)){const K=this._decodeWords();if((0,G.id)(K.join("\n")+"\n")!==_classPrivateFieldGet2(he,this))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);_classPrivateFieldSet2(ye,this,K)}return _classPrivateFieldGet2(ye,this)}return lL.WordlistOwl=WordlistOwl,lL}function requireLangEn(){if(mL)return fL;mL=1,Object.defineProperty(fL,"__esModule",{value:!0}),fL.LangEn=void 0;const G=requireWordlistOwl();let K=null;class LangEn extends G.WordlistOwl{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==K&&(K=new LangEn),K}}return fL.LangEn=LangEn,fL}var gL,vL={};function requireMnemonic(){if(gL)return vL;gL=1,Object.defineProperty(vL,"__esModule",{value:!0}),vL.Mnemonic=void 0;const G=requireCrypto(),K=requireUtils$4(),ne=requireLangEn();function getUpperMask(G){return(1<<G)-1<<8-G&255}function mnemonicToEntropy(ue,pe){(0,K.assertNormalize)("NFKD"),null==pe&&(pe=ne.LangEn.wordlist());const he=pe.split(ue);(0,K.assertArgument)(he.length%3==0&&he.length>=12&&he.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const ye=new Uint8Array(Math.ceil(11*he.length/8));let me=0;for(let G=0;G<he.length;G++){let ne=pe.getWordIndex(he[G].normalize("NFKD"));(0,K.assertArgument)(ne>=0,`invalid mnemonic word at index ${G}`,"mnemonic","[ REDACTED ]");for(let G=0;G<11;G++)ne&1<<10-G&&(ye[me>>3]|=1<<7-me%8),me++}const be=32*he.length/3,ve=getUpperMask(he.length/3),_e=(0,K.getBytes)((0,G.sha256)(ye.slice(0,be/8)))[0]&ve;return(0,K.assertArgument)(_e===(ye[ye.length-1]&ve),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,K.hexlify)(ye.slice(0,be/8))}function entropyToMnemonic(ue,pe){(0,K.assertArgument)(ue.length%4==0&&ue.length>=16&&ue.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==pe&&(pe=ne.LangEn.wordlist());const he=[0];let ye=11;for(let G=0;G<ue.length;G++)ye>8?(he[he.length-1]<<=8,he[he.length-1]|=ue[G],ye-=8):(he[he.length-1]<<=ye,he[he.length-1]|=ue[G]>>8-ye,he.push(ue[G]&((1<<8-ye)-1&255)),ye+=3);const me=ue.length/4,be=parseInt((0,G.sha256)(ue).substring(2,4),16)&getUpperMask(me);return he[he.length-1]<<=me,he[he.length-1]|=be>>8-me,pe.join(he.map((G=>pe.getWord(G))))}const ue={};class Mnemonic{constructor(G,pe,he,ye,me){_defineProperty(this,"phrase",void 0),_defineProperty(this,"password",void 0),_defineProperty(this,"wordlist",void 0),_defineProperty(this,"entropy",void 0),null==ye&&(ye=""),null==me&&(me=ne.LangEn.wordlist()),(0,K.assertPrivate)(G,ue,"Mnemonic"),(0,K.defineProperties)(this,{phrase:he,password:ye,wordlist:me,entropy:pe})}computeSeed(){const ne=(0,K.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,G.pbkdf2)((0,K.toUtf8Bytes)(this.phrase,"NFKD"),ne,2048,64,"sha512")}static fromPhrase(G,ne,pe){const he=mnemonicToEntropy(G,pe);return G=entropyToMnemonic((0,K.getBytes)(he),pe),new Mnemonic(ue,he,G,ne,pe)}static fromEntropy(G,ne,pe){const he=(0,K.getBytes)(G,"entropy"),ye=entropyToMnemonic(he,pe);return new Mnemonic(ue,(0,K.hexlify)(he),ye,ne,pe)}static entropyToPhrase(G,ne){return entropyToMnemonic((0,K.getBytes)(G,"entropy"),ne)}static phraseToEntropy(G,K){return mnemonicToEntropy(G,K)}static isValidMnemonic(G,K){try{return mnemonicToEntropy(G,K),!0}catch(G){}return!1}}return vL.Mnemonic=Mnemonic,vL}var wL,_L={},TL={},AL={};function requireAes(){if(wL)return AL;wL=1;
/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
var G,K,ne,ue=pn&&pn.__classPrivateFieldGet||function(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)},pe=pn&&pn.__classPrivateFieldSet||function(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne};Object.defineProperty(AL,"__esModule",{value:!0}),AL.AES=void 0;const he={16:10,24:12,32:14},ye=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],me=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],be=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],ve=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],_e=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Te=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ee=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Pe=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Se=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Ce=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],ke=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Oe=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],xe=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ne=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Me=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(G){const K=[];for(let ne=0;ne<G.length;ne+=4)K.push(G[ne]<<24|G[ne+1]<<16|G[ne+2]<<8|G[ne+3]);return K}class AES{get key(){return ue(this,G,"f").slice()}constructor(be){if(G.set(this,void 0),K.set(this,void 0),ne.set(this,void 0),!(this instanceof AES))throw Error("AES must be instanitated with `new`");pe(this,G,new Uint8Array(be),"f");const ve=he[this.key.length];if(null==ve)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");pe(this,ne,[],"f"),pe(this,K,[],"f");for(let G=0;G<=ve;G++)ue(this,ne,"f").push([0,0,0,0]),ue(this,K,"f").push([0,0,0,0]);const _e=4*(ve+1),Te=this.key.length/4,Ee=convertToInt32(this.key);let Pe;for(let G=0;G<Te;G++)Pe=G>>2,ue(this,ne,"f")[Pe][G%4]=Ee[G],ue(this,K,"f")[ve-Pe][G%4]=Ee[G];let Se,Ce=0,ke=Te;for(;ke<_e;){if(Se=Ee[Te-1],Ee[0]^=me[Se>>16&255]<<24^me[Se>>8&255]<<16^me[255&Se]<<8^me[Se>>24&255]^ye[Ce]<<24,Ce+=1,8!=Te)for(let G=1;G<Te;G++)Ee[G]^=Ee[G-1];else{for(let G=1;G<Te/2;G++)Ee[G]^=Ee[G-1];Se=Ee[Te/2-1],Ee[Te/2]^=me[255&Se]^me[Se>>8&255]<<8^me[Se>>16&255]<<16^me[Se>>24&255]<<24;for(let G=Te/2+1;G<Te;G++)Ee[G]^=Ee[G-1]}let G,pe,he=0;for(;he<Te&&ke<_e;)G=ke>>2,pe=ke%4,ue(this,ne,"f")[G][pe]=Ee[he],ue(this,K,"f")[ve-G][pe]=Ee[he++],ke++}for(let G=1;G<ve;G++)for(let ne=0;ne<4;ne++)Se=ue(this,K,"f")[G][ne],ue(this,K,"f")[G][ne]=Oe[Se>>24&255]^xe[Se>>16&255]^Ne[Se>>8&255]^Me[255&Se]}encrypt(G){if(16!=G.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const K=ue(this,ne,"f").length-1,pe=[0,0,0,0];let he=convertToInt32(G);for(let G=0;G<4;G++)he[G]^=ue(this,ne,"f")[0][G];for(let G=1;G<K;G++){for(let K=0;K<4;K++)pe[K]=ve[he[K]>>24&255]^_e[he[(K+1)%4]>>16&255]^Te[he[(K+2)%4]>>8&255]^Ee[255&he[(K+3)%4]]^ue(this,ne,"f")[G][K];he=pe.slice()}const ye=new Uint8Array(16);let be=0;for(let G=0;G<4;G++)be=ue(this,ne,"f")[K][G],ye[4*G]=255&(me[he[G]>>24&255]^be>>24),ye[4*G+1]=255&(me[he[(G+1)%4]>>16&255]^be>>16),ye[4*G+2]=255&(me[he[(G+2)%4]>>8&255]^be>>8),ye[4*G+3]=255&(me[255&he[(G+3)%4]]^be);return ye}decrypt(G){if(16!=G.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const ne=ue(this,K,"f").length-1,pe=[0,0,0,0];let he=convertToInt32(G);for(let G=0;G<4;G++)he[G]^=ue(this,K,"f")[0][G];for(let G=1;G<ne;G++){for(let ne=0;ne<4;ne++)pe[ne]=Pe[he[ne]>>24&255]^Se[he[(ne+3)%4]>>16&255]^Ce[he[(ne+2)%4]>>8&255]^ke[255&he[(ne+1)%4]]^ue(this,K,"f")[G][ne];he=pe.slice()}const ye=new Uint8Array(16);let me=0;for(let G=0;G<4;G++)me=ue(this,K,"f")[ne][G],ye[4*G]=255&(be[he[G]>>24&255]^me>>24),ye[4*G+1]=255&(be[he[(G+3)%4]>>16&255]^me>>16),ye[4*G+2]=255&(be[he[(G+2)%4]>>8&255]^me>>8),ye[4*G+3]=255&(be[255&he[(G+1)%4]]^me);return ye}}return AL.AES=AES,G=new WeakMap,K=new WeakMap,ne=new WeakMap,AL}var EL,PL={};function requireMode(){if(EL)return PL;EL=1,Object.defineProperty(PL,"__esModule",{value:!0}),PL.ModeOfOperation=void 0;const G=requireAes();return PL.ModeOfOperation=class ModeOfOperation{constructor(K,ne,ue){if(ue&&!(this instanceof ue))throw new Error(`${K} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new G.AES(ne)},name:{enumerable:!0,value:K}})}},PL}var SL,IL={};var CL,RL={};var kL,OL={};var xL,NL={};var ML,BL={};var FL,DL,LL={};function requireLib_commonjs(){return DL||(DL=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.pkcs7Strip=G.pkcs7Pad=G.OFB=G.ECB=G.CTR=G.CFB=G.CBC=G.ModeOfOperation=G.AES=void 0;var K=requireAes();Object.defineProperty(G,"AES",{enumerable:!0,get:function(){return K.AES}});var ne=requireMode();Object.defineProperty(G,"ModeOfOperation",{enumerable:!0,get:function(){return ne.ModeOfOperation}});var ue=function requireModeCbc(){if(SL)return IL;SL=1;var G,K,ne=pn&&pn.__classPrivateFieldSet||function(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne},ue=pn&&pn.__classPrivateFieldGet||function(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)};Object.defineProperty(IL,"__esModule",{value:!0}),IL.CBC=void 0;const pe=requireMode();class CBC extends pe.ModeOfOperation{constructor(ue,pe){if(super("ECC",ue,CBC),G.set(this,void 0),K.set(this,void 0),pe){if(pe.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");ne(this,G,new Uint8Array(pe),"f")}else ne(this,G,new Uint8Array(16),"f");ne(this,K,this.iv,"f")}get iv(){return new Uint8Array(ue(this,G,"f"))}encrypt(G){if(G.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const pe=new Uint8Array(G.length);for(let he=0;he<G.length;he+=16){for(let ne=0;ne<16;ne++)ue(this,K,"f")[ne]^=G[he+ne];ne(this,K,this.aes.encrypt(ue(this,K,"f")),"f"),pe.set(ue(this,K,"f"),he)}return pe}decrypt(G){if(G.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const ne=new Uint8Array(G.length);for(let pe=0;pe<G.length;pe+=16){const he=this.aes.decrypt(G.subarray(pe,pe+16));for(let ye=0;ye<16;ye++)ne[pe+ye]=he[ye]^ue(this,K,"f")[ye],ue(this,K,"f")[ye]=G[pe+ye]}return ne}}return IL.CBC=CBC,G=new WeakMap,K=new WeakMap,IL}();Object.defineProperty(G,"CBC",{enumerable:!0,get:function(){return ue.CBC}});var pe=function requireModeCfb(){if(CL)return RL;CL=1;var G,K,ne,ue,pe=pn&&pn.__classPrivateFieldSet||function(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne},he=pn&&pn.__classPrivateFieldGet||function(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)};Object.defineProperty(RL,"__esModule",{value:!0}),RL.CFB=void 0;const ye=requireMode();class CFB extends ye.ModeOfOperation{constructor(ue,he,ye=8){if(super("CFB",ue,CFB),G.add(this),K.set(this,void 0),ne.set(this,void 0),!Number.isInteger(ye)||ye%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:ye}}),he){if(he.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");pe(this,K,new Uint8Array(he),"f")}else pe(this,K,new Uint8Array(16),"f");pe(this,ne,this.iv,"f")}get iv(){return new Uint8Array(he(this,K,"f"))}encrypt(K){if(8*K.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");const pe=this.segmentSize/8,ye=new Uint8Array(K);for(let K=0;K<ye.length;K+=pe){const me=this.aes.encrypt(he(this,ne,"f"));for(let G=0;G<pe;G++)ye[K+G]^=me[G];he(this,G,"m",ue).call(this,ye.subarray(K))}return ye}decrypt(K){if(8*K.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");const pe=this.segmentSize/8,ye=new Uint8Array(K);for(let me=0;me<ye.length;me+=pe){const be=this.aes.encrypt(he(this,ne,"f"));for(let G=0;G<pe;G++)ye[me+G]^=be[G];he(this,G,"m",ue).call(this,K.subarray(me))}return ye}}return RL.CFB=CFB,K=new WeakMap,ne=new WeakMap,G=new WeakSet,ue=function _CFB_shift(G){const K=this.segmentSize/8;he(this,ne,"f").set(he(this,ne,"f").subarray(K)),he(this,ne,"f").set(G.subarray(0,K),16-K)},RL}();Object.defineProperty(G,"CFB",{enumerable:!0,get:function(){return pe.CFB}});var he=function requireModeCtr(){if(kL)return OL;kL=1;var G,K,ne,ue=pn&&pn.__classPrivateFieldSet||function(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne},pe=pn&&pn.__classPrivateFieldGet||function(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)};Object.defineProperty(OL,"__esModule",{value:!0}),OL.CTR=void 0;const he=requireMode();class CTR extends he.ModeOfOperation{constructor(he,ye){super("CTR",he,CTR),G.set(this,void 0),K.set(this,void 0),ne.set(this,void 0),ue(this,ne,new Uint8Array(16),"f"),pe(this,ne,"f").fill(0),ue(this,G,pe(this,ne,"f"),"f"),ue(this,K,16,"f"),null==ye&&(ye=1),"number"==typeof ye?this.setCounterValue(ye):this.setCounterBytes(ye)}get counter(){return new Uint8Array(pe(this,ne,"f"))}setCounterValue(G){if(!Number.isInteger(G)||G<0||G>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let K=15;K>=0;--K)pe(this,ne,"f")[K]=G%256,G=Math.floor(G/256)}setCounterBytes(G){if(16!==G.length)throw new TypeError("invalid counter initial Uint8Array value length");pe(this,ne,"f").set(G)}increment(){for(let G=15;G>=0;G--){if(255!==pe(this,ne,"f")[G]){pe(this,ne,"f")[G]++;break}pe(this,ne,"f")[G]=0}}encrypt(he){var ye,me;const be=new Uint8Array(he);for(let he=0;he<be.length;he++)16===pe(this,K,"f")&&(ue(this,G,this.aes.encrypt(pe(this,ne,"f")),"f"),ue(this,K,0,"f"),this.increment()),be[he]^=pe(this,G,"f")[(ue(this,K,(me=pe(this,K,"f"),ye=me++,me),"f"),ye)];return be}decrypt(G){return this.encrypt(G)}}return OL.CTR=CTR,G=new WeakMap,K=new WeakMap,ne=new WeakMap,OL}();Object.defineProperty(G,"CTR",{enumerable:!0,get:function(){return he.CTR}});var ye=function requireModeEcb(){if(xL)return NL;xL=1,Object.defineProperty(NL,"__esModule",{value:!0}),NL.ECB=void 0;const G=requireMode();class ECB extends G.ModeOfOperation{constructor(G){super("ECB",G,ECB)}encrypt(G){if(G.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const K=new Uint8Array(G.length);for(let ne=0;ne<G.length;ne+=16)K.set(this.aes.encrypt(G.subarray(ne,ne+16)),ne);return K}decrypt(G){if(G.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const K=new Uint8Array(G.length);for(let ne=0;ne<G.length;ne+=16)K.set(this.aes.decrypt(G.subarray(ne,ne+16)),ne);return K}}return NL.ECB=ECB,NL}();Object.defineProperty(G,"ECB",{enumerable:!0,get:function(){return ye.ECB}});var me=function requireModeOfb(){if(ML)return BL;ML=1;var G,K,ne,ue=pn&&pn.__classPrivateFieldSet||function(G,K,ne,ue,pe){if("m"===ue)throw new TypeError("Private method is not writable");if("a"===ue&&!pe)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof K?G!==K||!pe:!K.has(G))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===ue?pe.call(G,ne):pe?pe.value=ne:K.set(G,ne),ne},pe=pn&&pn.__classPrivateFieldGet||function(G,K,ne,ue){if("a"===ne&&!ue)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof K?G!==K||!ue:!K.has(G))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===ne?ue:"a"===ne?ue.call(G):ue?ue.value:K.get(G)};Object.defineProperty(BL,"__esModule",{value:!0}),BL.OFB=void 0;const he=requireMode();class OFB extends he.ModeOfOperation{constructor(pe,he){if(super("OFB",pe,OFB),G.set(this,void 0),K.set(this,void 0),ne.set(this,void 0),he){if(he.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");ue(this,G,new Uint8Array(he),"f")}else ue(this,G,new Uint8Array(16),"f");ue(this,K,this.iv,"f"),ue(this,ne,16,"f")}get iv(){return new Uint8Array(pe(this,G,"f"))}encrypt(G){var he,ye;if(G.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const me=new Uint8Array(G);for(let G=0;G<me.length;G++)16===pe(this,ne,"f")&&(ue(this,K,this.aes.encrypt(pe(this,K,"f")),"f"),ue(this,ne,0,"f")),me[G]^=pe(this,K,"f")[(ue(this,ne,(ye=pe(this,ne,"f"),he=ye++,ye),"f"),he)];return me}decrypt(G){if(G.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(G)}}return BL.OFB=OFB,G=new WeakMap,K=new WeakMap,ne=new WeakMap,BL}();Object.defineProperty(G,"OFB",{enumerable:!0,get:function(){return me.OFB}});var be=function requirePadding(){return FL||(FL=1,Object.defineProperty(LL,"__esModule",{value:!0}),LL.pkcs7Strip=LL.pkcs7Pad=void 0,LL.pkcs7Pad=function pkcs7Pad(G){const K=16-G.length%16,ne=new Uint8Array(G.length+K);ne.set(G);for(let ue=G.length;ue<ne.length;ue++)ne[ue]=K;return ne},LL.pkcs7Strip=function pkcs7Strip(G){if(G.length<16)throw new TypeError("PKCS#7 invalid length");const K=G[G.length-1];if(K>16)throw new TypeError("PKCS#7 padding byte out of range");const ne=G.length-K;for(let ue=0;ue<K;ue++)if(G[ne+ue]!==K)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(G.subarray(0,ne))}),LL}();Object.defineProperty(G,"pkcs7Pad",{enumerable:!0,get:function(){return be.pkcs7Pad}}),Object.defineProperty(G,"pkcs7Strip",{enumerable:!0,get:function(){return be.pkcs7Strip}})}(TL)),TL}var UL,$L,qL,GL={};function requireUtils(){if(UL)return GL;UL=1,Object.defineProperty(GL,"__esModule",{value:!0}),GL.spelunk=GL.getPassword=GL.zpad=GL.looseArrayify=void 0;const G=requireUtils$4();function looseArrayify(K){return"string"!=typeof K||K.startsWith("0x")||(K="0x"+K),(0,G.getBytesCopy)(K)}return GL.looseArrayify=looseArrayify,GL.zpad=function zpad(G,K){for(G=String(G);G.length<K;)G="0"+G;return G},GL.getPassword=function getPassword(K){return"string"==typeof K?(0,G.toUtf8Bytes)(K,"NFKC"):(0,G.getBytesCopy)(K)},GL.spelunk=function spelunk(K,ne){const ue=ne.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,G.assertArgument)(null!=ue,"invalid path","path",ne);const pe=ue[1],he=ue[3],ye="!"===ue[4];let me=K;for(const G of pe.toLowerCase().split(".")){if(Array.isArray(me)){if(!G.match(/^[0-9]+$/))break;me=me[parseInt(G)]}else if("object"==typeof me){let K=null;for(const ne in me)if(ne.toLowerCase()===G){K=me[ne];break}me=K}else me=null;if(null==me)break}if((0,G.assertArgument)(!ye||null!=me,"missing required value","path",pe),he&&null!=me){if("int"===he){if("string"==typeof me&&me.match(/^-?[0-9]+$/))return parseInt(me);if(Number.isSafeInteger(me))return me}if("number"===he&&"string"==typeof me&&me.match(/^-?[0-9.]*$/))return parseFloat(me);if("data"===he&&"string"==typeof me)return looseArrayify(me);if("array"===he&&Array.isArray(me))return me;if(he===typeof me)return me;(0,G.assertArgument)(!1,`wrong type found for ${he} `,"path",pe)}return me},GL}function requireJsonKeystore(){if($L)return _L;$L=1,Object.defineProperty(_L,"__esModule",{value:!0}),_L.encryptKeystoreJson=_L.encryptKeystoreJsonSync=_L.decryptKeystoreJson=_L.decryptKeystoreJsonSync=_L.isKeystoreJson=void 0;const G=requireLib_commonjs(),K=requireAddress$2(),ne=requireCrypto(),ue=requireTransaction(),pe=requireUtils$4(),he=requireUtils(),ye=require_version(),me="m/44'/60'/0'/0/0";function getAccount(ye,be){const ve=(0,pe.getBytes)(be),_e=(0,he.spelunk)(ye,"crypto.ciphertext:data!"),Te=(0,pe.hexlify)((0,ne.keccak256)((0,pe.concat)([ve.slice(16,32),_e]))).substring(2);(0,pe.assertArgument)(Te===(0,he.spelunk)(ye,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const Ee=function decrypt(K,ne,ue){if("aes-128-ctr"===(0,he.spelunk)(K,"crypto.cipher:string")){const ye=(0,he.spelunk)(K,"crypto.cipherparams.iv:data!"),me=new G.CTR(ne,ye);return(0,pe.hexlify)(me.decrypt(ue))}(0,pe.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(ye,ve.slice(0,16),_e),Pe=(0,ue.computeAddress)(Ee);if(ye.address){let G=ye.address.toLowerCase();G.startsWith("0x")||(G="0x"+G),(0,pe.assertArgument)((0,K.getAddress)(G)===Pe,"keystore address/privateKey mismatch","address",ye.address)}const Se={address:Pe,privateKey:Ee};if("0.1"===(0,he.spelunk)(ye,"x-ethers.version:string")){const K=ve.slice(32,64),ne=(0,he.spelunk)(ye,"x-ethers.mnemonicCiphertext:data!"),ue=(0,he.spelunk)(ye,"x-ethers.mnemonicCounter:data!"),be=new G.CTR(K,ue);Se.mnemonic={path:(0,he.spelunk)(ye,"x-ethers.path:string")||me,locale:(0,he.spelunk)(ye,"x-ethers.locale:string")||"en",entropy:(0,pe.hexlify)((0,pe.getBytes)(be.decrypt(ne)))}}return Se}function getDecryptKdfParams(G){const K=(0,he.spelunk)(G,"crypto.kdf:string");if(K&&"string"==typeof K){if("scrypt"===K.toLowerCase()){const ne=(0,he.spelunk)(G,"crypto.kdfparams.salt:data!"),ue=(0,he.spelunk)(G,"crypto.kdfparams.n:int!"),ye=(0,he.spelunk)(G,"crypto.kdfparams.r:int!"),me=(0,he.spelunk)(G,"crypto.kdfparams.p:int!");(0,pe.assertArgument)(ue>0&&0==(ue&ue-1),"invalid kdf.N","kdf.N",ue),(0,pe.assertArgument)(ye>0&&me>0,"invalid kdf","kdf",K);const be=(0,he.spelunk)(G,"crypto.kdfparams.dklen:int!");return(0,pe.assertArgument)(32===be,"invalid kdf.dklen","kdf.dflen",be),{name:"scrypt",salt:ne,N:ue,r:ye,p:me,dkLen:64}}if("pbkdf2"===K.toLowerCase()){const K=(0,he.spelunk)(G,"crypto.kdfparams.salt:data!"),ne=(0,he.spelunk)(G,"crypto.kdfparams.prf:string!"),ue=ne.split("-").pop();(0,pe.assertArgument)("sha256"===ue||"sha512"===ue,"invalid kdf.pdf","kdf.pdf",ne);const ye=(0,he.spelunk)(G,"crypto.kdfparams.c:int!"),me=(0,he.spelunk)(G,"crypto.kdfparams.dklen:int!");return(0,pe.assertArgument)(32===me,"invalid kdf.dklen","kdf.dklen",me),{name:"pbkdf2",salt:K,count:ye,dkLen:me,algorithm:ue}}}(0,pe.assertArgument)(!1,"unsupported key-derivation function","kdf",K)}function stall(G){return new Promise((K=>{setTimeout((()=>{K()}),G)}))}function getEncryptKdfParams(G){const K=null!=G.salt?(0,pe.getBytes)(G.salt,"options.salt"):(0,ne.randomBytes)(32);let ue=1<<17,he=8,ye=1;return G.scrypt&&(G.scrypt.N&&(ue=G.scrypt.N),G.scrypt.r&&(he=G.scrypt.r),G.scrypt.p&&(ye=G.scrypt.p)),(0,pe.assertArgument)("number"==typeof ue&&ue>0&&Number.isSafeInteger(ue)&&(BigInt(ue)&BigInt(ue-1))===BigInt(0),"invalid scrypt N parameter","options.N",ue),(0,pe.assertArgument)("number"==typeof he&&he>0&&Number.isSafeInteger(he),"invalid scrypt r parameter","options.r",he),(0,pe.assertArgument)("number"==typeof ye&&ye>0&&Number.isSafeInteger(ye),"invalid scrypt p parameter","options.p",ye),{name:"scrypt",dkLen:32,salt:K,N:ue,r:he,p:ye}}function _encryptKeystore(K,ue,be,ve){const _e=(0,pe.getBytes)(be.privateKey,"privateKey"),Te=null!=ve.iv?(0,pe.getBytes)(ve.iv,"options.iv"):(0,ne.randomBytes)(16);(0,pe.assertArgument)(16===Te.length,"invalid options.iv length","options.iv",ve.iv);const Ee=null!=ve.uuid?(0,pe.getBytes)(ve.uuid,"options.uuid"):(0,ne.randomBytes)(16);(0,pe.assertArgument)(16===Ee.length,"invalid options.uuid length","options.uuid",ve.iv);const Pe=K.slice(0,16),Se=K.slice(16,32),Ce=new G.CTR(Pe,Te),ke=(0,pe.getBytes)(Ce.encrypt(_e)),Oe=(0,ne.keccak256)((0,pe.concat)([Se,ke])),xe={address:be.address.substring(2).toLowerCase(),id:(0,pe.uuidV4)(Ee),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,pe.hexlify)(Te).substring(2)},ciphertext:(0,pe.hexlify)(ke).substring(2),kdf:"scrypt",kdfparams:{salt:(0,pe.hexlify)(ue.salt).substring(2),n:ue.N,dklen:32,p:ue.p,r:ue.r},mac:Oe.substring(2)}};if(be.mnemonic){const ue=null!=ve.client?ve.client:`ethers/${ye.version}`,_e=be.mnemonic.path||me,Te=be.mnemonic.locale||"en",Ee=K.slice(32,64),Pe=(0,pe.getBytes)(be.mnemonic.entropy,"account.mnemonic.entropy"),Se=(0,ne.randomBytes)(16),Ce=new G.CTR(Ee,Se),ke=(0,pe.getBytes)(Ce.encrypt(Pe)),Oe=new Date,Ne="UTC--"+(Oe.getUTCFullYear()+"-"+(0,he.zpad)(Oe.getUTCMonth()+1,2)+"-"+(0,he.zpad)(Oe.getUTCDate(),2)+"T"+(0,he.zpad)(Oe.getUTCHours(),2)+"-"+(0,he.zpad)(Oe.getUTCMinutes(),2)+"-"+(0,he.zpad)(Oe.getUTCSeconds(),2)+".0Z")+"--"+xe.address;xe["x-ethers"]={client:ue,gethFilename:Ne,path:_e,locale:Te,mnemonicCounter:(0,pe.hexlify)(Se).substring(2),mnemonicCiphertext:(0,pe.hexlify)(ke).substring(2),version:"0.1"}}return JSON.stringify(xe)}return _L.isKeystoreJson=function isKeystoreJson(G){try{const K=JSON.parse(G);if(3===(null!=K.version?parseInt(K.version):0))return!0}catch(G){}return!1},_L.decryptKeystoreJsonSync=function decryptKeystoreJsonSync(G,K){const ue=JSON.parse(G),ye=(0,he.getPassword)(K),me=getDecryptKdfParams(ue);if("pbkdf2"===me.name){const{salt:G,count:K,dkLen:pe,algorithm:he}=me;return getAccount(ue,(0,ne.pbkdf2)(ye,G,K,pe,he))}(0,pe.assert)("scrypt"===me.name,"cannot be reached","UNKNOWN_ERROR",{params:me});const{salt:be,N:ve,r:_e,p:Te,dkLen:Ee}=me;return getAccount(ue,(0,ne.scryptSync)(ye,be,ve,_e,Te,Ee))},_L.decryptKeystoreJson=async function decryptKeystoreJson(G,K,ue){const ye=JSON.parse(G),me=(0,he.getPassword)(K),be=getDecryptKdfParams(ye);if("pbkdf2"===be.name){ue&&(ue(0),await stall(0));const{salt:G,count:K,dkLen:pe,algorithm:he}=be,ve=(0,ne.pbkdf2)(me,G,K,pe,he);return ue&&(ue(1),await stall(0)),getAccount(ye,ve)}(0,pe.assert)("scrypt"===be.name,"cannot be reached","UNKNOWN_ERROR",{params:be});const{salt:ve,N:_e,r:Te,p:Ee,dkLen:Pe}=be;return getAccount(ye,await(0,ne.scrypt)(me,ve,_e,Te,Ee,Pe,ue))},_L.encryptKeystoreJsonSync=function encryptKeystoreJsonSync(G,K,ue){null==ue&&(ue={});const ye=(0,he.getPassword)(K),me=getEncryptKdfParams(ue),be=(0,ne.scryptSync)(ye,me.salt,me.N,me.r,me.p,64);return _encryptKeystore((0,pe.getBytes)(be),me,G,ue)},_L.encryptKeystoreJson=async function encryptKeystoreJson(G,K,ue){null==ue&&(ue={});const ye=(0,he.getPassword)(K),me=getEncryptKdfParams(ue),be=await(0,ne.scrypt)(ye,me.salt,me.N,me.r,me.p,64,ue.progressCallback);return _encryptKeystore((0,pe.getBytes)(be),me,G,ue)},_L}function requireHdwallet(){return qL||(qL=1,function(G,K){Object.defineProperty(G,"__esModule",{value:!0}),G.getIndexedAccountPath=G.getAccountPath=G.HDNodeVoidWallet=G.HDNodeWallet=G.defaultPath=void 0;const ne=requireCrypto(),ue=requireProviders(),pe=requireTransaction(),he=requireUtils$4(),ye=requireLangEn(),me=requireBaseWallet(),be=requireMnemonic(),ve=requireJsonKeystore();G.defaultPath="m/44'/60'/0'/0/0";const _e=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Te=2147483648,Ee=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function zpad(G,K){let ne="";for(;G;)ne="0123456789abcdef"[G%16]+ne,G=Math.trunc(G/16);for(;ne.length<2*K;)ne="0"+ne;return"0x"+ne}function encodeBase58Check(G){const K=(0,he.getBytes)(G),ue=(0,he.dataSlice)((0,ne.sha256)((0,ne.sha256)(K)),0,4),pe=(0,he.concat)([K,ue]);return(0,he.encodeBase58)(pe)}const Pe={};function ser_I(G,K,ue,pe){const ye=new Uint8Array(37);G&Te?((0,he.assert)(null!=pe,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),ye.set((0,he.getBytes)(pe),1)):ye.set((0,he.getBytes)(ue));for(let K=24;K>=0;K-=8)ye[33+(K>>3)]=G>>24-K&255;const me=(0,he.getBytes)((0,ne.computeHmac)("sha512",K,ye));return{IL:me.slice(0,32),IR:me.slice(32)}}function derivePath(G,K){const ne=K.split("/");(0,he.assertArgument)(ne.length>0,"invalid path","path",K),"m"===ne[0]&&((0,he.assertArgument)(0===G.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${G.depth}`,"path",K),ne.shift());let ue=G;for(let G=0;G<ne.length;G++){const K=ne[G];if(K.match(/^[0-9]+'$/)){const ne=parseInt(K.substring(0,K.length-1));(0,he.assertArgument)(ne<Te,"invalid path index",`path[${G}]`,K),ue=ue.deriveChild(Te+ne)}else if(K.match(/^[0-9]+$/)){const ne=parseInt(K);(0,he.assertArgument)(ne<Te,"invalid path index",`path[${G}]`,K),ue=ue.deriveChild(ne)}else(0,he.assertArgument)(!1,"invalid path component",`path[${G}]`,K)}return ue}var Se=new WeakSet;class HDNodeWallet extends me.BaseWallet{constructor(G,K,ue,pe,ye,me,be,ve,_e){super(K,_e),_classPrivateMethodInitSpec(this,Se),_defineProperty(this,"publicKey",void 0),_defineProperty(this,"fingerprint",void 0),_defineProperty(this,"parentFingerprint",void 0),_defineProperty(this,"mnemonic",void 0),_defineProperty(this,"chainCode",void 0),_defineProperty(this,"path",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"depth",void 0),(0,he.assertPrivate)(G,Pe,"HDNodeWallet"),(0,he.defineProperties)(this,{publicKey:K.compressedPublicKey});const Te=(0,he.dataSlice)((0,ne.ripemd160)((0,ne.sha256)(this.publicKey)),0,4);(0,he.defineProperties)(this,{parentFingerprint:ue,fingerprint:Te,chainCode:pe,path:ye,index:me,depth:be}),(0,he.defineProperties)(this,{mnemonic:ve})}connect(G){return new HDNodeWallet(Pe,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,G)}async encrypt(G,K){return await(0,ve.encryptKeystoreJson)(_assertClassBrand(Se,this,_account).call(this),G,{progressCallback:K})}encryptSync(G){return(0,ve.encryptKeystoreJsonSync)(_assertClassBrand(Se,this,_account).call(this),G)}get extendedKey(){return(0,he.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),encodeBase58Check((0,he.concat)(["0x0488ADE4",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,(0,he.concat)(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new HDNodeVoidWallet(Pe,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(G){const K=(0,he.getNumber)(G,"index");(0,he.assertArgument)(K<=4294967295,"invalid index","index",K);let ue=this.path;ue&&(ue+="/"+(2147483647&K),K&Te&&(ue+="'"));const{IR:pe,IL:ye}=ser_I(K,this.chainCode,this.publicKey,this.privateKey),me=new ne.SigningKey((0,he.toBeHex)(((0,he.toBigInt)(ye)+BigInt(this.privateKey))%Ee,32));return new HDNodeWallet(Pe,me,this.fingerprint,(0,he.hexlify)(pe),ue,K,this.depth+1,this.mnemonic,this.provider)}derivePath(G){return derivePath(this,G)}static fromExtendedKey(G){const K=(0,he.toBeArray)((0,he.decodeBase58)(G));(0,he.assertArgument)(82===K.length||encodeBase58Check(K.slice(0,78))===G,"invalid extended key","extendedKey","[ REDACTED ]");const ue=K[4],ye=(0,he.hexlify)(K.slice(5,9)),me=parseInt((0,he.hexlify)(K.slice(9,13)).substring(2),16),be=(0,he.hexlify)(K.slice(13,45)),ve=K.slice(45,78);switch((0,he.hexlify)(K.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const G=(0,he.hexlify)(ve);return new HDNodeVoidWallet(Pe,(0,pe.computeAddress)(G),G,ye,be,null,me,ue,null)}case"0x0488ade4":case"0x04358394 ":if(0!==ve[0])break;return new HDNodeWallet(Pe,new ne.SigningKey(ve.slice(1)),ye,be,null,me,ue,null,null)}(0,he.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(K,ue,pe){null==K&&(K=""),null==ue&&(ue=G.defaultPath),null==pe&&(pe=ye.LangEn.wordlist());const he=be.Mnemonic.fromEntropy((0,ne.randomBytes)(16),K,pe);return _fromSeed.call(HDNodeWallet,he.computeSeed(),he).derivePath(ue)}static fromMnemonic(K,ne){return ne||(ne=G.defaultPath),_fromSeed.call(HDNodeWallet,K.computeSeed(),K).derivePath(ne)}static fromPhrase(K,ne,ue,pe){null==ne&&(ne=""),null==ue&&(ue=G.defaultPath),null==pe&&(pe=ye.LangEn.wordlist());const he=be.Mnemonic.fromPhrase(K,ne,pe);return _fromSeed.call(HDNodeWallet,he.computeSeed(),he).derivePath(ue)}static fromSeed(G){return _fromSeed.call(HDNodeWallet,G,null)}}function _account(){const G={address:this.address,privateKey:this.privateKey},K=this.mnemonic;return this.path&&K&&"en"===K.wordlist.locale&&""===K.password&&(G.mnemonic={path:this.path,locale:"en",entropy:K.entropy}),G}function _fromSeed(G,ue){(0,he.assertArgument)((0,he.isBytesLike)(G),"invalid seed","seed","[REDACTED]");const pe=(0,he.getBytes)(G,"seed");(0,he.assertArgument)(pe.length>=16&&pe.length<=64,"invalid seed","seed","[REDACTED]");const ye=(0,he.getBytes)((0,ne.computeHmac)("sha512",_e,pe)),me=new ne.SigningKey((0,he.hexlify)(ye.slice(0,32)));return new K(Pe,me,"0x00000000",(0,he.hexlify)(ye.slice(32)),"m",0,0,ue,null)}K=HDNodeWallet,G.HDNodeWallet=HDNodeWallet;class HDNodeVoidWallet extends ue.VoidSigner{constructor(G,K,ue,pe,ye,me,be,ve,_e){super(K,_e),_defineProperty(this,"publicKey",void 0),_defineProperty(this,"fingerprint",void 0),_defineProperty(this,"parentFingerprint",void 0),_defineProperty(this,"chainCode",void 0),_defineProperty(this,"path",void 0),_defineProperty(this,"index",void 0),_defineProperty(this,"depth",void 0),(0,he.assertPrivate)(G,Pe,"HDNodeVoidWallet"),(0,he.defineProperties)(this,{publicKey:ue});const Te=(0,he.dataSlice)((0,ne.ripemd160)((0,ne.sha256)(ue)),0,4);(0,he.defineProperties)(this,{publicKey:ue,fingerprint:Te,parentFingerprint:pe,chainCode:ye,path:me,index:be,depth:ve})}connect(G){return new HDNodeVoidWallet(Pe,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,G)}get extendedKey(){return(0,he.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),encodeBase58Check((0,he.concat)(["0x0488B21E",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(G){const K=(0,he.getNumber)(G,"index");(0,he.assertArgument)(K<=4294967295,"invalid index","index",K);let ue=this.path;ue&&(ue+="/"+(2147483647&K),K&Te&&(ue+="'"));const{IR:ye,IL:me}=ser_I(K,this.chainCode,this.publicKey,null),be=ne.SigningKey.addPoints(me,this.publicKey,!0),ve=(0,pe.computeAddress)(be);return new HDNodeVoidWallet(Pe,ve,be,this.fingerprint,(0,he.hexlify)(ye),ue,K,this.depth+1,this.provider)}derivePath(G){return derivePath(this,G)}}G.HDNodeVoidWallet=HDNodeVoidWallet,G.getAccountPath=function getAccountPath(G){const K=(0,he.getNumber)(G,"index");return(0,he.assertArgument)(K>=0&&K<Te,"invalid account index","index",K),`m/44'/60'/${K}'/0/0`},G.getIndexedAccountPath=function getIndexedAccountPath(G){const K=(0,he.getNumber)(G,"index");return(0,he.assertArgument)(K>=0&&K<Te,"invalid account index","index",K),`m/44'/60'/0'/0/${K}`}}(uL)),uL}var jL,HL={};function requireJsonCrowdsale(){if(jL)return HL;jL=1,Object.defineProperty(HL,"__esModule",{value:!0}),HL.decryptCrowdsaleJson=HL.isCrowdsaleJson=void 0;const G=requireLib_commonjs(),K=requireAddress$2(),ne=requireCrypto(),ue=requireHash(),pe=requireUtils$4(),he=requireUtils();return HL.isCrowdsaleJson=function isCrowdsaleJson(G){try{if(JSON.parse(G).encseed)return!0}catch(G){}return!1},HL.decryptCrowdsaleJson=function decryptCrowdsaleJson(ye,me){const be=JSON.parse(ye),ve=(0,he.getPassword)(me),_e=(0,K.getAddress)((0,he.spelunk)(be,"ethaddr:string!")),Te=(0,he.looseArrayify)((0,he.spelunk)(be,"encseed:string!"));(0,pe.assertArgument)(Te&&Te.length%16==0,"invalid encseed","json",ye);const Ee=(0,pe.getBytes)((0,ne.pbkdf2)(ve,ve,2e3,32,"sha256")).slice(0,16),Pe=Te.slice(0,16),Se=Te.slice(16),Ce=new G.CBC(Ee,Pe),ke=(0,G.pkcs7Strip)((0,pe.getBytes)(Ce.decrypt(Se)));let Oe="";for(let G=0;G<ke.length;G++)Oe+=String.fromCharCode(ke[G]);return{address:_e,privateKey:(0,ue.id)(Oe)}},HL}var WL,zL,VL={};function requireWallet(){return zL||(zL=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Wallet=G.Mnemonic=G.encryptKeystoreJsonSync=G.encryptKeystoreJson=G.decryptKeystoreJson=G.decryptKeystoreJsonSync=G.isKeystoreJson=G.decryptCrowdsaleJson=G.isCrowdsaleJson=G.HDNodeVoidWallet=G.HDNodeWallet=G.getIndexedAccountPath=G.getAccountPath=G.defaultPath=G.BaseWallet=void 0;var K=requireBaseWallet();Object.defineProperty(G,"BaseWallet",{enumerable:!0,get:function(){return K.BaseWallet}});var ne=requireHdwallet();Object.defineProperty(G,"defaultPath",{enumerable:!0,get:function(){return ne.defaultPath}}),Object.defineProperty(G,"getAccountPath",{enumerable:!0,get:function(){return ne.getAccountPath}}),Object.defineProperty(G,"getIndexedAccountPath",{enumerable:!0,get:function(){return ne.getIndexedAccountPath}}),Object.defineProperty(G,"HDNodeWallet",{enumerable:!0,get:function(){return ne.HDNodeWallet}}),Object.defineProperty(G,"HDNodeVoidWallet",{enumerable:!0,get:function(){return ne.HDNodeVoidWallet}});var ue=requireJsonCrowdsale();Object.defineProperty(G,"isCrowdsaleJson",{enumerable:!0,get:function(){return ue.isCrowdsaleJson}}),Object.defineProperty(G,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return ue.decryptCrowdsaleJson}});var pe=requireJsonKeystore();Object.defineProperty(G,"isKeystoreJson",{enumerable:!0,get:function(){return pe.isKeystoreJson}}),Object.defineProperty(G,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return pe.decryptKeystoreJsonSync}}),Object.defineProperty(G,"decryptKeystoreJson",{enumerable:!0,get:function(){return pe.decryptKeystoreJson}}),Object.defineProperty(G,"encryptKeystoreJson",{enumerable:!0,get:function(){return pe.encryptKeystoreJson}}),Object.defineProperty(G,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return pe.encryptKeystoreJsonSync}});var he=requireMnemonic();Object.defineProperty(G,"Mnemonic",{enumerable:!0,get:function(){return he.Mnemonic}});var ye=function requireWallet$1(){var G;if(WL)return VL;WL=1,Object.defineProperty(VL,"__esModule",{value:!0}),VL.Wallet=void 0;const K=requireCrypto(),ne=requireUtils$4(),ue=requireBaseWallet(),pe=requireHdwallet(),he=requireJsonCrowdsale(),ye=requireJsonKeystore(),me=requireMnemonic();function stall(G){return new Promise((K=>{setTimeout((()=>{K()}),G)}))}class Wallet extends ue.BaseWallet{constructor(G,ne){"string"!=typeof G||G.startsWith("0x")||(G="0x"+G),super("string"==typeof G?new K.SigningKey(G):G,ne)}connect(G){return new Wallet(this.signingKey,G)}async encrypt(G,K){const ne={address:this.address,privateKey:this.privateKey};return await(0,ye.encryptKeystoreJson)(ne,G,{progressCallback:K})}encryptSync(G){const K={address:this.address,privateKey:this.privateKey};return(0,ye.encryptKeystoreJsonSync)(K,G)}static async fromEncryptedJson(G,K,ne){let ue=null;return(0,ye.isKeystoreJson)(G)?ue=await(0,ye.decryptKeystoreJson)(G,K,ne):(0,he.isCrowdsaleJson)(G)&&(ne&&(ne(0),await stall(0)),ue=(0,he.decryptCrowdsaleJson)(G,K),ne&&(ne(1),await stall(0))),_fromAccount.call(Wallet,ue)}static fromEncryptedJsonSync(G,K){let ue=null;return(0,ye.isKeystoreJson)(G)?ue=(0,ye.decryptKeystoreJsonSync)(G,K):(0,he.isCrowdsaleJson)(G)?ue=(0,he.decryptCrowdsaleJson)(G,K):(0,ne.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),_fromAccount.call(Wallet,ue)}static createRandom(G){const K=pe.HDNodeWallet.createRandom();return G?K.connect(G):K}static fromPhrase(G,K){const ne=pe.HDNodeWallet.fromPhrase(G);return K?ne.connect(K):ne}}function _fromAccount(K){if((0,ne.assertArgument)(K,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in K&&K.mnemonic&&"en"===K.mnemonic.locale){const G=me.Mnemonic.fromEntropy(K.mnemonic.entropy),ne=pe.HDNodeWallet.fromMnemonic(G,K.mnemonic.path);if(ne.address===K.address&&ne.privateKey===K.privateKey)return ne;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const ue=new G(K.privateKey);return(0,ne.assertArgument)(ue.address===K.address,"address/privateKey mismatch","json","[ REDACTED ]"),ue}return G=Wallet,VL.Wallet=Wallet,VL}();Object.defineProperty(G,"Wallet",{enumerable:!0,get:function(){return ye.Wallet}})}(oL)),oL}var KL,JL,XL,QL={},ZL={},YL={},eU={};function requireDecodeOwla(){if(JL)return YL;JL=1,Object.defineProperty(YL,"__esModule",{value:!0}),YL.decodeOwlA=void 0;const G=requireUtils$4(),K=function requireBitReader(){return KL||(KL=1,Object.defineProperty(eU,"__esModule",{value:!0}),eU.decodeBits=void 0,eU.decodeBits=function decodeBits(G,K){const ne=(1<<G)-1,ue=[];let pe=0,he=0,ye=0;for(let me=0;me<K.length;me++)for(pe=pe<<6|")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".indexOf(K[me]),he+=6;he>=G;){const K=pe>>he-G;pe&=(1<<he-G)-1,he-=G,0===K?ye+=ne:(ue.push(K+ye),ye=0)}return ue}),eU}(),ne=requireDecodeOwl();return YL.decodeOwlA=function decodeOwlA(ue,pe){let he=(0,ne.decodeOwl)(ue).join(",");return pe.split(/,/g).forEach((ne=>{const ue=ne.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,G.assertArgument)(null!==ue,"internal error parsing accents","accents",pe);let ye=0;const me=(0,K.decodeBits)(parseInt(ue[3]),ue[4]),be=parseInt(ue[2]),ve=new RegExp(`([${ue[1]}])`,"g");he=he.replace(ve,((G,K)=>(0===--me[ye]&&(K=String.fromCharCode(K.charCodeAt(0),be),ye++),K)))})),he.split(",")},YL}var tU,rU,nU,aU={};function requireWordlists(){return rU||(rU=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.wordlists=G.WordlistOwlA=G.WordlistOwl=G.LangEn=G.Wordlist=void 0;var K=requireWordlist();Object.defineProperty(G,"Wordlist",{enumerable:!0,get:function(){return K.Wordlist}});var ne=requireLangEn();Object.defineProperty(G,"LangEn",{enumerable:!0,get:function(){return ne.LangEn}});var ue=requireWordlistOwl();Object.defineProperty(G,"WordlistOwl",{enumerable:!0,get:function(){return ue.WordlistOwl}});var pe=function requireWordlistOwla(){if(XL)return ZL;XL=1,Object.defineProperty(ZL,"__esModule",{value:!0}),ZL.WordlistOwlA=void 0;const G=requireWordlistOwl(),K=requireDecodeOwla();var ne=new WeakMap;class WordlistOwlA extends G.WordlistOwl{constructor(G,K,ue,pe){super(G,K,pe),_classPrivateFieldInitSpec(this,ne,void 0),_classPrivateFieldSet2(ne,this,ue)}get _accent(){return _classPrivateFieldGet2(ne,this)}_decodeWords(){return(0,K.decodeOwlA)(this._data,this._accent)}}return ZL.WordlistOwlA=WordlistOwlA,ZL}();Object.defineProperty(G,"WordlistOwlA",{enumerable:!0,get:function(){return pe.WordlistOwlA}});var he=function requireWordlistsBrowser(){if(tU)return aU;tU=1,Object.defineProperty(aU,"__esModule",{value:!0}),aU.wordlists=void 0;const G=requireLangEn();return aU.wordlists={en:G.LangEn.wordlist()},aU}();Object.defineProperty(G,"wordlists",{enumerable:!0,get:function(){return he.wordlists}})}(QL)),QL}function requireEthers(){return nU||(nU=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ripemd160=G.keccak256=G.randomBytes=G.computeHmac=G.UndecodedEventLog=G.EventLog=G.ContractUnknownEventPayload=G.ContractTransactionResponse=G.ContractTransactionReceipt=G.ContractEventPayload=G.ContractFactory=G.Contract=G.BaseContract=G.MessagePrefix=G.EtherSymbol=G.ZeroHash=G.N=G.MaxInt256=G.MinInt256=G.MaxUint256=G.WeiPerEther=G.ZeroAddress=G.resolveAddress=G.isAddress=G.isAddressable=G.getCreate2Address=G.getCreateAddress=G.getIcapAddress=G.getAddress=G.Typed=G.TransactionDescription=G.Result=G.LogDescription=G.Interface=G.Indexed=G.ErrorDescription=G.checkResultErrors=G.StructFragment=G.ParamType=G.NamedFragment=G.FunctionFragment=G.FallbackFragment=G.Fragment=G.EventFragment=G.ErrorFragment=G.ConstructorFragment=G.AbiCoder=G.encodeBytes32String=G.decodeBytes32String=G.version=void 0,G.EtherscanPlugin=G.EnsPlugin=G.Network=G.EnsResolver=G.WebSocketProvider=G.SocketProvider=G.IpcSocketProvider=G.QuickNodeProvider=G.PocketProvider=G.InfuraWebSocketProvider=G.InfuraProvider=G.EtherscanProvider=G.CloudflareProvider=G.AnkrProvider=G.AlchemyProvider=G.BrowserProvider=G.JsonRpcSigner=G.JsonRpcProvider=G.JsonRpcApiProvider=G.FallbackProvider=G.AbstractProvider=G.VoidSigner=G.NonceManager=G.AbstractSigner=G.TransactionResponse=G.TransactionReceipt=G.Log=G.FeeData=G.Block=G.getDefaultProvider=G.verifyTypedData=G.TypedDataEncoder=G.solidityPackedSha256=G.solidityPackedKeccak256=G.solidityPacked=G.verifyMessage=G.hashMessage=G.dnsEncode=G.namehash=G.isValidName=G.ensNormalize=G.id=G.SigningKey=G.Signature=G.lock=G.scryptSync=G.scrypt=G.pbkdf2=G.sha512=G.sha256=void 0,G.toBeArray=G.getUint=G.getNumber=G.getBigInt=G.FixedNumber=G.FetchCancelSignal=G.FetchResponse=G.FetchRequest=G.EventPayload=G.isError=G.isCallException=G.makeError=G.assertPrivate=G.assertNormalize=G.assertArgumentCount=G.assertArgument=G.assert=G.resolveProperties=G.defineProperties=G.zeroPadValue=G.zeroPadBytes=G.stripZerosLeft=G.isBytesLike=G.isHexString=G.hexlify=G.getBytesCopy=G.getBytes=G.dataSlice=G.dataLength=G.concat=G.encodeBase64=G.decodeBase64=G.encodeBase58=G.decodeBase58=G.Transaction=G.recoverAddress=G.computeAddress=G.accessListify=G.showThrottleMessage=G.copyRequest=G.UnmanagedSubscriber=G.SocketSubscriber=G.SocketPendingSubscriber=G.SocketEventSubscriber=G.SocketBlockSubscriber=G.MulticoinProviderPlugin=G.NetworkPlugin=G.GasCostPlugin=G.FetchUrlFeeDataNetworkPlugin=G.FeeDataNetworkPlugin=void 0,G.wordlists=G.WordlistOwlA=G.WordlistOwl=G.LangEn=G.Wordlist=G.encryptKeystoreJsonSync=G.encryptKeystoreJson=G.decryptKeystoreJson=G.decryptKeystoreJsonSync=G.decryptCrowdsaleJson=G.isKeystoreJson=G.isCrowdsaleJson=G.getIndexedAccountPath=G.getAccountPath=G.defaultPath=G.Wallet=G.HDNodeVoidWallet=G.HDNodeWallet=G.BaseWallet=G.Mnemonic=G.uuidV4=G.encodeRlp=G.decodeRlp=G.Utf8ErrorFuncs=G.toUtf8String=G.toUtf8CodePoints=G.toUtf8Bytes=G.parseUnits=G.formatUnits=G.parseEther=G.formatEther=G.mask=G.toTwos=G.fromTwos=G.toQuantity=G.toNumber=G.toBeHex=G.toBigInt=void 0;var K=require_version();Object.defineProperty(G,"version",{enumerable:!0,get:function(){return K.version}});var ne=requireAbi();Object.defineProperty(G,"decodeBytes32String",{enumerable:!0,get:function(){return ne.decodeBytes32String}}),Object.defineProperty(G,"encodeBytes32String",{enumerable:!0,get:function(){return ne.encodeBytes32String}}),Object.defineProperty(G,"AbiCoder",{enumerable:!0,get:function(){return ne.AbiCoder}}),Object.defineProperty(G,"ConstructorFragment",{enumerable:!0,get:function(){return ne.ConstructorFragment}}),Object.defineProperty(G,"ErrorFragment",{enumerable:!0,get:function(){return ne.ErrorFragment}}),Object.defineProperty(G,"EventFragment",{enumerable:!0,get:function(){return ne.EventFragment}}),Object.defineProperty(G,"Fragment",{enumerable:!0,get:function(){return ne.Fragment}}),Object.defineProperty(G,"FallbackFragment",{enumerable:!0,get:function(){return ne.FallbackFragment}}),Object.defineProperty(G,"FunctionFragment",{enumerable:!0,get:function(){return ne.FunctionFragment}}),Object.defineProperty(G,"NamedFragment",{enumerable:!0,get:function(){return ne.NamedFragment}}),Object.defineProperty(G,"ParamType",{enumerable:!0,get:function(){return ne.ParamType}}),Object.defineProperty(G,"StructFragment",{enumerable:!0,get:function(){return ne.StructFragment}}),Object.defineProperty(G,"checkResultErrors",{enumerable:!0,get:function(){return ne.checkResultErrors}}),Object.defineProperty(G,"ErrorDescription",{enumerable:!0,get:function(){return ne.ErrorDescription}}),Object.defineProperty(G,"Indexed",{enumerable:!0,get:function(){return ne.Indexed}}),Object.defineProperty(G,"Interface",{enumerable:!0,get:function(){return ne.Interface}}),Object.defineProperty(G,"LogDescription",{enumerable:!0,get:function(){return ne.LogDescription}}),Object.defineProperty(G,"Result",{enumerable:!0,get:function(){return ne.Result}}),Object.defineProperty(G,"TransactionDescription",{enumerable:!0,get:function(){return ne.TransactionDescription}}),Object.defineProperty(G,"Typed",{enumerable:!0,get:function(){return ne.Typed}});var ue=requireAddress$2();Object.defineProperty(G,"getAddress",{enumerable:!0,get:function(){return ue.getAddress}}),Object.defineProperty(G,"getIcapAddress",{enumerable:!0,get:function(){return ue.getIcapAddress}}),Object.defineProperty(G,"getCreateAddress",{enumerable:!0,get:function(){return ue.getCreateAddress}}),Object.defineProperty(G,"getCreate2Address",{enumerable:!0,get:function(){return ue.getCreate2Address}}),Object.defineProperty(G,"isAddressable",{enumerable:!0,get:function(){return ue.isAddressable}}),Object.defineProperty(G,"isAddress",{enumerable:!0,get:function(){return ue.isAddress}}),Object.defineProperty(G,"resolveAddress",{enumerable:!0,get:function(){return ue.resolveAddress}});var pe=requireConstants();Object.defineProperty(G,"ZeroAddress",{enumerable:!0,get:function(){return pe.ZeroAddress}}),Object.defineProperty(G,"WeiPerEther",{enumerable:!0,get:function(){return pe.WeiPerEther}}),Object.defineProperty(G,"MaxUint256",{enumerable:!0,get:function(){return pe.MaxUint256}}),Object.defineProperty(G,"MinInt256",{enumerable:!0,get:function(){return pe.MinInt256}}),Object.defineProperty(G,"MaxInt256",{enumerable:!0,get:function(){return pe.MaxInt256}}),Object.defineProperty(G,"N",{enumerable:!0,get:function(){return pe.N}}),Object.defineProperty(G,"ZeroHash",{enumerable:!0,get:function(){return pe.ZeroHash}}),Object.defineProperty(G,"EtherSymbol",{enumerable:!0,get:function(){return pe.EtherSymbol}}),Object.defineProperty(G,"MessagePrefix",{enumerable:!0,get:function(){return pe.MessagePrefix}});var he=requireContract();Object.defineProperty(G,"BaseContract",{enumerable:!0,get:function(){return he.BaseContract}}),Object.defineProperty(G,"Contract",{enumerable:!0,get:function(){return he.Contract}}),Object.defineProperty(G,"ContractFactory",{enumerable:!0,get:function(){return he.ContractFactory}}),Object.defineProperty(G,"ContractEventPayload",{enumerable:!0,get:function(){return he.ContractEventPayload}}),Object.defineProperty(G,"ContractTransactionReceipt",{enumerable:!0,get:function(){return he.ContractTransactionReceipt}}),Object.defineProperty(G,"ContractTransactionResponse",{enumerable:!0,get:function(){return he.ContractTransactionResponse}}),Object.defineProperty(G,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return he.ContractUnknownEventPayload}}),Object.defineProperty(G,"EventLog",{enumerable:!0,get:function(){return he.EventLog}}),Object.defineProperty(G,"UndecodedEventLog",{enumerable:!0,get:function(){return he.UndecodedEventLog}});var ye=requireCrypto();Object.defineProperty(G,"computeHmac",{enumerable:!0,get:function(){return ye.computeHmac}}),Object.defineProperty(G,"randomBytes",{enumerable:!0,get:function(){return ye.randomBytes}}),Object.defineProperty(G,"keccak256",{enumerable:!0,get:function(){return ye.keccak256}}),Object.defineProperty(G,"ripemd160",{enumerable:!0,get:function(){return ye.ripemd160}}),Object.defineProperty(G,"sha256",{enumerable:!0,get:function(){return ye.sha256}}),Object.defineProperty(G,"sha512",{enumerable:!0,get:function(){return ye.sha512}}),Object.defineProperty(G,"pbkdf2",{enumerable:!0,get:function(){return ye.pbkdf2}}),Object.defineProperty(G,"scrypt",{enumerable:!0,get:function(){return ye.scrypt}}),Object.defineProperty(G,"scryptSync",{enumerable:!0,get:function(){return ye.scryptSync}}),Object.defineProperty(G,"lock",{enumerable:!0,get:function(){return ye.lock}}),Object.defineProperty(G,"Signature",{enumerable:!0,get:function(){return ye.Signature}}),Object.defineProperty(G,"SigningKey",{enumerable:!0,get:function(){return ye.SigningKey}});var me=requireHash();Object.defineProperty(G,"id",{enumerable:!0,get:function(){return me.id}}),Object.defineProperty(G,"ensNormalize",{enumerable:!0,get:function(){return me.ensNormalize}}),Object.defineProperty(G,"isValidName",{enumerable:!0,get:function(){return me.isValidName}}),Object.defineProperty(G,"namehash",{enumerable:!0,get:function(){return me.namehash}}),Object.defineProperty(G,"dnsEncode",{enumerable:!0,get:function(){return me.dnsEncode}}),Object.defineProperty(G,"hashMessage",{enumerable:!0,get:function(){return me.hashMessage}}),Object.defineProperty(G,"verifyMessage",{enumerable:!0,get:function(){return me.verifyMessage}}),Object.defineProperty(G,"solidityPacked",{enumerable:!0,get:function(){return me.solidityPacked}}),Object.defineProperty(G,"solidityPackedKeccak256",{enumerable:!0,get:function(){return me.solidityPackedKeccak256}}),Object.defineProperty(G,"solidityPackedSha256",{enumerable:!0,get:function(){return me.solidityPackedSha256}}),Object.defineProperty(G,"TypedDataEncoder",{enumerable:!0,get:function(){return me.TypedDataEncoder}}),Object.defineProperty(G,"verifyTypedData",{enumerable:!0,get:function(){return me.verifyTypedData}});var be=requireProviders();Object.defineProperty(G,"getDefaultProvider",{enumerable:!0,get:function(){return be.getDefaultProvider}}),Object.defineProperty(G,"Block",{enumerable:!0,get:function(){return be.Block}}),Object.defineProperty(G,"FeeData",{enumerable:!0,get:function(){return be.FeeData}}),Object.defineProperty(G,"Log",{enumerable:!0,get:function(){return be.Log}}),Object.defineProperty(G,"TransactionReceipt",{enumerable:!0,get:function(){return be.TransactionReceipt}}),Object.defineProperty(G,"TransactionResponse",{enumerable:!0,get:function(){return be.TransactionResponse}}),Object.defineProperty(G,"AbstractSigner",{enumerable:!0,get:function(){return be.AbstractSigner}}),Object.defineProperty(G,"NonceManager",{enumerable:!0,get:function(){return be.NonceManager}}),Object.defineProperty(G,"VoidSigner",{enumerable:!0,get:function(){return be.VoidSigner}}),Object.defineProperty(G,"AbstractProvider",{enumerable:!0,get:function(){return be.AbstractProvider}}),Object.defineProperty(G,"FallbackProvider",{enumerable:!0,get:function(){return be.FallbackProvider}}),Object.defineProperty(G,"JsonRpcApiProvider",{enumerable:!0,get:function(){return be.JsonRpcApiProvider}}),Object.defineProperty(G,"JsonRpcProvider",{enumerable:!0,get:function(){return be.JsonRpcProvider}}),Object.defineProperty(G,"JsonRpcSigner",{enumerable:!0,get:function(){return be.JsonRpcSigner}}),Object.defineProperty(G,"BrowserProvider",{enumerable:!0,get:function(){return be.BrowserProvider}}),Object.defineProperty(G,"AlchemyProvider",{enumerable:!0,get:function(){return be.AlchemyProvider}}),Object.defineProperty(G,"AnkrProvider",{enumerable:!0,get:function(){return be.AnkrProvider}}),Object.defineProperty(G,"CloudflareProvider",{enumerable:!0,get:function(){return be.CloudflareProvider}}),Object.defineProperty(G,"EtherscanProvider",{enumerable:!0,get:function(){return be.EtherscanProvider}}),Object.defineProperty(G,"InfuraProvider",{enumerable:!0,get:function(){return be.InfuraProvider}}),Object.defineProperty(G,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return be.InfuraWebSocketProvider}}),Object.defineProperty(G,"PocketProvider",{enumerable:!0,get:function(){return be.PocketProvider}}),Object.defineProperty(G,"QuickNodeProvider",{enumerable:!0,get:function(){return be.QuickNodeProvider}}),Object.defineProperty(G,"IpcSocketProvider",{enumerable:!0,get:function(){return be.IpcSocketProvider}}),Object.defineProperty(G,"SocketProvider",{enumerable:!0,get:function(){return be.SocketProvider}}),Object.defineProperty(G,"WebSocketProvider",{enumerable:!0,get:function(){return be.WebSocketProvider}}),Object.defineProperty(G,"EnsResolver",{enumerable:!0,get:function(){return be.EnsResolver}}),Object.defineProperty(G,"Network",{enumerable:!0,get:function(){return be.Network}}),Object.defineProperty(G,"EnsPlugin",{enumerable:!0,get:function(){return be.EnsPlugin}}),Object.defineProperty(G,"EtherscanPlugin",{enumerable:!0,get:function(){return be.EtherscanPlugin}}),Object.defineProperty(G,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return be.FeeDataNetworkPlugin}}),Object.defineProperty(G,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return be.FetchUrlFeeDataNetworkPlugin}}),Object.defineProperty(G,"GasCostPlugin",{enumerable:!0,get:function(){return be.GasCostPlugin}}),Object.defineProperty(G,"NetworkPlugin",{enumerable:!0,get:function(){return be.NetworkPlugin}}),Object.defineProperty(G,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return be.MulticoinProviderPlugin}}),Object.defineProperty(G,"SocketBlockSubscriber",{enumerable:!0,get:function(){return be.SocketBlockSubscriber}}),Object.defineProperty(G,"SocketEventSubscriber",{enumerable:!0,get:function(){return be.SocketEventSubscriber}}),Object.defineProperty(G,"SocketPendingSubscriber",{enumerable:!0,get:function(){return be.SocketPendingSubscriber}}),Object.defineProperty(G,"SocketSubscriber",{enumerable:!0,get:function(){return be.SocketSubscriber}}),Object.defineProperty(G,"UnmanagedSubscriber",{enumerable:!0,get:function(){return be.UnmanagedSubscriber}}),Object.defineProperty(G,"copyRequest",{enumerable:!0,get:function(){return be.copyRequest}}),Object.defineProperty(G,"showThrottleMessage",{enumerable:!0,get:function(){return be.showThrottleMessage}});var ve=requireTransaction();Object.defineProperty(G,"accessListify",{enumerable:!0,get:function(){return ve.accessListify}}),Object.defineProperty(G,"computeAddress",{enumerable:!0,get:function(){return ve.computeAddress}}),Object.defineProperty(G,"recoverAddress",{enumerable:!0,get:function(){return ve.recoverAddress}}),Object.defineProperty(G,"Transaction",{enumerable:!0,get:function(){return ve.Transaction}});var _e=requireUtils$4();Object.defineProperty(G,"decodeBase58",{enumerable:!0,get:function(){return _e.decodeBase58}}),Object.defineProperty(G,"encodeBase58",{enumerable:!0,get:function(){return _e.encodeBase58}}),Object.defineProperty(G,"decodeBase64",{enumerable:!0,get:function(){return _e.decodeBase64}}),Object.defineProperty(G,"encodeBase64",{enumerable:!0,get:function(){return _e.encodeBase64}}),Object.defineProperty(G,"concat",{enumerable:!0,get:function(){return _e.concat}}),Object.defineProperty(G,"dataLength",{enumerable:!0,get:function(){return _e.dataLength}}),Object.defineProperty(G,"dataSlice",{enumerable:!0,get:function(){return _e.dataSlice}}),Object.defineProperty(G,"getBytes",{enumerable:!0,get:function(){return _e.getBytes}}),Object.defineProperty(G,"getBytesCopy",{enumerable:!0,get:function(){return _e.getBytesCopy}}),Object.defineProperty(G,"hexlify",{enumerable:!0,get:function(){return _e.hexlify}}),Object.defineProperty(G,"isHexString",{enumerable:!0,get:function(){return _e.isHexString}}),Object.defineProperty(G,"isBytesLike",{enumerable:!0,get:function(){return _e.isBytesLike}}),Object.defineProperty(G,"stripZerosLeft",{enumerable:!0,get:function(){return _e.stripZerosLeft}}),Object.defineProperty(G,"zeroPadBytes",{enumerable:!0,get:function(){return _e.zeroPadBytes}}),Object.defineProperty(G,"zeroPadValue",{enumerable:!0,get:function(){return _e.zeroPadValue}}),Object.defineProperty(G,"defineProperties",{enumerable:!0,get:function(){return _e.defineProperties}}),Object.defineProperty(G,"resolveProperties",{enumerable:!0,get:function(){return _e.resolveProperties}}),Object.defineProperty(G,"assert",{enumerable:!0,get:function(){return _e.assert}}),Object.defineProperty(G,"assertArgument",{enumerable:!0,get:function(){return _e.assertArgument}}),Object.defineProperty(G,"assertArgumentCount",{enumerable:!0,get:function(){return _e.assertArgumentCount}}),Object.defineProperty(G,"assertNormalize",{enumerable:!0,get:function(){return _e.assertNormalize}}),Object.defineProperty(G,"assertPrivate",{enumerable:!0,get:function(){return _e.assertPrivate}}),Object.defineProperty(G,"makeError",{enumerable:!0,get:function(){return _e.makeError}}),Object.defineProperty(G,"isCallException",{enumerable:!0,get:function(){return _e.isCallException}}),Object.defineProperty(G,"isError",{enumerable:!0,get:function(){return _e.isError}}),Object.defineProperty(G,"EventPayload",{enumerable:!0,get:function(){return _e.EventPayload}}),Object.defineProperty(G,"FetchRequest",{enumerable:!0,get:function(){return _e.FetchRequest}}),Object.defineProperty(G,"FetchResponse",{enumerable:!0,get:function(){return _e.FetchResponse}}),Object.defineProperty(G,"FetchCancelSignal",{enumerable:!0,get:function(){return _e.FetchCancelSignal}}),Object.defineProperty(G,"FixedNumber",{enumerable:!0,get:function(){return _e.FixedNumber}}),Object.defineProperty(G,"getBigInt",{enumerable:!0,get:function(){return _e.getBigInt}}),Object.defineProperty(G,"getNumber",{enumerable:!0,get:function(){return _e.getNumber}}),Object.defineProperty(G,"getUint",{enumerable:!0,get:function(){return _e.getUint}}),Object.defineProperty(G,"toBeArray",{enumerable:!0,get:function(){return _e.toBeArray}}),Object.defineProperty(G,"toBigInt",{enumerable:!0,get:function(){return _e.toBigInt}}),Object.defineProperty(G,"toBeHex",{enumerable:!0,get:function(){return _e.toBeHex}}),Object.defineProperty(G,"toNumber",{enumerable:!0,get:function(){return _e.toNumber}}),Object.defineProperty(G,"toQuantity",{enumerable:!0,get:function(){return _e.toQuantity}}),Object.defineProperty(G,"fromTwos",{enumerable:!0,get:function(){return _e.fromTwos}}),Object.defineProperty(G,"toTwos",{enumerable:!0,get:function(){return _e.toTwos}}),Object.defineProperty(G,"mask",{enumerable:!0,get:function(){return _e.mask}}),Object.defineProperty(G,"formatEther",{enumerable:!0,get:function(){return _e.formatEther}}),Object.defineProperty(G,"parseEther",{enumerable:!0,get:function(){return _e.parseEther}}),Object.defineProperty(G,"formatUnits",{enumerable:!0,get:function(){return _e.formatUnits}}),Object.defineProperty(G,"parseUnits",{enumerable:!0,get:function(){return _e.parseUnits}}),Object.defineProperty(G,"toUtf8Bytes",{enumerable:!0,get:function(){return _e.toUtf8Bytes}}),Object.defineProperty(G,"toUtf8CodePoints",{enumerable:!0,get:function(){return _e.toUtf8CodePoints}}),Object.defineProperty(G,"toUtf8String",{enumerable:!0,get:function(){return _e.toUtf8String}}),Object.defineProperty(G,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return _e.Utf8ErrorFuncs}}),Object.defineProperty(G,"decodeRlp",{enumerable:!0,get:function(){return _e.decodeRlp}}),Object.defineProperty(G,"encodeRlp",{enumerable:!0,get:function(){return _e.encodeRlp}}),Object.defineProperty(G,"uuidV4",{enumerable:!0,get:function(){return _e.uuidV4}});var Te=requireWallet();Object.defineProperty(G,"Mnemonic",{enumerable:!0,get:function(){return Te.Mnemonic}}),Object.defineProperty(G,"BaseWallet",{enumerable:!0,get:function(){return Te.BaseWallet}}),Object.defineProperty(G,"HDNodeWallet",{enumerable:!0,get:function(){return Te.HDNodeWallet}}),Object.defineProperty(G,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Te.HDNodeVoidWallet}}),Object.defineProperty(G,"Wallet",{enumerable:!0,get:function(){return Te.Wallet}}),Object.defineProperty(G,"defaultPath",{enumerable:!0,get:function(){return Te.defaultPath}}),Object.defineProperty(G,"getAccountPath",{enumerable:!0,get:function(){return Te.getAccountPath}}),Object.defineProperty(G,"getIndexedAccountPath",{enumerable:!0,get:function(){return Te.getIndexedAccountPath}}),Object.defineProperty(G,"isCrowdsaleJson",{enumerable:!0,get:function(){return Te.isCrowdsaleJson}}),Object.defineProperty(G,"isKeystoreJson",{enumerable:!0,get:function(){return Te.isKeystoreJson}}),Object.defineProperty(G,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Te.decryptCrowdsaleJson}}),Object.defineProperty(G,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Te.decryptKeystoreJsonSync}}),Object.defineProperty(G,"decryptKeystoreJson",{enumerable:!0,get:function(){return Te.decryptKeystoreJson}}),Object.defineProperty(G,"encryptKeystoreJson",{enumerable:!0,get:function(){return Te.encryptKeystoreJson}}),Object.defineProperty(G,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Te.encryptKeystoreJsonSync}});var Ee=requireWordlists();Object.defineProperty(G,"Wordlist",{enumerable:!0,get:function(){return Ee.Wordlist}}),Object.defineProperty(G,"LangEn",{enumerable:!0,get:function(){return Ee.LangEn}}),Object.defineProperty(G,"WordlistOwl",{enumerable:!0,get:function(){return Ee.WordlistOwl}}),Object.defineProperty(G,"WordlistOwlA",{enumerable:!0,get:function(){return Ee.WordlistOwlA}}),Object.defineProperty(G,"wordlists",{enumerable:!0,get:function(){return Ee.wordlists}})}(xN)),xN}!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ethers=void 0;const K=ON,ne=K.__importStar(requireEthers());G.ethers=ne,K.__exportStar(requireEthers(),G)}(EN);var iU={};!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.DOMAIN_REGISTRY_ADDRESS=G.KNOWN_CONDUIT_KEYS_TO_CONDUIT=G.NO_CONDUIT=G.ONE_HUNDRED_PERCENT_BP=G.MAX_INT=G.BasicOrderRouteType=G.Side=G.ItemType=G.OrderType=G.EIP_712_BULK_ORDER_TYPE=G.EIP_712_ORDER_TYPE=G.OPENSEA_CONDUIT_ADDRESS=G.OPENSEA_CONDUIT_KEY=G.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=G.CROSS_CHAIN_SEAPORT_V1_6_ADDRESS=G.SEAPORT_CONTRACT_VERSION_V1_6=G.SEAPORT_CONTRACT_NAME=void 0;const K=EN;var ne,ue,pe,he;G.SEAPORT_CONTRACT_NAME="Seaport",G.SEAPORT_CONTRACT_VERSION_V1_6="1.6",G.CROSS_CHAIN_SEAPORT_V1_6_ADDRESS="0x0000000000000068F116a894984e2DB1123eB395",G.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",G.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",G.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",G.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},G.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},function(G){G[G.FULL_OPEN=0]="FULL_OPEN",G[G.PARTIAL_OPEN=1]="PARTIAL_OPEN",G[G.FULL_RESTRICTED=2]="FULL_RESTRICTED",G[G.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(ne||(G.OrderType=ne={})),function(G){G[G.NATIVE=0]="NATIVE",G[G.ERC20=1]="ERC20",G[G.ERC721=2]="ERC721",G[G.ERC1155=3]="ERC1155",G[G.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",G[G.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(ue||(G.ItemType=ue={})),function(G){G[G.OFFER=0]="OFFER",G[G.CONSIDERATION=1]="CONSIDERATION"}(pe||(G.Side=pe={})),function(G){G[G.ETH_TO_ERC721=0]="ETH_TO_ERC721",G[G.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",G[G.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",G[G.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",G[G.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",G[G.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(he||(G.BasicOrderRouteType=he={})),G.MAX_INT=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),G.ONE_HUNDRED_PERCENT_BP=10000n,G.NO_CONDUIT=K.ethers.ZeroHash,G.KNOWN_CONDUIT_KEYS_TO_CONDUIT={[G.OPENSEA_CONDUIT_KEY]:G.OPENSEA_CONDUIT_ADDRESS},G.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"}(iU);var sU={},oU={},cU={},dU={},uU={},fU={},lU={},pU={},hU={};Object.defineProperty(hU,"__esModule",{value:!0}),hU.ERC1155__factory=void 0;const yU=EN,mU=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];class ERC1155__factory{static createInterface(){return new yU.Interface(mU)}static connect(G,K){return new yU.Contract(G,mU,K)}}hU.ERC1155__factory=ERC1155__factory,ERC1155__factory.abi=mU;var bU={};Object.defineProperty(bU,"__esModule",{value:!0}),bU.ERC1155TokenReceiver__factory=void 0;const gU=EN,vU=[{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];class ERC1155TokenReceiver__factory{static createInterface(){return new gU.Interface(vU)}static connect(G,K){return new gU.Contract(G,vU,K)}}bU.ERC1155TokenReceiver__factory=ERC1155TokenReceiver__factory,ERC1155TokenReceiver__factory.abi=vU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ERC1155TokenReceiver__factory=G.ERC1155__factory=void 0;var K=hU;Object.defineProperty(G,"ERC1155__factory",{enumerable:!0,get:function(){return K.ERC1155__factory}});var ne=bU;Object.defineProperty(G,"ERC1155TokenReceiver__factory",{enumerable:!0,get:function(){return ne.ERC1155TokenReceiver__factory}})}(pU);var wU={},_U={};Object.defineProperty(_U,"__esModule",{value:!0}),_U.ERC721__factory=void 0;const TU=EN,AU=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];class ERC721__factory{static createInterface(){return new TU.Interface(AU)}static connect(G,K){return new TU.Contract(G,AU,K)}}_U.ERC721__factory=ERC721__factory,ERC721__factory.abi=AU;var EU={};Object.defineProperty(EU,"__esModule",{value:!0}),EU.ERC721TokenReceiver__factory=void 0;const PU=EN,SU=[{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];class ERC721TokenReceiver__factory{static createInterface(){return new PU.Interface(SU)}static connect(G,K){return new PU.Contract(G,SU,K)}}EU.ERC721TokenReceiver__factory=ERC721TokenReceiver__factory,ERC721TokenReceiver__factory.abi=SU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ERC721TokenReceiver__factory=G.ERC721__factory=void 0;var K=_U;Object.defineProperty(G,"ERC721__factory",{enumerable:!0,get:function(){return K.ERC721__factory}});var ne=EU;Object.defineProperty(G,"ERC721TokenReceiver__factory",{enumerable:!0,get:function(){return ne.ERC721TokenReceiver__factory}})}(wU);var IU={};Object.defineProperty(IU,"__esModule",{value:!0}),IU.ERC20__factory=void 0;const CU=EN,RU=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",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:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",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:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",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"}];let kU=class ERC20__factory{static createInterface(){return new CU.Interface(RU)}static connect(G,K){return new CU.Contract(G,RU,K)}};IU.ERC20__factory=kU,kU.abi=RU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ERC20__factory=G.erc721Sol=G.erc1155Sol=void 0,G.erc1155Sol=pU,G.erc721Sol=wU;var K=IU;Object.defineProperty(G,"ERC20__factory",{enumerable:!0,get:function(){return K.ERC20__factory}})}(lU),Object.defineProperty(fU,"__esModule",{value:!0}),fU.tokens=void 0,fU.tokens=lU,Object.defineProperty(uU,"__esModule",{value:!0}),uU.src=void 0,uU.src=fU,Object.defineProperty(dU,"__esModule",{value:!0}),dU.solmate=void 0,dU.solmate=uU;var OU={},xU={},NU={},MU={},BU={};Object.defineProperty(BU,"__esModule",{value:!0}),BU.LocalConduit__factory=void 0;const FU=EN,DU=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"address",name:"channel",type:"address"}],name:"ChannelClosed",type:"error"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"ChannelStatusAlreadySet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidController",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidItemType",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"channel",type:"address"},{indexed:!1,internalType:"bool",name:"open",type:"bool"}],name:"ChannelUpdated",type:"event"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"transfers",type:"tuple[]"}],name:"execute",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batchTransfers",type:"tuple[]"}],name:"executeBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"standardTransfers",type:"tuple[]"},{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batchTransfers",type:"tuple[]"}],name:"executeWithBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}],LU="0x60a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea26469706673582212204bd6c1ad7e8432b2ace82ccabb27cac8ed10d508fdedde8305c6353deda3a4d164736f6c63430008180033";class LocalConduit__factory extends FU.ContractFactory{constructor(...G){G.length>1?super(...G):super(DU,LU,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new FU.Interface(DU)}static connect(G,K){return new FU.Contract(G,DU,K)}}BU.LocalConduit__factory=LocalConduit__factory,LocalConduit__factory.bytecode=LU,LocalConduit__factory.abi=DU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.LocalConduit__factory=void 0;var K=BU;Object.defineProperty(G,"LocalConduit__factory",{enumerable:!0,get:function(){return K.LocalConduit__factory}})}(MU);var UU={},$U={};Object.defineProperty($U,"__esModule",{value:!0}),$U.LocalConduitController__factory=void 0;const qU=EN,GU=[{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotNewPotentialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ChannelOutOfRange",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ConduitAlreadyExists",type:"error"},{inputs:[],name:"InvalidCreator",type:"error"},{inputs:[],name:"InvalidInitialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"NewPotentialOwnerAlreadySet",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NewPotentialOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoConduit",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NoPotentialOwnerCurrentlySet",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"conduit",type:"address"},{indexed:!1,internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"NewConduit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"conduit",type:"address"},{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newPotentialOwner",type:"address"}],name:"PotentialOwnerUpdated",type:"event"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"cancelOwnershipTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"initialOwner",type:"address"}],name:"createConduit",outputs:[{internalType:"address",name:"conduit",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"uint256",name:"channelIndex",type:"uint256"}],name:"getChannel",outputs:[{internalType:"address",name:"channel",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"}],name:"getChannelStatus",outputs:[{internalType:"bool",name:"isOpen",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getChannels",outputs:[{internalType:"address[]",name:"channels",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"getConduit",outputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"bool",name:"exists",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getConduitCodeHashes",outputs:[{internalType:"bytes32",name:"creationCodeHash",type:"bytes32"},{internalType:"bytes32",name:"runtimeCodeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getKey",outputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getPotentialOwner",outputs:[{internalType:"address",name:"potentialOwner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getTotalChannels",outputs:[{internalType:"uint256",name:"totalChannels",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}],jU="0x60c060405234801561000f575f80fd5b5060405161001f60208201610082565b6020820181038252601f19601f8201166040525080519060200120608081815250505f805f1b60405161005190610082565b8190604051809103905ff590508015801561006e573d5f803e3d5ffd5b506001600160a01b03163f60a0525061008f565b610a6a8061197083390190565b60805160a0516118a46100cc5f395f81816101420152818161081101526108df01525f818161011f015281816107b9015261089b01526118a45ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c80636d435421116100885780637b37e561116100635780637b37e561146102435780638b9e028b14610256578063906c87cc1461027657806393790f4414610289575f80fd5b80636d435421146101eb5780636e9bfd9f146101fe578063794593bc14610230575f80fd5b806314afd79e116100c357806314afd79e1461018157806333bc8572146101945780634e3f9580146101b757806351710e45146101d8575f80fd5b8063027cc764146100e95780630a96ad391461011957806313ad9cab1461016c575b5f80fd5b6100fc6100f7366004610c39565b61029c565b6040516001600160a01b0390911681526020015b60405180910390f35b604080517f000000000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000602082015201610110565b61017f61017a366004610c61565b610339565b005b6100fc61018f366004610ca9565b610531565b6101a76101a2366004610cc9565b61055c565b6040519015158152602001610110565b6101ca6101c5366004610ca9565b610595565b604051908152602001610110565b61017f6101e6366004610ca9565b6105bd565b61017f6101f9366004610cc9565b6106be565b61021161020c366004610cfa565b6107ae565b604080516001600160a01b039093168352901515602083015201610110565b6100fc61023e366004610d11565b610838565b61017f610251366004610ca9565b610a0a565b610269610264366004610ca9565b610aab565b6040516101109190610d32565b6100fc610284366004610ca9565b610b28565b6101ca610297366004610ca9565b610b53565b5f6102a683610b8e565b6001600160a01b0383165f908152602081905260409020600301548083106102f157604051636ceb340b60e01b81526001600160a01b03851660048201526024015b60405180910390fd5b6001600160a01b0384165f90815260208190526040902060030180548490811061031d5761031d610d7e565b5f918252602090912001546001600160a01b0316949350505050565b61034283610bc6565b60405163c4e8fcb560e01b81526001600160a01b038381166004830152821515602483015284169063c4e8fcb5906044015f604051808303815f87803b15801561038a575f80fd5b505af115801561039c573d5f803e3d5ffd5b505050506001600160a01b038381165f908152602081815260408083209386168352600484019091529020548015158380156103d6575080155b15610425576003830180546001810182555f828152602080822090920180546001600160a01b0319166001600160a01b038a169081179091559254928152600486019091526040902055610529565b831580156104305750805b156105295760038301545f198301905f9061044d90600190610d92565b90508181146104d8575f85600301828154811061046c5761046c610d7e565b5f918252602090912001546003870180546001600160a01b03909216925082918590811061049c5761049c610d7e565b5f91825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260048701909152604090208490555b846003018054806104eb576104eb610db7565b5f828152602080822083015f1990810180546001600160a01b03191690559092019092556001600160a01b0389168252600487019052604081205550505b505050505050565b5f61053b82610b8e565b506001600160a01b039081165f908152602081905260409020600101541690565b5f61056683610b8e565b506001600160a01b039182165f9081526020818152604080832093909416825260049092019091522054151590565b5f61059f82610b8e565b506001600160a01b03165f9081526020819052604090206003015490565b6105c681610b8e565b6001600160a01b038181165f9081526020819052604090206002015416331461060d576040516388c3a11560e01b81526001600160a01b03821660048201526024016102e8565b6040515f907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da908290a26001600160a01b038082165f818152602081905260408082206002810180546001600160a01b031916905560010154905133949190911692917fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec91a46001600160a01b03165f90815260208190526040902060010180546001600160a01b03191633179055565b6106c782610bc6565b6001600160a01b0381166106f95760405163a388d26360e01b81526001600160a01b03831660048201526024016102e8565b6001600160a01b038083165f9081526020819052604090206002015481169082160361074b576040516365e0406560e11b81526001600160a01b038084166004830152821660248201526044016102e8565b6040516001600160a01b038216907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da905f90a26001600160a01b039182165f90815260208190526040902060020180546001600160a01b03191691909216179055565b5f8060ff60f81b30847f00000000000000000000000000000000000000000000000000000000000000006040516020016107eb9493929190610dcb565b60408051601f198184030181529190528051602090910120936001600160a01b0385163f7f0000000000000000000000000000000000000000000000000000000000000000149350915050565b5f6001600160a01b0382166108605760405163267eaa8160e21b815260040160405180910390fd5b606083901c3314610884576040516332db94d160e21b815260040160405180910390fd5b6040516108c3906001600160f81b031990309086907f000000000000000000000000000000000000000000000000000000000000000090602001610dcb565b604051602081830303815290604052805190602001205f1c90507f0000000000000000000000000000000000000000000000000000000000000000816001600160a01b03163f0361093257604051633194665960e11b81526001600160a01b03821660048201526024016102e8565b8260405161093f90610c16565b8190604051809103905ff590508015801561095c573d5f803e3d5ffd5b50506001600160a01b038181165f81815260208181526040918290206001810180546001600160a01b03191695881695909517909455868455815192835282018690527f4397af6128d529b8ae0442f99db1296d5136062597a15bbc61c1b2a6431a7d15910160405180910390a16040516001600160a01b03808516915f918516907fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec908390a45092915050565b610a1381610bc6565b6001600160a01b038181165f9081526020819052604090206002015416610a58576040516335809b0b60e11b81526001600160a01b03821660048201526024016102e8565b6040515f907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da908290a26001600160a01b03165f90815260208190526040902060020180546001600160a01b0319169055565b6060610ab682610b8e565b6001600160a01b0382165f908152602081815260409182902060030180548351818402810184019094528084529091830182828015610b1c57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610afe575b50505050509050919050565b5f610b3282610b8e565b506001600160a01b039081165f908152602081905260409020600201541690565b6001600160a01b0381165f9081526020819052604090205480610b89576040516304ca820960e41b815260040160405180910390fd5b919050565b6001600160a01b0381165f90815260208190526040902054610bc3576040516304ca820960e41b815260040160405180910390fd5b50565b610bcf81610b8e565b6001600160a01b038181165f90815260208190526040902060010154163314610bc35760405163d4ed9a1760e01b81526001600160a01b03821660048201526024016102e8565b610a6a80610e0583390190565b80356001600160a01b0381168114610b89575f80fd5b5f8060408385031215610c4a575f80fd5b610c5383610c23565b946020939093013593505050565b5f805f60608486031215610c73575f80fd5b610c7c84610c23565b9250610c8a60208501610c23565b915060408401358015158114610c9e575f80fd5b809150509250925092565b5f60208284031215610cb9575f80fd5b610cc282610c23565b9392505050565b5f8060408385031215610cda575f80fd5b610ce383610c23565b9150610cf160208401610c23565b90509250929050565b5f60208284031215610d0a575f80fd5b5035919050565b5f8060408385031215610d22575f80fd5b82359150610cf160208401610c23565b602080825282518282018190525f9190848201906040850190845b81811015610d725783516001600160a01b031683529284019291840191600101610d4d565b50909695505050505050565b634e487b7160e01b5f52603260045260245ffd5b81810381811115610db157634e487b7160e01b5f52601160045260245ffd5b92915050565b634e487b7160e01b5f52603160045260245ffd5b6001600160f81b031994909416845260609290921b6bffffffffffffffffffffffff19166001840152601583015260358201526055019056fe60a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea2646970667358221220b0886aab2892937538153703aeb41ab7d7ac415a3ca8c13b06cc4ce7aa06f43764736f6c63430008180033a2646970667358221220b58b5844486fa5644e523bd3c6ebc053496e4b6567a082345c1c5ff44f746df564736f6c6343000818003360a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea2646970667358221220b0886aab2892937538153703aeb41ab7d7ac415a3ca8c13b06cc4ce7aa06f43764736f6c63430008180033";class LocalConduitController__factory extends qU.ContractFactory{constructor(...G){G.length>1?super(...G):super(GU,jU,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new qU.Interface(GU)}static connect(G,K){return new qU.Contract(G,GU,K)}}$U.LocalConduitController__factory=LocalConduitController__factory,LocalConduitController__factory.bytecode=jU,LocalConduitController__factory.abi=GU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.LocalConduitController__factory=void 0;var K=$U;Object.defineProperty(G,"LocalConduitController__factory",{enumerable:!0,get:function(){return K.LocalConduitController__factory}})}(UU),Object.defineProperty(NU,"__esModule",{value:!0}),NU.conduitControllerSol=NU.conduitSol=void 0,NU.conduitSol=MU,NU.conduitControllerSol=UU;var HU={};Object.defineProperty(HU,"__esModule",{value:!0}),HU.Seaport__factory=void 0;const WU=EN,zU=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"",type:"tuple"}],name:"fulfillBasicOrder_efficient_6GL6yc",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],VU="0x61020060405234801562000011575f80fd5b50604051620061dc380380620061dc83398101604081905262000034916200031b565b808080808080808080806200004862000179565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa158015620000d3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620000f991906200034a565b506101a052505f90506200010c620002a0565b90506001600160a01b0381166200013657604051632aea588760e01b815260040160405180910390fd5b5f6200014282620002b9565b8015156101c0526001600160a01b0383166101e0529050806200016857600163929eee14555b5050505050505050505050620003e8565b5f8080808080620001a460408051808201909152600781526614d9585c1bdc9d60ca1b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a815260200162006172606a913990505f6040518060c001604052806084815260200162005fc86084913990505f60405180610100016040528060d481526020016200609e60d4913990506040518060800160405280605281526020016200604c6052913980519060200120965082805190602001209550818051906020012094505f81838560405160200162000279939291906200039c565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a620002d39190620003c8565b6040515f8181818686fa925050503d805f81146200030d576040519150601f19603f3d011682016040523d82523d5f602084013e62000312565b606091505b50909392505050565b5f602082840312156200032c575f80fd5b81516001600160a01b038116811462000343575f80fd5b9392505050565b5f80604083850312156200035c575f80fd5b505080516020909101519092909150565b5f81515f5b818110156200038e576020818501810151868301520162000372565b505f93019283525090919050565b5f620003bf620003b8620003b184886200036d565b866200036d565b846200036d565b95945050505050565b5f82620003e357634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615b24620004a45f395f61047f01525f818161036d0152818161043401528181611a7201528181611ac501526124e501525f61309501525f81816112b7015261306501525f612f2d01525f612e7501525f8181610c27015261165201525f8181610bb6015261149b01525f8181610b5001526115e401525f612ea501525f612eee01525f612eca0152615b245ff3fe608060405260043610610103575f3560e01c8063a900866b11610092578063f07ec37311610062578063f07ec373146102f7578063f2d12b1214610316578063f47b774014610329578063fb0f3ee114610116578063fd9f1e101461034c575f80fd5b8063a900866b1461028a578063b3a34c4c146102be578063e7acab24146102d1578063ed98a574146102e4575f80fd5b80637423eb3c116100d85780637423eb3c146101f757806379df72bd1461020b57806387201b411461022a578063881477321461024b578063a81744041461026a575f80fd5b801561011657806306fdde031461013e57806346423aa71461015f5780635b34b966146101d5575f80fd5b366101125761011061036b565b005b5f80fd5b61012961012436600461513d565b610402565b60405190151581526020015b60405180910390f35b348015610149575f80fd5b50610152610411565b60405161013591906151b7565b34801561016a575f80fd5b506101b36101793660046151c9565b5f9081526001602052604090205460ff808216926101008304909116916001600160781b03620100008204811692600160881b9092041690565b6040805194151585529215156020850152918301526060820152608001610135565b3480156101e0575f80fd5b506101e9610420565b604051908152602001610135565b348015610202575f80fd5b50610110610429565b348015610216575f80fd5b506101e96102253660046151e0565b6104ca565b61023d610238366004615274565b610501565b604051610135929190615418565b348015610256575f80fd5b50610129610265366004615467565b61057a565b61027d6102783660046154a5565b610598565b604051610135919061550b565b348015610295575f80fd5b506101e96102a436600461551d565b6001600160a01b03165f9081526002602052604090205490565b6101296102cc366004615536565b610633565b6101296102df36600461557b565b6106ac565b61023d6102f23660046155ff565b6106ea565b348015610302575f80fd5b506101e961031136600461551d565b61078d565b61027d61032436600461569f565b6107aa565b348015610334575f80fd5b5061033d6107f3565b60405161013593929190615741565b348015610357575f80fd5b50610129610366366004615467565b61080a565b7f000000000000000000000000000000000000000000000000000000000000000080156103b057600263929eee145c146103b05763a61be9f05f52346020526024601cfd5b806103ff5763929eee1454806103de57600263929eee145c146103de5763a61be9f05f52346020526024601cfd5b600381141581151516156103fd5763a61be9f05f52346020526024601cfd5b505b50565b5f61040b610815565b92915050565b606061041b6109c9565b905090565b5f61041b6109e1565b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061045c575080155b1561047a57604051630f45b98b60e41b815260040160405180910390fd5b6104a37f0000000000000000000000000000000000000000000000000000000000000000610a4e565b6104c0576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f806104d66004610aac565b90506104fa6104eb82610abc5b63ffffffff16565b610140830135610b39565b3590565b9392505050565b60608061056661051c6105146004610aac565b610c7d6104e3565b61053361052b60046020610ce5565b610d036104e3565b61054a61054260046040610ce5565b610d5b6104e3565b61055961054260046060610ce5565b89338a15028a0189610db3565b915091509b509b9950505050505050505050565b5f6104fa61059361058b6004610aac565b610ded6104e3565b610e45565b60606106286105b26105aa6004610aac565b610f666104e3565b604080515f808252602082019092529061060a565b6105f76040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816105c75790505b5061062261061a60046020610ce5565b610fbe6104e3565b33611016565b90505b949350505050565b5f6104fa61064c6106446004610aac565b6110546104e3565b604080515f80825260208201909252906106a4565b6106916040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816106615790505b5084336110ca565b5f6106e06106c56106bd6004610aac565b6112496104e3565b6106d461052b60046020610ce5565b853386150286016110ca565b9695505050505050565b60608061077c6106fd6105aa6004610aac565b604080515f8082526020820190925290610755565b6107426040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816107125790505b5061076561054260046020610ce5565b61077461054260046040610ce5565b883389610db3565b915091509850989650505050505050565b6001600160a01b0381165f9081526020819052604081205461040b565b60606107e56107bc6105146004610aac565b6107cb61052b60046020610ce5565b6107da61061a60046040610ce5565b338615028601611016565b90505b979650505050505050565b60605f806107ff6112a5565b925092509250909192565b5f6104fa83836112f1565b5f61012435600281901c906003166001821183341582148061083a5761083a3461142c565b506003841160a0810260240135906502030203010160d01b861a905f630101020360d01b881a61086d888289888861143d565b9096509150506101c4600583901b01355f87600581111561089057610890615351565b036108c55760443560243517156108ae57636ab37ce75f526004601cfd5b6108b8848261175a565b6108c0611824565b6109a6565b6040805160208082528183019092525f9160208201818036833701905050905060028a60058111156108f9576108f9615351565b0361091c5761091760c4356084353360e435610104355b87876118a4565b610991565b60038a600581111561093057610930615351565b0361094e5761091760c4356084353360e435610104355b87876118ef565b60048a600581111561096257610962615351565b0361097c5761091760243533608435604435606435610910565b61099160243533608435604435606435610947565b61099b8482611925565b6109a4816119df565b505b6109b1868984611a03565b6109b9611a70565b6001995050505050505050505090565b6060602080526707536561706f727460475260606020f35b5f6109ea611ac3565b600143034060801c335f525f60205260405f208054820192508281555050336001600160a01b03167f721c20121297512b72821b97f5326877ea8ecf4bb9948fea5bfcb6453074d37f82604051610a4391815260200190565b60405180910390a290565b5f816001600160a01b0316600a5a610a66919061579b565b6040515f8181818686fa925050503d805f8114610a9e576040519150601f19603f3d011682016040523d82523d5f602084013e610aa3565b606091505b50909392505050565b5f813563ffffffff16820161040b565b5f610acf61016060408051918201905290565b9050610ade8282610140611b40565b610afb610af4610aef846040610ce5565b611b49565b6040830152565b5f610b0f610b0a846060610ce5565b611b9c565b9050610b1c816060840152565b610b2f610b27825190565b610140840152565b50919050565b0190565b610140820151604080519084015180515f939284927f000000000000000000000000000000000000000000000000000000000000000092602090910190845b81811015610ba5578251601f1901805186825260c082208652905260209384019390920191600101610b78565b508060051b6040512094505050505f7f0000000000000000000000000000000000000000000000000000000000000000915060405160206060890151015f5b86811015610c11578151601f1901805186825260e082208552905260209283019290910190600101610be4565b505060408051600587901b9020601f198a0180517f00000000000000000000000000000000000000000000000000000000000000008252928b01805197815260608c018051938152610140909c019a8b5261018082209390915295909552939097525050925250919050565b5f8063ffffffff8335169050600581901b610ca16020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb57610cd3610ccd610cc88484610ce5565b611249565b82850152565b602001610cb0565b5050505050919050565b5f6104fa63ffffffff610cfd6104f68686610b358516565b16840190565b5f8063ffffffff8335169050600581901b610d276020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb57610d53610ccd610d4e8484610ce5565b611bdf565b602001610d36565b5f8063ffffffff8335169050600581901b610d7f6020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb57610dab610ccd610da68484610ce5565b611c21565b602001610d8e565b60608036155f80610dc78c8c85898b611c64565b91509150610dda8c8b8b8b8b8787612041565b9450945050505097509795505050505050565b5f8063ffffffff8335169050600581901b610e116020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb57610e3d610ccd610e388484610ce5565b612173565b602001610e20565b5f610e4e611ac3565b5f805f80855190505f5b81811015610f59575f878281518110610e7357610e736157ba565b60209081029190910101518051909150600481608001516004811115610e9b57610e9b615351565b03610ea7575050610f51565b80519450610eb4816121b6565b5f8181526001602052604081209850909650610ed690879089903615156121ef565b50865460ff16610f4e5780610140015181606001515114610ef957610ef961227d565b610f088587846020015161228a565b865460ff191660011787556040517ff280791efe782edcf06ce15c8f4dff17601db3b88eb3805a0db7d77faf757f0490610f4590889084906158bd565b60405180910390a15b50505b600101610e58565b5060019695505050505050565b5f8063ffffffff8335169050600581901b610f8a6020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb57610fb6610ccd610fb18484610ce5565b611054565b602001610f99565b5f8063ffffffff8335169050600581901b610fe26020820160408051918201905290565b828152925060208381019085015f5b83811015610cdb5761100e610ccd6110098484610ce5565b612326565b602001610ff1565b60605f36151590505f8061102e8888858b5189611c64565b9150915061103b82612359565b6110488887848885612398565b98975050505050505050565b5f61106761020060408051918201905290565b60a0810180825290915061108361107d84610aac565b8261246b565b61108f60016020840152565b61109b60016040840152565b6110b86110b16110ac856020610ce5565b6124a1565b6060840152565b610b2f6110c36124c9565b6080840152565b835160808101515f91906110f160048260048111156110eb576110eb615351565b146124e3565b5f80806111008a361515612586565b60408051600180825281830190925293965091945092505f9190816020015b61112761504f565b81526020019060019003908161111f5790505090508a815f8151811061114f5761114f6157ba565b6020026020010181905250611164818b61277e565b6111708684848b6128f7565b6040805160018082528183019092525f9160208083019080368337509192505050361515600487818111156111a7576111a7615351565b146111ca576111b88d83885f6129f7565b6111c486868684612a49565b506111dc565b6111d9888e6080015183612b4d565b95505b6111e7888c8c612c1d565b85825f815181106111fa576111fa6157ba565b6020026020010181815250506112118d8388612d40565b61122e86895f01518a602001518d8c604001518d60600151612e0d565b611236611a70565b5060019c9b505050505050505050505050565b5f61125c61020060408051918201905290565b905061127060208381019083016040611b40565b60a0810180825261128361107d84610aac565b6112946110b16110ac856060610ce5565b610b2f6110c36110ac856080610ce5565b60605f805f6112b2612e72565b90505f7f0000000000000000000000000000000000000000000000000000000000000000905060605f5281602052806040526303312e3660635260a05ff35b5f6112fa611ac3565b5f8083815b81811015611411573687878381811061131a5761131a6157ba565b905060200281019061132c919061599f565b90505f61133c602083018361551d565b90505f61134f604084016020850161551d565b90505f61136260a08501608086016159be565b905081331483331417156004821417871796505f61139661138b6113838790565b610abc6104e3565b866101400135610b39565b5f8181526001602052604090819020805461ffff19166101001781559051909a509091506001600160a01b0380851691908616907f6bacc01dbe442496068f7d234edd811f1a5f833243e0aec824f86ab861f3c90d906113f99085815260200190565b60405180910390a385600101955050505050506112ff565b5050801561142157611421612f4f565b506001949350505050565b63a61be9f05f52806020526024601cfd5b5f806114485f6124e3565b611450612f5c565b42610164351115426101443511171561147e576321ccfeb75f5261014435602052610164356040526044601cfd5b610204356102643510156114995763466aa6165f526004601cfd5b7f0000000000000000000000000000000000000000000000000000000000000000608081905260a08790526060602460c037604060646101203760e060802061016052610264356102043560051b6102a0016001820181526020810190508881526080602460208301376101608860a0528760c0525f60e0525f6102043593505f5b8481101561156f578060400261028401602081610100376040816101203760208101358317925060208401935060e0608020845260a0850194508b85528a602086015260408160608701375060010161151b565b6001850160051b610160206060526102643594505b848110156115bf578060400261028401925060a0840193508a8452896020850152604083606086013760208301359190911790600101611584565b506001600160a01b038111156115dc576339f3e3fd5f526004601cfd5b50505050505f7f00000000000000000000000000000000000000000000000000000000000000009050806080528360a052606060c460c0376020610104610120375060c06080205f9081526020812060e05260843590611650826001600160a01b03165f9081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000060808190529091506040608460a03760605161010052896101205260a061014461014037816101e05261018060802094505050506102043560051b61018001828152336020820152608060408201526101206060820152600160808201528360a0820152606060c460c083013760a061026435026101e00160a4356084357f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f318385a35f60605260608101820160405250505f61172c83612fa7565b90506117388389612ff8565b7101000000000000000000000000000001000182559150509550959350505050565b60c43560843560e4356101043584156117cb576117768161304d565b5f6040519050632671a55160e11b815260206004820152600160248201528660448201528460648201528360848201523360a48201528260c48201528160e48201526117c5868261010461305f565b5061181c565b60028660058111156117df576117df615351565b0361180657806001146117f5576117f581613116565b61180184843385613127565b61181c565b61180f8161304d565b61181c84843385856131dc565b505050505050565b346064356084356102643560061b5f80805b838110156118755761028481013592506102a481013591508683111561185e5761185e6132b3565b828703965061186d82846132c0565b604001611836565b5085851115611886576118866132b3565b61189084866132c0565b8486111561181c5761181c338688036132c0565b6118ae81836132f6565b816118d557826001146118c4576118c483613116565b6118d087878787613127565b6118e6565b6118e6828260028a8a8a8a8a613314565b50505050505050565b6118f88361304d565b61190281836132f6565b81611914576118d087878787876131dc565b6118e6828260038a8a8a8a8a613314565b5f805f805f861561194a57505060843592503391505060c4356101043560e43561195f565b50339350506084359150506024356064356044355b801561196d5761196d613393565b50600586901b6101e403356102643560061b5f80805b838110156119c45761028481013592506102a481013591508a156119ae576119ab83876159dc565b95505b6119bc878a8486898f6133a0565b604001611983565b506119d386898988888e6133a0565b50505050505050505050565b60408151146119eb5750565b5f6119f7826020015190565b90506103fd81836133d5565b611a1f8260a4355b331415600182116004909210919091161690565b15611a6b57805f611a2e825190565b9050608081901c63ffffffff8216611a4684826133f9565b601c840163fb5014fc6060529350611a6260a435888685613409565b5f6060526118e6565b505050565b7f00000000000000000000000000000000000000000000000000000000000000008015611aa1575f63929eee145d50565b63929eee145480611ab7575f63929eee145d5050565b50600163929eee145550565b7f00000000000000000000000000000000000000000000000000000000000000008015611b025763929eee145c15611b0257637fa8a9875f526004601cfd5b806103ff5763929eee145480611b2a5763929eee145c15611b2a57637fa8a9875f526004601cfd5b60018111156103fd57637fa8a9875f526004601cfd5b80838337505050565b5f63ffffffff8235166040519150808252602082018160051b81018060a084026020870183378293505b81841015611b8c5780845260209093019260a001611b73565b60405250919392505050565b9052565b5f63ffffffff8235166040519150808252602082018160051b81018060c084026020870183378293505b81841015611b8c5780845260209093019260c001611bc6565b5f611bf160a060408051918201905290565b9050611bff82826080611b40565b611c1c611c15611c10846080610ce5565b613451565b6080830152565b919050565b5f63ffffffff8235166040519150808252602082018160051b8101808360061b6020870183378293505b81841015611b8c57808452602090930192604001611c4b565b60605f611c7160016124e3565b86515f90600160e61b82351690806001600160401b03811115611c9657611c96615773565b604051908082528060200260200182016040528015611cbf578160200160208202803683370190505b50945060010160051b91505f60205b83811015611ec0575f611ce48c83613cf86104e3565b90505f805f611cf3848e612586565b6001600160781b0382166020880152919450925090505f829003611d1a5750505050611eb8565b6001600160781b0381166040808601919091528a8601849052845160a081015160c0820151608083015192909301518051600184119d909d179c600490931099509092915f5b81811015611e02575f838281518110611d7b57611d7b6157ba565b602002602001015190508b8151108d179c505f611d9d89898460800151613488565b90508160800151826060015103611dba5760608201819052611dcf565b611dc989898460600151613488565b60608301525b5f611de88360600151838a8a611de3361590565b6134c4565b606084018190526080909301929092525050600101611d60565b5087516060015180515f5b81811015611eac575f838281518110611e2857611e286157ba565b602002602001015190505f611e428b8b8460800151613488565b90508160800151826060015103611e5f5760608201819052611e74565b611e6e8b8b8460600151613488565b60608301525b5f611e898360600151838c8c611de336151590565b6060840181905260a0840180516080909501949094529092525050600101611e0d565b50505050505050505050505b602001611cce565b50506001600160e61b018103611ed857611ed8613517565b50611ee3888861277e565b5f8060205b8381101561202657858101519250821561201e575f611f0a8c83613cf86104e3565b9050885f03611f25575f87830181905260209091015261201e565b60048151608001516004811115611f3e57611f3e615351565b14611fc157611f578188866001600587901c038e613524565b611f6d575f87830181905260209091015261201e565b602080820151604083015183516080810151930151611fa69388936001600160781b039081169316913314156001909111168e17612a49565b611fbc575f87830181905260209091015261201e565b611fec565b611fd3815f015182608001518c612b4d565b878301819052935083611fec575f60209091015261201e565b886001900398505f815f0151905061201785825f015183602001518c85604001518660600151612e0d565b6001935050505b602001611ee8565b50806120345761203461357f565b5050509550959350505050565b85518551606091829161205481836159ef565b6001600160401b0381111561206b5761206b615773565b6040519080825280602002602001820160405280156120a457816020015b612091615082565b8152602001906001900390816120895790505b5092505f5b828110156120fc576120d78c5f8d84815181106120c8576120c86157ba565b60200260200101518c8c61358c565b8482815181106120e9576120e96157ba565b60209081029190910101526001016120a9565b505f5b818110156121555761212e8c60018c848151811061211f5761211f6157ba565b60200260200101518c5f61358c565b8484830181518110612142576121426157ba565b60209081029190910101526001016120ff565b506121638b84888a896135db565b9350505097509795505050505050565b5f6121846040808051918201905290565b905061219e61219a61219584610aac565b6138c4565b8252565b611c1c6121af6110ac846020610ce5565b6020830152565b5f6121cb8260600151518361014001516138e3565b81516001600160a01b03165f9081526020819052604090205461040b908390610b39565b82545f90610100900460ff161561221657811561220f5761220f856138f3565b505f61062b565b83546201000090046001600160781b031680156122715783156122415761223c86613904565b612271565b8454600160881b90046001600160781b031681106122715782156122685761226886613915565b5f91505061062b565b50600195945050505050565b632165628a5f526004601cfd5b33831480156122995750505050565b5f6122a2612e72565b61190160f01b5f9081526002828152602287815260428320908390528651939450929190601f601d840116106102e2606219840110161561230c576122e78688613926565b61190160f01b5f9081526002869052602282815260428220919052909750905061230f565b50815b61231c888285858a6139bc565b5050505050505050565b5f6123376040808051918201905290565b905061234861219a610da684610aac565b611c1c6121af610da6846020610ce5565b80518060051b6040019050602082038051602082527f4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e78383a190525050565b8351606090806001600160401b038111156123b5576123b5615773565b6040519080825280602002602001820160405280156123ee57816020015b6123db615082565b8152602001906001900390816123d35790505b5091505f5b81811015612451575f87828151811061240e5761240e6157ba565b6020026020010151905061242b89825f0151836020015185613b05565b84838151811061243d5761243d6157ba565b6020908102919091010152506001016123f3565b5061245f87838787876135db565b50505b95945050505050565b6124788282610160611b40565b612489610af4610aef846040610ce5565b6103fd61249a610b0a846060610ce5565b6060830152565b6040518135601f0163ffffffe01660200180838337913563ffffffff16815290810160405290565b5f6124db602060408051918201905290565b5f8152905090565b7f000000000000000000000000000000000000000000000000000000000000000080156125315763929eee145c1561252257637fa8a9875f526004601cfd5b8160010163929eee145d6103fd565b63929eee1454806125645763929eee145c1561255457637fa8a9875f526004601cfd5b8260010163929eee145d506103fd565b6001811461257957637fa8a9875f526004601cfd5b505060020163929eee1455565b5f805f80855f015190506125a38160a001518260c0015187613caa565b6125b657505f9250829150819050612777565b602086015160408701516001600160781b0391821694501691505f6004826080015160048111156125e9576125e9615351565b03612616576001838502189050801561260457612604613ccd565b50600193508392508291506127779050565b50818311831517801561262b5761262b613ccd565b608082015160011615848411161561264557612645613cda565b61264e826121b6565b5f81815260016020526040812091965061266c90879083908a6121ef565b61267f57505f9350839250612777915050565b805460ff1661269a5761269a835f0151878a6060015161228a565b8054608881901c806126ae57869150612771565b6001600160781b038260101c169150600186036126d2578181039650809550612771565b8086036126ed57908601858103868211029096039590612771565b80860296810291909502810186810387821102918290039695919003906001600160781b0386111561277157612731565b5f5b8215610b2f57908290069190612720565b61274461273e878461271e565b8861271e565b8015019687900496909504946001600160781b0386111561277157634e487b715f5260116020526024601cfd5b50505050505b9250925092565b805182515f5b8281101561286d575f84828151811061279f5761279f6157ba565b602002602001015190505f815f015190508381106127c4576127c48260200151613ce7565b5f8782815181106127d7576127d76157ba565b6020026020010151905080602001516001600160781b03165f036127fd57505050612865565b80516040808201519085015163bfb3f8ce5f8760200151600181111561282557612825615351565b14612841575f612836856060613cf8565b9350636088d7de9150505b8251821061285257805f526004601cfd5b61285d838389613d03565b505050505050505b600101612784565b505f5b818110156128f0575f85828151811061288b5761288b6157ba565b6020026020010151905080602001516001600160781b03165f036128af57506128e8565b8051608081015160608201516128cc9085908363a8930e9a613db4565b6128e48483604001518363d69293326104e3613db490565b5050505b600101612870565b5050505050565b60a084015160c08501516040860151515f805b82811015612974575f89604001518281518110612929576129296157ba565b602002602001015190505f815f01519050801584179350505f612960826060015183608001518c8c8b8b61295b361590565b613e1b565b60608301525060800186905260010161290a565b506080880151600481108216801561298e5761298e613517565b505050506060860151515f5b8181101561231c575f886060015182815181106129b9576129b96157ba565b602002602001015190505f6129de826060015183608001518b8b8a8a61295b36151590565b60608301525060a081015160809091015260010161299a565b8351608081015160208201513314156001821160049092109190911616156128f0575f80612a2c858489608001518988613e56565b63fb5014fc6060529092509050611a628360200151868484613409565b5f848152600160205260408120805482908290608881901c80612a6e57889150612af6565b6001600160781b038260101c169150808803612a9257908801878111935090612af6565b97880297808802979190910288018781119350906001600160781b038083119089111715612af657612ac4888361271e565b8015019788900497909104906001600160781b038083119089111715612af657634e487b715f5260116020526024601cfd5b508215612b2f578515612b23576040516310fda3e160e01b8152600481018a905260240160405180910390fd5b5f94505050505061062b565b8660881b8160101b1760011782556001945050505050949350505050565b5f83610140015184606001515114612b6757612b6761227d565b83515f8080612b768888613fd4565b915091505f8082845f885af16001600160a01b0385165f908152600260205260409020805460018101909155606086901b189550925082612bd5578515612bc857612bbf61407e565b612bc8856140c5565b505f93506104fa92505050565b505050505f805f612bf2876040015188606001516104e36140d690565b925092509250825f14612c0857612c08846140c5565b60408701919091526060860152509392505050565b6040805160208082528183019092525f916020820181803683375050506040850151519091505f5b81811015612c95575f86604001518281518110612c6457612c646157ba565b60200260200101519050846080820152612c8c81885f0151896101200151876104e361434f90565b50600101612c45565b50506060840151515f90815b81811015612d23575f87606001518281518110612cc057612cc06157ba565b602002602001015190505f6005811115612cdc57612cdc615351565b81516005811115612cef57612cef615351565b03612d0b574793508381606001511115612d0b57612d0b6132b3565b612d1a8133898861434f6104e3565b50600101612ca1565b5050612d2e826119df565b504780156128f0576128f033826132c0565b8251608081015160208201515f92839283928392916004811060019091111633909114151615612da257612d83612d7d61010083015190565b5190565b88614444565b9093509150612d9460208201612d79565b945063fb5014fc9350612dee565b600481608001516004811115612dba57612dba615351565b0361231c57805194505f8560601b9050612ddb87838b608001518b85614485565b639397928596509094509250612dee9050565b612df86060859052565b612e0485878585613409565b5f60605261231c565b60608290506060829050856001600160a01b0316876001600160a01b03167f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f318a888686604051612e609493929190615a3b565b60405180910390a35050505050505050565b5f7f00000000000000000000000000000000000000000000000000000000000000004614612f2a575060408051608080517f00000000000000000000000000000000000000000000000000000000000000005f9081527f00000000000000000000000000000000000000000000000000000000000000006020527f0000000000000000000000000000000000000000000000000000000000000000855246606090815230845260a08220949095529093529190915290565b507f000000000000000000000000000000000000000000000000000000000000000090565b63fed398fc5f526004601cfd5b600435602014610224356102401416610244356102606102643560061b01141660186101243510600160a01b60843560a4351760c4356024351717101616806103ff576103ff614550565b5f8181526001602081905260409091209060843590612fcc90849084903615156121ef565b50815460ff16610b2f57610b2f8184612ff3602463ffffffff6102443516016124a16104e3565b61228a565b5f6130058260a435611a0b565b1561040b575f805f6130168661455d565b63fb5014fc6060529194509250905061303660a43587601c860185613409565b5f60605260209190910160801b1781529392505050565b806103ff576391b3e5145f526004601cfd5b604080517f000000000000000000000000000000000000000000000000000000000000000060ff60a01b175f90815260208690527f000000000000000000000000000000000000000000000000000000000000000083526055600b20919092526001600160a01b031690505f805f805260205f85875f875af191505f519050816130f4576130eb61407e565b6130f483614615565b6001600160e01b03198116632671a55160e11b1461181c5761181c8684614626565b6369f958275f52806020526024601cfd5b833b61313e57635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af1806131ce573d156131ac57601f3d0160051c8260051c8160030281831115613195578183036003028280028480020360091c01015b5a6020820110156131a8573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b6131f357635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af180613298573d1561327757601f3d0160051c8560051c8160030281831115613260578183036003028280028480020360091c01015b5a602082011015613273573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b638ffff9805f526004601cfd5b6132c98161304d565b5f805f805f85875af1905080611a6b576132e161407e565b63bc806b965f5282602052816040526044601cfd5b5f613302836020015190565b9050818114611a6b57611a6b836119df565b5f602088510361334e5750604080885260208089018a9052632671a55160e11b91890191909152604488015260016064880181905261335d565b50606487018051600101908190525b603c60c082028901038781528660208201528560408201528460608201528360808201528260a082015250505050505050505050565b636ab37ce75f526004601cfd5b6133a98361304d565b6133b381836132f6565b816133c4576118018686868661463b565b61181c828260018989895f8a613314565b6064810151604082019060c0026044016133f084838361305f565b50506020905250565b6317b1f9428252600181526103fd565b5f806001600160e01b03198451165f805260205f85875f8b5af15f51909350149050816134425761343861407e565b846080526024607cfd5b8061181c57846080526024607cfd5b5f8063ffffffff83351690506001810160051b6134748160408051918201905290565b9250613481848483611b40565b5050919050565b5f8284036134975750806104fa565b82848309156134ad5763c63cf0895f526004601cfd5b5f6134b88584615ad7565b93909304949350505050565b5f84861461350d57838303428590038082035f6134e1838a615ad7565b6134eb838c615ad7565b6134f591906159ef565b90508584878303040181151502945050505050612462565b5092949350505050565b6312d3f5a35f526004601cfd5b8451608081015160208201515f92916004811060019091111633909114151615610f59575f8061355b87848b608001518b8a613e56565b91509150613575836020015188848463fb5014fc8a61472f565b9350505050612462565b63d5da9a1b5f526004601cfd5b613594615082565b83515f036135a5576135a58561479c565b5f8560018111156135b8576135b8615351565b036135ce576135c9868583856147ad565b612462565b612462868583338761491d565b84516060905f816001600160401b038111156135f9576135f9615773565b604051908082528060200260200182016040528015613622578160200160208202803683370190505b506040805160208082528183019092529192505f9190602082018180368337505089519192505060010160051b60205b818110156136b1575f6136688b83613cf86104e3565b805160608101519192509080156136a657478111825115161561369257638ffff9805f526004601cfd5b6136a682846020015185604001518961434f565b505050602001613652565b50505f5b8381101561381d575f8a82815181106136d0576136d06157ba565b6020026020010151905080602001516001600160781b03165f03613717575f848381518110613701576137016157ba565b9115156020928302919091019091015250613815565b600184838151811061372b5761372b6157ba565b911515602092830291909101909101528051604081015180515f5b818110156137b0575f838281518110613761576137616157ba565b6020026020010151905080606001515f1461379d57608081018051908e905285516101208701516137979184918c61434f6104e3565b60808201525b6080810151606090910152600101613746565b505050606081015180515f5b8181101561380f575f8382815181106137d7576137d76157ba565b602002602001015190505f81606001519050805f146137fb576137fb888483614a54565b5060a08101516060909101526001016137bc565b50505050505b6001016136b5565b50613827816119df565b4780156138385761383833826132c0565b85156138ae575f5b848110156138ac5783818151811061385a5761385a6157ba565b6020026020010151156138a4576138a48b828151811061387c5761387c6157ba565b60200260200101518a8b8481518110613897576138976157ba565b6020026020010151612d40565b600101613840565b505b6138b6611a70565b509098975050505050505050565b5f6138d761016060408051918201905290565b9050611c1c828261246b565b808210156103fd576103fd614a6d565b631a5155745f52806020526024601cfd5b63ee9e0e635f52806020526024601cfd5b6310fda3e15f52806020526024601cfd5b5f805f84516001811660410380820360051c9250808752806020018701915050805160e81c6003820191506001811660051b868152825160208218525060015b838110156139925760405f2082821c60051b602090811691825293840180519190941852600101613966565b50505060405f2091505f6139a582614a7a565b5f9081526020939093525050604090209392505050565b5f805f528151602083038051826041035f60018211613a1f57604087015160608801515f1a8315613a0057601b8260ff1c0190506001600160ff1b03821660408a01525b88528a855260205f60808760015afa508385528588526040880152505f515b8a148a1515169450849050613ae857858552604082526044850380516040870351630b135d3f60e11b835289604089035260205f60648b01858f5afa96508615613adc57630b135d3f60e11b5f5114613adc578b3b15613a8657634f7fb80d5f526004601cfd5b6001866041031115613a9f57638baa579f5f526004601cfd5b64010100000060608901515f1a1a15604187141615613acf57631f003d0a5f5260608801515f1a6020526024601cfd5b63815e1d645f526004601cfd5b8385529152603f198601525b5050508061181c57613af861407e565b634f7fb80d5f526004601cfd5b613b0d615082565b8251158451151715613b26576398e9db6e5f526004601cfd5b613b2e615082565b613b3b8685835f8061491d565b805160608101515f03613b505750905061062b565b613b6087878584608001516147ad565b82516040828101519082015160208085015190840151855185511891181791181715613b975763bced929d5f52846020526024601cfd5b806060015182606001511115613c1e575f865f81518110613bba57613bba6157ba565b60200260200101519050816060015183606001510389825f015181518110613be457613be46157ba565b60200260200101515f015160600151826020015181518110613c0857613c086157ba565b6020026020010151606001818152505050613c9f565b5f875f81518110613c3157613c316157ba565b60200260200101519050826060015182606001510389825f015181518110613c5b57613c5b6157ba565b60200260200101515f015160400151826020015181518110613c7f57613c7f6157ba565b602002602001015160600181815250508260600151826060018181525050505b505050949350505050565b428084111590831116818015613cbe575080155b156104fa576104fa8484614e89565b635a052b325f526004601cfd5b63a11b63ff5f526004601cfd5b63133c37c65f52806020526024601cfd5b5f6104fa8284015190565b5f838381518110613d1657613d166157ba565b602002602001015190505f815f01519050613d318160031090565b613d3d57613d3d614e9e565b60408201518015613d6057613d5b8460600151828660800151614eab565b613d73565b60808401515115613d7357613d73614ef5565b600119820183816005811115613d8b57613d8b615351565b90816005811115613d9e57613d9e615351565b9052505050606090920151604090910152505050565b82515f5b8181101561181c575f858281518110613dd357613dd36157ba565b60209081029190910101518051604082015191925090600382116004881415821515171615613e0d57855f5288602052836040526044601cfd5b505050806001019050613db8565b5f868803613e3557613e2e868689613488565b90506107e8565b6107e5613e4387878b613488565b613e4e88888b613488565b8686866134c4565b5f805f613e61614f02565b6301e4d72a815260208082015260408101898152336060830152601c820194509091508751604082015287613ea1613e9a60a083015190565b60e0840152565b613eb7613eaf60c083015190565b610100840152565b613ecd613ec560e083015190565b610120840152565b610140613edb816060850152565b5f613ee7604084015190565b90505f613ef682848701614f0c565b928301929050613f07836080870152565b5f613f13606086015190565b90505f613f2282868901614f72565b948501949050613f338560a0890152565b5f613f408e878a01614fd7565b959095019450613f518560c0890152565b8685015f613f5f8e83614ff6565b602497019687019a50613f7b9050613f768c8c0190565b615026565b8060408b901b60808b901b17178f610100018181525050613fa58c82611b9890919063ffffffff16565b60058c8e51613fb491906159dc565b613fbf911b8b6159dc565b99505050505050505050509550959350505050565b5f8083613fdf614f02565b639891976581523360208201908152608060408301819052601c9092019450905f61400b604085015190565b90505f61401a82848601614f0c565b92830192905061402b836040860152565b5f614037606087015190565b90505f61404682868801614f0c565b948501949050614057856060880152565b895f61406582898901614fd7565b9a9d96909a016004019b50949950505050505050505050565b3d156140c357601f3d0160051c60405160051c81600302818311156140b0578183036003028280028480020360091c01015b5a602082011015611a6b573d5f803e3d5ffd5b565b63939792855f52806020526024601cfd5b60603d105f8080808080866141485760405f803e5f51935060205192503d60208501113d60208501118082179850505086614148576020845f3e5f51915060208360203e60205190508160071b60208501018160a0026020850101803d10823d101761ffff8486171117985050505f80525b8661417a575f8061415d84602088018d614183565b9250975061416f83602087018c614263565b929092179850909550505b50505050612777565b5f806040519150825160c08602602001830160405285835260208660010160051b8085018360010160051b87016141c1858b81811090829003020190565b60010160051b8a861196505b8085101561422157828589015260808a843e6060830151955085608084015260608201518681116141fe858561430a565b17881797505060808a01995060a08301925060a0820191506020850194506141cd565b50505b81831015614257578083870152608088823e6060810151608082015260808801975060a081019050602083019250614224565b50505050935093915050565b604051815180851190808603818710028101602060e08202850181016040528185526001928301600590811b87019390920190911b908185015b8282101561425757808287015260a088823e60206060890160a083013e606081015160608501516142da6080840151608088015180159114171590565b818311176142e8848861430a565b60a09b909b019a179690961795505060c093840193602092909201910161429d565b5f81516040830151801560038311161561432c57506040840151600119909101905b604085015181148551831460208701516020870151141616159250505092915050565b5f8451600581111561436357614363615351565b036143a057604084015160208501516001600160a01b0316171561438957614389613393565b61439b846080015185606001516132c0565b61443e565b6001845160058111156143b5576143b5615351565b036143e6576040840151156143cc576143cc613393565b61439b8460200151848660800151876060015186866133a0565b6002845160058111156143fb576143fb615351565b0361441f5761439b84602001518486608001518760400151886060015187876118a4565b61443e84602001518486608001518760400151886060015187876118ef565b50505050565b608082901c63ffffffff604084901c8116908085169061446c9084906317b1f94290611b9816565b601c8301925061447c8482614ff6565b50509250929050565b5f8061448f614f02565b63f4dd92ce815287841860a0820152601c8101925060200160a0808252875f6144b9604083015190565b90505f6144c882858701614f0c565b9384019390506144d9846020870152565b5f6144e5606085015190565b90505f6144f482878901614f72565b958601959050614505866040890152565b5f6145128d888a01614fd7565b9687019690506145238760608a0152565b5f6145308d898b01614ff6565b905080880197508760040199505050505050505050509550959350505050565b6339f3e3fd5f526004601cfd5b6301e4d72a6102043560051b6080019081525f808260208082015260408101858152336060830152601c9190910190614597608435610af4565b6145a861014460e083016060611b40565b6101406145b6816060840152565b6145c460a082016080840152565b61016060a06102643581029290920101906145e0908290840152565b6145ea5f82840152565b6020016145f88160c0840152565b5f9181019182526020820196909652939560449095019492505050565b63d13d53d45f52806020526024601cfd5b631cf99b265f5281602052806040526044601cfd5b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166147205780873b151516614720578061470f57816146f2573d156146d157601f3d0160051c8360051c81600302818311156146ba578183036003028280028480020360091c01015b5a6020820110156146cd573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b5f805f6001600160e01b03198751165f805260205f888a5f8e5af15f519093501490508161477b5783614766575f925050506106e0565b61476e61407e565b845f52876020526024601cfd5b8061478d57845f52876020526024601cfd5b50600198975050505050505050565b63375c24c15f52806020526024601cfd5b5f805f85865160051b87015b808210156148ca576020820191508851825151106147d9576147d96148fe565b81515160051b60208a01015180516020845101515f60408301516020850151158151841015171561480e5750505050506147b9565b8260051b60208201015191505060608101935083518901915083511589831060011b17881797508198505f84528a5193508615600181146148775760608220881860408d01516101208601511860208e0151865118171715614872576148726148fe565b6148c0565b8151855260208201516020860152604082015160408601528a6080860152835160208d015261012084015160408d015260608520975060208d019250868318156148c057865183525b50505050506147b9565b5050508160608551015280156148f757600181036148ef576391b3e5145f526004601cfd5b6148f761490b565b505061443e565b637fda72795f526004601cfd5b634e487b715f5260116020526024601cfd5b5f805f86875160051b88015b80821015614a1f576020820191508151518a51811061494a5761494a6148fe565b8060051b60208c01015190506020835101515f6060835101516020840151158151841015171561497d5750505050614929565b8260051b60208201015191505060608101925082518801915082511588831060011b17871796508197505f83528a5192508515600181146149cf5760a0822087146149ca576149ca6148fe565b614a16565b815184526020820151602085015260408201516040850152608082015160808501528a60208d01528960408d015260a08220965060208d01925085831815614a1657855183525b50505050614929565b50508551606001839052508015614a4d5760018103614a45576391b3e5145f526004601cfd5b614a4d61490b565b50506128f0565b63a5f542085f528260205281604052806060526064601cfd5b63466aa6165f526004601cfd5b5f614e80565b5f6009821015614bd9576005821015614b36576003821015614ae9577f832c58a5b611aadcfa6a082ac9d04bace53d8278387f10040347b7e98eb5b30260018314027fbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde301861040b565b7ff3e8417a785f980bdaf134fa0274a6bf891eeb8195cd94b09d2aa651046e28bc60038314027fa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af11861040b565b6007821015614b8c577f25d02425402d882d211a7ab774c0ed6eca048c4d03d9af40132475744753b2a360058314027f1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b551861040b565b7fb58d772fb09b426b9dece637f61ca9065f2b994f1464b51e9207f55f7c8f594860078314027f7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc141861040b565b6011821015614d3157600d821015614c8e57600b821015614c41577f6f0ec38c21f6f583ab7f3c5413c773ffd5344c34fde1d390958e438bf667448f60098314027fd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da051861040b565b7f32f4e7485d6485f9f6c255929b9905c62ba919758bbe231f231eaeecf33d810c600b8314027fbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f1861040b565b600f821015614ce4577f8df51df98847160517f5b1186b4bc3f418d98b8a7f17f1292f392d79d600d79e600d8314027f6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a8525901861040b565b7fcc4886e37eedd9aacd6c1c2c9247197a621a71282e87a7cbc673f3736d9aa141600f8314027f1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde81861040b565b6015821015614ddd576013821015614d90577f2d7a3ed6dab270fdb8e054b2ad525f0ce2a8b89cc76c17f0965434740f673a5560118314027fc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d858771861040b565b7f54b3212a178782f104e0d514b41a9a5c4ca9c980bf6597c3cecbf280917e202a60138314027f5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e643500171861040b565b6017821015614e33577fbb40bf8cea3a5a716e2b6eb08bbdac8ec159f82f380783db3c56904f15a43d0460158314027f3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d1861040b565b7f403be09941a31d05cfc2f896505811353d45d38743288b016630cce39435476a60178314027f1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c1861040b565b61040b82614a80565b6321ccfeb75f5281602052806040526044601cfd5b6394eb6af65f526004601cfd5b5f835f5260205f2060208301835160051b81015b80821015614ee657815180841160051b93845260209384185260405f209290910190614ebf565b5050831490508061443e5761443e5b6309bde3395f526004601cfd5b5f61041b60405190565b5f825180835260208401602084018260051b82015b80831015614f5f5782518051835260208101516020840152604081015160408401526060810151606084015250602083019250608082019150614f21565b5050508060071b60200191505092915050565b5f80614f7c845190565b8084529050602084810190600583901b860181019085015b82821115614fc4575f614fa684615030565b9050614fb4818360a0615039565b506020929092019160a001614f94565b60a0840260200194505050505092915050565b5f63ffffffe0603f614fe7855190565b0116905061040b838383615039565b5f80615000845190565b8084529050600581901b61501b602086810190860183615039565b602001949350505050565b6103ff6040829052565b5f61040b825190565b8082828560045afa80153d15171561443e575f80fd5b6040518060a001604052806150626150c4565b81525f602082018190526040820152606080820181905260809091015290565b60408051610100810182525f606082018181526080830182905260a0830182905260c0830182905260e083018290528252602082018190529181019190915290565b6040518061016001604052805f6001600160a01b031681526020015f6001600160a01b0316815260200160608152602001606081526020015f600481111561510e5761510e615351565b81525f6020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b5f6020828403121561514d575f80fd5b81356001600160401b03811115615162575f80fd5b820161024081850312156104fa575f80fd5b5f81518084525f5b818110156151985760208185018101518683018201520161517c565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f6104fa6020830184615174565b5f602082840312156151d9575f80fd5b5035919050565b5f602082840312156151f0575f80fd5b81356001600160401b03811115615205575f80fd5b820161016081850312156104fa575f80fd5b5f8083601f840112615227575f80fd5b5081356001600160401b0381111561523d575f80fd5b6020830191508360208260051b8501011115615257575f80fd5b9250929050565b80356001600160a01b0381168114611c1c575f80fd5b5f805f805f805f805f805f60e08c8e03121561528e575f80fd5b6001600160401b03808d3511156152a3575f80fd5b6152b08e8e358f01615217565b909c509a5060208d01358110156152c5575f80fd5b6152d58e60208f01358f01615217565b909a50985060408d01358110156152ea575f80fd5b6152fa8e60408f01358f01615217565b909850965060608d013581101561530f575f80fd5b506153208d60608e01358e01615217565b909550935060808c0135925061533860a08d0161525e565b915060c08c013590509295989b509295989b9093969950565b634e487b7160e01b5f52602160045260245ffd5b60068110611b9857611b98615351565b615380828251615365565b6020818101516001600160a01b0390811691840191909152604080830151908401526060808301519084015260809182015116910152565b5f815180845260208085019450602084015f5b8381101561540d5781516153e0888251615375565b808401516001600160a01b031660a08901526040015160c088015260e090960195908201906001016153cb565b509495945050505050565b604080825283519082018190525f906020906060840190828701845b82811015615452578151151584529284019290840190600101615434565b50505083810360208501526106e081866153b8565b5f8060208385031215615478575f80fd5b82356001600160401b0381111561548d575f80fd5b61549985828601615217565b90969095509350505050565b5f805f80604085870312156154b8575f80fd5b84356001600160401b03808211156154ce575f80fd5b6154da88838901615217565b909650945060208701359150808211156154f2575f80fd5b506154ff87828801615217565b95989497509550505050565b602081525f6104fa60208301846153b8565b5f6020828403121561552d575f80fd5b6104fa8261525e565b5f8060408385031215615547575f80fd5b82356001600160401b0381111561555c575f80fd5b83016040818603121561556d575f80fd5b946020939093013593505050565b5f805f805f6080868803121561558f575f80fd5b85356001600160401b03808211156155a5575f80fd5b9087019060a0828a0312156155b8575f80fd5b909550602087013590808211156155cd575f80fd5b506155da88828901615217565b909550935050604086013591506155f36060870161525e565b90509295509295909350565b5f805f805f805f8060a0898b031215615616575f80fd5b88356001600160401b038082111561562c575f80fd5b6156388c838d01615217565b909a50985060208b0135915080821115615650575f80fd5b61565c8c838d01615217565b909850965060408b0135915080821115615674575f80fd5b506156818b828c01615217565b999c989b509699959896976060870135966080013595509350505050565b5f805f805f805f6080888a0312156156b5575f80fd5b87356001600160401b03808211156156cb575f80fd5b6156d78b838c01615217565b909950975060208a01359150808211156156ef575f80fd5b6156fb8b838c01615217565b909750955060408a0135915080821115615713575f80fd5b506157208a828b01615217565b909450925061573390506060890161525e565b905092959891949750929550565b606081525f6157536060830186615174565b6020830194909452506001600160a01b0391909116604090910152919050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f826157b557634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b5f815180845260208085019450602084015f5b8381101561540d5781516157f6888251615365565b838101516001600160a01b03168885015260408082015190890152606080820151908901526080908101519088015260a090960195908201906001016157e1565b5f815180845260208085019450602084015f5b8381101561540d57815161585f888251615365565b808401516001600160a01b0390811689860152604080830151908a0152606080830151908a0152608080830151908a015260a091820151169088015260c0909601959082019060010161584a565b60058110611b9857611b98615351565b828152604060208201526158dd6040820183516001600160a01b03169052565b5f60208301516158f860608401826001600160a01b03169052565b5060408301516101608060808501526159156101a08501836157ce565b91506060850151603f198584030160a08601526159328382615837565b925050608085015161594760c08601826158ad565b5060a085015160e085015260c0850151610100818187015260e0870151915061012082818801528188015192506101409150828288015280880151848801525080870151610180870152505050809150509392505050565b5f823561015e198336030181126159b4575f80fd5b9190910192915050565b5f602082840312156159ce575f80fd5b8135600581106104fa575f80fd5b8181038181111561040b5761040b615787565b8082018082111561040b5761040b615787565b5f815180845260208085019450602084015f5b8381101561540d57615a28878351615375565b60a0969096019590820190600101615a15565b5f6080808301878452602060018060a01b03808916602087015260406080604088015283895180865260a08901915060208b0195505f5b81811015615ab3578651615a87848251615365565b808701518616848801528481015185850152606090810151908401529585019591870191600101615a72565b50508781036060890152615ac7818a615a02565b9c9b505050505050505050505050565b808202811582820484141761040b5761040b61578756fea264697066735822122096875ef1894bdfe7b2f5edc7307457fb7330844836c1e3538c6f67427177396564736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class Seaport__factory extends WU.ContractFactory{constructor(...G){G.length>1?super(...G):super(zU,VU,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new WU.Interface(zU)}static connect(G,K){return new WU.Contract(G,zU,K)}}HU.Seaport__factory=Seaport__factory,Seaport__factory.bytecode=VU,Seaport__factory.abi=zU,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Seaport__factory=G.conduit=void 0,G.conduit=NU;var K=HU;Object.defineProperty(G,"Seaport__factory",{enumerable:!0,get:function(){return K.Seaport__factory}})}(xU),Object.defineProperty(OU,"__esModule",{value:!0}),OU.contracts=void 0,OU.contracts=xU;var KU={},JU={},XU={},QU={};Object.defineProperty(QU,"__esModule",{value:!0}),QU.Conduit__factory=void 0;const ZU=EN,YU=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"address",name:"channel",type:"address"}],name:"ChannelClosed",type:"error"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"ChannelStatusAlreadySet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidController",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidItemType",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"channel",type:"address"},{indexed:!1,internalType:"bool",name:"open",type:"bool"}],name:"ChannelUpdated",type:"event"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"transfers",type:"tuple[]"}],name:"execute",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batchTransfers",type:"tuple[]"}],name:"executeBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"standardTransfers",type:"tuple[]"},{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batchTransfers",type:"tuple[]"}],name:"executeWithBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}],e$="0x60a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea2646970667358221220b0886aab2892937538153703aeb41ab7d7ac415a3ca8c13b06cc4ce7aa06f43764736f6c63430008180033";class Conduit__factory extends ZU.ContractFactory{constructor(...G){G.length>1?super(...G):super(YU,e$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new ZU.Interface(YU)}static connect(G,K){return new ZU.Contract(G,YU,K)}}QU.Conduit__factory=Conduit__factory,Conduit__factory.bytecode=e$,Conduit__factory.abi=YU;var t$={};Object.defineProperty(t$,"__esModule",{value:!0}),t$.ConduitController__factory=void 0;const r$=EN,n$=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotNewPotentialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ChannelOutOfRange",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ConduitAlreadyExists",type:"error"},{inputs:[],name:"InvalidCreator",type:"error"},{inputs:[],name:"InvalidInitialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"NewPotentialOwnerAlreadySet",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NewPotentialOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoConduit",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NoPotentialOwnerCurrentlySet",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"conduit",type:"address"},{indexed:!1,internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"NewConduit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"conduit",type:"address"},{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newPotentialOwner",type:"address"}],name:"PotentialOwnerUpdated",type:"event"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"cancelOwnershipTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"initialOwner",type:"address"}],name:"createConduit",outputs:[{internalType:"address",name:"conduit",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"uint256",name:"channelIndex",type:"uint256"}],name:"getChannel",outputs:[{internalType:"address",name:"channel",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"}],name:"getChannelStatus",outputs:[{internalType:"bool",name:"isOpen",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getChannels",outputs:[{internalType:"address[]",name:"channels",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"getConduit",outputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"bool",name:"exists",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getConduitCodeHashes",outputs:[{internalType:"bytes32",name:"creationCodeHash",type:"bytes32"},{internalType:"bytes32",name:"runtimeCodeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getKey",outputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getPotentialOwner",outputs:[{internalType:"address",name:"potentialOwner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getTotalChannels",outputs:[{internalType:"uint256",name:"totalChannels",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}],a$="0x60c060405234801561000f575f80fd5b5060405161001f60208201610082565b6020820181038252601f19601f8201166040525080519060200120608081815250505f805f1b60405161005190610082565b8190604051809103905ff590508015801561006e573d5f803e3d5ffd5b506001600160a01b03163f60a0525061008f565b610a6a8061197083390190565b60805160a0516118a46100cc5f395f81816101420152818161081101526108df01525f818161011f015281816107b9015261089b01526118a45ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c80636d435421116100885780637b37e561116100635780637b37e561146102435780638b9e028b14610256578063906c87cc1461027657806393790f4414610289575f80fd5b80636d435421146101eb5780636e9bfd9f146101fe578063794593bc14610230575f80fd5b806314afd79e116100c357806314afd79e1461018157806333bc8572146101945780634e3f9580146101b757806351710e45146101d8575f80fd5b8063027cc764146100e95780630a96ad391461011957806313ad9cab1461016c575b5f80fd5b6100fc6100f7366004610c39565b61029c565b6040516001600160a01b0390911681526020015b60405180910390f35b604080517f000000000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000602082015201610110565b61017f61017a366004610c61565b610339565b005b6100fc61018f366004610ca9565b610531565b6101a76101a2366004610cc9565b61055c565b6040519015158152602001610110565b6101ca6101c5366004610ca9565b610595565b604051908152602001610110565b61017f6101e6366004610ca9565b6105bd565b61017f6101f9366004610cc9565b6106be565b61021161020c366004610cfa565b6107ae565b604080516001600160a01b039093168352901515602083015201610110565b6100fc61023e366004610d11565b610838565b61017f610251366004610ca9565b610a0a565b610269610264366004610ca9565b610aab565b6040516101109190610d32565b6100fc610284366004610ca9565b610b28565b6101ca610297366004610ca9565b610b53565b5f6102a683610b8e565b6001600160a01b0383165f908152602081905260409020600301548083106102f157604051636ceb340b60e01b81526001600160a01b03851660048201526024015b60405180910390fd5b6001600160a01b0384165f90815260208190526040902060030180548490811061031d5761031d610d7e565b5f918252602090912001546001600160a01b0316949350505050565b61034283610bc6565b60405163c4e8fcb560e01b81526001600160a01b038381166004830152821515602483015284169063c4e8fcb5906044015f604051808303815f87803b15801561038a575f80fd5b505af115801561039c573d5f803e3d5ffd5b505050506001600160a01b038381165f908152602081815260408083209386168352600484019091529020548015158380156103d6575080155b15610425576003830180546001810182555f828152602080822090920180546001600160a01b0319166001600160a01b038a169081179091559254928152600486019091526040902055610529565b831580156104305750805b156105295760038301545f198301905f9061044d90600190610d92565b90508181146104d8575f85600301828154811061046c5761046c610d7e565b5f918252602090912001546003870180546001600160a01b03909216925082918590811061049c5761049c610d7e565b5f91825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260048701909152604090208490555b846003018054806104eb576104eb610db7565b5f828152602080822083015f1990810180546001600160a01b03191690559092019092556001600160a01b0389168252600487019052604081205550505b505050505050565b5f61053b82610b8e565b506001600160a01b039081165f908152602081905260409020600101541690565b5f61056683610b8e565b506001600160a01b039182165f9081526020818152604080832093909416825260049092019091522054151590565b5f61059f82610b8e565b506001600160a01b03165f9081526020819052604090206003015490565b6105c681610b8e565b6001600160a01b038181165f9081526020819052604090206002015416331461060d576040516388c3a11560e01b81526001600160a01b03821660048201526024016102e8565b6040515f907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da908290a26001600160a01b038082165f818152602081905260408082206002810180546001600160a01b031916905560010154905133949190911692917fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec91a46001600160a01b03165f90815260208190526040902060010180546001600160a01b03191633179055565b6106c782610bc6565b6001600160a01b0381166106f95760405163a388d26360e01b81526001600160a01b03831660048201526024016102e8565b6001600160a01b038083165f9081526020819052604090206002015481169082160361074b576040516365e0406560e11b81526001600160a01b038084166004830152821660248201526044016102e8565b6040516001600160a01b038216907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da905f90a26001600160a01b039182165f90815260208190526040902060020180546001600160a01b03191691909216179055565b5f8060ff60f81b30847f00000000000000000000000000000000000000000000000000000000000000006040516020016107eb9493929190610dcb565b60408051601f198184030181529190528051602090910120936001600160a01b0385163f7f0000000000000000000000000000000000000000000000000000000000000000149350915050565b5f6001600160a01b0382166108605760405163267eaa8160e21b815260040160405180910390fd5b606083901c3314610884576040516332db94d160e21b815260040160405180910390fd5b6040516108c3906001600160f81b031990309086907f000000000000000000000000000000000000000000000000000000000000000090602001610dcb565b604051602081830303815290604052805190602001205f1c90507f0000000000000000000000000000000000000000000000000000000000000000816001600160a01b03163f0361093257604051633194665960e11b81526001600160a01b03821660048201526024016102e8565b8260405161093f90610c16565b8190604051809103905ff590508015801561095c573d5f803e3d5ffd5b50506001600160a01b038181165f81815260208181526040918290206001810180546001600160a01b03191695881695909517909455868455815192835282018690527f4397af6128d529b8ae0442f99db1296d5136062597a15bbc61c1b2a6431a7d15910160405180910390a16040516001600160a01b03808516915f918516907fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec908390a45092915050565b610a1381610bc6565b6001600160a01b038181165f9081526020819052604090206002015416610a58576040516335809b0b60e11b81526001600160a01b03821660048201526024016102e8565b6040515f907f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da908290a26001600160a01b03165f90815260208190526040902060020180546001600160a01b0319169055565b6060610ab682610b8e565b6001600160a01b0382165f908152602081815260409182902060030180548351818402810184019094528084529091830182828015610b1c57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610afe575b50505050509050919050565b5f610b3282610b8e565b506001600160a01b039081165f908152602081905260409020600201541690565b6001600160a01b0381165f9081526020819052604090205480610b89576040516304ca820960e41b815260040160405180910390fd5b919050565b6001600160a01b0381165f90815260208190526040902054610bc3576040516304ca820960e41b815260040160405180910390fd5b50565b610bcf81610b8e565b6001600160a01b038181165f90815260208190526040902060010154163314610bc35760405163d4ed9a1760e01b81526001600160a01b03821660048201526024016102e8565b610a6a80610e0583390190565b80356001600160a01b0381168114610b89575f80fd5b5f8060408385031215610c4a575f80fd5b610c5383610c23565b946020939093013593505050565b5f805f60608486031215610c73575f80fd5b610c7c84610c23565b9250610c8a60208501610c23565b915060408401358015158114610c9e575f80fd5b809150509250925092565b5f60208284031215610cb9575f80fd5b610cc282610c23565b9392505050565b5f8060408385031215610cda575f80fd5b610ce383610c23565b9150610cf160208401610c23565b90509250929050565b5f60208284031215610d0a575f80fd5b5035919050565b5f8060408385031215610d22575f80fd5b82359150610cf160208401610c23565b602080825282518282018190525f9190848201906040850190845b81811015610d725783516001600160a01b031683529284019291840191600101610d4d565b50909695505050505050565b634e487b7160e01b5f52603260045260245ffd5b81810381811115610db157634e487b7160e01b5f52601160045260245ffd5b92915050565b634e487b7160e01b5f52603160045260245ffd5b6001600160f81b031994909416845260609290921b6bffffffffffffffffffffffff19166001840152601583015260358201526055019056fe60a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea2646970667358221220b0886aab2892937538153703aeb41ab7d7ac415a3ca8c13b06cc4ce7aa06f43764736f6c63430008180033a2646970667358221220e29054c540a0f6e7d656266a120916316eb9aa4069456f077abfb7efa982c5ee64736f6c6343000818003360a060405234801561000f575f80fd5b5033608052608051610a3e61002c5f395f6101d20152610a3e5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80634ce34aa21461004e578063899e104c1461007e5780638df25d9214610091578063c4e8fcb5146100a4575b5f80fd5b61006161005c366004610834565b6100b9565b6040516001600160e01b0319909116815260200160405180910390f35b61006161008c3660046108b4565b610121565b61006161009f36600461091b565b61018a565b6100b76100b2366004610969565b6101c7565b005b5f335f525f60205260405f20546100dd576349ed56f960e11b5f523360045260245ffd5b815f5b81811015610110576101088585838181106100fd576100fd6109a2565b905060c002016102c4565b6001016100e0565b50632671a55160e11b949350505050565b5f335f525f60205260405f2054610145576349ed56f960e11b5f523360045260245ffd5b835f5b8181101561016d576101658787838181106100fd576100fd6109a2565b600101610148565b506101788484610436565b50632267841360e21b95945050505050565b5f335f525f60205260405f20546101ae576349ed56f960e11b5f523360045260245ffd5b6101b88383610436565b506346f92ec960e11b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610210576040516336abb4df60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526020819052604090205481151560ff909116151503610268576040516349271a0f60e11b81526001600160a01b038316600482015281151560248201526044015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff191685151590811790915591519182527fae63067d43ac07563b7eb8db6595635fc77f1578a2a5ea06ba91b63e2afa37e2910160405180910390a25050565b60016102d360208301836109ca565b60038111156102e4576102e46109b6565b03610329576103266102fc60408301602084016109ef565b61030c60608401604085016109ef565b61031c60808501606086016109ef565b8460a0013561056c565b50565b600261033860208301836109ca565b6003811115610349576103496109b6565b036103b6578060a00135600114610379576040516369f9582760e01b815260a0820135600482015260240161025f565b61032661038c60408301602084016109ef565b61039c60608401604085016109ef565b6103ac60808501606086016109ef565b8460800135610660565b60036103c560208301836109ca565b60038111156103d6576103d66109b6565b0361041d576103266103ee60408301602084016109ef565b6103fe60608401604085016109ef565b61040e60808501606086016109ef565b84608001358560a00135610715565b604051631e4cbc7f60e21b815260040160405180910390fd5b808280631759616b60e11b6020525f5b8381101561055f57823582018035803b61046b57635f15d6725f52806020526024601cfd5b60a08201358060051b60c0018060808501351460a0606086013514168185013583141615905080156104a657633ae8821360e21b5f5260045ffd5b506020860195506080602084016024378060061b60400190508060a00160a4525f8160c401528060c4018160a0850160c4375f808260205f875af1935083610550573d1561053057601f3d0160051c91508060051c826003028184111561051a578184036003028280028580020360091c01015b5a60208201101561052d573d5f803e3d5ffd5b50505b6357e222f160e11b5f528260045260c0606452608451602001608452805ffd5b50505050600181019050610446565b5050505060806040525050565b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166106515780873b15151661065157806106405781610623573d1561060257601f3d0160051c8360051c81600302818311156105eb578183036003028280028480020360091c01015b5a6020820110156105fe573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b833b61067757635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af180610707573d156106e557601f3d0160051c8260051c81600302818311156106ce578183036003028280028480020360091c01015b5a6020820110156106e1573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b61072c57635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af1806107d1573d156107b057601f3d0160051c8560051c8160030281831115610799578183036003028280028480020360091c01015b5a6020820110156107ac573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b5f8083601f8401126107fc575f80fd5b50813567ffffffffffffffff811115610813575f80fd5b60208301915083602060c08302850101111561082d575f80fd5b9250929050565b5f8060208385031215610845575f80fd5b823567ffffffffffffffff81111561085b575f80fd5b610867858286016107ec565b90969095509350505050565b5f8083601f840112610883575f80fd5b50813567ffffffffffffffff81111561089a575f80fd5b6020830191508360208260051b850101111561082d575f80fd5b5f805f80604085870312156108c7575f80fd5b843567ffffffffffffffff808211156108de575f80fd5b6108ea888389016107ec565b90965094506020870135915080821115610902575f80fd5b5061090f87828801610873565b95989497509550505050565b5f806020838503121561092c575f80fd5b823567ffffffffffffffff811115610942575f80fd5b61086785828601610873565b80356001600160a01b0381168114610964575f80fd5b919050565b5f806040838503121561097a575f80fd5b6109838361094e565b915060208301358015158114610997575f80fd5b809150509250929050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156109da575f80fd5b8135600481106109e8575f80fd5b9392505050565b5f602082840312156109ff575f80fd5b6109e88261094e56fea2646970667358221220b0886aab2892937538153703aeb41ab7d7ac415a3ca8c13b06cc4ce7aa06f43764736f6c63430008180033";class ConduitController__factory extends r$.ContractFactory{constructor(...G){G.length>1?super(...G):super(n$,a$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new r$.Interface(n$)}static connect(G,K){return new r$.Contract(G,n$,K)}}t$.ConduitController__factory=ConduitController__factory,ConduitController__factory.bytecode=a$,ConduitController__factory.abi=n$,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ConduitController__factory=G.Conduit__factory=void 0;var K=QU;Object.defineProperty(G,"Conduit__factory",{enumerable:!0,get:function(){return K.Conduit__factory}});var ne=t$;Object.defineProperty(G,"ConduitController__factory",{enumerable:!0,get:function(){return ne.ConduitController__factory}})}(XU);var i$={},s$={};Object.defineProperty(s$,"__esModule",{value:!0}),s$.AmountDeriver__factory=void 0;const o$=EN,c$=[{inputs:[],name:"InexactFraction",type:"error"}],d$="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea2646970667358221220a39826498d0de68d571ab26af5858e9d3d7e4d0fb3b081a46a01f21a5a6fc96d64736f6c63430008180033";class AmountDeriver__factory extends o$.ContractFactory{constructor(...G){G.length>1?super(...G):super(c$,d$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new o$.Interface(c$)}static connect(G,K){return new o$.Contract(G,c$,K)}}s$.AmountDeriver__factory=AmountDeriver__factory,AmountDeriver__factory.bytecode=d$,AmountDeriver__factory.abi=c$;var u$={};Object.defineProperty(u$,"__esModule",{value:!0}),u$.Assertions__factory=void 0;const f$=EN,l$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],p$="0x610200604052348015610010575f80fd5b506040516107b83803806107b883398101604081905261002f916102f5565b8080610039610158565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e79190610322565b506101a052505f90506100f861027e565b90506001600160a01b03811661012157604051632aea588760e01b815260040160405180910390fd5b5f61012b82610297565b8015156101c0526001600160a01b0383166101e05290508061015057600163929eee14555b5050506103b6565b5f808080808061018860408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a815260200161074e606a913990505f6040518060c00160405280608481526020016105a46084913990505f60405180610100016040528060d4815260200161067a60d4913990506040518060800160405280605281526020016106286052913980519060200120965082805190602001209550818051906020012094505f81838560405160200161025793929190610371565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102af9190610397565b6040515f8181818686fa925050503d805f81146102e7576040519150601f19603f3d011682016040523d82523d5f602084013e6102ec565b606091505b50909392505050565b5f60208284031215610305575f80fd5b81516001600160a01b038116811461031b575f80fd5b9392505050565b5f8060408385031215610333575f80fd5b505080516020909101519092909150565b5f81515f5b818110156103635760208185018101518683015201610349565b505f93019283525090919050565b5f61038e6103886103828488610344565b86610344565b84610344565b95945050505050565b5f826103b157634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b6104195f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122059b3727fd612b5707c5b2591a54bc2067a81375bbc72d00c0cec9e095f68d5d964736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class Assertions__factory extends f$.ContractFactory{constructor(...G){G.length>1?super(...G):super(l$,p$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new f$.Interface(l$)}static connect(G,K){return new f$.Contract(G,l$,K)}}u$.Assertions__factory=Assertions__factory,Assertions__factory.bytecode=p$,Assertions__factory.abi=l$;var h$={};Object.defineProperty(h$,"__esModule",{value:!0}),h$.BasicOrderFulfiller__factory=void 0;const y$=EN,m$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],b$="0x610200604052348015610010575f80fd5b506040516107c03803806107c083398101604081905261002f916102fd565b80808080808061003d610160565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100eb919061032a565b506101a052505f90506100fc610286565b90506001600160a01b03811661012557604051632aea588760e01b815260040160405180910390fd5b5f61012f8261029f565b8015156101c0526001600160a01b0383166101e05290508061015457600163929eee14555b505050505050506103be565b5f808080808061019060408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a8152602001610756606a913990505f6040518060c00160405280608481526020016105ac6084913990505f60405180610100016040528060d4815260200161068260d4913990506040518060800160405280605281526020016106306052913980519060200120965082805190602001209550818051906020012094505f81838560405160200161025f93929190610379565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102b7919061039f565b6040515f8181818686fa925050503d805f81146102ef576040519150601f19603f3d011682016040523d82523d5f602084013e6102f4565b606091505b50909392505050565b5f6020828403121561030d575f80fd5b81516001600160a01b0381168114610323575f80fd5b9392505050565b5f806040838503121561033b575f80fd5b505080516020909101519092909150565b5f81515f5b8181101561036b5760208185018101518683015201610351565b505f93019283525090919050565b5f61039661039061038a848861034c565b8661034c565b8461034c565b95945050505050565b5f826103b957634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b6104215f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea2646970667358221220ea6de715722e433f7e977dcf4cbdcdb92ac57176688d66996b43661f3af351cc64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class BasicOrderFulfiller__factory extends y$.ContractFactory{constructor(...G){G.length>1?super(...G):super(m$,b$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new y$.Interface(m$)}static connect(G,K){return new y$.Contract(G,m$,K)}}h$.BasicOrderFulfiller__factory=BasicOrderFulfiller__factory,BasicOrderFulfiller__factory.bytecode=b$,BasicOrderFulfiller__factory.abi=m$;var g$={};Object.defineProperty(g$,"__esModule",{value:!0}),g$.Consideration__factory=void 0;const v$=EN,w$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"",type:"tuple"}],name:"fulfillBasicOrder_efficient_6GL6yc",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],_$="0x61020060405234801562000011575f80fd5b50604051620061e6380380620061e683398101604081905262000034916200031f565b8080808080808080806200004762000177565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa158015620000d2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620000f891906200034e565b506101a052505f90506200010b620002a4565b90506001600160a01b0381166200013557604051632aea588760e01b815260040160405180910390fd5b5f6200014182620002bd565b8015156101c0526001600160a01b0383166101e0529050806200016757600163929eee14555b50505050505050505050620003ec565b5f8080808080620001a860408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a81526020016200617c606a913990505f6040518060c001604052806084815260200162005fd26084913990505f60405180610100016040528060d48152602001620060a860d491399050604051806080016040528060528152602001620060566052913980519060200120965082805190602001209550818051906020012094505f8183856040516020016200027d93929190620003a0565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a620002d79190620003cc565b6040515f8181818686fa925050503d805f811462000311576040519150601f19603f3d011682016040523d82523d5f602084013e62000316565b606091505b50909392505050565b5f6020828403121562000330575f80fd5b81516001600160a01b038116811462000347575f80fd5b9392505050565b5f806040838503121562000360575f80fd5b505080516020909101519092909150565b5f81515f5b8181101562000392576020818501810151868301520162000376565b505f93019283525090919050565b5f620003c3620003bc620003b5848862000371565b8662000371565b8462000371565b95945050505050565b5f82620003e757634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615b2a620004a85f395f61047f01525f818161036d0152818161043401528181611a7801528181611acb01526124eb01525f61309b01525f81816112bd015261306b01525f612f3301525f612e7b01525f8181610c2d015261165801525f8181610bbc01526114a101525f8181610b5601526115ea01525f612eab01525f612ef401525f612ed00152615b2a5ff3fe608060405260043610610103575f3560e01c8063a900866b11610092578063f07ec37311610062578063f07ec373146102f7578063f2d12b1214610316578063f47b774014610329578063fb0f3ee114610116578063fd9f1e101461034c575f80fd5b8063a900866b1461028a578063b3a34c4c146102be578063e7acab24146102d1578063ed98a574146102e4575f80fd5b80637423eb3c116100d85780637423eb3c146101f757806379df72bd1461020b57806387201b411461022a578063881477321461024b578063a81744041461026a575f80fd5b801561011657806306fdde031461013e57806346423aa71461015f5780635b34b966146101d5575f80fd5b366101125761011061036b565b005b5f80fd5b610129610124366004615143565b610402565b60405190151581526020015b60405180910390f35b348015610149575f80fd5b50610152610411565b60405161013591906151bd565b34801561016a575f80fd5b506101b36101793660046151cf565b5f9081526001602052604090205460ff808216926101008304909116916001600160781b03620100008204811692600160881b9092041690565b6040805194151585529215156020850152918301526060820152608001610135565b3480156101e0575f80fd5b506101e9610420565b604051908152602001610135565b348015610202575f80fd5b50610110610429565b348015610216575f80fd5b506101e96102253660046151e6565b6104ca565b61023d61023836600461527a565b610501565b60405161013592919061541e565b348015610256575f80fd5b5061012961026536600461546d565b61057a565b61027d6102783660046154ab565b610598565b6040516101359190615511565b348015610295575f80fd5b506101e96102a4366004615523565b6001600160a01b03165f9081526002602052604090205490565b6101296102cc36600461553c565b610633565b6101296102df366004615581565b6106ac565b61023d6102f2366004615605565b6106ea565b348015610302575f80fd5b506101e9610311366004615523565b61078d565b61027d6103243660046156a5565b6107aa565b348015610334575f80fd5b5061033d6107f3565b60405161013593929190615747565b348015610357575f80fd5b5061012961036636600461546d565b61080a565b7f000000000000000000000000000000000000000000000000000000000000000080156103b057600263929eee145c146103b05763a61be9f05f52346020526024601cfd5b806103ff5763929eee1454806103de57600263929eee145c146103de5763a61be9f05f52346020526024601cfd5b600381141581151516156103fd5763a61be9f05f52346020526024601cfd5b505b50565b5f61040b610815565b92915050565b606061041b6109c9565b905090565b5f61041b6109e7565b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061045c575080155b1561047a57604051630f45b98b60e41b815260040160405180910390fd5b6104a37f0000000000000000000000000000000000000000000000000000000000000000610a54565b6104c0576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f806104d66004610ab2565b90506104fa6104eb82610ac25b63ffffffff16565b610140830135610b3f565b3590565b9392505050565b60608061056661051c6105146004610ab2565b610c836104e3565b61053361052b60046020610ceb565b610d096104e3565b61054a61054260046040610ceb565b610d616104e3565b61055961054260046060610ceb565b89338a15028a0189610db9565b915091509b509b9950505050505050505050565b5f6104fa61059361058b6004610ab2565b610df36104e3565b610e4b565b60606106286105b26105aa6004610ab2565b610f6c6104e3565b604080515f808252602082019092529061060a565b6105f76040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816105c75790505b5061062261061a60046020610ceb565b610fc46104e3565b3361101c565b90505b949350505050565b5f6104fa61064c6106446004610ab2565b61105a6104e3565b604080515f80825260208201909252906106a4565b6106916040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816106615790505b5084336110d0565b5f6106e06106c56106bd6004610ab2565b61124f6104e3565b6106d461052b60046020610ceb565b853386150286016110d0565b9695505050505050565b60608061077c6106fd6105aa6004610ab2565b604080515f8082526020820190925290610755565b6107426040805160a081019091525f808252602082019081526020015f81526020015f8152602001606081525090565b8152602001906001900390816107125790505b5061076561054260046020610ceb565b61077461054260046040610ceb565b883389610db9565b915091509850989650505050505050565b6001600160a01b0381165f9081526020819052604081205461040b565b60606107e56107bc6105146004610ab2565b6107cb61052b60046020610ceb565b6107da61061a60046040610ceb565b33861502860161101c565b90505b979650505050505050565b60605f806107ff6112ab565b925092509250909192565b5f6104fa83836112f7565b5f61012435600281901c906003166001821183341582148061083a5761083a34611432565b506003841160a0810260240135906502030203010160d01b861a905f630101020360d01b881a61086d8882898888611443565b9096509150506101c4600583901b01355f87600581111561089057610890615357565b036108c55760443560243517156108ae57636ab37ce75f526004601cfd5b6108b88482611760565b6108c061182a565b6109a6565b6040805160208082528183019092525f9160208201818036833701905050905060028a60058111156108f9576108f9615357565b0361091c5761091760c4356084353360e435610104355b87876118aa565b610991565b60038a600581111561093057610930615357565b0361094e5761091760c4356084353360e435610104355b87876118f5565b60048a600581111561096257610962615357565b0361097c5761091760243533608435604435606435610910565b61099160243533608435604435606435610947565b61099b848261192b565b6109a4816119e5565b505b6109b1868984611a09565b6109b9611a76565b6001995050505050505050505090565b6060602080526d0d436f6e73696465726174696f6e604d5260606020f35b5f6109f0611ac9565b600143034060801c335f525f60205260405f208054820192508281555050336001600160a01b03167f721c20121297512b72821b97f5326877ea8ecf4bb9948fea5bfcb6453074d37f82604051610a4991815260200190565b60405180910390a290565b5f816001600160a01b0316600a5a610a6c91906157a1565b6040515f8181818686fa925050503d805f8114610aa4576040519150601f19603f3d011682016040523d82523d5f602084013e610aa9565b606091505b50909392505050565b5f813563ffffffff16820161040b565b5f610ad561016060408051918201905290565b9050610ae48282610140611b46565b610b01610afa610af5846040610ceb565b611b4f565b6040830152565b5f610b15610b10846060610ceb565b611ba2565b9050610b22816060840152565b610b35610b2d825190565b610140840152565b50919050565b0190565b610140820151604080519084015180515f939284927f000000000000000000000000000000000000000000000000000000000000000092602090910190845b81811015610bab578251601f1901805186825260c082208652905260209384019390920191600101610b7e565b508060051b6040512094505050505f7f0000000000000000000000000000000000000000000000000000000000000000915060405160206060890151015f5b86811015610c17578151601f1901805186825260e082208552905260209283019290910190600101610bea565b505060408051600587901b9020601f198a0180517f00000000000000000000000000000000000000000000000000000000000000008252928b01805197815260608c018051938152610140909c019a8b5261018082209390915295909552939097525050925250919050565b5f8063ffffffff8335169050600581901b610ca76020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157610cd9610cd3610cce8484610ceb565b61124f565b82850152565b602001610cb6565b5050505050919050565b5f6104fa63ffffffff610d036104f68686610b3b8516565b16840190565b5f8063ffffffff8335169050600581901b610d2d6020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157610d59610cd3610d548484610ceb565b611be5565b602001610d3c565b5f8063ffffffff8335169050600581901b610d856020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157610db1610cd3610dac8484610ceb565b611c27565b602001610d94565b60608036155f80610dcd8c8c85898b611c6a565b91509150610de08c8b8b8b8b8787612047565b9450945050505097509795505050505050565b5f8063ffffffff8335169050600581901b610e176020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157610e43610cd3610e3e8484610ceb565b612179565b602001610e26565b5f610e54611ac9565b5f805f80855190505f5b81811015610f5f575f878281518110610e7957610e796157c0565b60209081029190910101518051909150600481608001516004811115610ea157610ea1615357565b03610ead575050610f57565b80519450610eba816121bc565b5f8181526001602052604081209850909650610edc90879089903615156121f5565b50865460ff16610f545780610140015181606001515114610eff57610eff612283565b610f0e85878460200151612290565b865460ff191660011787556040517ff280791efe782edcf06ce15c8f4dff17601db3b88eb3805a0db7d77faf757f0490610f4b90889084906158c3565b60405180910390a15b50505b600101610e5e565b5060019695505050505050565b5f8063ffffffff8335169050600581901b610f906020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157610fbc610cd3610fb78484610ceb565b61105a565b602001610f9f565b5f8063ffffffff8335169050600581901b610fe86020820160408051918201905290565b828152925060208381019085015f5b83811015610ce157611014610cd361100f8484610ceb565b61232c565b602001610ff7565b60605f36151590505f806110348888858b5189611c6a565b915091506110418261235f565b61104e888784888561239e565b98975050505050505050565b5f61106d61020060408051918201905290565b60a0810180825290915061108961108384610ab2565b82612471565b61109560016020840152565b6110a160016040840152565b6110be6110b76110b2856020610ceb565b6124a7565b6060840152565b610b356110c96124cf565b6080840152565b835160808101515f91906110f760048260048111156110f1576110f1615357565b146124e9565b5f80806111068a36151561258c565b60408051600180825281830190925293965091945092505f9190816020015b61112d615055565b8152602001906001900390816111255790505090508a815f81518110611155576111556157c0565b602002602001018190525061116a818b612784565b6111768684848b6128fd565b6040805160018082528183019092525f9160208083019080368337509192505050361515600487818111156111ad576111ad615357565b146111d0576111be8d83885f6129fd565b6111ca86868684612a4f565b506111e2565b6111df888e6080015183612b53565b95505b6111ed888c8c612c23565b85825f81518110611200576112006157c0565b6020026020010181815250506112178d8388612d46565b61123486895f01518a602001518d8c604001518d60600151612e13565b61123c611a76565b5060019c9b505050505050505050505050565b5f61126261020060408051918201905290565b905061127660208381019083016040611b46565b60a0810180825261128961108384610ab2565b61129a6110b76110b2856060610ceb565b610b356110c96110b2856080610ceb565b60605f805f6112b8612e78565b90505f7f0000000000000000000000000000000000000000000000000000000000000000905060605f5281602052806040526303312e3660635260a05ff35b5f611300611ac9565b5f8083815b818110156114175736878783818110611320576113206157c0565b905060200281019061133291906159a5565b90505f6113426020830183615523565b90505f6113556040840160208501615523565b90505f61136860a08501608086016159c4565b905081331483331417156004821417871796505f61139c6113916113898790565b610ac26104e3565b866101400135610b3f565b5f8181526001602052604090819020805461ffff19166101001781559051909a509091506001600160a01b0380851691908616907f6bacc01dbe442496068f7d234edd811f1a5f833243e0aec824f86ab861f3c90d906113ff9085815260200190565b60405180910390a38560010195505050505050611305565b5050801561142757611427612f55565b506001949350505050565b63a61be9f05f52806020526024601cfd5b5f8061144e5f6124e9565b611456612f62565b426101643511154261014435111715611484576321ccfeb75f5261014435602052610164356040526044601cfd5b6102043561026435101561149f5763466aa6165f526004601cfd5b7f0000000000000000000000000000000000000000000000000000000000000000608081905260a08790526060602460c037604060646101203760e060802061016052610264356102043560051b6102a0016001820181526020810190508881526080602460208301376101608860a0528760c0525f60e0525f6102043593505f5b84811015611575578060400261028401602081610100376040816101203760208101358317925060208401935060e0608020845260a0850194508b85528a6020860152604081606087013750600101611521565b6001850160051b610160206060526102643594505b848110156115c5578060400261028401925060a0840193508a845289602085015260408360608601376020830135919091179060010161158a565b506001600160a01b038111156115e2576339f3e3fd5f526004601cfd5b50505050505f7f00000000000000000000000000000000000000000000000000000000000000009050806080528360a052606060c460c0376020610104610120375060c06080205f9081526020812060e05260843590611656826001600160a01b03165f9081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000060808190529091506040608460a03760605161010052896101205260a061014461014037816101e05261018060802094505050506102043560051b61018001828152336020820152608060408201526101206060820152600160808201528360a0820152606060c460c083013760a061026435026101e00160a4356084357f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f318385a35f60605260608101820160405250505f61173283612fad565b905061173e8389612ffe565b7101000000000000000000000000000001000182559150509550959350505050565b60c43560843560e4356101043584156117d15761177c81613053565b5f6040519050632671a55160e11b815260206004820152600160248201528660448201528460648201528360848201523360a48201528260c48201528160e48201526117cb8682610104613065565b50611822565b60028660058111156117e5576117e5615357565b0361180c57806001146117fb576117fb8161311c565b6118078484338561312d565b611822565b61181581613053565b61182284843385856131e2565b505050505050565b346064356084356102643560061b5f80805b8381101561187b5761028481013592506102a4810135915086831115611864576118646132b9565b828703965061187382846132c6565b60400161183c565b508585111561188c5761188c6132b9565b61189684866132c6565b8486111561182257611822338688036132c6565b6118b481836132fc565b816118db57826001146118ca576118ca8361311c565b6118d68787878761312d565b6118ec565b6118ec828260028a8a8a8a8a61331a565b50505050505050565b6118fe83613053565b61190881836132fc565b8161191a576118d687878787876131e2565b6118ec828260038a8a8a8a8a61331a565b5f805f805f861561195057505060843592503391505060c4356101043560e435611965565b50339350506084359150506024356064356044355b801561197357611973613399565b50600586901b6101e403356102643560061b5f80805b838110156119ca5761028481013592506102a481013591508a156119b4576119b183876159e2565b95505b6119c2878a8486898f6133a6565b604001611989565b506119d986898988888e6133a6565b50505050505050505050565b60408151146119f15750565b5f6119fd826020015190565b90506103fd81836133db565b611a258260a4355b331415600182116004909210919091161690565b15611a7157805f611a34825190565b9050608081901c63ffffffff8216611a4c84826133ff565b601c840163fb5014fc6060529350611a6860a43588868561340f565b5f6060526118ec565b505050565b7f00000000000000000000000000000000000000000000000000000000000000008015611aa7575f63929eee145d50565b63929eee145480611abd575f63929eee145d5050565b50600163929eee145550565b7f00000000000000000000000000000000000000000000000000000000000000008015611b085763929eee145c15611b0857637fa8a9875f526004601cfd5b806103ff5763929eee145480611b305763929eee145c15611b3057637fa8a9875f526004601cfd5b60018111156103fd57637fa8a9875f526004601cfd5b80838337505050565b5f63ffffffff8235166040519150808252602082018160051b81018060a084026020870183378293505b81841015611b925780845260209093019260a001611b79565b60405250919392505050565b9052565b5f63ffffffff8235166040519150808252602082018160051b81018060c084026020870183378293505b81841015611b925780845260209093019260c001611bcc565b5f611bf760a060408051918201905290565b9050611c0582826080611b46565b611c22611c1b611c16846080610ceb565b613457565b6080830152565b919050565b5f63ffffffff8235166040519150808252602082018160051b8101808360061b6020870183378293505b81841015611b9257808452602090930192604001611c51565b60605f611c7760016124e9565b86515f90600160e61b82351690806001600160401b03811115611c9c57611c9c615779565b604051908082528060200260200182016040528015611cc5578160200160208202803683370190505b50945060010160051b91505f60205b83811015611ec6575f611cea8c83613cfe6104e3565b90505f805f611cf9848e61258c565b6001600160781b0382166020880152919450925090505f829003611d205750505050611ebe565b6001600160781b0381166040808601919091528a8601849052845160a081015160c0820151608083015192909301518051600184119d909d179c600490931099509092915f5b81811015611e08575f838281518110611d8157611d816157c0565b602002602001015190508b8151108d179c505f611da38989846080015161348e565b90508160800151826060015103611dc05760608201819052611dd5565b611dcf8989846060015161348e565b60608301525b5f611dee8360600151838a8a611de9361590565b6134ca565b606084018190526080909301929092525050600101611d66565b5087516060015180515f5b81811015611eb2575f838281518110611e2e57611e2e6157c0565b602002602001015190505f611e488b8b846080015161348e565b90508160800151826060015103611e655760608201819052611e7a565b611e748b8b846060015161348e565b60608301525b5f611e8f8360600151838c8c611de936151590565b6060840181905260a0840180516080909501949094529092525050600101611e13565b50505050505050505050505b602001611cd4565b50506001600160e61b018103611ede57611ede61351d565b50611ee98888612784565b5f8060205b8381101561202c578581015192508215612024575f611f108c83613cfe6104e3565b9050885f03611f2b575f878301819052602090910152612024565b60048151608001516004811115611f4457611f44615357565b14611fc757611f5d8188866001600587901c038e61352a565b611f73575f878301819052602090910152612024565b602080820151604083015183516080810151930151611fac9388936001600160781b039081169316913314156001909111168e17612a4f565b611fc2575f878301819052602090910152612024565b611ff2565b611fd9815f015182608001518c612b53565b878301819052935083611ff2575f602090910152612024565b886001900398505f815f0151905061201d85825f015183602001518c85604001518660600151612e13565b6001935050505b602001611eee565b508061203a5761203a613585565b5050509550959350505050565b85518551606091829161205a81836159f5565b6001600160401b0381111561207157612071615779565b6040519080825280602002602001820160405280156120aa57816020015b612097615088565b81526020019060019003908161208f5790505b5092505f5b82811015612102576120dd8c5f8d84815181106120ce576120ce6157c0565b60200260200101518c8c613592565b8482815181106120ef576120ef6157c0565b60209081029190910101526001016120af565b505f5b8181101561215b576121348c60018c8481518110612125576121256157c0565b60200260200101518c5f613592565b8484830181518110612148576121486157c0565b6020908102919091010152600101612105565b506121698b84888a896135e1565b9350505097509795505050505050565b5f61218a6040808051918201905290565b90506121a46121a061219b84610ab2565b6138ca565b8252565b611c226121b56110b2846020610ceb565b6020830152565b5f6121d18260600151518361014001516138e9565b81516001600160a01b03165f9081526020819052604090205461040b908390610b3f565b82545f90610100900460ff161561221c57811561221557612215856138f9565b505f61062b565b83546201000090046001600160781b03168015612277578315612247576122428661390a565b612277565b8454600160881b90046001600160781b0316811061227757821561226e5761226e8661391b565b5f91505061062b565b50600195945050505050565b632165628a5f526004601cfd5b338314801561229f5750505050565b5f6122a8612e78565b61190160f01b5f9081526002828152602287815260428320908390528651939450929190601f601d840116106102e26062198401101615612312576122ed868861392c565b61190160f01b5f90815260028690526022828152604282209190529097509050612315565b50815b612322888285858a6139c2565b5050505050505050565b5f61233d6040808051918201905290565b905061234e6121a0610dac84610ab2565b611c226121b5610dac846020610ceb565b80518060051b6040019050602082038051602082527f4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e78383a190525050565b8351606090806001600160401b038111156123bb576123bb615779565b6040519080825280602002602001820160405280156123f457816020015b6123e1615088565b8152602001906001900390816123d95790505b5091505f5b81811015612457575f878281518110612414576124146157c0565b6020026020010151905061243189825f0151836020015185613b0b565b848381518110612443576124436157c0565b6020908102919091010152506001016123f9565b5061246587838787876135e1565b50505b95945050505050565b61247e8282610160611b46565b61248f610afa610af5846040610ceb565b6103fd6124a0610b10846060610ceb565b6060830152565b6040518135601f0163ffffffe01660200180838337913563ffffffff16815290810160405290565b5f6124e1602060408051918201905290565b5f8152905090565b7f000000000000000000000000000000000000000000000000000000000000000080156125375763929eee145c1561252857637fa8a9875f526004601cfd5b8160010163929eee145d6103fd565b63929eee14548061256a5763929eee145c1561255a57637fa8a9875f526004601cfd5b8260010163929eee145d506103fd565b6001811461257f57637fa8a9875f526004601cfd5b505060020163929eee1455565b5f805f80855f015190506125a98160a001518260c0015187613cb0565b6125bc57505f925082915081905061277d565b602086015160408701516001600160781b0391821694501691505f6004826080015160048111156125ef576125ef615357565b0361261c576001838502189050801561260a5761260a613cd3565b506001935083925082915061277d9050565b50818311831517801561263157612631613cd3565b608082015160011615848411161561264b5761264b613ce0565b612654826121bc565b5f81815260016020526040812091965061267290879083908a6121f5565b61268557505f935083925061277d915050565b805460ff166126a0576126a0835f0151878a60600151612290565b8054608881901c806126b457869150612777565b6001600160781b038260101c169150600186036126d8578181039650809550612777565b8086036126f357908601858103868211029096039590612777565b80860296810291909502810186810387821102918290039695919003906001600160781b0386111561277757612737565b5f5b8215610b3557908290069190612726565b61274a6127448784612724565b88612724565b8015019687900496909504946001600160781b0386111561277757634e487b715f5260116020526024601cfd5b50505050505b9250925092565b805182515f5b82811015612873575f8482815181106127a5576127a56157c0565b602002602001015190505f815f015190508381106127ca576127ca8260200151613ced565b5f8782815181106127dd576127dd6157c0565b6020026020010151905080602001516001600160781b03165f036128035750505061286b565b80516040808201519085015163bfb3f8ce5f8760200151600181111561282b5761282b615357565b14612847575f61283c856060613cfe565b9350636088d7de9150505b8251821061285857805f526004601cfd5b612863838389613d09565b505050505050505b60010161278a565b505f5b818110156128f6575f858281518110612891576128916157c0565b6020026020010151905080602001516001600160781b03165f036128b557506128ee565b8051608081015160608201516128d29085908363a8930e9a613dba565b6128ea8483604001518363d69293326104e3613dba90565b5050505b600101612876565b5050505050565b60a084015160c08501516040860151515f805b8281101561297a575f8960400151828151811061292f5761292f6157c0565b602002602001015190505f815f01519050801584179350505f612966826060015183608001518c8c8b8b612961361590565b613e21565b606083015250608001869052600101612910565b50608088015160048110821680156129945761299461351d565b505050506060860151515f5b81811015612322575f886060015182815181106129bf576129bf6157c0565b602002602001015190505f6129e4826060015183608001518b8b8a8a61296136151590565b60608301525060a08101516080909101526001016129a0565b8351608081015160208201513314156001821160049092109190911616156128f6575f80612a32858489608001518988613e5c565b63fb5014fc6060529092509050611a68836020015186848461340f565b5f848152600160205260408120805482908290608881901c80612a7457889150612afc565b6001600160781b038260101c169150808803612a9857908801878111935090612afc565b97880297808802979190910288018781119350906001600160781b038083119089111715612afc57612aca8883612724565b8015019788900497909104906001600160781b038083119089111715612afc57634e487b715f5260116020526024601cfd5b508215612b35578515612b29576040516310fda3e160e01b8152600481018a905260240160405180910390fd5b5f94505050505061062b565b8660881b8160101b1760011782556001945050505050949350505050565b5f83610140015184606001515114612b6d57612b6d612283565b83515f8080612b7c8888613fda565b915091505f8082845f885af16001600160a01b0385165f908152600260205260409020805460018101909155606086901b189550925082612bdb578515612bce57612bc5614084565b612bce856140cb565b505f93506104fa92505050565b505050505f805f612bf8876040015188606001516104e36140dc90565b925092509250825f14612c0e57612c0e846140cb565b60408701919091526060860152509392505050565b6040805160208082528183019092525f916020820181803683375050506040850151519091505f5b81811015612c9b575f86604001518281518110612c6a57612c6a6157c0565b60200260200101519050846080820152612c9281885f0151896101200151876104e361435590565b50600101612c4b565b50506060840151515f90815b81811015612d29575f87606001518281518110612cc657612cc66157c0565b602002602001015190505f6005811115612ce257612ce2615357565b81516005811115612cf557612cf5615357565b03612d11574793508381606001511115612d1157612d116132b9565b612d20813389886143556104e3565b50600101612ca7565b5050612d34826119e5565b504780156128f6576128f633826132c6565b8251608081015160208201515f92839283928392916004811060019091111633909114151615612da857612d89612d8361010083015190565b5190565b8861444a565b9093509150612d9a60208201612d7f565b945063fb5014fc9350612df4565b600481608001516004811115612dc057612dc0615357565b0361232257805194505f8560601b9050612de187838b608001518b8561448b565b639397928596509094509250612df49050565b612dfe6060859052565b612e0a8587858561340f565b5f606052612322565b60608290506060829050856001600160a01b0316876001600160a01b03167f9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f318a888686604051612e669493929190615a41565b60405180910390a35050505050505050565b5f7f00000000000000000000000000000000000000000000000000000000000000004614612f30575060408051608080517f00000000000000000000000000000000000000000000000000000000000000005f9081527f00000000000000000000000000000000000000000000000000000000000000006020527f0000000000000000000000000000000000000000000000000000000000000000855246606090815230845260a08220949095529093529190915290565b507f000000000000000000000000000000000000000000000000000000000000000090565b63fed398fc5f526004601cfd5b600435602014610224356102401416610244356102606102643560061b01141660186101243510600160a01b60843560a4351760c4356024351717101616806103ff576103ff614556565b5f8181526001602081905260409091209060843590612fd290849084903615156121f5565b50815460ff16610b3557610b358184612ff9602463ffffffff6102443516016124a76104e3565b612290565b5f61300b8260a435611a11565b1561040b575f805f61301c86614563565b63fb5014fc6060529194509250905061303c60a43587601c86018561340f565b5f60605260209190910160801b1781529392505050565b806103ff576391b3e5145f526004601cfd5b604080517f000000000000000000000000000000000000000000000000000000000000000060ff60a01b175f90815260208690527f000000000000000000000000000000000000000000000000000000000000000083526055600b20919092526001600160a01b031690505f805f805260205f85875f875af191505f519050816130fa576130f1614084565b6130fa8361461b565b6001600160e01b03198116632671a55160e11b1461182257611822868461462c565b6369f958275f52806020526024601cfd5b833b61314457635f15d6725f52836020526024601cfd5b6040516323b872dd60e01b5f528360045282602452816044525f8060645f80895af1806131d4573d156131b257601f3d0160051c8260051c816003028183111561319b578183036003028280028480020360091c01015b5a6020820110156131ae573d5f803e3d5ffd5b5050505b63f486bc875f5285602052846040528360605282608052600160a05260a4601cfd5b5060405250505f6060525050565b843b6131f957635f15d6725f52846020526024601cfd5b60405160805160a05160c051637921219560e11b5f528760045286602452856044528460645260a06084525f60a4525f8060c45f808d5af18061329e573d1561327d57601f3d0160051c8560051c8160030281831115613266578183036003028280028480020360091c01015b5a602082011015613279573d5f803e3d5ffd5b5050505b63f486bc875f52896020528860405287606052866080528560a05260a4601cfd5b5060809290925260a05260c05260405250505f606052505050565b638ffff9805f526004601cfd5b6132cf81613053565b5f805f805f85875af1905080611a71576132e7614084565b63bc806b965f5282602052816040526044601cfd5b5f613308836020015190565b9050818114611a7157611a71836119e5565b5f60208851036133545750604080885260208089018a9052632671a55160e11b918901919091526044880152600160648801819052613363565b50606487018051600101908190525b603c60c082028901038781528660208201528560408201528460608201528360808201528260a082015250505050505050505050565b636ab37ce75f526004601cfd5b6133af83613053565b6133b981836132fc565b816133ca5761180786868686614641565b611822828260018989895f8a61331a565b6064810151604082019060c0026044016133f6848383613065565b50506020905250565b6317b1f9428252600181526103fd565b5f806001600160e01b03198451165f805260205f85875f8b5af15f51909350149050816134485761343e614084565b846080526024607cfd5b8061182257846080526024607cfd5b5f8063ffffffff83351690506001810160051b61347a8160408051918201905290565b9250613487848483611b46565b5050919050565b5f82840361349d5750806104fa565b82848309156134b35763c63cf0895f526004601cfd5b5f6134be8584615add565b93909304949350505050565b5f84861461351357838303428590038082035f6134e7838a615add565b6134f1838c615add565b6134fb91906159f5565b90508584878303040181151502945050505050612468565b5092949350505050565b6312d3f5a35f526004601cfd5b8451608081015160208201515f92916004811060019091111633909114151615610f5f575f8061356187848b608001518b8a613e5c565b9150915061357b836020015188848463fb5014fc8a614735565b9350505050612468565b63d5da9a1b5f526004601cfd5b61359a615088565b83515f036135ab576135ab856147a2565b5f8560018111156135be576135be615357565b036135d4576135cf868583856147b3565b612468565b6124688685833387614923565b84516060905f816001600160401b038111156135ff576135ff615779565b604051908082528060200260200182016040528015613628578160200160208202803683370190505b506040805160208082528183019092529192505f9190602082018180368337505089519192505060010160051b60205b818110156136b7575f61366e8b83613cfe6104e3565b805160608101519192509080156136ac57478111825115161561369857638ffff9805f526004601cfd5b6136ac828460200151856040015189614355565b505050602001613658565b50505f5b83811015613823575f8a82815181106136d6576136d66157c0565b6020026020010151905080602001516001600160781b03165f0361371d575f848381518110613707576137076157c0565b911515602092830291909101909101525061381b565b6001848381518110613731576137316157c0565b911515602092830291909101909101528051604081015180515f5b818110156137b6575f838281518110613767576137676157c0565b6020026020010151905080606001515f146137a357608081018051908e9052855161012087015161379d9184918c6143556104e3565b60808201525b608081015160609091015260010161374c565b505050606081015180515f5b81811015613815575f8382815181106137dd576137dd6157c0565b602002602001015190505f81606001519050805f1461380157613801888483614a5a565b5060a08101516060909101526001016137c2565b50505050505b6001016136bb565b5061382d816119e5565b47801561383e5761383e33826132c6565b85156138b4575f5b848110156138b257838181518110613860576138606157c0565b6020026020010151156138aa576138aa8b8281518110613882576138826157c0565b60200260200101518a8b848151811061389d5761389d6157c0565b6020026020010151612d46565b600101613846565b505b6138bc611a76565b509098975050505050505050565b5f6138dd61016060408051918201905290565b9050611c228282612471565b808210156103fd576103fd614a73565b631a5155745f52806020526024601cfd5b63ee9e0e635f52806020526024601cfd5b6310fda3e15f52806020526024601cfd5b5f805f84516001811660410380820360051c9250808752806020018701915050805160e81c6003820191506001811660051b868152825160208218525060015b838110156139985760405f2082821c60051b60209081169182529384018051919094185260010161396c565b50505060405f2091505f6139ab82614a80565b5f9081526020939093525050604090209392505050565b5f805f528151602083038051826041035f60018211613a2557604087015160608801515f1a8315613a0657601b8260ff1c0190506001600160ff1b03821660408a01525b88528a855260205f60808760015afa508385528588526040880152505f515b8a148a1515169450849050613aee57858552604082526044850380516040870351630b135d3f60e11b835289604089035260205f60648b01858f5afa96508615613ae257630b135d3f60e11b5f5114613ae2578b3b15613a8c57634f7fb80d5f526004601cfd5b6001866041031115613aa557638baa579f5f526004601cfd5b64010100000060608901515f1a1a15604187141615613ad557631f003d0a5f5260608801515f1a6020526024601cfd5b63815e1d645f526004601cfd5b8385529152603f198601525b5050508061182257613afe614084565b634f7fb80d5f526004601cfd5b613b13615088565b8251158451151715613b2c576398e9db6e5f526004601cfd5b613b34615088565b613b418685835f80614923565b805160608101515f03613b565750905061062b565b613b6687878584608001516147b3565b82516040828101519082015160208085015190840151855185511891181791181715613b9d5763bced929d5f52846020526024601cfd5b806060015182606001511115613c24575f865f81518110613bc057613bc06157c0565b60200260200101519050816060015183606001510389825f015181518110613bea57613bea6157c0565b60200260200101515f015160600151826020015181518110613c0e57613c0e6157c0565b6020026020010151606001818152505050613ca5565b5f875f81518110613c3757613c376157c0565b60200260200101519050826060015182606001510389825f015181518110613c6157613c616157c0565b60200260200101515f015160400151826020015181518110613c8557613c856157c0565b602002602001015160600181815250508260600151826060018181525050505b505050949350505050565b428084111590831116818015613cc4575080155b156104fa576104fa8484614e8f565b635a052b325f526004601cfd5b63a11b63ff5f526004601cfd5b63133c37c65f52806020526024601cfd5b5f6104fa8284015190565b5f838381518110613d1c57613d1c6157c0565b602002602001015190505f815f01519050613d378160031090565b613d4357613d43614ea4565b60408201518015613d6657613d618460600151828660800151614eb1565b613d79565b60808401515115613d7957613d79614efb565b600119820183816005811115613d9157613d91615357565b90816005811115613da457613da4615357565b9052505050606090920151604090910152505050565b82515f5b81811015611822575f858281518110613dd957613dd96157c0565b60209081029190910101518051604082015191925090600382116004881415821515171615613e1357855f5288602052836040526044601cfd5b505050806001019050613dbe565b5f868803613e3b57613e3486868961348e565b90506107e8565b6107e5613e4987878b61348e565b613e5488888b61348e565b8686866134ca565b5f805f613e67614f08565b6301e4d72a815260208082015260408101898152336060830152601c820194509091508751604082015287613ea7613ea060a083015190565b60e0840152565b613ebd613eb560c083015190565b610100840152565b613ed3613ecb60e083015190565b610120840152565b610140613ee1816060850152565b5f613eed604084015190565b90505f613efc82848701614f12565b928301929050613f0d836080870152565b5f613f19606086015190565b90505f613f2882868901614f78565b948501949050613f398560a0890152565b5f613f468e878a01614fdd565b959095019450613f578560c0890152565b8685015f613f658e83614ffc565b602497019687019a50613f819050613f7c8c8c0190565b61502c565b8060408b901b60808b901b17178f610100018181525050613fab8c82611b9e90919063ffffffff16565b60058c8e51613fba91906159e2565b613fc5911b8b6159e2565b99505050505050505050509550959350505050565b5f8083613fe5614f08565b639891976581523360208201908152608060408301819052601c9092019450905f614011604085015190565b90505f61402082848601614f12565b928301929050614031836040860152565b5f61403d606087015190565b90505f61404c82868801614f12565b94850194905061405d856060880152565b895f61406b82898901614fdd565b9a9d96909a016004019b50949950505050505050505050565b3d156140c957601f3d0160051c60405160051c81600302818311156140b6578183036003028280028480020360091c01015b5a602082011015611a71573d5f803e3d5ffd5b565b63939792855f52806020526024601cfd5b60603d105f80808080808661414e5760405f803e5f51935060205192503d60208501113d6020850111808217985050508661414e576020845f3e5f51915060208360203e60205190508160071b60208501018160a0026020850101803d10823d101761ffff8486171117985050505f80525b86614180575f8061416384602088018d614189565b9250975061417583602087018c614269565b929092179850909550505b5050505061277d565b5f806040519150825160c08602602001830160405285835260208660010160051b8085018360010160051b87016141c7858b81811090829003020190565b60010160051b8a861196505b8085101561422757828589015260808a843e6060830151955085608084015260608201518681116142048585614310565b17881797505060808a01995060a08301925060a0820191506020850194506141d3565b50505b8183101561425d578083870152608088823e6060810151608082015260808801975060a08101905060208301925061422a565b50505050935093915050565b604051815180851190808603818710028101602060e08202850181016040528185526001928301600590811b87019390920190911b908185015b8282101561425d57808287015260a088823e60206060890160a083013e606081015160608501516142e06080840151608088015180159114171590565b818311176142ee8488614310565b60a09b909b019a179690961795505060c09384019360209290920191016142a3565b5f81516040830151801560038311161561433257506040840151600119909101905b604085015181148551831460208701516020870151141616159250505092915050565b5f8451600581111561436957614369615357565b036143a657604084015160208501516001600160a01b0316171561438f5761438f613399565b6143a1846080015185606001516132c6565b614444565b6001845160058111156143bb576143bb615357565b036143ec576040840151156143d2576143d2613399565b6143a18460200151848660800151876060015186866133a6565b60028451600581111561440157614401615357565b03614425576143a184602001518486608001518760400151886060015187876118aa565b61444484602001518486608001518760400151886060015187876118f5565b50505050565b608082901c63ffffffff604084901c811690808516906144729084906317b1f94290611b9e16565b601c830192506144828482614ffc565b50509250929050565b5f80614495614f08565b63f4dd92ce815287841860a0820152601c8101925060200160a0808252875f6144bf604083015190565b90505f6144ce82858701614f12565b9384019390506144df846020870152565b5f6144eb606085015190565b90505f6144fa82878901614f78565b95860195905061450b866040890152565b5f6145188d888a01614fdd565b9687019690506145298760608a0152565b5f6145368d898b01614ffc565b905080880197508760040199505050505050505050509550959350505050565b6339f3e3fd5f526004601cfd5b6301e4d72a6102043560051b6080019081525f808260208082015260408101858152336060830152601c919091019061459d608435610afa565b6145ae61014460e083016060611b46565b6101406145bc816060840152565b6145ca60a082016080840152565b61016060a06102643581029290920101906145e6908290840152565b6145f05f82840152565b6020016145fe8160c0840152565b5f9181019182526020820196909652939560449095019492505050565b63d13d53d45f52806020526024601cfd5b631cf99b265f5281602052806040526044601cfd5b6040516323b872dd60e01b5f5283600452826024528160445260205f60645f80895af1803d15601f3d1160015f51141617163d151581166147265780873b151516614726578061471557816146f8573d156146d757601f3d0160051c8360051c81600302818311156146c0578183036003028280028480020360091c01015b5a6020820110156146d3573d5f803e3d5ffd5b5050505b63f486bc875f528660205285604052846060525f6080528360a05260a4601cfd5b63988919235f52866020528560405284606052836080526084601cfd5b635f15d6725f52866020526024601cfd5b505060405250505f6060525050565b5f805f6001600160e01b03198751165f805260205f888a5f8e5af15f5190935014905081614781578361476c575f925050506106e0565b614774614084565b845f52876020526024601cfd5b8061479357845f52876020526024601cfd5b50600198975050505050505050565b63375c24c15f52806020526024601cfd5b5f805f85865160051b87015b808210156148d0576020820191508851825151106147df576147df614904565b81515160051b60208a01015180516020845101515f6040830151602085015115815184101517156148145750505050506147bf565b8260051b60208201015191505060608101935083518901915083511589831060011b17881797508198505f84528a51935086156001811461487d5760608220881860408d01516101208601511860208e015186511817171561487857614878614904565b6148c6565b8151855260208201516020860152604082015160408601528a6080860152835160208d015261012084015160408d015260608520975060208d019250868318156148c657865183525b50505050506147bf565b5050508160608551015280156148fd57600181036148f5576391b3e5145f526004601cfd5b6148fd614911565b5050614444565b637fda72795f526004601cfd5b634e487b715f5260116020526024601cfd5b5f805f86875160051b88015b80821015614a25576020820191508151518a51811061495057614950614904565b8060051b60208c01015190506020835101515f60608351015160208401511581518410151715614983575050505061492f565b8260051b60208201015191505060608101925082518801915082511588831060011b17871796508197505f83528a5192508515600181146149d55760a0822087146149d0576149d0614904565b614a1c565b815184526020820151602085015260408201516040850152608082015160808501528a60208d01528960408d015260a08220965060208d01925085831815614a1c57855183525b5050505061492f565b50508551606001839052508015614a535760018103614a4b576391b3e5145f526004601cfd5b614a53614911565b50506128f6565b63a5f542085f528260205281604052806060526064601cfd5b63466aa6165f526004601cfd5b5f614e86565b5f6009821015614bdf576005821015614b3c576003821015614aef577f832c58a5b611aadcfa6a082ac9d04bace53d8278387f10040347b7e98eb5b30260018314027fbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde301861040b565b7ff3e8417a785f980bdaf134fa0274a6bf891eeb8195cd94b09d2aa651046e28bc60038314027fa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af11861040b565b6007821015614b92577f25d02425402d882d211a7ab774c0ed6eca048c4d03d9af40132475744753b2a360058314027f1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b551861040b565b7fb58d772fb09b426b9dece637f61ca9065f2b994f1464b51e9207f55f7c8f594860078314027f7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc141861040b565b6011821015614d3757600d821015614c9457600b821015614c47577f6f0ec38c21f6f583ab7f3c5413c773ffd5344c34fde1d390958e438bf667448f60098314027fd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da051861040b565b7f32f4e7485d6485f9f6c255929b9905c62ba919758bbe231f231eaeecf33d810c600b8314027fbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f1861040b565b600f821015614cea577f8df51df98847160517f5b1186b4bc3f418d98b8a7f17f1292f392d79d600d79e600d8314027f6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a8525901861040b565b7fcc4886e37eedd9aacd6c1c2c9247197a621a71282e87a7cbc673f3736d9aa141600f8314027f1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde81861040b565b6015821015614de3576013821015614d96577f2d7a3ed6dab270fdb8e054b2ad525f0ce2a8b89cc76c17f0965434740f673a5560118314027fc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d858771861040b565b7f54b3212a178782f104e0d514b41a9a5c4ca9c980bf6597c3cecbf280917e202a60138314027f5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e643500171861040b565b6017821015614e39577fbb40bf8cea3a5a716e2b6eb08bbdac8ec159f82f380783db3c56904f15a43d0460158314027f3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d1861040b565b7f403be09941a31d05cfc2f896505811353d45d38743288b016630cce39435476a60178314027f1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c1861040b565b61040b82614a86565b6321ccfeb75f5281602052806040526044601cfd5b6394eb6af65f526004601cfd5b5f835f5260205f2060208301835160051b81015b80821015614eec57815180841160051b93845260209384185260405f209290910190614ec5565b50508314905080614444576144445b6309bde3395f526004601cfd5b5f61041b60405190565b5f825180835260208401602084018260051b82015b80831015614f655782518051835260208101516020840152604081015160408401526060810151606084015250602083019250608082019150614f27565b5050508060071b60200191505092915050565b5f80614f82845190565b8084529050602084810190600583901b860181019085015b82821115614fca575f614fac84615036565b9050614fba818360a061503f565b506020929092019160a001614f9a565b60a0840260200194505050505092915050565b5f63ffffffe0603f614fed855190565b0116905061040b83838361503f565b5f80615006845190565b8084529050600581901b61502160208681019086018361503f565b602001949350505050565b6103ff6040829052565b5f61040b825190565b8082828560045afa80153d151715614444575f80fd5b6040518060a001604052806150686150ca565b81525f602082018190526040820152606080820181905260809091015290565b60408051610100810182525f606082018181526080830182905260a0830182905260c0830182905260e083018290528252602082018190529181019190915290565b6040518061016001604052805f6001600160a01b031681526020015f6001600160a01b0316815260200160608152602001606081526020015f600481111561511457615114615357565b81525f6020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b5f60208284031215615153575f80fd5b81356001600160401b03811115615168575f80fd5b820161024081850312156104fa575f80fd5b5f81518084525f5b8181101561519e57602081850181015186830182015201615182565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f6104fa602083018461517a565b5f602082840312156151df575f80fd5b5035919050565b5f602082840312156151f6575f80fd5b81356001600160401b0381111561520b575f80fd5b820161016081850312156104fa575f80fd5b5f8083601f84011261522d575f80fd5b5081356001600160401b03811115615243575f80fd5b6020830191508360208260051b850101111561525d575f80fd5b9250929050565b80356001600160a01b0381168114611c22575f80fd5b5f805f805f805f805f805f60e08c8e031215615294575f80fd5b6001600160401b03808d3511156152a9575f80fd5b6152b68e8e358f0161521d565b909c509a5060208d01358110156152cb575f80fd5b6152db8e60208f01358f0161521d565b909a50985060408d01358110156152f0575f80fd5b6153008e60408f01358f0161521d565b909850965060608d0135811015615315575f80fd5b506153268d60608e01358e0161521d565b909550935060808c0135925061533e60a08d01615264565b915060c08c013590509295989b509295989b9093969950565b634e487b7160e01b5f52602160045260245ffd5b60068110611b9e57611b9e615357565b61538682825161536b565b6020818101516001600160a01b0390811691840191909152604080830151908401526060808301519084015260809182015116910152565b5f815180845260208085019450602084015f5b838110156154135781516153e688825161537b565b808401516001600160a01b031660a08901526040015160c088015260e090960195908201906001016153d1565b509495945050505050565b604080825283519082018190525f906020906060840190828701845b8281101561545857815115158452928401929084019060010161543a565b50505083810360208501526106e081866153be565b5f806020838503121561547e575f80fd5b82356001600160401b03811115615493575f80fd5b61549f8582860161521d565b90969095509350505050565b5f805f80604085870312156154be575f80fd5b84356001600160401b03808211156154d4575f80fd5b6154e08883890161521d565b909650945060208701359150808211156154f8575f80fd5b506155058782880161521d565b95989497509550505050565b602081525f6104fa60208301846153be565b5f60208284031215615533575f80fd5b6104fa82615264565b5f806040838503121561554d575f80fd5b82356001600160401b03811115615562575f80fd5b830160408186031215615573575f80fd5b946020939093013593505050565b5f805f805f60808688031215615595575f80fd5b85356001600160401b03808211156155ab575f80fd5b9087019060a0828a0312156155be575f80fd5b909550602087013590808211156155d3575f80fd5b506155e08882890161521d565b909550935050604086013591506155f960608701615264565b90509295509295909350565b5f805f805f805f8060a0898b03121561561c575f80fd5b88356001600160401b0380821115615632575f80fd5b61563e8c838d0161521d565b909a50985060208b0135915080821115615656575f80fd5b6156628c838d0161521d565b909850965060408b013591508082111561567a575f80fd5b506156878b828c0161521d565b999c989b509699959896976060870135966080013595509350505050565b5f805f805f805f6080888a0312156156bb575f80fd5b87356001600160401b03808211156156d1575f80fd5b6156dd8b838c0161521d565b909950975060208a01359150808211156156f5575f80fd5b6157018b838c0161521d565b909750955060408a0135915080821115615719575f80fd5b506157268a828b0161521d565b9094509250615739905060608901615264565b905092959891949750929550565b606081525f615759606083018661517a565b6020830194909452506001600160a01b0391909116604090910152919050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f826157bb57634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b5f815180845260208085019450602084015f5b838110156154135781516157fc88825161536b565b838101516001600160a01b03168885015260408082015190890152606080820151908901526080908101519088015260a090960195908201906001016157e7565b5f815180845260208085019450602084015f5b8381101561541357815161586588825161536b565b808401516001600160a01b0390811689860152604080830151908a0152606080830151908a0152608080830151908a015260a091820151169088015260c09096019590820190600101615850565b60058110611b9e57611b9e615357565b828152604060208201526158e36040820183516001600160a01b03169052565b5f60208301516158fe60608401826001600160a01b03169052565b50604083015161016080608085015261591b6101a08501836157d4565b91506060850151603f198584030160a0860152615938838261583d565b925050608085015161594d60c08601826158b3565b5060a085015160e085015260c0850151610100818187015260e0870151915061012082818801528188015192506101409150828288015280880151848801525080870151610180870152505050809150509392505050565b5f823561015e198336030181126159ba575f80fd5b9190910192915050565b5f602082840312156159d4575f80fd5b8135600581106104fa575f80fd5b8181038181111561040b5761040b61578d565b8082018082111561040b5761040b61578d565b5f815180845260208085019450602084015f5b8381101561541357615a2e87835161537b565b60a0969096019590820190600101615a1b565b5f6080808301878452602060018060a01b03808916602087015260406080604088015283895180865260a08901915060208b0195505f5b81811015615ab9578651615a8d84825161536b565b808701518616848801528481015185850152606090810151908401529585019591870191600101615a78565b50508781036060890152615acd818a615a08565b9c9b505050505050505050505050565b808202811582820484141761040b5761040b61578d56fea2646970667358221220144ae316c8b03bb9076a4856a427dfd0918729f5e815fc76c06889fcb10b46bb64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class Consideration__factory extends v$.ContractFactory{constructor(...G){G.length>1?super(...G):super(w$,_$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new v$.Interface(w$)}static connect(G,K){return new v$.Contract(G,w$,K)}}g$.Consideration__factory=Consideration__factory,Consideration__factory.bytecode=_$,Consideration__factory.abi=w$;var T$={};Object.defineProperty(T$,"__esModule",{value:!0}),T$.ConsiderationBase__factory=void 0;const A$=EN,E$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"}],P$="0x6101c0604052348015610010575f80fd5b5060405161055938038061055983398101604081905261002f91610216565b6100376100f0565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e59190610243565b506101a052506102b8565b5f808080808061012060408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a81526020016104ef606a913990505f6040518060c00160405280608481526020016103456084913990505f60405180610100016040528060d4815260200161041b60d4913990506040518060800160405280605281526020016103c96052913980519060200120965082805190602001209550818051906020012094505f8183856040516020016101ef93929190610292565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f60208284031215610226575f80fd5b81516001600160a01b038116811461023c575f80fd5b9392505050565b5f8060408385031215610254575f80fd5b505080516020909101519092909150565b5f81515f5b81811015610284576020818501810151868301520161026a565b505f93019283525090919050565b5f6102af6102a96102a38488610265565b86610265565b84610265565b95945050505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051603e6103075f395f50505f50505f50505f50505f50505f50505f50505f50505f50505f5050603e5ff3fe60806040525f80fdfea2646970667358221220c6ffe18fa92bda9699516ff36313fbc821bd831fb9b149f399b06205add0353064736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class ConsiderationBase__factory extends A$.ContractFactory{constructor(...G){G.length>1?super(...G):super(E$,P$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new A$.Interface(E$)}static connect(G,K){return new A$.Contract(G,E$,K)}}T$.ConsiderationBase__factory=ConsiderationBase__factory,ConsiderationBase__factory.bytecode=P$,ConsiderationBase__factory.abi=E$;var S$={};Object.defineProperty(S$,"__esModule",{value:!0}),S$.CounterManager__factory=void 0;const I$=EN,C$=[{inputs:[],name:"BadFraction",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],R$="0x60c060405234801561000f575f80fd5b505f610019610076565b90506001600160a01b03811661004257604051632aea588760e01b815260040160405180910390fd5b5f61004c8261008f565b8015156080526001600160a01b03831660a05290508061006f57600163929eee14555b505061010c565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6100a791906100ed565b6040515f8181818686fa925050503d805f81146100df576040519150601f19603f3d011682016040523d82523d5f602084013e6100e4565b606091505b50909392505050565b5f8261010757634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05161018b61012b5f395f608d01525f6042015261018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea2646970667358221220c84c0e5646455162d0de7da644549cedcffcd49028fd38c31e4d3be5826fc0bc64736f6c63430008180033";class CounterManager__factory extends I$.ContractFactory{constructor(...G){G.length>1?super(...G):super(C$,R$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new I$.Interface(C$)}static connect(G,K){return new I$.Contract(G,C$,K)}}S$.CounterManager__factory=CounterManager__factory,CounterManager__factory.bytecode=R$,CounterManager__factory.abi=C$;var k$={};Object.defineProperty(k$,"__esModule",{value:!0}),k$.CriteriaResolution__factory=void 0;const O$=EN,x$=[{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"}],N$="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea2646970667358221220f613ca4fda4b0650eb06a2a814e61f6a9afa26b55c206c64970473a15b796f4764736f6c63430008180033";class CriteriaResolution__factory extends O$.ContractFactory{constructor(...G){G.length>1?super(...G):super(x$,N$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new O$.Interface(x$)}static connect(G,K){return new O$.Contract(G,x$,K)}}k$.CriteriaResolution__factory=CriteriaResolution__factory,CriteriaResolution__factory.bytecode=N$,CriteriaResolution__factory.abi=x$;var M$={};Object.defineProperty(M$,"__esModule",{value:!0}),M$.Executor__factory=void 0;const B$=EN,F$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],D$="0x610200604052348015610010575f80fd5b506040516107bc3803806107bc83398101604081905261002f916102f9565b8080808061003b61015c565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e99190610326565b506101a052505f90506100fa610282565b90506001600160a01b03811661012357604051632aea588760e01b815260040160405180910390fd5b5f61012d8261029b565b8015156101c0526001600160a01b0383166101e05290508061015257600163929eee14555b50505050506103ba565b5f808080808061018c60408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a8152602001610752606a913990505f6040518060c00160405280608481526020016105a86084913990505f60405180610100016040528060d4815260200161067e60d49139905060405180608001604052806052815260200161062c6052913980519060200120965082805190602001209550818051906020012094505f81838560405160200161025b93929190610375565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102b3919061039b565b6040515f8181818686fa925050503d805f81146102eb576040519150601f19603f3d011682016040523d82523d5f602084013e6102f0565b606091505b50909392505050565b5f60208284031215610309575f80fd5b81516001600160a01b038116811461031f575f80fd5b9392505050565b5f8060408385031215610337575f80fd5b505080516020909101519092909150565b5f81515f5b81811015610367576020818501810151868301520161034d565b505f93019283525090919050565b5f61039261038c6103868488610348565b86610348565b84610348565b95945050505050565b5f826103b557634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b61041d5f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea2646970667358221220886bb2b7f7350dd17decd5e0decd38ac95caf56921cbbe143b88589e0631647a64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class Executor__factory extends B$.ContractFactory{constructor(...G){G.length>1?super(...G):super(F$,D$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new B$.Interface(F$)}static connect(G,K){return new B$.Contract(G,F$,K)}}M$.Executor__factory=Executor__factory,Executor__factory.bytecode=D$,Executor__factory.abi=F$;var L$={};Object.defineProperty(L$,"__esModule",{value:!0}),L$.FulfillmentApplier__factory=void 0;const U$=EN,$$=[{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"}],q$="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea2646970667358221220e18f94530c9f91237515c9e94a3e96d81a4843e5e2bd34e0d3f8623b1bc91c5264736f6c63430008180033";class FulfillmentApplier__factory extends U$.ContractFactory{constructor(...G){G.length>1?super(...G):super($$,q$,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new U$.Interface($$)}static connect(G,K){return new U$.Contract(G,$$,K)}}L$.FulfillmentApplier__factory=FulfillmentApplier__factory,FulfillmentApplier__factory.bytecode=q$,FulfillmentApplier__factory.abi=$$;var G$={};Object.defineProperty(G$,"__esModule",{value:!0}),G$.GettersAndDerivers__factory=void 0;const j$=EN,H$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"}],W$="0x6101c0604052348015610010575f80fd5b5060405161055c38038061055c83398101604081905261002f91610219565b806100386100f3565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e69190610246565b506101a052506102bb9050565b5f808080808061012360408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a81526020016104f2606a913990505f6040518060c00160405280608481526020016103486084913990505f60405180610100016040528060d4815260200161041e60d4913990506040518060800160405280605281526020016103cc6052913980519060200120965082805190602001209550818051906020012094505f8183856040516020016101f293929190610295565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f60208284031215610229575f80fd5b81516001600160a01b038116811461023f575f80fd5b9392505050565b5f8060408385031215610257575f80fd5b505080516020909101519092909150565b5f81515f5b81811015610287576020818501810151868301520161026d565b505f93019283525090919050565b5f6102b26102ac6102a68488610268565b86610268565b84610268565b95945050505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051603e61030a5f395f50505f50505f50505f50505f50505f50505f50505f50505f50505f5050603e5ff3fe60806040525f80fdfea2646970667358221220dab8f3b02f3b0f76433738f50323af6adf3ef44ef65771c1369ed6d1b00e506064736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class GettersAndDerivers__factory extends j$.ContractFactory{constructor(...G){G.length>1?super(...G):super(H$,W$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new j$.Interface(H$)}static connect(G,K){return new j$.Contract(G,H$,K)}}G$.GettersAndDerivers__factory=GettersAndDerivers__factory,GettersAndDerivers__factory.bytecode=W$,GettersAndDerivers__factory.abi=H$;var z$={};Object.defineProperty(z$,"__esModule",{value:!0}),z$.OrderCombiner__factory=void 0;const V$=EN,K$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],J$="0x610200604052348015610010575f80fd5b506040516107c43803806107c483398101604081905261002f91610301565b808080808080808061003f610164565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100ed919061032e565b506101a052505f90506100fe61028a565b90506001600160a01b03811661012757604051632aea588760e01b815260040160405180910390fd5b5f610131826102a3565b8015156101c0526001600160a01b0383166101e05290508061015657600163929eee14555b5050505050505050506103c2565b5f808080808061019460408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a815260200161075a606a913990505f6040518060c00160405280608481526020016105b06084913990505f60405180610100016040528060d4815260200161068660d4913990506040518060800160405280605281526020016106346052913980519060200120965082805190602001209550818051906020012094505f8183856040516020016102639392919061037d565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102bb91906103a3565b6040515f8181818686fa925050503d805f81146102f3576040519150601f19603f3d011682016040523d82523d5f602084013e6102f8565b606091505b50909392505050565b5f60208284031215610311575f80fd5b81516001600160a01b0381168114610327575f80fd5b9392505050565b5f806040838503121561033f575f80fd5b505080516020909101519092909150565b5f81515f5b8181101561036f5760208185018101518683015201610355565b505f93019283525090919050565b5f61039a61039461038e8488610350565b86610350565b84610350565b95945050505050565b5f826103bd57634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b6104255f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea2646970667358221220f55781cea9f97f7ad8b87e66c18dac58c8e52c8498bda3c74bf343731da75d6b64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class OrderCombiner__factory extends V$.ContractFactory{constructor(...G){G.length>1?super(...G):super(K$,J$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new V$.Interface(K$)}static connect(G,K){return new V$.Contract(G,K$,K)}}z$.OrderCombiner__factory=OrderCombiner__factory,OrderCombiner__factory.bytecode=J$,OrderCombiner__factory.abi=K$;var X$={};Object.defineProperty(X$,"__esModule",{value:!0}),X$.OrderFulfiller__factory=void 0;const Q$=EN,Z$=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],Y$="0x610200604052348015610010575f80fd5b506040516107c23803806107c283398101604081905261002f916102ff565b8080808080808061003e610162565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100ec919061032c565b506101a052505f90506100fd610288565b90506001600160a01b03811661012657604051632aea588760e01b815260040160405180910390fd5b5f610130826102a1565b8015156101c0526001600160a01b0383166101e05290508061015557600163929eee14555b50505050505050506103c0565b5f808080808061019260408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a8152602001610758606a913990505f6040518060c00160405280608481526020016105ae6084913990505f60405180610100016040528060d4815260200161068460d4913990506040518060800160405280605281526020016106326052913980519060200120965082805190602001209550818051906020012094505f8183856040516020016102619392919061037b565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102b991906103a1565b6040515f8181818686fa925050503d805f81146102f1576040519150601f19603f3d011682016040523d82523d5f602084013e6102f6565b606091505b50909392505050565b5f6020828403121561030f575f80fd5b81516001600160a01b0381168114610325575f80fd5b9392505050565b5f806040838503121561033d575f80fd5b505080516020909101519092909150565b5f81515f5b8181101561036d5760208185018101518683015201610353565b505f93019283525090919050565b5f61039861039261038c848861034e565b8661034e565b8461034e565b95945050505050565b5f826103bb57634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b6104235f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea26469706673582212209b2a54dacc9f6a84c6a04b0fc4438fb0177d80cf7d42961f8a9576dccdd6e99a64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class OrderFulfiller__factory extends Q$.ContractFactory{constructor(...G){G.length>1?super(...G):super(Z$,Y$,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new Q$.Interface(Z$)}static connect(G,K){return new Q$.Contract(G,Z$,K)}}X$.OrderFulfiller__factory=OrderFulfiller__factory,OrderFulfiller__factory.bytecode=Y$,OrderFulfiller__factory.abi=Z$;var tq={};Object.defineProperty(tq,"__esModule",{value:!0}),tq.OrderValidator__factory=void 0;const rq=EN,nq=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],aq="0x610200604052348015610010575f80fd5b506040516107be3803806107be83398101604081905261002f916102fb565b808080808061003c61015e565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100ea9190610328565b506101a052505f90506100fb610284565b90506001600160a01b03811661012457604051632aea588760e01b815260040160405180910390fd5b5f61012e8261029d565b8015156101c0526001600160a01b0383166101e05290508061015357600163929eee14555b5050505050506103bc565b5f808080808061018e60408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a8152602001610754606a913990505f6040518060c00160405280608481526020016105aa6084913990505f60405180610100016040528060d4815260200161068060d49139905060405180608001604052806052815260200161062e6052913980519060200120965082805190602001209550818051906020012094505f81838560405160200161025d93929190610377565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102b5919061039d565b6040515f8181818686fa925050503d805f81146102ed576040519150601f19603f3d011682016040523d82523d5f602084013e6102f2565b606091505b50909392505050565b5f6020828403121561030b575f80fd5b81516001600160a01b0381168114610321575f80fd5b9392505050565b5f8060408385031215610339575f80fd5b505080516020909101519092909150565b5f81515f5b81811015610369576020818501810151868301520161034f565b505f93019283525090919050565b5f61039461038e610388848861034a565b8661034a565b8461034a565b95945050505050565b5f826103b757634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b61041f5f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122072e5f6ae135872cdaebd56fcb57e472ba41e59b702e59e756edfdcb11b92698564736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class OrderValidator__factory extends rq.ContractFactory{constructor(...G){G.length>1?super(...G):super(nq,aq,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new rq.Interface(nq)}static connect(G,K){return new rq.Contract(G,nq,K)}}tq.OrderValidator__factory=OrderValidator__factory,OrderValidator__factory.bytecode=aq,OrderValidator__factory.abi=nq;var iq={};Object.defineProperty(iq,"__esModule",{value:!0}),iq.ReentrancyGuard__factory=void 0;const sq=EN,oq=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],cq="0x60c060405234801561000f575f80fd5b505f610019610076565b90506001600160a01b03811661004257604051632aea588760e01b815260040160405180910390fd5b5f61004c8261008f565b8015156080526001600160a01b03831660a05290508061006f57600163929eee14555b505061010c565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6100a791906100ed565b6040515f8181818686fa925050503d805f81146100df576040519150601f19603f3d011682016040523d82523d5f602084013e6100e4565b606091505b50909392505050565b5f8261010757634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05161018b61012b5f395f608d01525f6042015261018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea26469706673582212200b7deff1ff3e0664ceada1cb9953469a04b1867a733fd55416f02dcb5d12cf3464736f6c63430008180033";class ReentrancyGuard__factory extends sq.ContractFactory{constructor(...G){G.length>1?super(...G):super(oq,cq,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new sq.Interface(oq)}static connect(G,K){return new sq.Contract(G,oq,K)}}iq.ReentrancyGuard__factory=ReentrancyGuard__factory,ReentrancyGuard__factory.bytecode=cq,ReentrancyGuard__factory.abi=oq;var dq={};Object.defineProperty(dq,"__esModule",{value:!0}),dq.SignatureVerification__factory=void 0;const uq=EN,fq=[{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"}],lq="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea2646970667358221220c33f341fc1c39001b6bfa2d4e617624bdaf9d7c43032a43176f397c5e05f1dcb64736f6c63430008180033";class SignatureVerification__factory extends uq.ContractFactory{constructor(...G){G.length>1?super(...G):super(fq,lq,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new uq.Interface(fq)}static connect(G,K){return new uq.Contract(G,fq,K)}}dq.SignatureVerification__factory=SignatureVerification__factory,SignatureVerification__factory.bytecode=lq,SignatureVerification__factory.abi=fq;var pq={};Object.defineProperty(pq,"__esModule",{value:!0}),pq.TokenTransferrer__factory=void 0;const hq=EN,yq=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"}],mq="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea264697066735822122096d328f4f566a1c9c8883c5e49aa03f35600bab7454c84391bb3aea09834822364736f6c63430008180033";class TokenTransferrer__factory extends hq.ContractFactory{constructor(...G){G.length>1?super(...G):super(yq,mq,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new hq.Interface(yq)}static connect(G,K){return new hq.Contract(G,yq,K)}}pq.TokenTransferrer__factory=TokenTransferrer__factory,TokenTransferrer__factory.bytecode=mq,TokenTransferrer__factory.abi=yq;var bq={};Object.defineProperty(bq,"__esModule",{value:!0}),bq.Verifiers__factory=void 0;const gq=EN,vq=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[],name:"__activateTstore",outputs:[],stateMutability:"nonpayable",type:"function"}],wq="0x610200604052348015610010575f80fd5b506040516107ba3803806107ba83398101604081905261002f916102f7565b80808061003a61015a565b610120526101005260e05260c081905260a082815246610140819052604080515f9485526020879052948152606091825230608090815292842085825293909152939052610160526001600160a01b038316610180819052630a96ad3960e01b825282519092630a96ad3992600480820193918290030181865afa1580156100c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e89190610324565b506101a052505f90506100f9610280565b90506001600160a01b03811661012257604051632aea588760e01b815260040160405180910390fd5b5f61012c82610299565b8015156101c0526001600160a01b0383166101e05290508061015157600163929eee14555b505050506103b8565b5f808080808061018a60408051808201909152600d81526c21b7b739b4b232b930ba34b7b760991b602082015290565b8051906020012095506040518060400160405280600381526020016218971b60e91b8152508051906020012094505f6040518060a00160405280606a8152602001610750606a913990505f6040518060c00160405280608481526020016105a66084913990505f60405180610100016040528060d4815260200161067c60d49139905060405180608001604052806052815260200161062a6052913980519060200120965082805190602001209550818051906020012094505f81838560405160200161025993929190610373565b60405160208183030381529060405290508080519060200120945050505050909192939495565b5f696002601e613d5c3d52f35f52600a60165ff0905090565b5f816001600160a01b0316600a5a6102b19190610399565b6040515f8181818686fa925050503d805f81146102e9576040519150601f19603f3d011682016040523d82523d5f602084013e6102ee565b606091505b50909392505050565b5f60208284031215610307575f80fd5b81516001600160a01b038116811461031d575f80fd5b9392505050565b5f8060408385031215610335575f80fd5b505080516020909101519092909150565b5f81515f5b81811015610365576020818501810151868301520161034b565b505f93019283525090919050565b5f61039061038a6103848488610346565b86610346565b84610346565b95945050505050565b5f826103b357634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161018b61041b5f395f608d01525f604201525f50505f50505f50505f50505f50505f50505f50505f50505f50505f505061018b5ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80637423eb3c1461002d575b5f80fd5b610035610037565b005b63929eee14546001147f00000000000000000000000000000000000000000000000000000000000000008061006a575080155b1561008857604051630f45b98b60e41b815260040160405180910390fd5b6100b17f00000000000000000000000000000000000000000000000000000000000000006100d8565b6100ce576040516370a4078f60e01b815260040160405180910390fd5b5f63929eee145550565b5f816001600160a01b0316600a5a6100f09190610136565b6040515f8181818686fa925050503d805f8114610128576040519150601f19603f3d011682016040523d82523d5f602084013e61012d565b606091505b50909392505050565b5f8261015057634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122020e5c6c5dac5bed8a6941955fbcd3f0bef3b14edd08b1ec1d02cb021ea09f25e64736f6c63430008180033436f6e73696465726174696f6e4974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e742c6164647265737320726563697069656e7429454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294f72646572436f6d706f6e656e74732861646472657373206f6666657265722c61646472657373207a6f6e652c4f666665724974656d5b5d206f666665722c436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f6e2c75696e7438206f72646572547970652c75696e7432353620737461727454696d652c75696e7432353620656e6454696d652c62797465733332207a6f6e65486173682c75696e743235362073616c742c6279746573333220636f6e647569744b65792c75696e7432353620636f756e746572294f666665724974656d2875696e7438206974656d547970652c6164647265737320746f6b656e2c75696e74323536206964656e7469666965724f7243726974657269612c75696e74323536207374617274416d6f756e742c75696e7432353620656e64416d6f756e7429";class Verifiers__factory extends gq.ContractFactory{constructor(...G){G.length>1?super(...G):super(vq,wq,G[0])}getDeployTransaction(G,K){return super.getDeployTransaction(G,K||{})}deploy(G,K){return super.deploy(G,K||{})}connect(G){return super.connect(G)}static createInterface(){return new gq.Interface(vq)}static connect(G,K){return new gq.Contract(G,vq,K)}}bq.Verifiers__factory=Verifiers__factory,Verifiers__factory.bytecode=wq,Verifiers__factory.abi=vq;var _q={};Object.defineProperty(_q,"__esModule",{value:!0}),_q.ZoneInteraction__factory=void 0;const Tq=EN,Aq=[{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"}],Eq="0x6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea264697066735822122030b78722acfb68476127f7f246052e6735a8966a534cb4457bd18c966e8dd62964736f6c63430008180033";class ZoneInteraction__factory extends Tq.ContractFactory{constructor(...G){G.length>1?super(...G):super(Aq,Eq,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new Tq.Interface(Aq)}static connect(G,K){return new Tq.Contract(G,Aq,K)}}_q.ZoneInteraction__factory=ZoneInteraction__factory,ZoneInteraction__factory.bytecode=Eq,ZoneInteraction__factory.abi=Aq,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ZoneInteraction__factory=G.Verifiers__factory=G.TokenTransferrer__factory=G.SignatureVerification__factory=G.ReentrancyGuard__factory=G.OrderValidator__factory=G.OrderFulfiller__factory=G.OrderCombiner__factory=G.GettersAndDerivers__factory=G.FulfillmentApplier__factory=G.Executor__factory=G.CriteriaResolution__factory=G.CounterManager__factory=G.ConsiderationBase__factory=G.Consideration__factory=G.BasicOrderFulfiller__factory=G.Assertions__factory=G.AmountDeriver__factory=void 0;var K=s$;Object.defineProperty(G,"AmountDeriver__factory",{enumerable:!0,get:function(){return K.AmountDeriver__factory}});var ne=u$;Object.defineProperty(G,"Assertions__factory",{enumerable:!0,get:function(){return ne.Assertions__factory}});var ue=h$;Object.defineProperty(G,"BasicOrderFulfiller__factory",{enumerable:!0,get:function(){return ue.BasicOrderFulfiller__factory}});var pe=g$;Object.defineProperty(G,"Consideration__factory",{enumerable:!0,get:function(){return pe.Consideration__factory}});var he=T$;Object.defineProperty(G,"ConsiderationBase__factory",{enumerable:!0,get:function(){return he.ConsiderationBase__factory}});var ye=S$;Object.defineProperty(G,"CounterManager__factory",{enumerable:!0,get:function(){return ye.CounterManager__factory}});var me=k$;Object.defineProperty(G,"CriteriaResolution__factory",{enumerable:!0,get:function(){return me.CriteriaResolution__factory}});var be=M$;Object.defineProperty(G,"Executor__factory",{enumerable:!0,get:function(){return be.Executor__factory}});var ve=L$;Object.defineProperty(G,"FulfillmentApplier__factory",{enumerable:!0,get:function(){return ve.FulfillmentApplier__factory}});var _e=G$;Object.defineProperty(G,"GettersAndDerivers__factory",{enumerable:!0,get:function(){return _e.GettersAndDerivers__factory}});var Te=z$;Object.defineProperty(G,"OrderCombiner__factory",{enumerable:!0,get:function(){return Te.OrderCombiner__factory}});var Ee=X$;Object.defineProperty(G,"OrderFulfiller__factory",{enumerable:!0,get:function(){return Ee.OrderFulfiller__factory}});var Pe=tq;Object.defineProperty(G,"OrderValidator__factory",{enumerable:!0,get:function(){return Pe.OrderValidator__factory}});var Se=iq;Object.defineProperty(G,"ReentrancyGuard__factory",{enumerable:!0,get:function(){return Se.ReentrancyGuard__factory}});var Ce=dq;Object.defineProperty(G,"SignatureVerification__factory",{enumerable:!0,get:function(){return Ce.SignatureVerification__factory}});var ke=pq;Object.defineProperty(G,"TokenTransferrer__factory",{enumerable:!0,get:function(){return ke.TokenTransferrer__factory}});var Oe=bq;Object.defineProperty(G,"Verifiers__factory",{enumerable:!0,get:function(){return Oe.Verifiers__factory}});var xe=_q;Object.defineProperty(G,"ZoneInteraction__factory",{enumerable:!0,get:function(){return xe.ZoneInteraction__factory}})}(i$),Object.defineProperty(JU,"__esModule",{value:!0}),JU.lib=JU.conduit=void 0,JU.conduit=XU,JU.lib=i$,Object.defineProperty(KU,"__esModule",{value:!0}),KU.src=void 0,KU.src=JU;var Pq={},Sq={},Iq={},Cq={};Object.defineProperty(Cq,"__esModule",{value:!0}),Cq.AmountDerivationErrors__factory=void 0;const Rq=EN,kq=[{inputs:[],name:"InexactFraction",type:"error"}];class AmountDerivationErrors__factory{static createInterface(){return new Rq.Interface(kq)}static connect(G,K){return new Rq.Contract(G,kq,K)}}Cq.AmountDerivationErrors__factory=AmountDerivationErrors__factory,AmountDerivationErrors__factory.abi=kq;var Oq={};Object.defineProperty(Oq,"__esModule",{value:!0}),Oq.ConduitControllerInterface__factory=void 0;const xq=EN,Nq=[{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotNewPotentialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"CallerIsNotOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ChannelOutOfRange",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ConduitAlreadyExists",type:"error"},{inputs:[],name:"InvalidCreator",type:"error"},{inputs:[],name:"InvalidInitialOwner",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"NewPotentialOwnerAlreadySet",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NewPotentialOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoConduit",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"NoPotentialOwnerCurrentlySet",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"conduit",type:"address"},{indexed:!1,internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"NewConduit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"conduit",type:"address"},{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newPotentialOwner",type:"address"}],name:"PotentialOwnerUpdated",type:"event"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"cancelOwnershipTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"initialOwner",type:"address"}],name:"createConduit",outputs:[{internalType:"address",name:"conduit",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"uint256",name:"channelIndex",type:"uint256"}],name:"getChannel",outputs:[{internalType:"address",name:"channel",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"}],name:"getChannelStatus",outputs:[{internalType:"bool",name:"isOpen",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getChannels",outputs:[{internalType:"address[]",name:"channels",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],name:"getConduit",outputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"bool",name:"exists",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getConduitCodeHashes",outputs:[{internalType:"bytes32",name:"creationCodeHash",type:"bytes32"},{internalType:"bytes32",name:"runtimeCodeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getKey",outputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getPotentialOwner",outputs:[{internalType:"address",name:"potentialOwner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"getTotalChannels",outputs:[{internalType:"uint256",name:"totalChannels",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"newPotentialOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"conduit",type:"address"},{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}];class ConduitControllerInterface__factory{static createInterface(){return new xq.Interface(Nq)}static connect(G,K){return new xq.Contract(G,Nq,K)}}Oq.ConduitControllerInterface__factory=ConduitControllerInterface__factory,ConduitControllerInterface__factory.abi=Nq;var Mq={};Object.defineProperty(Mq,"__esModule",{value:!0}),Mq.ConduitInterface__factory=void 0;const Bq=EN,Fq=[{inputs:[{internalType:"address",name:"channel",type:"address"}],name:"ChannelClosed",type:"error"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"ChannelStatusAlreadySet",type:"error"},{inputs:[],name:"InvalidController",type:"error"},{inputs:[],name:"InvalidItemType",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"channel",type:"address"},{indexed:!1,internalType:"bool",name:"open",type:"bool"}],name:"ChannelUpdated",type:"event"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"transfers",type:"tuple[]"}],name:"execute",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batch1155Transfers",type:"tuple[]"}],name:"executeBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"enum ConduitItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct ConduitTransfer[]",name:"standardTransfers",type:"tuple[]"},{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],internalType:"struct ConduitBatch1155Transfer[]",name:"batch1155Transfers",type:"tuple[]"}],name:"executeWithBatch1155",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"channel",type:"address"},{internalType:"bool",name:"isOpen",type:"bool"}],name:"updateChannel",outputs:[],stateMutability:"nonpayable",type:"function"}];class ConduitInterface__factory{static createInterface(){return new Bq.Interface(Fq)}static connect(G,K){return new Bq.Contract(G,Fq,K)}}Mq.ConduitInterface__factory=ConduitInterface__factory,ConduitInterface__factory.abi=Fq;var Dq={};Object.defineProperty(Dq,"__esModule",{value:!0}),Dq.ConsiderationEventsAndErrors__factory=void 0;const Lq=EN,Uq=[{inputs:[],name:"BadFraction",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"InsufficientNativeTokensSupplied",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeTokenTransferGenericFailure",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"}];class ConsiderationEventsAndErrors__factory{static createInterface(){return new Lq.Interface(Uq)}static connect(G,K){return new Lq.Contract(G,Uq,K)}}Dq.ConsiderationEventsAndErrors__factory=ConsiderationEventsAndErrors__factory,ConsiderationEventsAndErrors__factory.abi=Uq;var $q={};Object.defineProperty($q,"__esModule",{value:!0}),$q.ConsiderationInterface__factory=void 0;const qq=EN,Gq=[{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder_efficient_6GL6yc",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"}];class ConsiderationInterface__factory{static createInterface(){return new qq.Interface(Gq)}static connect(G,K){return new qq.Contract(G,Gq,K)}}$q.ConsiderationInterface__factory=ConsiderationInterface__factory,ConsiderationInterface__factory.abi=Gq;var jq={};Object.defineProperty(jq,"__esModule",{value:!0}),jq.CriteriaResolutionErrors__factory=void 0;const Hq=EN,Wq=[{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"}];class CriteriaResolutionErrors__factory{static createInterface(){return new Hq.Interface(Wq)}static connect(G,K){return new Hq.Contract(G,Wq,K)}}jq.CriteriaResolutionErrors__factory=CriteriaResolutionErrors__factory,CriteriaResolutionErrors__factory.abi=Wq;var zq={};Object.defineProperty(zq,"__esModule",{value:!0}),zq.FulfillmentApplicationErrors__factory=void 0;const Vq=EN,Kq=[{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"}];class FulfillmentApplicationErrors__factory{static createInterface(){return new Vq.Interface(Kq)}static connect(G,K){return new Vq.Contract(G,Kq,K)}}zq.FulfillmentApplicationErrors__factory=FulfillmentApplicationErrors__factory,FulfillmentApplicationErrors__factory.abi=Kq;var Jq={};Object.defineProperty(Jq,"__esModule",{value:!0}),Jq.ReentrancyErrors__factory=void 0;const Xq=EN,Qq=[{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"TStoreAlreadyActivated",type:"error"},{inputs:[],name:"TStoreNotSupported",type:"error"},{inputs:[],name:"TloadTestContractDeploymentFailed",type:"error"}];class ReentrancyErrors__factory{static createInterface(){return new Xq.Interface(Qq)}static connect(G,K){return new Xq.Contract(G,Qq,K)}}Jq.ReentrancyErrors__factory=ReentrancyErrors__factory,ReentrancyErrors__factory.abi=Qq;var Zq={};Object.defineProperty(Zq,"__esModule",{value:!0}),Zq.SignatureVerificationErrors__factory=void 0;const Yq=EN,eG=[{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"}];class SignatureVerificationErrors__factory{static createInterface(){return new Yq.Interface(eG)}static connect(G,K){return new Yq.Contract(G,eG,K)}}Zq.SignatureVerificationErrors__factory=SignatureVerificationErrors__factory,SignatureVerificationErrors__factory.abi=eG;var tG={};Object.defineProperty(tG,"__esModule",{value:!0}),tG.TokenTransferrerErrors__factory=void 0;const rG=EN,nG=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"}];class TokenTransferrerErrors__factory{static createInterface(){return new rG.Interface(nG)}static connect(G,K){return new rG.Contract(G,nG,K)}}tG.TokenTransferrerErrors__factory=TokenTransferrerErrors__factory,TokenTransferrerErrors__factory.abi=nG;var aG={};Object.defineProperty(aG,"__esModule",{value:!0}),aG.ZoneInteractionErrors__factory=void 0;const iG=EN,sG=[{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"}];class ZoneInteractionErrors__factory{static createInterface(){return new iG.Interface(sG)}static connect(G,K){return new iG.Contract(G,sG,K)}}aG.ZoneInteractionErrors__factory=ZoneInteractionErrors__factory,ZoneInteractionErrors__factory.abi=sG,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.ZoneInteractionErrors__factory=G.TokenTransferrerErrors__factory=G.SignatureVerificationErrors__factory=G.ReentrancyErrors__factory=G.FulfillmentApplicationErrors__factory=G.CriteriaResolutionErrors__factory=G.ConsiderationInterface__factory=G.ConsiderationEventsAndErrors__factory=G.ConduitInterface__factory=G.ConduitControllerInterface__factory=G.AmountDerivationErrors__factory=void 0;var K=Cq;Object.defineProperty(G,"AmountDerivationErrors__factory",{enumerable:!0,get:function(){return K.AmountDerivationErrors__factory}});var ne=Oq;Object.defineProperty(G,"ConduitControllerInterface__factory",{enumerable:!0,get:function(){return ne.ConduitControllerInterface__factory}});var ue=Mq;Object.defineProperty(G,"ConduitInterface__factory",{enumerable:!0,get:function(){return ue.ConduitInterface__factory}});var pe=Dq;Object.defineProperty(G,"ConsiderationEventsAndErrors__factory",{enumerable:!0,get:function(){return pe.ConsiderationEventsAndErrors__factory}});var he=$q;Object.defineProperty(G,"ConsiderationInterface__factory",{enumerable:!0,get:function(){return he.ConsiderationInterface__factory}});var ye=jq;Object.defineProperty(G,"CriteriaResolutionErrors__factory",{enumerable:!0,get:function(){return ye.CriteriaResolutionErrors__factory}});var me=zq;Object.defineProperty(G,"FulfillmentApplicationErrors__factory",{enumerable:!0,get:function(){return me.FulfillmentApplicationErrors__factory}});var be=Jq;Object.defineProperty(G,"ReentrancyErrors__factory",{enumerable:!0,get:function(){return be.ReentrancyErrors__factory}});var ve=Zq;Object.defineProperty(G,"SignatureVerificationErrors__factory",{enumerable:!0,get:function(){return ve.SignatureVerificationErrors__factory}});var _e=tG;Object.defineProperty(G,"TokenTransferrerErrors__factory",{enumerable:!0,get:function(){return _e.TokenTransferrerErrors__factory}});var Te=aG;Object.defineProperty(G,"ZoneInteractionErrors__factory",{enumerable:!0,get:function(){return Te.ZoneInteractionErrors__factory}})}(Iq),Object.defineProperty(Sq,"__esModule",{value:!0}),Sq.interfaces=void 0,Sq.interfaces=Iq,Object.defineProperty(Pq,"__esModule",{value:!0}),Pq.src=void 0,Pq.src=Sq;var oG={},cG={},dG={},uG={};Object.defineProperty(uG,"__esModule",{value:!0}),uG.DomainRegistry__factory=void 0;const fG=EN,lG=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}],pG="0x608060405234801561000f575f80fd5b506107ef8061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063432ba75c1461004e578063d45619b61461008a578063e5eab096146100aa578063eab5fc24146100d6575b5f80fd5b61007761005c366004610447565b6001600160e01b0319165f9081526020819052604090205490565b6040519081526020015b60405180910390f35b61009d610098366004610447565b6100f6565b60405161008191906104aa565b6100bd6100b836600461050c565b6101df565b6040516001600160e01b03199091168152602001610081565b6100e96100e4366004610578565b610302565b60405161008191906105a0565b6001600160e01b031981165f90815260208181526040808320805482518185028101850190935280835260609492939192909184015b828210156101d4578382905f5260205f20018054610149906105b2565b80601f0160208091040260200160405190810160405280929190818152602001828054610175906105b2565b80156101c05780601f10610197576101008083540402835291602001916101c0565b820191905f5260205f20905b8154815290600101906020018083116101a357829003601f168201915b50505050508152602001906001019061012c565b505050509050919050565b5f600183836040516101f29291906105ea565b9081526040519081900360200190205460ff16156102305782826040516350cb29b360e01b8152600401610227929190610621565b60405180910390fd5b60018084846040516102439291906105ea565b90815260405160209181900382018120805460ff1916931515939093179092556102719185918591016105ea565b60408051601f1981840301815291815281516020928301206001600160e01b031981165f90815280845291822080546001810182559083529290912090925081016102bd84868361069c565b507fe1a483db0873e9c9247adea872915ec5b4ca6f23d07334941b368c0c04224c0d848484846040516102f39493929190610756565b60405180910390a15092915050565b6001600160e01b031982165f908152602081905260408120546060919061032b90600190610786565b90508083111561036857604051630a6e1dad60e31b81526001600160e01b0319851660048201526024810182905260448101849052606401610227565b6001600160e01b031984165f908152602081905260409020805484908110610392576103926107a5565b905f5260205f200180546103a5906105b2565b80601f01602080910402602001604051908101604052809291908181526020018280546103d1906105b2565b801561041c5780601f106103f35761010080835404028352916020019161041c565b820191905f5260205f20905b8154815290600101906020018083116103ff57829003601f168201915b50505050509150505b92915050565b80356001600160e01b031981168114610442575f80fd5b919050565b5f60208284031215610457575f80fd5b6104608261042b565b9392505050565b5f81518084525f5b8181101561048b5760208185018101518683018201520161046f565b505f602082860101526020601f19601f83011685010191505092915050565b5f60208083016020845280855180835260408601915060408160051b8701019250602087015f5b828110156104ff57603f198886030184526104ed858351610467565b945092850192908501906001016104d1565b5092979650505050505050565b5f806020838503121561051d575f80fd5b823567ffffffffffffffff80821115610534575f80fd5b818501915085601f830112610547575f80fd5b813581811115610555575f80fd5b866020828501011115610566575f80fd5b60209290920196919550909350505050565b5f8060408385031215610589575f80fd5b6105928361042b565b946020939093013593505050565b602081525f6104606020830184610467565b600181811c908216806105c657607f821691505b6020821081036105e457634e487b7160e01b5f52602260045260245ffd5b50919050565b818382375f9101908152919050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6106346020830184866105f9565b949350505050565b634e487b7160e01b5f52604160045260245ffd5b601f82111561069757805f5260205f20601f840160051c810160208510156106755750805b601f840160051c820191505b81811015610694575f8155600101610681565b50505b505050565b67ffffffffffffffff8311156106b4576106b461063c565b6106c8836106c283546105b2565b83610650565b5f601f8411600181146106f9575f85156106e25750838201355b5f19600387901b1c1916600186901b178355610694565b5f83815260208120601f198716915b828110156107285786850135825560209485019460019092019101610708565b5086821015610744575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b606081525f6107696060830186886105f9565b6001600160e01b0319949094166020830152506040015292915050565b8181038181111561042557634e487b7160e01b5f52601160045260245ffd5b634e487b7160e01b5f52603260045260245ffdfea2646970667358221220f6b7ceec5684a9f90abdbd865b3b166abf224a1fbbc93139ede29f15637e0eb164736f6c63430008180033";class DomainRegistry__factory extends fG.ContractFactory{constructor(...G){G.length>1?super(...G):super(lG,pG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new fG.Interface(lG)}static connect(G,K){return new fG.Contract(G,lG,K)}}uG.DomainRegistry__factory=DomainRegistry__factory,DomainRegistry__factory.bytecode=pG,DomainRegistry__factory.abi=lG;var hG={};Object.defineProperty(hG,"__esModule",{value:!0}),hG.DomainRegistryInterface__factory=void 0;const yG=EN,mG=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];class DomainRegistryInterface__factory{static createInterface(){return new yG.Interface(mG)}static connect(G,K){return new yG.Contract(G,mG,K)}}hG.DomainRegistryInterface__factory=DomainRegistryInterface__factory,DomainRegistryInterface__factory.abi=mG,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.DomainRegistryInterface__factory=G.DomainRegistry__factory=void 0;var K=uG;Object.defineProperty(G,"DomainRegistry__factory",{enumerable:!0,get:function(){return K.DomainRegistry__factory}});var ne=hG;Object.defineProperty(G,"DomainRegistryInterface__factory",{enumerable:!0,get:function(){return ne.DomainRegistryInterface__factory}})}(dG);var bG={},gG={},vG={};Object.defineProperty(vG,"__esModule",{value:!0}),vG.IERC20Approve__factory=void 0;const wG=EN,_G=[{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"}];class IERC20Approve__factory{static createInterface(){return new wG.Interface(_G)}static connect(G,K){return new wG.Contract(G,_G,K)}}vG.IERC20Approve__factory=IERC20Approve__factory,IERC20Approve__factory.abi=_G;var TG={};Object.defineProperty(TG,"__esModule",{value:!0}),TG.TestERC1271Wallet__factory=void 0;const AG=EN,EG=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approveToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[],name:"orderSigner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}],PG="0x608060405234801561000f575f80fd5b505f80546001600160a01b031916331790556104d48061002e5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063150b7a021461004e5780631626ba7e1461008b578063da3e33971461009e578063f299f8b3146100b3575b5f80fd5b61006d61005c36600461036f565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020015b60405180910390f35b61006d6100993660046103d9565b6100dd565b6100b16100ac366004610421565b610152565b005b5f546100c5906001600160a01b031681565b6040516001600160a01b039091168152602001610082565b5f8061011e8585858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506101c892505050565b5f549091506001600160a01b03908116908216036101465750630b135d3f60e11b905061014b565b505f90505b9392505050565b60405163095ea7b360e01b81526001600160a01b0383811660048301526024820183905284169063095ea7b3906044016020604051808303815f875af115801561019e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101c2919061045a565b50505050565b5f805f8084516041036101ee575050506020820151604083015160608401515f1a610267565b845160400361021b5750505060408201516020830151906001600160ff1b0381169060ff1c601b01610267565b60405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640160405180910390fd5b601b8160ff1610156102815761027e601b82610479565b90505b8060ff16601b1415801561029957508060ff16601c14155b156102a9575f9350505050610309565b604080515f81526020810180835288905260ff831691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa1580156102f9573d5f803e3d5ffd5b5050506020604051035193505050505b92915050565b80356001600160a01b0381168114610325575f80fd5b919050565b5f8083601f84011261033a575f80fd5b50813567ffffffffffffffff811115610351575f80fd5b602083019150836020828501011115610368575f80fd5b9250929050565b5f805f805f60808688031215610383575f80fd5b61038c8661030f565b945061039a6020870161030f565b935060408601359250606086013567ffffffffffffffff8111156103bc575f80fd5b6103c88882890161032a565b969995985093965092949392505050565b5f805f604084860312156103eb575f80fd5b83359250602084013567ffffffffffffffff811115610408575f80fd5b6104148682870161032a565b9497909650939450505050565b5f805f60608486031215610433575f80fd5b61043c8461030f565b925061044a6020850161030f565b9150604084013590509250925092565b5f6020828403121561046a575f80fd5b8151801515811461014b575f80fd5b60ff818116838216019081111561030957634e487b7160e01b5f52601160045260245ffdfea26469706673582212200f000a5230cc36b934f80f6c61eb58ed52a293f12d76642f777291aa1cabb7f664736f6c63430008180033";class TestERC1271Wallet__factory extends AG.ContractFactory{constructor(...G){G.length>1?super(...G):super(EG,PG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new AG.Interface(EG)}static connect(G,K){return new AG.Contract(G,EG,K)}}TG.TestERC1271Wallet__factory=TestERC1271Wallet__factory,TestERC1271Wallet__factory.bytecode=PG,TestERC1271Wallet__factory.abi=EG,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.TestERC1271Wallet__factory=G.IERC20Approve__factory=void 0;var K=vG;Object.defineProperty(G,"IERC20Approve__factory",{enumerable:!0,get:function(){return K.IERC20Approve__factory}});var ne=TG;Object.defineProperty(G,"TestERC1271Wallet__factory",{enumerable:!0,get:function(){return ne.TestERC1271Wallet__factory}})}(gG);var SG={};Object.defineProperty(SG,"__esModule",{value:!0}),SG.TestERC1155__factory=void 0;const IG=EN,CG=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",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:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}],RG="0x608060405234801561000f575f80fd5b50610fe58061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061008f575f3560e01c80632eb2c2d6116100635780632eb2c2d61461013c5780634e1273f414610151578063a22cb46514610171578063e985e9c514610184578063f242432a146101b1575f80fd5b8062fdd58e1461009357806301ffc9a7146100cd5780630e89341c146100f0578063156e29f614610129575b5f80fd5b6100ba6100a13660046109c6565b5f60208181529281526040808220909352908152205481565b6040519081526020015b60405180910390f35b6100e06100db366004610a06565b6101c4565b60405190151581526020016100c4565b61011c6100fe366004610a28565b5060408051808201909152600381526275726960e81b602082015290565b6040516100c49190610a82565b6100e0610137366004610a94565b610215565b61014f61014a366004610b4a565b61023a565b005b61016461015f366004610bfd565b6104da565b6040516100c49190610c64565b61014f61017f366004610ca7565b61060a565b6100e0610192366004610ce0565b600160209081525f928352604080842090915290825290205460ff1681565b61014f6101bf366004610d11565b610675565b5f6301ffc9a760e01b6001600160e01b0319831614806101f45750636cdb3d1360e11b6001600160e01b03198316145b8061020f57506303a24d0760e21b6001600160e01b03198316145b92915050565b5f61023084848460405180602001604052805f815250610869565b5060019392505050565b8483146102805760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b60448201526064015b60405180910390fd5b336001600160a01b03891614806102b957506001600160a01b0388165f90815260016020908152604080832033845290915290205460ff165b6102f65760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610277565b5f805f5b878110156103ad5788888281811061031457610314610d84565b90506020020135925086868281811061032f5761032f610d84565b6001600160a01b038e165f908152602081815260408083208984528252822080549390910294909401359550859392509061036b908490610dac565b90915550506001600160a01b038a165f90815260208181526040808320868452909152812080548492906103a0908490610dbf565b90915550506001016102fa565b50886001600160a01b03168a6001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8b8b8b8b6040516104019493929190610e02565b60405180910390a46001600160a01b0389163b156104a55760405163bc197c8160e01b808252906001600160a01b038b169063bc197c81906104559033908f908e908e908e908e908e908e90600401610e5b565b6020604051808303815f875af1158015610471573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104959190610ebe565b6001600160e01b031916146104b2565b6001600160a01b03891615155b6104ce5760405162461bcd60e51b815260040161027790610ed9565b50505050505050505050565b606083821461051d5760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b6044820152606401610277565b8367ffffffffffffffff81111561053657610536610f03565b60405190808252806020026020018201604052801561055f578160200160208202803683370190505b5090505f5b84811015610601575f8087878481811061058057610580610d84565b90506020020160208101906105959190610f17565b6001600160a01b03166001600160a01b031681526020019081526020015f205f8585848181106105c7576105c7610d84565b9050602002013581526020019081526020015f20548282815181106105ee576105ee610d84565b6020908102919091010152600101610564565b50949350505050565b335f8181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b336001600160a01b03871614806106ae57506001600160a01b0386165f90815260016020908152604080832033845290915290205460ff165b6106eb5760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610277565b6001600160a01b0386165f908152602081815260408083208784529091528120805485929061071b908490610dac565b90915550506001600160a01b0385165f9081526020818152604080832087845290915281208054859290610750908490610dbf565b909155505060408051858152602081018590526001600160a01b03808816929089169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0385163b156108385760405163f23a6e6160e01b808252906001600160a01b0387169063f23a6e61906107e89033908b908a908a908a908a90600401610f30565b6020604051808303815f875af1158015610804573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108289190610ebe565b6001600160e01b03191614610845565b6001600160a01b03851615155b6108615760405162461bcd60e51b815260040161027790610ed9565b505050505050565b6001600160a01b0384165f9081526020818152604080832086845290915281208054849290610899908490610dbf565b909155505060408051848152602081018490526001600160a01b038616915f9133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0384163b1561097c5760405163f23a6e6160e01b808252906001600160a01b0386169063f23a6e619061092c9033905f90899089908990600401610f76565b6020604051808303815f875af1158015610948573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061096c9190610ebe565b6001600160e01b03191614610989565b6001600160a01b03841615155b6109a55760405162461bcd60e51b815260040161027790610ed9565b50505050565b80356001600160a01b03811681146109c1575f80fd5b919050565b5f80604083850312156109d7575f80fd5b6109e0836109ab565b946020939093013593505050565b6001600160e01b031981168114610a03575f80fd5b50565b5f60208284031215610a16575f80fd5b8135610a21816109ee565b9392505050565b5f60208284031215610a38575f80fd5b5035919050565b5f81518084525f5b81811015610a6357602081850181015186830182015201610a47565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610a216020830184610a3f565b5f805f60608486031215610aa6575f80fd5b610aaf846109ab565b95602085013595506040909401359392505050565b5f8083601f840112610ad4575f80fd5b50813567ffffffffffffffff811115610aeb575f80fd5b6020830191508360208260051b8501011115610b05575f80fd5b9250929050565b5f8083601f840112610b1c575f80fd5b50813567ffffffffffffffff811115610b33575f80fd5b602083019150836020828501011115610b05575f80fd5b5f805f805f805f8060a0898b031215610b61575f80fd5b610b6a896109ab565b9750610b7860208a016109ab565b9650604089013567ffffffffffffffff80821115610b94575f80fd5b610ba08c838d01610ac4565b909850965060608b0135915080821115610bb8575f80fd5b610bc48c838d01610ac4565b909650945060808b0135915080821115610bdc575f80fd5b50610be98b828c01610b0c565b999c989b5096995094979396929594505050565b5f805f8060408587031215610c10575f80fd5b843567ffffffffffffffff80821115610c27575f80fd5b610c3388838901610ac4565b90965094506020870135915080821115610c4b575f80fd5b50610c5887828801610ac4565b95989497509550505050565b602080825282518282018190525f9190848201906040850190845b81811015610c9b57835183529284019291840191600101610c7f565b50909695505050505050565b5f8060408385031215610cb8575f80fd5b610cc1836109ab565b915060208301358015158114610cd5575f80fd5b809150509250929050565b5f8060408385031215610cf1575f80fd5b610cfa836109ab565b9150610d08602084016109ab565b90509250929050565b5f805f805f8060a08789031215610d26575f80fd5b610d2f876109ab565b9550610d3d602088016109ab565b94506040870135935060608701359250608087013567ffffffffffffffff811115610d66575f80fd5b610d7289828a01610b0c565b979a9699509497509295939492505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8181038181111561020f5761020f610d98565b8082018082111561020f5761020f610d98565b8183525f6001600160fb1b03831115610de9575f80fd5b8260051b80836020870137939093016020019392505050565b604081525f610e15604083018688610dd2565b8281036020840152610e28818587610dd2565b979650505050505050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682528816602082015260a0604082018190525f90610e87908301888a610dd2565b8281036060840152610e9a818789610dd2565b90508281036080840152610eaf818587610e33565b9b9a5050505050505050505050565b5f60208284031215610ece575f80fd5b8151610a21816109ee565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215610f27575f80fd5b610a21826109ab565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190525f90610f6a9083018486610e33565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f90610e2890830184610a3f56fea2646970667358221220ec74e0d7d66f1c1290ad4b687119dcd8d1c065edb860f43b04d1fa3c05894fc864736f6c63430008180033";class TestERC1155__factory extends IG.ContractFactory{constructor(...G){G.length>1?super(...G):super(CG,RG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new IG.Interface(CG)}static connect(G,K){return new IG.Contract(G,CG,K)}}SG.TestERC1155__factory=TestERC1155__factory,TestERC1155__factory.bytecode=RG,TestERC1155__factory.abi=CG;var kG={};Object.defineProperty(kG,"__esModule",{value:!0}),kG.TestERC20__factory=void 0;const OG=EN,xG=[{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:"amount",type:"uint256"}],name:"Approval",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:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",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:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"blocking",type:"bool"}],name:"blockTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blocked",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",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:"ok",type:"bool"}],stateMutability:"nonpayable",type:"function"}],NG="0x60e060405234801562000010575f80fd5b506040518060400160405280600681526020016505465737432360d41b81525060405180604001604052806005815260200164054535432360dc1b8152506012825f9081620000609190620001d3565b5060016200006f8382620001d3565b5060ff81166080524660a052620000856200009b565b60c05250506006805460ff191690555062000319565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f604051620000cd91906200029f565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200015e57607f821691505b6020821081036200017d57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620001ce57805f5260205f20601f840160051c81016020851015620001aa5750805b601f840160051c820191505b81811015620001cb575f8155600101620001b6565b50505b505050565b81516001600160401b03811115620001ef57620001ef62000135565b620002078162000200845462000149565b8462000183565b602080601f8311600181146200023d575f8415620002255750858301515b5f19600386901b1c1916600185901b17855562000297565b5f85815260208120601f198616915b828110156200026d578886015182559484019460019091019084016200024c565b50858210156200028b57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f808354620002ae8162000149565b60018281168015620002c95760018114620002df576200030d565b60ff19841687528215158302870194506200030d565b875f526020805f205f5b85811015620003045781548a820152908401908201620002e9565b50505082870194505b50929695505050505050565b60805160a05160c051610ba2620003445f395f6103d401525f61039f01525f6101710152610ba25ff3fe608060405234801561000f575f80fd5b50600436106100f0575f3560e01c806340c10f1911610093578063a9059cbb11610063578063a9059cbb14610206578063d505accf14610219578063dd62ed3e1461022e578063e074d6a914610258575f80fd5b806340c10f19146101ad57806370a08231146101c05780637ecebe00146101df57806395d89b41146101fe575f80fd5b806323b872dd116100ce57806323b872dd1461014c578063303bdd2c1461015f578063313ce5671461016c5780633644e515146101a5575f80fd5b806306fdde03146100f4578063095ea7b31461011257806318160ddd14610135575b5f80fd5b6100fc610279565b60405161010991906108be565b60405180910390f35b610125610120366004610925565b610304565b6040519015158152602001610109565b61013e60025481565b604051908152602001610109565b61012561015a36600461094d565b610370565b6006546101259060ff1681565b6101937f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610109565b61013e61039c565b6101256101bb366004610925565b6103f6565b61013e6101ce366004610986565b60036020525f908152604090205481565b61013e6101ed366004610986565b60056020525f908152604090205481565b6100fc61040a565b610125610214366004610925565b610417565b61022c61022736600461099f565b61048d565b005b61013e61023c366004610a0c565b600460209081525f928352604080842090915290825290205481565b61022c610266366004610a3d565b6006805460ff1916911515919091179055565b5f805461028590610a5c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610a5c565b80156102fc5780601f106102d3576101008083540402835291602001916102fc565b820191905f5260205f20905b8154815290600101906020018083116102df57829003601f168201915b505050505081565b335f8181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061035e9086815260200190565b60405180910390a35060015b92915050565b6006545f9060ff161561038457505f610395565b61038f8484846106d0565b50600190505b9392505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146103d1576103cc6107bd565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b5f6104018383610855565b50600192915050565b6001805461028590610a5c565b335f90815260036020526040812080548391908390610437908490610aa8565b90915550506001600160a01b0383165f81815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061035e9086815260200190565b428410156104e25760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b5f60016104ed61039c565b6001600160a01b038a81165f8181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156105f5573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381161580159061062b5750876001600160a01b0316816001600160a01b0316145b6106685760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016104d9565b6001600160a01b039081165f9081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b6001600160a01b0383165f9081526004602090815260408083203384529091528120545f198114610729576107058382610aa8565b6001600160a01b0386165f9081526004602090815260408083203384529091529020555b6001600160a01b0385165f9081526003602052604081208054859290610750908490610aa8565b90915550506001600160a01b038085165f81815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107aa9087815260200190565b60405180910390a3506001949350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516107ed9190610abb565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b8060025f8282546108669190610b59565b90915550506001600160a01b0382165f818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f602080835283518060208501525f5b818110156108ea578581018301518582016040015282016108ce565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610920575f80fd5b919050565b5f8060408385031215610936575f80fd5b61093f8361090a565b946020939093013593505050565b5f805f6060848603121561095f575f80fd5b6109688461090a565b92506109766020850161090a565b9150604084013590509250925092565b5f60208284031215610996575f80fd5b6103958261090a565b5f805f805f805f60e0888a0312156109b5575f80fd5b6109be8861090a565b96506109cc6020890161090a565b95506040880135945060608801359350608088013560ff811681146109ef575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215610a1d575f80fd5b610a268361090a565b9150610a346020840161090a565b90509250929050565b5f60208284031215610a4d575f80fd5b81358015158114610395575f80fd5b600181811c90821680610a7057607f821691505b602082108103610a8e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561036a5761036a610a94565b5f8083545f60018260011c91506001831680610ad857607f831692505b60208084108203610af757634e487b7160e01b5f52602260045260245ffd5b818015610b0b5760018114610b2057610b4b565b60ff1986168952841515850289019650610b4b565b5f8a8152602090205f5b86811015610b435781548b820152908501908301610b2a565b505084890196505b509498975050505050505050565b8082018082111561036a5761036a610a9456fea2646970667358221220309e8fd45163f082d3f1c520ec74fc6129f86d68c526883865e74dfb67cba9bd64736f6c63430008180033";class TestERC20__factory extends OG.ContractFactory{constructor(...G){G.length>1?super(...G):super(xG,NG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new OG.Interface(xG)}static connect(G,K){return new OG.Contract(G,xG,K)}}kG.TestERC20__factory=TestERC20__factory,TestERC20__factory.bytecode=NG,TestERC20__factory.abi=xG;var MG={};Object.defineProperty(MG,"__esModule",{value:!0}),MG.TestERC20USDC__factory=void 0;const BG=EN,FG=[{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:"amount",type:"uint256"}],name:"Approval",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:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",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:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"blocking",type:"bool"}],name:"blockTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blocked",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",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:"ok",type:"bool"}],stateMutability:"nonpayable",type:"function"}],DG="0x60e060405234801562000010575f80fd5b5060405180604001604052806008815260200167546573745553444360c01b815250604051806040016040528060078152602001665453545553444360c81b8152506006825f9081620000649190620001d7565b506001620000738382620001d7565b5060ff81166080524660a052620000896200009f565b60c05250506006805460ff19169055506200031d565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f604051620000d19190620002a3565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200016257607f821691505b6020821081036200018157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620001d257805f5260205f20601f840160051c81016020851015620001ae5750805b601f840160051c820191505b81811015620001cf575f8155600101620001ba565b50505b505050565b81516001600160401b03811115620001f357620001f362000139565b6200020b816200020484546200014d565b8462000187565b602080601f83116001811462000241575f8415620002295750858301515b5f19600386901b1c1916600185901b1785556200029b565b5f85815260208120601f198616915b82811015620002715788860151825594840194600190910190840162000250565b50858210156200028f57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f808354620002b2816200014d565b60018281168015620002cd5760018114620002e35762000311565b60ff198416875282151583028701945062000311565b875f526020805f205f5b85811015620003085781548a820152908401908201620002ed565b50505082870194505b50929695505050505050565b60805160a05160c051610ba2620003485f395f6103d401525f61039f01525f6101710152610ba25ff3fe608060405234801561000f575f80fd5b50600436106100f0575f3560e01c806340c10f1911610093578063a9059cbb11610063578063a9059cbb14610206578063d505accf14610219578063dd62ed3e1461022e578063e074d6a914610258575f80fd5b806340c10f19146101ad57806370a08231146101c05780637ecebe00146101df57806395d89b41146101fe575f80fd5b806323b872dd116100ce57806323b872dd1461014c578063303bdd2c1461015f578063313ce5671461016c5780633644e515146101a5575f80fd5b806306fdde03146100f4578063095ea7b31461011257806318160ddd14610135575b5f80fd5b6100fc610279565b60405161010991906108be565b60405180910390f35b610125610120366004610925565b610304565b6040519015158152602001610109565b61013e60025481565b604051908152602001610109565b61012561015a36600461094d565b610370565b6006546101259060ff1681565b6101937f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610109565b61013e61039c565b6101256101bb366004610925565b6103f6565b61013e6101ce366004610986565b60036020525f908152604090205481565b61013e6101ed366004610986565b60056020525f908152604090205481565b6100fc61040a565b610125610214366004610925565b610417565b61022c61022736600461099f565b61048d565b005b61013e61023c366004610a0c565b600460209081525f928352604080842090915290825290205481565b61022c610266366004610a3d565b6006805460ff1916911515919091179055565b5f805461028590610a5c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610a5c565b80156102fc5780601f106102d3576101008083540402835291602001916102fc565b820191905f5260205f20905b8154815290600101906020018083116102df57829003601f168201915b505050505081565b335f8181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061035e9086815260200190565b60405180910390a35060015b92915050565b6006545f9060ff161561038457505f610395565b61038f8484846106d0565b50600190505b9392505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146103d1576103cc6107bd565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b5f6104018383610855565b50600192915050565b6001805461028590610a5c565b335f90815260036020526040812080548391908390610437908490610aa8565b90915550506001600160a01b0383165f81815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061035e9086815260200190565b428410156104e25760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b5f60016104ed61039c565b6001600160a01b038a81165f8181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156105f5573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381161580159061062b5750876001600160a01b0316816001600160a01b0316145b6106685760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016104d9565b6001600160a01b039081165f9081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b6001600160a01b0383165f9081526004602090815260408083203384529091528120545f198114610729576107058382610aa8565b6001600160a01b0386165f9081526004602090815260408083203384529091529020555b6001600160a01b0385165f9081526003602052604081208054859290610750908490610aa8565b90915550506001600160a01b038085165f81815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107aa9087815260200190565b60405180910390a3506001949350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516107ed9190610abb565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b8060025f8282546108669190610b59565b90915550506001600160a01b0382165f818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f602080835283518060208501525f5b818110156108ea578581018301518582016040015282016108ce565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610920575f80fd5b919050565b5f8060408385031215610936575f80fd5b61093f8361090a565b946020939093013593505050565b5f805f6060848603121561095f575f80fd5b6109688461090a565b92506109766020850161090a565b9150604084013590509250925092565b5f60208284031215610996575f80fd5b6103958261090a565b5f805f805f805f60e0888a0312156109b5575f80fd5b6109be8861090a565b96506109cc6020890161090a565b95506040880135945060608801359350608088013560ff811681146109ef575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215610a1d575f80fd5b610a268361090a565b9150610a346020840161090a565b90509250929050565b5f60208284031215610a4d575f80fd5b81358015158114610395575f80fd5b600181811c90821680610a7057607f821691505b602082108103610a8e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561036a5761036a610a94565b5f8083545f60018260011c91506001831680610ad857607f831692505b60208084108203610af757634e487b7160e01b5f52602260045260245ffd5b818015610b0b5760018114610b2057610b4b565b60ff1986168952841515850289019650610b4b565b5f8a8152602090205f5b86811015610b435781548b820152908501908301610b2a565b505084890196505b509498975050505050505050565b8082018082111561036a5761036a610a9456fea2646970667358221220c6ecf48e577715c99a01d2b6a3ce00783fb94e506d38827fdf46b888bdc0784064736f6c63430008180033";class TestERC20USDC__factory extends BG.ContractFactory{constructor(...G){G.length>1?super(...G):super(FG,DG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new BG.Interface(FG)}static connect(G,K){return new BG.Contract(G,FG,K)}}MG.TestERC20USDC__factory=TestERC20USDC__factory,TestERC20USDC__factory.bytecode=DG,TestERC20USDC__factory.abi=FG;var LG={};Object.defineProperty(LG,"__esModule",{value:!0}),LG.TestERC721__factory=void 0;const UG=EN,$G=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],qG="0x608060405234801562000010575f80fd5b50604051806040016040528060078152602001665465737437323160c81b8152506040518060400160405280600681526020016554535437323160d01b815250815f908162000060919062000116565b5060016200006f828262000116565b505050620001e2565b634e487b7160e01b5f52604160045260245ffd5b600181811c90821680620000a157607f821691505b602082108103620000c057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200011157805f5260205f20601f840160051c81016020851015620000ed5750805b601f840160051c820191505b818110156200010e575f8155600101620000f9565b50505b505050565b81516001600160401b0381111562000132576200013262000078565b6200014a816200014384546200008c565b84620000c6565b602080601f83116001811462000180575f8415620001685750858301515b5f19600386901b1c1916600185901b178555620001da565b5f85815260208120601f198616915b82811015620001b0578886015182559484019460019091019084016200018f565b5085821015620001ce57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b610d2080620001f05f395ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c80636352211e11610088578063a22cb46511610063578063a22cb465146101f0578063b88d4fde14610203578063c87b56dd14610216578063e985e9c514610247575f80fd5b80636352211e146101b457806370a08231146101c757806395d89b41146101e8575f80fd5b8063095ea7b3116100c3578063095ea7b31461016657806323b872dd1461017b57806340c10f191461018e57806342842e0e146101a1575f80fd5b806301ffc9a7146100e957806306fdde0314610111578063081812fc14610126575b5f80fd5b6100fc6100f7366004610a33565b610274565b60405190151581526020015b60405180910390f35b6101196102c5565b6040516101089190610a55565b61014e610134366004610aa1565b60046020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610108565b610179610174366004610ace565b610350565b005b610179610189366004610af6565b610434565b6100fc61019c366004610ace565b6105f6565b6101796101af366004610af6565b61060a565b61014e6101c2366004610aa1565b6106fe565b6101da6101d5366004610b2f565b610754565b604051908152602001610108565b6101196107b5565b6101796101fe366004610b48565b6107c2565b610179610211366004610b81565b61082d565b610119610224366004610aa1565b50604080518082019091526008815267746f6b656e55524960c01b602082015290565b6100fc610255366004610c14565b600560209081525f928352604080842090915290825290205460ff1681565b5f6301ffc9a760e01b6001600160e01b0319831614806102a457506380ac58cd60e01b6001600160e01b03198316145b806102bf5750635b5e139f60e01b6001600160e01b03198316145b92915050565b5f80546102d190610c45565b80601f01602080910402602001604051908101604052809291908181526020018280546102fd90610c45565b80156103485780601f1061031f57610100808354040283529160200191610348565b820191905f5260205f20905b81548152906001019060200180831161032b57829003601f168201915b505050505081565b5f818152600260205260409020546001600160a01b03163381148061039757506001600160a01b0381165f90815260056020908152604080832033845290915290205460ff165b6103d95760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b5f8281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b5f818152600260205260409020546001600160a01b038481169116146104895760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b60448201526064016103d0565b6001600160a01b0382166104d35760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016103d0565b336001600160a01b038416148061050c57506001600160a01b0383165f90815260056020908152604080832033845290915290205460ff165b8061052c57505f818152600460205260409020546001600160a01b031633145b6105695760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016103d0565b6001600160a01b038084165f81815260036020908152604080832080545f19019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b5f6106018383610912565b50600192915050565b610615838383610434565b6001600160a01b0382163b15806106ba5750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401525f608484015290919084169063150b7a029060a4016020604051808303815f875af115801561068a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106ae9190610c7d565b6001600160e01b031916145b6106f95760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b60448201526064016103d0565b505050565b5f818152600260205260409020546001600160a01b03168061074f5760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016103d0565b919050565b5f6001600160a01b03821661079a5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016103d0565b506001600160a01b03165f9081526003602052604090205490565b600180546102d190610c45565b335f8181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610838858585610434565b6001600160a01b0384163b15806108cc5750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a02906108809033908a90899089908990600401610c98565b6020604051808303815f875af115801561089c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c09190610c7d565b6001600160e01b031916145b61090b5760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b60448201526064016103d0565b5050505050565b6001600160a01b03821661095c5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016103d0565b5f818152600260205260409020546001600160a01b0316156109b15760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b60448201526064016103d0565b6001600160a01b0382165f81815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610a30575f80fd5b50565b5f60208284031215610a43575f80fd5b8135610a4e81610a1b565b9392505050565b5f602080835283518060208501525f5b81811015610a8157858101830151858201604001528201610a65565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610ab1575f80fd5b5035919050565b80356001600160a01b038116811461074f575f80fd5b5f8060408385031215610adf575f80fd5b610ae883610ab8565b946020939093013593505050565b5f805f60608486031215610b08575f80fd5b610b1184610ab8565b9250610b1f60208501610ab8565b9150604084013590509250925092565b5f60208284031215610b3f575f80fd5b610a4e82610ab8565b5f8060408385031215610b59575f80fd5b610b6283610ab8565b915060208301358015158114610b76575f80fd5b809150509250929050565b5f805f805f60808688031215610b95575f80fd5b610b9e86610ab8565b9450610bac60208701610ab8565b935060408601359250606086013567ffffffffffffffff80821115610bcf575f80fd5b818801915088601f830112610be2575f80fd5b813581811115610bf0575f80fd5b896020828501011115610c01575f80fd5b9699959850939650602001949392505050565b5f8060408385031215610c25575f80fd5b610c2e83610ab8565b9150610c3c60208401610ab8565b90509250929050565b600181811c90821680610c5957607f821691505b602082108103610c7757634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610c8d575f80fd5b8151610a4e81610a1b565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290525f828460a08401375f60a0848401015260a0601f19601f8501168301019050969550505050505056fea26469706673582212205a79bcfc82262828b2b16ac33b24c34a52b9fde11fb66fd482dcb03e54d0043364736f6c63430008180033";class TestERC721__factory extends UG.ContractFactory{constructor(...G){G.length>1?super(...G):super($G,qG,G[0])}getDeployTransaction(G){return super.getDeployTransaction(G||{})}deploy(G){return super.deploy(G||{})}connect(G){return super.connect(G)}static createInterface(){return new UG.Interface($G)}static connect(G,K){return new UG.Contract(G,$G,K)}}LG.TestERC721__factory=TestERC721__factory,TestERC721__factory.bytecode=qG,TestERC721__factory.abi=$G,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.TestERC721__factory=G.TestERC20USDC__factory=G.TestERC20__factory=G.TestERC1155__factory=G.testErc1271WalletSol=void 0,G.testErc1271WalletSol=gG;var K=SG;Object.defineProperty(G,"TestERC1155__factory",{enumerable:!0,get:function(){return K.TestERC1155__factory}});var ne=kG;Object.defineProperty(G,"TestERC20__factory",{enumerable:!0,get:function(){return ne.TestERC20__factory}});var ue=MG;Object.defineProperty(G,"TestERC20USDC__factory",{enumerable:!0,get:function(){return ue.TestERC20USDC__factory}});var pe=LG;Object.defineProperty(G,"TestERC721__factory",{enumerable:!0,get:function(){return pe.TestERC721__factory}})}(bG),Object.defineProperty(cG,"__esModule",{value:!0}),cG.test=cG.domainRegistrySol=void 0,cG.domainRegistrySol=dG,cG.test=bG,Object.defineProperty(oG,"__esModule",{value:!0}),oG.contracts=void 0,oG.contracts=cG,Object.defineProperty(cU,"__esModule",{value:!0}),cU.src=cU.seaportTypes=cU.seaportCore=cU.seaport=cU.rariCapital=void 0,cU.rariCapital=dU,cU.seaport=OU,cU.seaportCore=KU,cU.seaportTypes=Pq,cU.src=oG,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.TestERC721__factory=G.TestERC20USDC__factory=G.TestERC20__factory=G.TestERC1271Wallet__factory=G.IERC20Approve__factory=G.TestERC1155__factory=G.DomainRegistryInterface__factory=G.DomainRegistry__factory=G.Seaport__factory=G.LocalConduitController__factory=G.LocalConduit__factory=G.ZoneInteractionErrors__factory=G.TokenTransferrerErrors__factory=G.SignatureVerificationErrors__factory=G.ReentrancyErrors__factory=G.FulfillmentApplicationErrors__factory=G.CriteriaResolutionErrors__factory=G.ConsiderationInterface__factory=G.ConsiderationEventsAndErrors__factory=G.ConduitInterface__factory=G.ConduitControllerInterface__factory=G.AmountDerivationErrors__factory=G.ZoneInteraction__factory=G.Verifiers__factory=G.TokenTransferrer__factory=G.SignatureVerification__factory=G.ReentrancyGuard__factory=G.OrderValidator__factory=G.OrderFulfiller__factory=G.OrderCombiner__factory=G.GettersAndDerivers__factory=G.FulfillmentApplier__factory=G.Executor__factory=G.CriteriaResolution__factory=G.CounterManager__factory=G.ConsiderationBase__factory=G.Consideration__factory=G.BasicOrderFulfiller__factory=G.Assertions__factory=G.AmountDeriver__factory=G.ConduitController__factory=G.Conduit__factory=G.ERC721TokenReceiver__factory=G.ERC721__factory=G.ERC20__factory=G.ERC1155TokenReceiver__factory=G.ERC1155__factory=G.factories=void 0,G.factories=cU;var K=hU;Object.defineProperty(G,"ERC1155__factory",{enumerable:!0,get:function(){return K.ERC1155__factory}});var ne=bU;Object.defineProperty(G,"ERC1155TokenReceiver__factory",{enumerable:!0,get:function(){return ne.ERC1155TokenReceiver__factory}});var ue=IU;Object.defineProperty(G,"ERC20__factory",{enumerable:!0,get:function(){return ue.ERC20__factory}});var pe=_U;Object.defineProperty(G,"ERC721__factory",{enumerable:!0,get:function(){return pe.ERC721__factory}});var he=EU;Object.defineProperty(G,"ERC721TokenReceiver__factory",{enumerable:!0,get:function(){return he.ERC721TokenReceiver__factory}});var ye=QU;Object.defineProperty(G,"Conduit__factory",{enumerable:!0,get:function(){return ye.Conduit__factory}});var me=t$;Object.defineProperty(G,"ConduitController__factory",{enumerable:!0,get:function(){return me.ConduitController__factory}});var be=s$;Object.defineProperty(G,"AmountDeriver__factory",{enumerable:!0,get:function(){return be.AmountDeriver__factory}});var ve=u$;Object.defineProperty(G,"Assertions__factory",{enumerable:!0,get:function(){return ve.Assertions__factory}});var _e=h$;Object.defineProperty(G,"BasicOrderFulfiller__factory",{enumerable:!0,get:function(){return _e.BasicOrderFulfiller__factory}});var Te=g$;Object.defineProperty(G,"Consideration__factory",{enumerable:!0,get:function(){return Te.Consideration__factory}});var Ee=T$;Object.defineProperty(G,"ConsiderationBase__factory",{enumerable:!0,get:function(){return Ee.ConsiderationBase__factory}});var Pe=S$;Object.defineProperty(G,"CounterManager__factory",{enumerable:!0,get:function(){return Pe.CounterManager__factory}});var Se=k$;Object.defineProperty(G,"CriteriaResolution__factory",{enumerable:!0,get:function(){return Se.CriteriaResolution__factory}});var Ce=M$;Object.defineProperty(G,"Executor__factory",{enumerable:!0,get:function(){return Ce.Executor__factory}});var ke=L$;Object.defineProperty(G,"FulfillmentApplier__factory",{enumerable:!0,get:function(){return ke.FulfillmentApplier__factory}});var Oe=G$;Object.defineProperty(G,"GettersAndDerivers__factory",{enumerable:!0,get:function(){return Oe.GettersAndDerivers__factory}});var xe=z$;Object.defineProperty(G,"OrderCombiner__factory",{enumerable:!0,get:function(){return xe.OrderCombiner__factory}});var Ne=X$;Object.defineProperty(G,"OrderFulfiller__factory",{enumerable:!0,get:function(){return Ne.OrderFulfiller__factory}});var Me=tq;Object.defineProperty(G,"OrderValidator__factory",{enumerable:!0,get:function(){return Me.OrderValidator__factory}});var Be=iq;Object.defineProperty(G,"ReentrancyGuard__factory",{enumerable:!0,get:function(){return Be.ReentrancyGuard__factory}});var Fe=dq;Object.defineProperty(G,"SignatureVerification__factory",{enumerable:!0,get:function(){return Fe.SignatureVerification__factory}});var De=pq;Object.defineProperty(G,"TokenTransferrer__factory",{enumerable:!0,get:function(){return De.TokenTransferrer__factory}});var Le=bq;Object.defineProperty(G,"Verifiers__factory",{enumerable:!0,get:function(){return Le.Verifiers__factory}});var Ue=_q;Object.defineProperty(G,"ZoneInteraction__factory",{enumerable:!0,get:function(){return Ue.ZoneInteraction__factory}});var je=Cq;Object.defineProperty(G,"AmountDerivationErrors__factory",{enumerable:!0,get:function(){return je.AmountDerivationErrors__factory}});var ze=Oq;Object.defineProperty(G,"ConduitControllerInterface__factory",{enumerable:!0,get:function(){return ze.ConduitControllerInterface__factory}});var Je=Mq;Object.defineProperty(G,"ConduitInterface__factory",{enumerable:!0,get:function(){return Je.ConduitInterface__factory}});var Xe=Dq;Object.defineProperty(G,"ConsiderationEventsAndErrors__factory",{enumerable:!0,get:function(){return Xe.ConsiderationEventsAndErrors__factory}});var Qe=$q;Object.defineProperty(G,"ConsiderationInterface__factory",{enumerable:!0,get:function(){return Qe.ConsiderationInterface__factory}});var Ye=jq;Object.defineProperty(G,"CriteriaResolutionErrors__factory",{enumerable:!0,get:function(){return Ye.CriteriaResolutionErrors__factory}});var et=zq;Object.defineProperty(G,"FulfillmentApplicationErrors__factory",{enumerable:!0,get:function(){return et.FulfillmentApplicationErrors__factory}});var tt=Jq;Object.defineProperty(G,"ReentrancyErrors__factory",{enumerable:!0,get:function(){return tt.ReentrancyErrors__factory}});var rt=Zq;Object.defineProperty(G,"SignatureVerificationErrors__factory",{enumerable:!0,get:function(){return rt.SignatureVerificationErrors__factory}});var nt=tG;Object.defineProperty(G,"TokenTransferrerErrors__factory",{enumerable:!0,get:function(){return nt.TokenTransferrerErrors__factory}});var at=aG;Object.defineProperty(G,"ZoneInteractionErrors__factory",{enumerable:!0,get:function(){return at.ZoneInteractionErrors__factory}});var it=BU;Object.defineProperty(G,"LocalConduit__factory",{enumerable:!0,get:function(){return it.LocalConduit__factory}});var ot=$U;Object.defineProperty(G,"LocalConduitController__factory",{enumerable:!0,get:function(){return ot.LocalConduitController__factory}});var ct=HU;Object.defineProperty(G,"Seaport__factory",{enumerable:!0,get:function(){return ct.Seaport__factory}});var dt=uG;Object.defineProperty(G,"DomainRegistry__factory",{enumerable:!0,get:function(){return dt.DomainRegistry__factory}});var ut=hG;Object.defineProperty(G,"DomainRegistryInterface__factory",{enumerable:!0,get:function(){return ut.DomainRegistryInterface__factory}});var ft=SG;Object.defineProperty(G,"TestERC1155__factory",{enumerable:!0,get:function(){return ft.TestERC1155__factory}});var yt=vG;Object.defineProperty(G,"IERC20Approve__factory",{enumerable:!0,get:function(){return yt.IERC20Approve__factory}});var wt=TG;Object.defineProperty(G,"TestERC1271Wallet__factory",{enumerable:!0,get:function(){return wt.TestERC1271Wallet__factory}});var At=kG;Object.defineProperty(G,"TestERC20__factory",{enumerable:!0,get:function(){return At.TestERC20__factory}});var St=MG;Object.defineProperty(G,"TestERC20USDC__factory",{enumerable:!0,get:function(){return St.TestERC20USDC__factory}});var kt=LG;Object.defineProperty(G,"TestERC721__factory",{enumerable:!0,get:function(){return kt.TestERC721__factory}})}(oU);var jG,HG={},WG={};function requireCriteria(){if(jG)return WG;jG=1,Object.defineProperty(WG,"__esModule",{value:!0}),WG.getItemToCriteriaMap=WG.generateCriteriaResolvers=void 0;const G=iU,K=requireItem();WG.generateCriteriaResolvers=({orders:ne,offerCriterias:ue=[[]],considerationCriterias:pe=[[]]})=>{const he=ne.flatMap(((ne,ue)=>ne.parameters.offer.map(((K,ne)=>({orderIndex:ue,item:K,index:ne,side:G.Side.OFFER}))).filter((({item:G})=>(0,K.isCriteriaItem)(G.itemType))))),ye=ne.flatMap(((ne,ue)=>ne.parameters.consideration.map(((K,ne)=>({orderIndex:ue,item:K,index:ne,side:G.Side.CONSIDERATION}))).filter((({item:G})=>(0,K.isCriteriaItem)(G.itemType))))),mapCriteriaItemsToResolver=(G,K)=>G.map((({orderIndex:G,item:ne,index:ue,side:pe})=>{const he=ne.identifierOrCriteria||"0",ye=K[G][ue];return{orderIndex:G,index:ue,side:pe,identifier:ye.identifier,criteriaProof:"0"===he?[]:ye.proof}}));return[...mapCriteriaItemsToResolver(he,ue),...mapCriteriaItemsToResolver(ye,pe)]};return WG.getItemToCriteriaMap=(G,ne)=>{const ue=[...ne];return G.reduce(((G,ne)=>((0,K.isCriteriaItem)(ne.itemType)&&G.set(ne,ue.shift()),G)),new Map)},WG}var zG,VG={};function requireItem(){return zG||(zG=1,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.getMaximumSizeForOrder=G.getSummedTokenAndIdentifierAmounts=G.getPresentItemAmount=G.isCriteriaItem=G.isErc1155Item=G.isErc721Item=G.isErc20Item=G.isNativeCurrencyItem=G.isCurrencyItem=void 0;const K=iU,ne=requireCriteria(),ue=VG;G.isCurrencyItem=({itemType:G})=>[K.ItemType.NATIVE,K.ItemType.ERC20].includes(G);G.isNativeCurrencyItem=({itemType:G})=>G===K.ItemType.NATIVE;G.isErc20Item=G=>G===K.ItemType.ERC20;G.isErc721Item=G=>[K.ItemType.ERC721,K.ItemType.ERC721_WITH_CRITERIA].includes(G);G.isErc1155Item=G=>[K.ItemType.ERC1155,K.ItemType.ERC1155_WITH_CRITERIA].includes(G);G.isCriteriaItem=G=>[K.ItemType.ERC721_WITH_CRITERIA,K.ItemType.ERC1155_WITH_CRITERIA].includes(G);G.getPresentItemAmount=({startAmount:G,endAmount:K,timeBasedItemParams:ne})=>{const ue=BigInt(G),pe=BigInt(K);if(!ne)return ue>pe?ue:pe;const{isConsiderationItem:he,currentBlockTimestamp:ye,ascendingAmountTimestampBuffer:me,startTime:be,endTime:ve}=ne,_e=BigInt(be),Te=BigInt(ve),Ee=Te-_e,Pe=BigInt(pe>ue?ye+me:ye);if(Pe<_e)return ue;const Se=(Pe>Te?Te:Pe)-_e;return(ue*(Ee-Se)+pe*Se+(he?Ee-1n:0n))/Ee};G.getSummedTokenAndIdentifierAmounts=({items:K,criterias:ue,timeBasedItemParams:pe})=>{const he=(0,ne.getItemToCriteriaMap)(K,ue),ye=K.reduce(((K,ne)=>{const ue=he.get(ne)?.identifier??ne.identifierOrCriteria;return{...K,[ne.token]:{...K[ne.token],[ue]:(K[ne.token]?.[ue]??0n)+(0,G.getPresentItemAmount)({startAmount:ne.startAmount,endAmount:ne.endAmount,timeBasedItemParams:pe})}}}),{});return ye};G.getMaximumSizeForOrder=({parameters:{offer:G,consideration:K}})=>{const ne=[...G,...K].flatMap((({startAmount:G,endAmount:K})=>[G,K]));return(0,ue.findGcd)(ne)}}(HG)),HG}!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.findGcd=G.gcd=void 0;G.gcd=(K,ne)=>{const ue=BigInt(K),pe=BigInt(ne);return 0n===ue?pe:(0,G.gcd)(pe%ue,ue)};G.findGcd=K=>{let ne=BigInt(K[0]);for(let ue=1;ue<K.length;ue++)if(ne=(0,G.gcd)(K[ue],ne),1n===ne)return ne;return ne}}(VG);var KG={};!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.getTagFromDomain=G.getTransactionMethods=G.executeAllActions=void 0;const K=EN;G.executeAllActions=async G=>{for(let K=0;K<G.length-1;K++){const ne=G[K];if("approval"===ne.type){const G=await ne.transactionMethods.transact();await G.wait()}}const K=G[G.length-1];switch(K.type){case"create":return K.createOrder();case"createBulk":return K.createBulkOrders();default:return K.transactionMethods.transact()}};G.getTransactionMethods=(K,ne,ue,pe,he)=>{let ye;if(pe?.length>0){const G=pe[pe.length-1];(G=>{const K=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","overrides"];return void 0===G||Object.keys(G).length>0&&Object.keys(G).every((G=>K.includes(G)))})(G)&&(ye=G,pe.pop())}const contractMethod=async G=>ne.connect(await G)[ue],buildTransaction=async ne=>{const ue={...ye,...ne},me=await contractMethod(K),be=await me.populateTransaction(...pe,ue);if(he){const K=(0,G.getTagFromDomain)(he);be.data=be.data+K}return be};return{staticCall:async G=>{const ne={...ye,...G},ue=[...pe,ne];return(await contractMethod(K)).staticCall(...ue)},estimateGas:async G=>{const ne={...ye,...G},ue=[...pe,ne];return(await contractMethod(K)).estimateGas(...ue)},transact:async G=>{const ne={...ye,...G},ue=await buildTransaction(ne);return(await K).sendTransaction(ue)},buildTransaction:buildTransaction}};G.getTagFromDomain=G=>(0,K.keccak256)((0,K.toUtf8Bytes)(G)).slice(2,10)}(KG),Object.defineProperty(sU,"__esModule",{value:!0}),sU.getApprovalActions=sU.approvedItemAmount=void 0;const JG=iU,XG=oU,QG=requireItem(),ZG=KG;sU.approvedItemAmount=async(G,K,ne,ue)=>{if((0,QG.isErc721Item)(K.itemType)||(0,QG.isErc1155Item)(K.itemType)){const pe=XG.TestERC721__factory.connect(K.token,ue);return await pe.isApprovedForAll(G,ne)?JG.MAX_INT:0n}if(K.itemType===JG.ItemType.ERC20){return XG.TestERC20__factory.connect(K.token,ue).allowance(G,ne)}return JG.MAX_INT},sU.getApprovalActions=function getApprovalActions(G,K,ne){return G.filter(((K,ne)=>ne===G.length-1||G[ne+1].token!==K.token)).map((({token:G,operator:ue,itemType:pe,identifierOrCriteria:he,requiredApprovedAmount:ye})=>{const me=(0,QG.isErc1155Item)(pe);if((0,QG.isErc721Item)(pe)||me){const ye=XG.TestERC721__factory.connect(G,ne);return{type:"approval",token:G,identifierOrCriteria:he,itemType:pe,operator:ue,transactionMethods:K&&!me?(0,ZG.getTransactionMethods)(ne,ye,"approve",[ue,he]):(0,ZG.getTransactionMethods)(ne,ye,"setApprovalForAll",[ue,!0])}}{const me=XG.TestERC20__factory.connect(G,ne);return{type:"approval",token:G,identifierOrCriteria:he,itemType:pe,transactionMethods:(0,ZG.getTransactionMethods)(ne,me,"approve",[ue,K?ye:JG.MAX_INT]),operator:ue}}}))};var YG={},ej={};Object.defineProperty(ej,"__esModule",{value:!0}),ej.balanceOf=void 0;const tj=iU,rj=oU,nj=requireItem();ej.balanceOf=async(G,K,ne,ue)=>{if((0,nj.isErc721Item)(K.itemType)){const pe=rj.TestERC721__factory.connect(K.token,ne);return K.itemType===tj.ItemType.ERC721_WITH_CRITERIA?ue?pe.ownerOf(ue.identifier).then((K=>BigInt(K.toLowerCase()===G.toLowerCase()))):pe.balanceOf(G):pe.ownerOf(K.identifierOrCriteria).then((K=>BigInt(K.toLowerCase()===G.toLowerCase())))}if((0,nj.isErc1155Item)(K.itemType)){const pe=rj.TestERC1155__factory.connect(K.token,ne);if(K.itemType===tj.ItemType.ERC1155_WITH_CRITERIA){if(!ue){const G=BigInt(K.startAmount),ne=BigInt(K.endAmount);return G>ne?G:ne}return pe.balanceOf(G,ue.identifier)}return pe.balanceOf(G,K.identifierOrCriteria)}if((0,nj.isErc20Item)(K.itemType)){return rj.TestERC20__factory.connect(K.token,ne).balanceOf(G)}return ne.getBalance(G)},function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.validateStandardFulfillBalancesAndApprovals=G.validateBasicFulfillBalancesAndApprovals=G.validateOfferBalancesAndApprovals=G.getInsufficientBalanceAndApprovalAmounts=G.getBalancesAndApprovals=void 0;const K=iU,ne=sU,ue=ej,pe=requireCriteria(),he=requireItem(),findBalanceAndApproval=(G,K,ne)=>{const ue=G.find((({token:G,identifierOrCriteria:ue})=>K.toLowerCase()===G.toLowerCase()&&ue.toLowerCase()===ne.toLowerCase()));if(!ue)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return ue};G.getBalancesAndApprovals=async({owner:G,items:ye,criterias:me,operator:be,provider:ve})=>{const _e=(0,pe.getItemToCriteriaMap)(ye,me);return Promise.all(ye.map((async pe=>{let ye=0n;return ye=(0,he.isErc721Item)(pe.itemType)||(0,he.isErc1155Item)(pe.itemType)||(0,he.isErc20Item)(pe.itemType)?await(0,ne.approvedItemAmount)(G,pe,be,ve):K.MAX_INT,{token:pe.token,identifierOrCriteria:_e.get(pe)?.identifier??pe.identifierOrCriteria,balance:await(0,ue.balanceOf)(G,pe,ve,_e.get(pe)),approvedAmount:ye,itemType:pe.itemType}})))};G.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:G,tokenAndIdentifierAmounts:K,operator:ne})=>{const ue=[...Object.entries(K).map((([G,K])=>Object.entries(K).map((([K,ne])=>[G,K,ne]))))].flat(),filterBalancesOrApprovals=K=>ue.filter((([ne,ue,pe])=>findBalanceAndApproval(G,ne,ue)[K]<pe)).map((([ne,ue,pe])=>{const he=findBalanceAndApproval(G,ne,ue);return{token:ne,identifierOrCriteria:ue,requiredAmount:pe,amountHave:he[K],itemType:he.itemType}})),[pe,he]=[filterBalancesOrApprovals("balance"),filterBalancesOrApprovals("approvedAmount").map((G=>({token:G.token,identifierOrCriteria:G.identifierOrCriteria,approvedAmount:G.amountHave,requiredApprovedAmount:G.requiredAmount,itemType:G.itemType,operator:ne})))];return{insufficientBalances:pe,insufficientApprovals:he}};G.validateOfferBalancesAndApprovals=({offer:K,criterias:ne,balancesAndApprovals:ue,timeBasedItemParams:pe,throwOnInsufficientBalances:ye=!0,throwOnInsufficientApprovals:me,operator:be})=>{const{insufficientBalances:ve,insufficientApprovals:_e}=(0,G.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:ue,tokenAndIdentifierAmounts:(0,he.getSummedTokenAndIdentifierAmounts)({items:K,criterias:ne,timeBasedItemParams:pe?{...pe,isConsiderationItem:!1}:void 0}),operator:be});if(ye&&ve.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(me&&_e.length>0)throw new Error("The offerer does not have the sufficient approvals.");return _e};G.validateBasicFulfillBalancesAndApprovals=({offer:K,consideration:ne,offererBalancesAndApprovals:ue,fulfillerBalancesAndApprovals:pe,timeBasedItemParams:ye,offererOperator:me,fulfillerOperator:be})=>{(0,G.validateOfferBalancesAndApprovals)({offer:K,criterias:[],balancesAndApprovals:ue,timeBasedItemParams:ye,throwOnInsufficientApprovals:!0,operator:me});const ve=ne.filter((G=>G.itemType!==K[0].itemType)),{insufficientBalances:_e,insufficientApprovals:Te}=(0,G.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:pe,tokenAndIdentifierAmounts:(0,he.getSummedTokenAndIdentifierAmounts)({items:ve,criterias:[],timeBasedItemParams:{...ye,isConsiderationItem:!0}}),operator:be});if(_e.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return Te};G.validateStandardFulfillBalancesAndApprovals=({offer:K,consideration:ne,offerCriteria:ue,considerationCriteria:pe,offererBalancesAndApprovals:ye,fulfillerBalancesAndApprovals:me,timeBasedItemParams:be,offererOperator:ve,fulfillerOperator:_e})=>{(0,G.validateOfferBalancesAndApprovals)({offer:K,criterias:ue,balancesAndApprovals:ye,timeBasedItemParams:be,throwOnInsufficientApprovals:!0,operator:ve});const Te=addToExistingBalances({items:K,criterias:ue,balancesAndApprovals:me,timeBasedItemParams:be}),{insufficientBalances:Ee,insufficientApprovals:Pe}=(0,G.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:Te,tokenAndIdentifierAmounts:(0,he.getSummedTokenAndIdentifierAmounts)({items:ne,criterias:pe,timeBasedItemParams:{...be,isConsiderationItem:!0}}),operator:_e});if(Ee.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return Pe};const addToExistingBalances=({items:G,criterias:K,timeBasedItemParams:ne,balancesAndApprovals:ue})=>{const pe=(0,he.getSummedTokenAndIdentifierAmounts)({items:G,criterias:K,timeBasedItemParams:{...ne,isConsiderationItem:!1}}),ye=ue.map((G=>({...G})));return Object.entries(pe).forEach((([G,K])=>Object.entries(K).forEach((([K,ne])=>{const ue=findBalanceAndApproval(ye,G,K),pe=ye.indexOf(ue);ye[pe].balance=ye[pe].balance+ne})))),ye}}(YG);var aj={},ij={},sj={};Object.defineProperty(sj,"__esModule",{value:!0}),sj.DefaultGetter=void 0;const oj=EN,cj={integer:0,address:oj.ethers.zeroPadValue("0x",20),bool:!1,bytes:"0x",string:""},isNullish$1=G=>void 0!==G&&(null!=G&&(["string","number"].includes(typeof G)&&0n===BigInt(G)||Array.isArray(G)&&G.every(isNullish$1)||"object"==typeof G&&Object.values(G).every(isNullish$1)||"boolean"==typeof G&&!1===G));sj.DefaultGetter=class DefaultGetter{constructor(G){this.types=G,this.defaultValues={};for(const K in G){const G=this.getDefaultValue(K);if(this.defaultValues[K]=G,!isNullish$1(G))throw new Error(`Got non-empty value for type ${K} in default generator: ${G}`)}}static from(G,K){const{defaultValues:ne}=new DefaultGetter(G);return K?ne[K]:ne}getDefaultValue(G){if(this.defaultValues[G])return this.defaultValues[G];const K=function getDefaultForBaseType$1(G){const[,K]=G.match(/^bytes(\d+)$/)??[];return K?(0,oj.zeroPadValue)("0x",parseInt(K)):(G.match(/^(u?)int(\d*)$/)&&(G="integer"),cj[G])}(G);if(void 0!==K)return K;const ne=G.match(/^(.*)(\x5b(\d*)\x5d)$/);if(ne){const G=ne[1],K=parseInt(ne[3]);if(K>0){const ne=this.getDefaultValue(G);return Array(K).fill(ne)}return[]}const ue=this.types[G];if(ue)return ue.reduce(((G,{name:K,type:ne})=>({...G,[K]:this.getDefaultValue(ne)})),{});throw new Error(`unknown type: ${G}`)}};var dj={};!function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.getNextLayer=G.getRoot=G.fillArray=G.hashConcat=G.bufferKeccak=G.hexToBuffer=G.bufferToHex=G.chunk=G.makeArray=void 0;const K=EN;G.makeArray=(G,K)=>Array(G).fill(0).map(((G,ne)=>K(ne)));G.chunk=(K,ne)=>(0,G.makeArray)(Math.ceil(K.length/ne),(G=>K.slice(G*ne,(G+1)*ne)));G.bufferToHex=G=>(0,K.toBeHex)(G.toString("hex"));G.hexToBuffer=G=>Buffer.from(G.slice(2),"hex");G.bufferKeccak=ne=>(0,G.hexToBuffer)((0,K.keccak256)(ne));G.hashConcat=ne=>(0,G.bufferKeccak)((0,K.concat)(ne));G.fillArray=(G,K,ne)=>(K>G.length&&G.push(...Array(K-G.length).fill(ne)),G);G.getRoot=(K,ne=!0)=>{if(0===K.length)throw new Error("empty tree");const ue=K.map((K=>{const ue=Buffer.isBuffer(K)?K:(0,G.hexToBuffer)(K);return ne?(0,G.bufferKeccak)(ue):ue})),pe=[ue];for(;pe[pe.length-1].length>1;)pe.push((0,G.getNextLayer)(pe[pe.length-1]));return pe[pe.length-1][0]};G.getNextLayer=K=>(0,G.chunk)(K,2).map(G.hashConcat)}(dj),Object.defineProperty(ij,"__esModule",{value:!0}),ij.Eip712MerkleTree=void 0;const uj=EN,fj=LO,lj=sj,pj=dj;ij.Eip712MerkleTree=class Eip712MerkleTree{get completedSize(){return Math.pow(2,this.depth)}getCompleteElements(){const G=this.elements;return(0,pj.fillArray)([...G],this.completedSize,this.defaultNode)}getCompleteLeaves(){const G=this.elements.map(this.leafHasher);return(0,pj.fillArray)([...G],this.completedSize,this.defaultLeaf)}get root(){return this.tree.getHexRoot()}getProof(G){const K=this.getCompleteLeaves()[G];return{leaf:K,proof:this.tree.getHexProof(K,G),root:this.tree.getHexRoot()}}getEncodedProofAndSignature(G,K){const{proof:ne}=this.getProof(G);return((G,K,ne=`0x${"ff".repeat(64)}`)=>(0,uj.concat)([ne,`0x${G.toString(16).padStart(6,"0")}`,uj.AbiCoder.defaultAbiCoder().encode([`uint256[${K.length}]`],[K])]))(G,ne,K)}getDataToSign(){let G=this.getCompleteElements();for(;G.length>2;)G=(0,pj.chunk)(G,2);return G}add(G){this.elements.push(G)}getBulkOrderHash(){const G=this.encoder.hashStruct("BulkOrder",{tree:this.getDataToSign()}),K=this.getCompleteLeaves().map(pj.hexToBuffer),ne=(0,pj.bufferToHex)((0,pj.getRoot)(K,!1)),ue=(0,uj.keccak256)((0,uj.toUtf8Bytes)(this.encoder.types.BulkOrder[0].type));if((0,uj.keccak256)((0,uj.concat)([ue,ne]))!==G)throw new Error("expected derived bulk order hash to match");return G}constructor(G,K,ne,ue,pe){this.types=G,this.rootType=K,this.leafType=ne,this.elements=ue,this.depth=pe;const he=uj.TypedDataEncoder.from(G);var ye,me;this.encoder=he,this.leafHasher=G=>he.hashStruct(ne,G),this.defaultNode=lj.DefaultGetter.from(G,ne),this.defaultLeaf=this.leafHasher(this.defaultNode),this.tree=(ye=this.getCompleteLeaves(),me=this.defaultLeaf,new fj.MerkleTree(ye.map(pj.hexToBuffer),pj.bufferKeccak,{complete:!0,sort:!1,hashLeaves:!1,fillDefaultHash:(0,pj.hexToBuffer)(me)}))}},Object.defineProperty(aj,"__esModule",{value:!0}),aj.getBulkOrderTypeHashes=aj.getBulkOrderTypeHash=aj.getBulkOrderTree=aj.getBulkOrderTreeHeight=void 0;const hj=EN,yj=ij,mj=sj,bj=dj,gj=iU;function getBulkOrderTypes$1(G){const K={...gj.EIP_712_BULK_ORDER_TYPE};return K.BulkOrder=[{name:"tree",type:`OrderComponents${"[2]".repeat(G)}`}],K}function getBulkOrderTreeHeight$1(G){return Math.max(Math.ceil(Math.log2(G)),1)}function getBulkOrderTypeHash(G){const K=getBulkOrderTypes$1(G),ne=hj.TypedDataEncoder.from(K),ue=(0,hj.toUtf8Bytes)(ne.types.BulkOrder[0].type);return(0,hj.keccak256)(ue)}aj.getBulkOrderTreeHeight=getBulkOrderTreeHeight$1,aj.getBulkOrderTree=function getBulkOrderTree$1(G,K=0,ne=getBulkOrderTreeHeight$1(G.length+K)){const ue=getBulkOrderTypes$1(ne),pe=mj.DefaultGetter.from(ue,"OrderComponents");let he=[...G];return K>0&&(he=[...(0,bj.fillArray)([],K,pe),...G]),new yj.Eip712MerkleTree(ue,"BulkOrder","OrderComponents",he,ne)},aj.getBulkOrderTypeHash=getBulkOrderTypeHash,aj.getBulkOrderTypeHashes=function getBulkOrderTypeHashes(G){const K=[];for(let ne=0;ne<G;ne++)K.push(getBulkOrderTypeHash(ne+1));return K};var vj={},wj={},_j={};Object.defineProperty(_j,"__esModule",{value:!0}),_j.MerkleTree=void 0;const Tj=EN,Aj=LO,hashIdentifier=G=>(0,Tj.keccak256)(Buffer.from((0,Tj.toBeHex)(G).slice(2).padStart(64,"0"),"hex"));_j.MerkleTree=class MerkleTree{constructor(G){this.tree=new Aj.default(G.map(hashIdentifier),Tj.keccak256,{sort:!0})}getProof(G){return this.tree.getHexProof(hashIdentifier(G))}getRoot(){return this.tree.getRoot().toString("hex")?this.tree.getHexRoot():"0"}},Object.defineProperty(wj,"__esModule",{value:!0}),wj.shouldUseMatchForFulfill=wj.generateRandomSalt=wj.mapTipAmountsFromFilledStatus=wj.mapTipAmountsFromUnitsToFill=wj.mapOrderAmountsFromUnitsToFill=wj.mapOrderAmountsFromFilledStatus=wj.totalItemsAmount=wj.areAllCurrenciesSame=wj.mapInputItemToOfferItem=wj.deductFees=wj.feeToConsiderationItem=void 0;const Ej=EN,Pj=iU,Sj=requireItem(),Ij=_j,multiplyBasisPoints=(G,K)=>BigInt(G)*BigInt(K)/Pj.ONE_HUNDRED_PERCENT_BP;wj.feeToConsiderationItem=({fee:G,token:K,baseAmount:ne,baseEndAmount:ue=ne})=>({itemType:K===Ej.ethers.ZeroAddress?Pj.ItemType.NATIVE:Pj.ItemType.ERC20,token:K,identifierOrCriteria:"0",startAmount:multiplyBasisPoints(ne,G.basisPoints).toString(),endAmount:multiplyBasisPoints(ue,G.basisPoints).toString(),recipient:G.recipient});wj.deductFees=(G,K)=>{if(!K)return G;const ne=K.reduce(((G,K)=>G+K.basisPoints),0);return G.map((G=>({...G,startAmount:(0,Sj.isCurrencyItem)(G)?(BigInt(G.startAmount)-multiplyBasisPoints(G.startAmount,ne)).toString():G.startAmount,endAmount:(0,Sj.isCurrencyItem)(G)?(BigInt(G.endAmount)-multiplyBasisPoints(G.endAmount,ne)).toString():G.endAmount})))};wj.mapInputItemToOfferItem=G=>{if("itemType"in G){if("identifiers"in G||"criteria"in G){const K="criteria"in G?G.criteria:new Ij.MerkleTree(G.identifiers).getRoot();return{itemType:G.itemType===Pj.ItemType.ERC721?Pj.ItemType.ERC721_WITH_CRITERIA:Pj.ItemType.ERC1155_WITH_CRITERIA,token:G.token,identifierOrCriteria:K,startAmount:G.amount??"1",endAmount:G.endAmount??G.amount??"1"}}return"amount"in G||"endAmount"in G?{itemType:G.itemType,token:G.token,identifierOrCriteria:G.identifier??"0",startAmount:G.amount,endAmount:G.endAmount??G.amount??"1"}:{itemType:G.itemType,token:G.token,identifierOrCriteria:G.identifier,startAmount:"1",endAmount:"1"}}return{itemType:G.token&&G.token!==Ej.ethers.ZeroAddress?Pj.ItemType.ERC20:Pj.ItemType.NATIVE,token:G.token??Ej.ethers.ZeroAddress,identifierOrCriteria:"0",startAmount:G.amount,endAmount:G.endAmount??G.amount}};wj.areAllCurrenciesSame=({offer:G,consideration:K})=>{const ne=[...G,...K].filter(Sj.isCurrencyItem);return ne.every((({itemType:G,token:K})=>G===ne[0].itemType&&K.toLowerCase()===ne[0].token.toLowerCase()))};wj.totalItemsAmount=G=>G.map((({startAmount:G,endAmount:K})=>({startAmount:G,endAmount:K}))).reduce((({startAmount:G,endAmount:K},{startAmount:ne,endAmount:ue})=>({startAmount:G+BigInt(ne),endAmount:K+BigInt(ue)})),{startAmount:0n,endAmount:0n});wj.mapOrderAmountsFromFilledStatus=(G,{totalFilled:K,totalSize:ne})=>{if(0n===K||0n===ne)return G;const ue=(ne-K)*Pj.ONE_HUNDRED_PERCENT_BP/ne;return{parameters:{...G.parameters,offer:G.parameters.offer.map((G=>({...G,startAmount:multiplyBasisPoints(G.startAmount,ue).toString(),endAmount:multiplyBasisPoints(G.endAmount,ue).toString()}))),consideration:G.parameters.consideration.map((G=>({...G,startAmount:multiplyBasisPoints(G.startAmount,ue).toString(),endAmount:multiplyBasisPoints(G.endAmount,ue).toString()})))},signature:G.signature}};const multiplyDivision=(G,K,ne)=>BigInt(G)*BigInt(K)/BigInt(ne);wj.mapOrderAmountsFromUnitsToFill=(G,{unitsToFill:K,totalSize:ne})=>{const ue=BigInt(K);if(ue<=0n)throw new Error("Units to fill must be greater than 1");const pe=(0,Sj.getMaximumSizeForOrder)(G);return 0n===ne&&(ne=pe),{parameters:{...G.parameters,offer:G.parameters.offer.map((G=>({...G,startAmount:multiplyDivision(G.startAmount,ue,ne).toString(),endAmount:multiplyDivision(G.endAmount,ue,ne).toString()}))),consideration:G.parameters.consideration.map((G=>({...G,startAmount:multiplyDivision(G.startAmount,ue,ne).toString(),endAmount:multiplyDivision(G.endAmount,ue,ne).toString()})))},signature:G.signature}},wj.mapTipAmountsFromUnitsToFill=function mapTipAmountsFromUnitsToFill(G,K,ne){const ue=BigInt(K);if(ue<=0n)throw new Error("Units to fill must be greater than 0");return G.map((G=>({...G,startAmount:multiplyDivision(G.startAmount,ue,ne).toString(),endAmount:multiplyDivision(G.endAmount,ue,ne).toString()})))},wj.mapTipAmountsFromFilledStatus=function mapTipAmountsFromFilledStatus(G,K,ne){if(0n===K||0n===ne)return G;const ue=(ne-K)*Pj.ONE_HUNDRED_PERCENT_BP/ne;return G.map((G=>({...G,startAmount:multiplyBasisPoints(G.startAmount,ue).toString(),endAmount:multiplyBasisPoints(G.endAmount,ue).toString()})))};wj.generateRandomSalt=G=>G?(0,Ej.toBeHex)((0,Ej.concat)([(0,Ej.keccak256)((0,Ej.toUtf8Bytes)(G)).slice(0,10),Uint8Array.from(Array(20).fill(0)),(0,Ej.randomBytes)(8)])):`0x${Buffer.from((0,Ej.randomBytes)(8)).toString("hex").padStart(64,"0")}`;wj.shouldUseMatchForFulfill=()=>!0,function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.scaleOrderStatusToMaxUnits=G.getAdvancedOrderNumeratorDenominator=G.generateFulfillOrdersFulfillments=G.fulfillAvailableOrders=G.validateAndSanitizeFromOrderStatus=G.fulfillStandardOrder=G.fulfillBasicOrder=G.shouldUseBasicFulfill=void 0;const K=EN,ne=iU,ue=sU,pe=YG,he=requireCriteria(),ye=VG,me=requireItem(),be=wj,ve=KG;G.shouldUseBasicFulfill=({offer:G,consideration:ue,offerer:pe},he)=>{if(0n!==he)return!1;if(G.length>1||0===ue.length)return!1;const ye=[...G,...ue],ve=ye.filter((({itemType:G})=>[ne.ItemType.ERC721,ne.ItemType.ERC1155].includes(G))),_e=ye.filter((({itemType:G})=>(0,me.isCriteriaItem)(G)));if((0,me.isNativeCurrencyItem)(G[0]))return!1;if(1!==ve.length||0!==_e.length)return!1;if(!(0,be.areAllCurrenciesSame)({offer:G,consideration:ue}))return!1;if(ye.some((({startAmount:G,endAmount:K})=>G!==K)))return!1;const[Te,...Ee]=ue;if(Te.recipient.toLowerCase()!==pe.toLowerCase())return!1;if(ue.length>1&&Ee.every((K=>K.itemType===G[0].itemType))&&(0,be.totalItemsAmount)(Ee).endAmount>BigInt(G[0].endAmount))return!1;const Pe=ye.filter(me.isCurrencyItem),Se=Pe.filter((({itemType:G})=>G===ne.ItemType.NATIVE)).every((({token:G})=>G===K.ethers.ZeroAddress)),Ce=Pe.every((({identifierOrCriteria:G})=>0n===BigInt(G))),ke=ve.filter((({itemType:G})=>G===ne.ItemType.ERC721)).every((({endAmount:G})=>"1"===G));return Se&&Ce&&ke};const _e={[ne.ItemType.ERC20]:{[ne.ItemType.ERC721]:ne.BasicOrderRouteType.ERC721_TO_ERC20,[ne.ItemType.ERC1155]:ne.BasicOrderRouteType.ERC1155_TO_ERC20},[ne.ItemType.ERC721]:{[ne.ItemType.NATIVE]:ne.BasicOrderRouteType.ETH_TO_ERC721,[ne.ItemType.ERC20]:ne.BasicOrderRouteType.ERC20_TO_ERC721},[ne.ItemType.ERC1155]:{[ne.ItemType.NATIVE]:ne.BasicOrderRouteType.ETH_TO_ERC1155,[ne.ItemType.ERC20]:ne.BasicOrderRouteType.ERC20_TO_ERC1155}};function validateAndSanitizeFromOrderStatus(G,K){const{isValidated:ne,isCancelled:ue,totalFilled:pe,totalSize:he}=K;if(he>0n&&pe/he===1n)throw new Error("The order you are trying to fulfill is already filled");if(ue)throw new Error("The order you are trying to fulfill is cancelled");return ne?{parameters:{...G.parameters},signature:"0x"}:G}function generateFulfillOrdersFulfillments(G){const hashAggregateKey=({sourceOrDestination:G,operator:K="",token:ne,identifier:ue})=>`${G}-${K}-${ne}-${ue}`,K={},ne={};return G.forEach((({order:G,offererOperator:ne,offerCriteria:ue},pe)=>{const ye=(0,he.getItemToCriteriaMap)(G.parameters.offer,ue);return G.parameters.offer.forEach(((ue,he)=>{const be=`${hashAggregateKey({sourceOrDestination:G.parameters.offerer,operator:ne,token:ue.token,identifier:ye.get(ue)?.identifier??ue.identifierOrCriteria})}${(0,me.isErc721Item)(ue.itemType)?he:""}`;K[be]=[...K[be]??[],{orderIndex:pe,itemIndex:he}]}))})),G.forEach((({order:G,considerationCriteria:K,tips:ue},pe)=>{const ye=(0,he.getItemToCriteriaMap)(G.parameters.consideration,K);return[...G.parameters.consideration,...ue].forEach(((G,K)=>{const ue=`${hashAggregateKey({sourceOrDestination:G.recipient,token:G.token,identifier:ye.get(G)?.identifier??G.identifierOrCriteria})}${(0,me.isErc721Item)(G.itemType)?K:""}`;ne[ue]=[...ne[ue]??[],{orderIndex:pe,itemIndex:K}]}))})),{offerFulfillments:Object.values(K),considerationFulfillments:Object.values(ne)}}G.fulfillBasicOrder=function fulfillBasicOrder({order:G,seaportContract:he,offererBalancesAndApprovals:ye,fulfillerBalancesAndApprovals:be,timeBasedItemParams:Te,offererOperator:Ee,fulfillerOperator:Pe,signer:Se,tips:Ce=[],conduitKey:ke=ne.NO_CONDUIT,domain:Oe,overrides:xe},Ne){const{offer:Me,consideration:Be}=G.parameters,Fe=[...Be,...Ce],De=Me[0],[Le,...Ue]=Fe,je=_e[De.itemType]?.[Le.itemType];if(void 0===je)throw new Error("Order parameters did not result in a valid basic fulfillment");const ze=Ue.map((({startAmount:G,recipient:K})=>({amount:G,recipient:K}))),Je=Fe.filter((G=>G.itemType!==Me[0].itemType)),Xe=(0,me.getSummedTokenAndIdentifierAmounts)({items:Je,criterias:[],timeBasedItemParams:{...Te,isConsiderationItem:!0}})[K.ethers.ZeroAddress]?.[0],Qe=(0,pe.validateBasicFulfillBalancesAndApprovals)({offer:Me,consideration:Fe,offererBalancesAndApprovals:ye,fulfillerBalancesAndApprovals:be,timeBasedItemParams:Te,offererOperator:Ee,fulfillerOperator:Pe}),Ye={offerer:G.parameters.offerer,offererConduitKey:G.parameters.conduitKey,zone:G.parameters.zone,basicOrderType:G.parameters.orderType+4*je,offerToken:De.token,offerIdentifier:De.identifierOrCriteria,offerAmount:De.endAmount,considerationToken:Le.token,considerationIdentifier:Le.identifierOrCriteria,considerationAmount:Le.endAmount,startTime:G.parameters.startTime,endTime:G.parameters.endTime,salt:G.parameters.salt,totalOriginalAdditionalRecipients:G.parameters.consideration.length-1,signature:G.signature,fulfillerConduitKey:ke,additionalRecipients:ze,zoneHash:G.parameters.zoneHash};xe={...xe,value:Xe};const et=[...(0,ue.getApprovalActions)(Qe,Ne,Se),{type:"exchange",transactionMethods:(0,ve.getTransactionMethods)(Se,he,"fulfillBasicOrder",[Ye,xe],Oe)}];return{actions:et,executeAllActions:()=>(0,ve.executeAllActions)(et)}},G.fulfillStandardOrder=function fulfillStandardOrder({order:ne,unitsToFill:ye=0,totalSize:_e,totalFilled:Te,offerCriteria:Ee,considerationCriteria:Pe,tips:Se=[],extraData:Ce,seaportContract:ke,offererBalancesAndApprovals:Oe,fulfillerBalancesAndApprovals:xe,offererOperator:Ne,fulfillerOperator:Me,timeBasedItemParams:Be,conduitKey:Fe,recipientAddress:De,signer:Le,domain:Ue,overrides:je},ze){const Je=ye?(0,be.mapOrderAmountsFromUnitsToFill)(ne,{unitsToFill:ye,totalSize:_e}):(0,be.mapOrderAmountsFromFilledStatus)(ne,{totalFilled:Te,totalSize:_e});let Xe=[];Se.length>0&&(Xe=(0,be.mapTipAmountsFromUnitsToFill)(Se,ye,_e));const{parameters:{offer:Qe,consideration:Ye}}=Je,et=[...Ye,...Xe],tt=Qe.filter((({itemType:G})=>(0,me.isCriteriaItem)(G))),rt=et.filter((({itemType:G})=>(0,me.isCriteriaItem)(G))),nt=tt.length>0||rt.length>0;if(tt.length!==Ee.length||rt.length!==Pe.length)throw new Error("You must supply the appropriate criterias for criteria based items");const at=(0,me.getSummedTokenAndIdentifierAmounts)({items:et,criterias:Pe,timeBasedItemParams:{...Be,isConsiderationItem:!0}})[K.ethers.ZeroAddress]?.[0],it=(0,pe.validateStandardFulfillBalancesAndApprovals)({offer:Qe,consideration:et,offerCriteria:Ee,considerationCriteria:Pe,offererBalancesAndApprovals:Oe,fulfillerBalancesAndApprovals:xe,timeBasedItemParams:Be,offererOperator:Ne,fulfillerOperator:Me});je={...je,value:at};const ot=(0,ue.getApprovalActions)(it,ze,Le),ct=De!==K.ethers.ZeroAddress,dt=Boolean(ye)||nt||ct,ut={...ne,parameters:{...ne.parameters,consideration:[...ne.parameters.consideration,...Se],totalOriginalConsiderationItems:Ye.length}},{numerator:ft,denominator:yt}=(0,G.getAdvancedOrderNumeratorDenominator)(ne,ye),wt=[...ot,{type:"exchange",transactionMethods:dt?(0,ve.getTransactionMethods)(Le,ke,"fulfillAdvancedOrder",[{...ut,numerator:ft,denominator:yt,extraData:Ce??"0x"},nt?(0,he.generateCriteriaResolvers)({orders:[ne],offerCriterias:[Ee],considerationCriterias:[Pe]}):[],Fe,De,je],Ue):(0,ve.getTransactionMethods)(Le,ke,"fulfillOrder",[ut,Fe,je],Ue)}];return{actions:wt,executeAllActions:()=>(0,ve.executeAllActions)(wt)}},G.validateAndSanitizeFromOrderStatus=validateAndSanitizeFromOrderStatus,G.fulfillAvailableOrders=function fulfillAvailableOrders({ordersMetadata:ne,seaportContract:ye,fulfillerBalancesAndApprovals:_e,fulfillerOperator:Te,currentBlockTimestamp:Ee,ascendingAmountTimestampBuffer:Pe,conduitKey:Se,signer:Ce,recipientAddress:ke,exactApproval:Oe,domain:xe}){const Ne=ne.map((G=>({...G,order:validateAndSanitizeFromOrderStatus(G.order,G.orderStatus)}))),adjustTips=G=>G.tips&&G.tips.length?G.unitsToFill?(0,be.mapTipAmountsFromUnitsToFill)(G.tips,G.unitsToFill,G.orderStatus.totalSize):(0,be.mapTipAmountsFromFilledStatus)(G.tips,G.orderStatus.totalFilled,G.orderStatus.totalSize):[],Me=Ne.map((G=>({...G,order:G.unitsToFill?(0,be.mapOrderAmountsFromUnitsToFill)(G.order,{unitsToFill:G.unitsToFill,totalSize:G.orderStatus.totalSize}):(0,be.mapOrderAmountsFromFilledStatus)(G.order,{totalFilled:G.orderStatus.totalFilled,totalSize:G.orderStatus.totalSize}),tips:adjustTips(G)})));let Be=0n;const Fe=[],De=Ne.flatMap((G=>[G.order.parameters.offer,G.order.parameters.consideration])).flat().filter((({itemType:G})=>(0,me.isCriteriaItem)(G))).length>0;Me.forEach((({order:G,tips:ne,offerCriteria:ue,considerationCriteria:he,offererBalancesAndApprovals:ye,offererOperator:be})=>{const ve=[...G.parameters.consideration,...ne],Se={startTime:G.parameters.startTime,endTime:G.parameters.endTime,currentBlockTimestamp:Ee,ascendingAmountTimestampBuffer:Pe,isConsiderationItem:!0};Be+=(0,me.getSummedTokenAndIdentifierAmounts)({items:ve,criterias:he,timeBasedItemParams:Se})[K.ethers.ZeroAddress]?.[0]??0n;const Ce=(0,pe.validateStandardFulfillBalancesAndApprovals)({offer:G.parameters.offer,consideration:ve,offerCriteria:ue,considerationCriteria:he,offererBalancesAndApprovals:ye,fulfillerBalancesAndApprovals:_e,timeBasedItemParams:Se,offererOperator:be,fulfillerOperator:Te}),ke=G.parameters.offer.filter((({itemType:G})=>(0,me.isCriteriaItem)(G))),Oe=ve.filter((({itemType:G})=>(0,me.isCriteriaItem)(G)));if(ke.length!==ue.length||Oe.length!==he.length)throw new Error("You must supply the appropriate criterias for criteria based items");Ce.forEach((G=>{Fe.find((K=>K.token===G.token))||Fe.push(G)}))}));const Le={value:Be},Ue=(0,ue.getApprovalActions)(Fe,Oe,Ce),je=Ne.map((({order:K,unitsToFill:ne=0,tips:ue,extraData:pe})=>{const{numerator:he,denominator:ye}=(0,G.getAdvancedOrderNumeratorDenominator)(K,ne),me=[...K.parameters.consideration,...ue];return{...K,parameters:{...K.parameters,consideration:me,totalOriginalConsiderationItems:K.parameters.consideration.length},numerator:he,denominator:ye,extraData:pe}})),{offerFulfillments:ze,considerationFulfillments:Je}=generateFulfillOrdersFulfillments(ne),Xe={type:"exchange",transactionMethods:(0,ve.getTransactionMethods)(Ce,ye,"fulfillAvailableAdvancedOrders",[je,De?(0,he.generateCriteriaResolvers)({orders:ne.map((({order:G})=>G)),offerCriterias:ne.map((({offerCriteria:G})=>G)),considerationCriterias:ne.map((({considerationCriteria:G})=>G))}):[],ze,Je,Se,ke,je.length,Le],xe)},Qe=[...Ue,Xe];return{actions:Qe,executeAllActions:()=>(0,ve.executeAllActions)(Qe)}},G.generateFulfillOrdersFulfillments=generateFulfillOrdersFulfillments;G.getAdvancedOrderNumeratorDenominator=(G,K)=>{const ne=(0,me.getMaximumSizeForOrder)(G);let ue=1n,pe=1n;if(K){const G=(0,ye.gcd)(BigInt(K),ne);ue=BigInt(K)/G,pe=ne/G}return{numerator:ue,denominator:pe}};G.scaleOrderStatusToMaxUnits=(G,K)=>{const ne=(0,me.getMaximumSizeForOrder)(G);return 0n===K.totalSize||(K.totalFilled=K.totalFilled*ne/K.totalSize),K.totalSize=ne,K}}(vj),Object.defineProperty(AN,"__esModule",{value:!0}),AN.Seaport=void 0;const Cj=EN,Rj=iU,kj=sU,Oj=YG,xj=aj,Nj=vj,Mj=requireItem(),Bj=wj,Fj=KG,Dj=oU;AN.Seaport=class Seaport{constructor(G,{overrides:K,ascendingAmountFulfillmentBuffer:ne=300,balanceAndApprovalChecksOnOrderCreation:ue=!0,conduitKeyToConduit:pe}={}){this.OPENSEA_CONDUIT_KEY=Rj.OPENSEA_CONDUIT_KEY,this.getOrderHash=G=>{const K="OfferItem(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)",ne="ConsiderationItem(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)",ue=`OrderComponents(address offerer,address zone,OfferItem[] offer,ConsiderationItem[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)${ne}${K}`,pe=Cj.ethers.keccak256(Cj.ethers.toUtf8Bytes(K)),he=Cj.ethers.keccak256(Cj.ethers.toUtf8Bytes(ne)),ye=Cj.ethers.keccak256(Cj.ethers.toUtf8Bytes(ue)),me=Cj.ethers.keccak256("0x"+G.offer.map((G=>Cj.ethers.keccak256("0x"+[pe.slice(2),G.itemType.toString().padStart(64,"0"),G.token.slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.identifierOrCriteria).slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.startAmount).slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.endAmount).slice(2).padStart(64,"0")].join("")).slice(2))).join("")),be=Cj.ethers.keccak256("0x"+G.consideration.map((G=>Cj.ethers.keccak256("0x"+[he.slice(2),G.itemType.toString().padStart(64,"0"),G.token.slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.identifierOrCriteria).slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.startAmount).slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.endAmount).slice(2).padStart(64,"0"),G.recipient.slice(2).padStart(64,"0")].join("")).slice(2))).join(""));return Cj.ethers.keccak256("0x"+[ye.slice(2),G.offerer.slice(2).padStart(64,"0"),G.zone.slice(2).padStart(64,"0"),me.slice(2),be.slice(2),G.orderType.toString().padStart(64,"0"),Cj.ethers.toBeHex(G.startTime).slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.endTime).slice(2).padStart(64,"0"),G.zoneHash.slice(2),Cj.ethers.toBeHex(G.salt).slice(2).padStart(64,"0"),G.conduitKey.slice(2).padStart(64,"0"),Cj.ethers.toBeHex(G.counter).slice(2).padStart(64,"0")].join(""))};const he="provider"in G?G.provider:G;if(this.signer="getAddress"in G?G:void 0,!he)throw new Error("Either a provider or custom signer with provider must be provided");this.provider=he;const ye=K?.seaportVersion??Rj.SEAPORT_CONTRACT_VERSION_V1_6,me=K?.contractAddress??Rj.CROSS_CHAIN_SEAPORT_V1_6_ADDRESS;this.contract=Dj.Seaport__factory.connect(me,this.provider);const be=K?.domainRegistryAddress??Rj.DOMAIN_REGISTRY_ADDRESS;this.domainRegistry=Dj.DomainRegistry__factory.connect(be,this.provider),this.config={ascendingAmountFulfillmentBuffer:ne,balanceAndApprovalChecksOnOrderCreation:ue,conduitKeyToConduit:{...Rj.KNOWN_CONDUIT_KEYS_TO_CONDUIT,[Rj.NO_CONDUIT]:me,...pe},seaportVersion:ye},this.defaultConduitKey=K?.defaultConduitKey??Rj.NO_CONDUIT}async createOrder(G,K,ne){const ue=await this._getSigner(K),pe=K??await ue.getAddress(),{orderComponents:he,approvalActions:ye}=await this._formatOrder(ue,pe,Boolean(ne),G),me={type:"create",getMessageToSign:()=>this._getMessageToSign(he),createOrder:async()=>{const G=await this.signOrder(he,pe);return{parameters:he,signature:G}}},be=[...ye,me];return{actions:be,executeAllActions:()=>(0,Fj.executeAllActions)(be)}}async createBulkOrders(G,K,ne){const ue=await this._getSigner(K),pe=await ue.getAddress(),he=await this.getCounter(pe),ye=[],me=[];for(const K of G){K.counter??(K.counter=he);const{orderComponents:G,approvalActions:be}=await this._formatOrder(ue,pe,Boolean(ne),K);me.push(G);for(const G of be)void 0===ye.find((K=>K.token===G.token))&&ye.push(G)}const be={type:"createBulk",getMessageToSign:()=>this._getBulkMessageToSign(me),createBulkOrders:async()=>await this.signBulkOrder(me,pe)},ve=[...ye,be];return{actions:ve,executeAllActions:()=>(0,Fj.executeAllActions)(ve)}}async _formatOrder(G,K,ne,{conduitKey:ue=this.defaultConduitKey,zone:pe=Cj.ethers.ZeroAddress,zoneHash:he=Cj.ethers.ZeroHash,startTime:ye=Math.floor(Date.now()/1e3).toString(),endTime:me=Rj.MAX_INT.toString(),offer:be,consideration:ve,counter:_e,allowPartialFills:Te,restrictedByZone:Ee,fees:Pe,domain:Se,salt:Ce}){const ke=be.map(Bj.mapInputItemToOfferItem),Oe=[...ve.map((G=>({...(0,Bj.mapInputItemToOfferItem)(G),recipient:G.recipient??K})))];if(Pe?.length&&!(0,Bj.areAllCurrenciesSame)({offer:ke,consideration:Oe}))throw new Error("All currency tokens in the order must be the same token when applying fees");const xe=[...ke,...Oe].filter(Mj.isCurrencyItem),Ne=(0,Bj.totalItemsAmount)(xe),Me=this.config.conduitKeyToConduit[ue],Be=this._getOrderTypeFromOrderOptions({allowPartialFills:Te,restrictedByZone:Ee}),Fe=[...(0,Bj.deductFees)(Oe,Pe),...xe.length?Pe?.map((G=>(0,Bj.feeToConsiderationItem)({fee:G,token:xe[0].token,baseAmount:Ne.startAmount,baseEndAmount:Ne.endAmount})))??[]:[]],De=void 0!==Ce?`0x${Cj.ethers.toBeHex(Ce).slice(2).padStart(64,"0")}`:(0,Bj.generateRandomSalt)(Se),Le={offerer:K,zone:pe,zoneHash:he,startTime:ye,endTime:me,orderType:Be,offer:ke,consideration:Fe,totalOriginalConsiderationItems:Fe.length,salt:De,conduitKey:ue,counter:(_e??await this.getCounter(K)).toString()},Ue=[];if(this.config.balanceAndApprovalChecksOnOrderCreation){const ue=await(0,Oj.getBalancesAndApprovals)({owner:K,items:ke,criterias:[],provider:this.provider,operator:Me}),pe=(0,Oj.validateOfferBalancesAndApprovals)({offer:ke,criterias:[],balancesAndApprovals:ue,throwOnInsufficientBalances:!0,operator:Me}),he=(0,kj.getApprovalActions)(pe,ne,G);Ue.push(...he)}return{orderComponents:Le,approvalActions:Ue}}async _getSigner(G){if(this.signer)return this.signer;if(!("send"in this.provider))throw new Error("Either signer or JsonRpcProvider with signer must be provided");return this.provider.getSigner(G)}_getOrderTypeFromOrderOptions({allowPartialFills:G,restrictedByZone:K}){return G?K?Rj.OrderType.PARTIAL_RESTRICTED:Rj.OrderType.PARTIAL_OPEN:K?Rj.OrderType.FULL_RESTRICTED:Rj.OrderType.FULL_OPEN}async _getDomainData(){const{chainId:G}=await this.provider.getNetwork();return{name:Rj.SEAPORT_CONTRACT_NAME,version:this.config.seaportVersion,chainId:G,verifyingContract:await this.contract.getAddress()}}async _getMessageToSign(G){const K=await this._getDomainData();return JSON.stringify(Cj.TypedDataEncoder.getPayload(K,Rj.EIP_712_ORDER_TYPE,G))}async _getBulkMessageToSign(G){const K=await this._getDomainData(),ne=(0,xj.getBulkOrderTree)(G),ue=ne.types,pe=ne.getDataToSign();return JSON.stringify(Cj.TypedDataEncoder.getPayload(K,ue,{tree:pe}))}async signOrder(G,K){const ne=await this._getSigner(K),ue=await this._getDomainData();let pe=await ne.signTypedData(ue,Rj.EIP_712_ORDER_TYPE,G);return 132===pe.length&&(pe=Cj.ethers.Signature.from(pe).compactSerialized),pe}async signBulkOrder(G,K){const ne=await this._getSigner(K),ue=await this._getDomainData(),pe=(0,xj.getBulkOrderTree)(G),he=pe.types,ye={tree:pe.getDataToSign()};let me=await ne.signTypedData(ue,he,ye);132===me.length&&(me=Cj.ethers.Signature.from(me).compactSerialized);const be=G.map(((G,K)=>({parameters:G,signature:pe.getEncodedProofAndSignature(K,me)})));return be}cancelOrders(G,K,ne,ue){return(0,Fj.getTransactionMethods)(this._getSigner(K),this.contract,"cancel",[G,ue],ne)}bulkCancelOrders(G,K,ne){return(0,Fj.getTransactionMethods)(this._getSigner(G),this.contract,"incrementCounter",[ne],K)}validate(G,K,ne,ue){return(0,Fj.getTransactionMethods)(this._getSigner(K),this.contract,"validate",[G,ue],ne)}async getOrderStatus(G){const K=await this.contract.getOrderStatus(G),[ne,ue,pe,he]=K;return{isValidated:ne,isCancelled:ue,totalFilled:pe,totalSize:he}}getCounter(G){return this.contract.getCounter(G)}async fulfillOrder({order:G,unitsToFill:K,offerCriteria:ne=[],considerationCriteria:ue=[],tips:pe=[],extraData:he="0x",accountAddress:ye,conduitKey:me=this.defaultConduitKey,recipientAddress:be=Cj.ethers.ZeroAddress,domain:ve,exactApproval:_e=!1,overrides:Te}){if(!G.signature)throw new Error("Order is missing signature");const{parameters:Ee}=G,{offerer:Pe,offer:Se,consideration:Ce}=Ee,ke=await this._getSigner(ye),Oe=await ke.getAddress(),xe=this.config.conduitKeyToConduit[Ee.conduitKey],Ne=this.config.conduitKeyToConduit[me],[Me,Be,Fe,De]=await Promise.all([(0,Oj.getBalancesAndApprovals)({owner:Pe,items:Se,criterias:ne,provider:this.provider,operator:xe}),(0,Oj.getBalancesAndApprovals)({owner:Oe,items:[...Se,...Ce],criterias:[...ne,...ue],provider:this.provider,operator:Ne}),this.provider.getBlock("latest"),this.getOrderStatus(this.getOrderHash(Ee))]),Le=Fe.timestamp;(0,Nj.scaleOrderStatusToMaxUnits)(G,De);const{totalFilled:Ue,totalSize:je}=De,ze=(0,Nj.validateAndSanitizeFromOrderStatus)(G,De),Je={startTime:ze.parameters.startTime,endTime:ze.parameters.endTime,currentBlockTimestamp:Le,ascendingAmountTimestampBuffer:this.config.ascendingAmountFulfillmentBuffer},Xe=pe.map((G=>({...(0,Bj.mapInputItemToOfferItem)(G),recipient:G.recipient}))),Qe=be===Cj.ethers.ZeroAddress;return!K&&Qe&&(0,Nj.shouldUseBasicFulfill)(ze.parameters,Ue)?(0,Nj.fulfillBasicOrder)({order:ze,seaportContract:this.contract,offererBalancesAndApprovals:Me,fulfillerBalancesAndApprovals:Be,timeBasedItemParams:Je,conduitKey:me,offererOperator:xe,fulfillerOperator:Ne,signer:ke,tips:Xe,domain:ve,overrides:Te},_e):(0,Nj.fulfillStandardOrder)({order:ze,unitsToFill:K,totalFilled:Ue,totalSize:je,offerCriteria:ne,considerationCriteria:ue,tips:Xe,extraData:he,seaportContract:this.contract,offererBalancesAndApprovals:Me,fulfillerBalancesAndApprovals:Be,timeBasedItemParams:Je,conduitKey:me,signer:ke,offererOperator:xe,fulfillerOperator:Ne,recipientAddress:be,domain:ve,overrides:Te},_e)}async fulfillOrders({fulfillOrderDetails:G,accountAddress:K,conduitKey:ne=this.defaultConduitKey,recipientAddress:ue=Cj.ethers.ZeroAddress,domain:pe,exactApproval:he=!1}){if(G.some((G=>!G.order.signature)))throw new Error("All orders must include signatures");const ye=await this._getSigner(K),me=await ye.getAddress(),be=G.map((({order:G})=>this.config.conduitKeyToConduit[G.parameters.conduitKey])),ve=this.config.conduitKeyToConduit[ne],_e=G.flatMap((({order:G})=>G.parameters.offer)),Te=G.flatMap((({order:G})=>G.parameters.consideration)),Ee=G.flatMap((({offerCriteria:G=[]})=>G)),Pe=G.flatMap((({considerationCriteria:G=[]})=>G)),[Se,Ce,ke,Oe]=await Promise.all([Promise.all(G.map((({order:G,offerCriteria:K=[]},ne)=>(0,Oj.getBalancesAndApprovals)({owner:G.parameters.offerer,items:G.parameters.offer,criterias:K,operator:be[ne],provider:this.provider})))),(0,Oj.getBalancesAndApprovals)({owner:me,items:[..._e,...Te],criterias:[...Ee,...Pe],operator:ve,provider:this.provider}),this.provider.getBlock("latest"),Promise.all(G.map((({order:G})=>this.getOrderStatus(this.getOrderHash(G.parameters)))))]),xe=G.map(((G,K)=>({order:G.order,unitsToFill:G.unitsToFill,orderStatus:(0,Nj.scaleOrderStatusToMaxUnits)(G.order,Oe[K]),offerCriteria:G.offerCriteria??[],considerationCriteria:G.considerationCriteria??[],tips:G.tips?.map((G=>({...(0,Bj.mapInputItemToOfferItem)(G),recipient:G.recipient})))??[],extraData:G.extraData??"0x",offererBalancesAndApprovals:Se[K],offererOperator:be[K]})));return(0,Nj.fulfillAvailableOrders)({ordersMetadata:xe,seaportContract:this.contract,fulfillerBalancesAndApprovals:Ce,currentBlockTimestamp:ke.timestamp,ascendingAmountTimestampBuffer:this.config.ascendingAmountFulfillmentBuffer,fulfillerOperator:ve,signer:ye,conduitKey:ne,recipientAddress:ue,domain:pe,exactApproval:he})}matchOrders({orders:G,fulfillments:K,overrides:ne,accountAddress:ue,domain:pe}){return(0,Fj.getTransactionMethods)(this._getSigner(ue),this.contract,"matchOrders",[G,K,ne],pe)}setDomain(G,K,ne){return(0,Fj.getTransactionMethods)(this._getSigner(K),this.domainRegistry,"setDomain",[G,ne])}getNumberOfDomains(G){return this.domainRegistry.getNumberOfDomains(G)}getDomain(G,K){return this.domainRegistry.getDomain(G,K)}async getDomains(G){try{return this.domainRegistry.getDomains(G)}catch(K){const ne=await this.domainRegistry.getNumberOfDomains(G),ue=Promise.all([...Array(Number(ne)).keys()].map((K=>this.domainRegistry.getDomain(G,K))));return await ue}}},function(G){Object.defineProperty(G,"__esModule",{value:!0}),G.Seaport=void 0;const K=AN;Object.defineProperty(G,"Seaport",{enumerable:!0,get:function(){return K.Seaport}})}(TN);class BaseHttpRequest{config;constructor(G){this.config=G}}class ApiError extends Error{url;status;statusText;body;request;constructor(G,K,ne){super(ne),this.name="ApiError",this.url=K.url,this.status=K.status,this.statusText=K.statusText,this.body=K.body,this.request=G}}class CancelError extends Error{constructor(G){super(G),this.name="CancelError"}get isCancelled(){return!0}}class CancelablePromise{[Symbol.toStringTag];_isResolved;_isRejected;_isCancelled;_cancelHandlers;_promise;_resolve;_reject;constructor(G){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise(((K,ne)=>{this._resolve=K,this._reject=ne;const onCancel=G=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(G)};return Object.defineProperty(onCancel,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(onCancel,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(onCancel,"isCancelled",{get:()=>this._isCancelled}),G((G=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve?.(G))}),(G=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject?.(G))}),onCancel)}))}then(G,K){return this._promise.then(G,K)}catch(G){return this._promise.catch(G)}finally(G){return this._promise.finally(G)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const G of this._cancelHandlers)G()}catch(G){return void console.warn("Cancellation threw an error",G)}this._cancelHandlers.length=0,this._reject?.(new CancelError("Request aborted"))}}get isCancelled(){return this._isCancelled}}const isDefined=G=>null!=G,isString$1=G=>"string"==typeof G,isStringWithValue=G=>isString$1(G)&&""!==G,getUrl=(G,K)=>{const ne=G.ENCODE_PATH||encodeURI,ue=K.url.replace("{api-version}",G.VERSION).replace(/{(.*?)}/g,((G,ue)=>K.path?.hasOwnProperty(ue)?ne(String(K.path[ue])):G)),pe=`${G.BASE}${ue}`;return K.query?`${pe}${(G=>{const K=[];return Object.entries(G).forEach((([G,K])=>{(void 0)(G,K)})),K.length>0?`?${K.join("&")}`:""})(K.query)}`:pe},resolve=async(G,K)=>"function"==typeof K?K(G):K,getHeaders=async(G,K,ne)=>{const ue=await resolve(K,G.TOKEN),pe=await resolve(K,G.USERNAME),he=await resolve(K,G.PASSWORD),ye=await resolve(K,G.HEADERS),me="function"==typeof ne?.getHeaders&&ne?.getHeaders()||{},be=Object.entries({Accept:"application/json",...ye,...K.headers,...me}).filter((([G,K])=>isDefined(K))).reduce(((G,[K,ne])=>({...G,[K]:String(ne)})),{});if(isStringWithValue(ue)&&(be.Authorization=`Bearer ${ue}`),isStringWithValue(pe)&&isStringWithValue(he)){const G=(G=>{try{return btoa(G)}catch(K){return Buffer.from(G).toString("base64")}})(`${pe}:${he}`);be.Authorization=`Basic ${G}`}var ve;return K.body&&(K.mediaType?be["Content-Type"]=K.mediaType:"object"==typeof(ve=K.body)&&"string"==typeof ve.type&&"function"==typeof ve.stream&&"function"==typeof ve.arrayBuffer&&"function"==typeof ve.constructor&&"string"==typeof ve.constructor.name&&/^(Blob|File)$/.test(ve.constructor.name)&&/^(Blob|File)$/.test(ve[Symbol.toStringTag])?be["Content-Type"]=K.body.type||"application/octet-stream":isString$1(K.body)?be["Content-Type"]="text/plain":(G=>G instanceof dP)(K.body)||(be["Content-Type"]="application/json")),be},request=(G,K)=>new CancelablePromise((async(ne,ue,pe)=>{try{const ue=getUrl(G,K),ye=(G=>{if(G.formData){const K=new dP;return Object.entries(G.formData).filter((([G,K])=>isDefined(K))).forEach((([G,K])=>{Array.isArray(K)?K.forEach((K=>(void 0)(G,K))):(void 0)(G,K)})),K}})(K),me=(G=>{if(G.body)return G.body})(K),be=await getHeaders(G,K,ye);if(!pe.isCancelled){const ve=await(async(G,K,ne,ue,pe,he,ye)=>{const me=er.CancelToken.source(),be={url:ne,headers:he,data:ue??pe,method:K.method,withCredentials:G.WITH_CREDENTIALS,cancelToken:me.token};ye((()=>me.cancel("The user aborted a request.")));try{return await er.request(be)}catch(G){const K=G;if(K.response)return K.response;throw G}})(G,K,ue,me,ye,be,pe),_e=(G=>{if(204!==G.status)return G.data})(ve),Te=((G,K)=>{if(K){const ne=G.headers[K];if(isString$1(ne))return ne}})(ve,K.responseHeader),Ee={url:ue,ok:(he=ve.status,he>=200&&he<300),status:ve.status,statusText:ve.statusText,body:Te??_e};((G,K)=>{const ne={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...G.errors}[K.status];if(ne)throw new ApiError(G,K,ne);if(!K.ok)throw new ApiError(G,K,"Generic Error")})(K,Ee),ne(Ee.body)}}catch(G){ue(G)}var he}));class AxiosHttpRequest extends BaseHttpRequest{constructor(G){super(G)}request(G){return request(this.config,G)}}class OrdersService{httpRequest;constructor(G){this.httpRequest=G}cancelOrders({chainName:G,requestBody:K}){return this.httpRequest.request({method:"POST",url:"/v1/chains/{chain_name}/orders/cancel",path:{chain_name:G},body:K,mediaType:"application/json",errors:{400:"Bad Request (400)",401:"Unauthorised Request (401)",404:"The specified resource was not found (404)",429:"Too Many Requests (429)",500:"Internal Server Error (500)",501:"Not Implemented Error (501)"}})}listListings({chainName:G,status:K,sellItemContractAddress:ne,buyItemType:ue,buyItemContractAddress:pe,accountAddress:he,sellItemMetadataId:ye,sellItemTokenId:me,fromUpdatedAt:be,pageSize:ve,sortBy:_e,sortDirection:Te,pageCursor:Ee}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/listings",path:{chain_name:G},query:{status:K,sell_item_contract_address:ne,buy_item_type:ue,buy_item_contract_address:pe,account_address:he,sell_item_metadata_id:ye,sell_item_token_id:me,from_updated_at:be,page_size:ve,sort_by:_e,sort_direction:Te,page_cursor:Ee},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}createListing({chainName:G,requestBody:K}){return this.httpRequest.request({method:"POST",url:"/v1/chains/{chain_name}/orders/listings",path:{chain_name:G},body:K,mediaType:"application/json",errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}listBids({chainName:G,status:K,buyItemContractAddress:ne,sellItemContractAddress:ue,accountAddress:pe,buyItemMetadataId:he,buyItemTokenId:ye,fromUpdatedAt:me,pageSize:be,sortBy:ve,sortDirection:_e,pageCursor:Te}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/bids",path:{chain_name:G},query:{status:K,buy_item_contract_address:ne,sell_item_contract_address:ue,account_address:pe,buy_item_metadata_id:he,buy_item_token_id:ye,from_updated_at:me,page_size:be,sort_by:ve,sort_direction:_e,page_cursor:Te},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}createBid({chainName:G,requestBody:K}){return this.httpRequest.request({method:"POST",url:"/v1/chains/{chain_name}/orders/bids",path:{chain_name:G},body:K,mediaType:"application/json",errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)",501:"Not Implemented Error (501)"}})}listCollectionBids({chainName:G,status:K,buyItemContractAddress:ne,sellItemContractAddress:ue,accountAddress:pe,fromUpdatedAt:he,pageSize:ye,sortBy:me,sortDirection:be,pageCursor:ve}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/collection-bids",path:{chain_name:G},query:{status:K,buy_item_contract_address:ne,sell_item_contract_address:ue,account_address:pe,from_updated_at:he,page_size:ye,sort_by:me,sort_direction:be,page_cursor:ve},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}createCollectionBid({chainName:G,requestBody:K}){return this.httpRequest.request({method:"POST",url:"/v1/chains/{chain_name}/orders/collection-bids",path:{chain_name:G},body:K,mediaType:"application/json",errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)",501:"Not Implemented Error (501)"}})}getListing({chainName:G,listingId:K}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/listings/{listing_id}",path:{chain_name:G,listing_id:K},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}getBid({chainName:G,bidId:K}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/bids/{bid_id}",path:{chain_name:G,bid_id:K},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}getCollectionBid({chainName:G,collectionBidId:K}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/orders/collection-bids/{collection_bid_id}",path:{chain_name:G,collection_bid_id:K},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}fulfillmentData({chainName:G,requestBody:K}){return this.httpRequest.request({method:"POST",url:"/v1/chains/{chain_name}/orders/fulfillment-data",path:{chain_name:G},body:K,mediaType:"application/json",errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}listTrades({chainName:G,accountAddress:K,sellItemContractAddress:ne,fromIndexedAt:ue,pageSize:pe,sortBy:he,sortDirection:ye,pageCursor:me}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/trades",path:{chain_name:G},query:{account_address:K,sell_item_contract_address:ne,from_indexed_at:ue,page_size:pe,sort_by:he,sort_direction:ye,page_cursor:me},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}getTrade({chainName:G,tradeId:K}){return this.httpRequest.request({method:"GET",url:"/v1/chains/{chain_name}/trades/{trade_id}",path:{chain_name:G,trade_id:K},errors:{400:"Bad Request (400)",404:"The specified resource was not found (404)",500:"Internal Server Error (500)"}})}}class OrderBookClient{orders;request;constructor(G,K=AxiosHttpRequest){this.request=new K({BASE:G?.BASE??"https://api.immutable.com",VERSION:G?.VERSION??"1.0.0",WITH_CREDENTIALS:G?.WITH_CREDENTIALS??!1,CREDENTIALS:G?.CREDENTIALS??"include",TOKEN:G?.TOKEN,USERNAME:G?.USERNAME,PASSWORD:G?.PASSWORD,HEADERS:G?.HEADERS,ENCODE_PATH:G?.ENCODE_PATH}),this.orders=new OrdersService(this.request)}}var Lj,Uj,$j,qj,Gj,jj,Hj,Wj,zj,Vj;function exhaustiveSwitch(G){throw new Error("Unreachable")}function mapListingFromOpenApiOrder(G){if(G.type!==qj.type.LISTING)throw new Error("Order type must be LISTING");const K=G.sell.map((G=>{if("ERC721"===G.type)return{type:"ERC721",contractAddress:G.contract_address,tokenId:G.token_id};if("ERC1155"===G.type)return{type:"ERC1155",contractAddress:G.contract_address,tokenId:G.token_id,amount:G.amount};throw new Error("Listing sell items must either ERC721 or ERC1155")})),ne=G.buy.map((G=>{if("NATIVE"===G.type)return{type:"NATIVE",amount:G.amount};if("ERC20"===G.type)return{type:"ERC20",contractAddress:G.contract_address,amount:G.amount};throw new Error("Listing buy items must be either NATIVE or ERC20")}));return{id:G.id,type:G.type,chain:G.chain,accountAddress:G.account_address,sell:K,buy:ne,fees:G.fees.map((G=>({amount:G.amount,recipientAddress:G.recipient_address,type:G.type}))),status:G.status,fillStatus:G.fill_status,startAt:G.start_at,endAt:G.end_at,salt:G.salt,signature:G.signature,orderHash:G.order_hash,protocolData:{orderType:G.protocol_data.order_type,counter:G.protocol_data.counter,seaportAddress:G.protocol_data.seaport_address,seaportVersion:G.protocol_data.seaport_version,zoneAddress:G.protocol_data.zone_address},createdAt:G.created_at,updatedAt:G.updated_at}}function mapBidFromOpenApiOrder(G){if(G.type!==qj.type.BID)throw new Error("Order type must be BID");const K=G.sell.map((G=>{if("ERC20"===G.type)return{type:"ERC20",contractAddress:G.contract_address,amount:G.amount};throw new Error("Bid sell items must be ERC20")})),ne=G.buy.map((G=>{if("ERC721"===G.type)return{type:"ERC721",contractAddress:G.contract_address,tokenId:G.token_id};if("ERC1155"===G.type)return{type:"ERC1155",contractAddress:G.contract_address,tokenId:G.token_id,amount:G.amount};throw new Error("Bid buy items must either ERC721 or ERC1155")}));return{id:G.id,type:G.type,chain:G.chain,accountAddress:G.account_address,sell:K,buy:ne,fees:G.fees.map((G=>({amount:G.amount,recipientAddress:G.recipient_address,type:G.type}))),status:G.status,fillStatus:G.fill_status,startAt:G.start_at,endAt:G.end_at,salt:G.salt,signature:G.signature,orderHash:G.order_hash,protocolData:{orderType:G.protocol_data.order_type,counter:G.protocol_data.counter,seaportAddress:G.protocol_data.seaport_address,seaportVersion:G.protocol_data.seaport_version,zoneAddress:G.protocol_data.zone_address},createdAt:G.created_at,updatedAt:G.updated_at}}function mapCollectionBidFromOpenApiOrder(G){if(G.type!==qj.type.COLLECTION_BID)throw new Error("Order type must be COLLECTION_BID");const K=G.sell.map((G=>{if("ERC20"===G.type)return{type:"ERC20",contractAddress:G.contract_address,amount:G.amount};throw new Error("Collection bid sell items must be ERC20")})),ne=G.buy.map((G=>{if("ERC721_COLLECTION"===G.type)return{type:"ERC721_COLLECTION",contractAddress:G.contract_address,amount:G.amount};if("ERC1155_COLLECTION"===G.type)return{type:"ERC1155_COLLECTION",contractAddress:G.contract_address,amount:G.amount};throw new Error("Collection bid buy items must either ERC721_COLLECTION or ERC1155_COLLECTION")}));return{id:G.id,type:G.type,chain:G.chain,accountAddress:G.account_address,sell:K,buy:ne,fees:G.fees.map((G=>({amount:G.amount,recipientAddress:G.recipient_address,type:G.type}))),status:G.status,fillStatus:G.fill_status,startAt:G.start_at,endAt:G.end_at,salt:G.salt,signature:G.signature,orderHash:G.order_hash,protocolData:{orderType:G.protocol_data.order_type,counter:G.protocol_data.counter,seaportAddress:G.protocol_data.seaport_address,seaportVersion:G.protocol_data.seaport_version,zoneAddress:G.protocol_data.zone_address},createdAt:G.created_at,updatedAt:G.updated_at}}function mapOrderFromOpenApiOrder(G){switch(G.type){case qj.type.LISTING:return mapListingFromOpenApiOrder(G);case qj.type.BID:return mapBidFromOpenApiOrder(G);case qj.type.COLLECTION_BID:return mapCollectionBidFromOpenApiOrder(G);default:return exhaustiveSwitch(G.type)}}function mapFromOpenApiTrade(G){const K=G.buy.map((G=>{if("NATIVE"===G.type)return{type:"NATIVE",amount:G.amount};if("ERC20"===G.type)return{type:"ERC20",contractAddress:G.contract_address,amount:G.amount};if("ERC721"===G.type)return{type:"ERC721",contractAddress:G.contract_address,tokenId:G.token_id};if("ERC1155"===G.type)return{type:"ERC1155",contractAddress:G.contract_address,tokenId:G.token_id,amount:G.amount};throw new Error("Buy items must be NATIVE, ERC20, ERC721 or ERC1155")})),ne=G.sell.map((G=>{if("ERC20"===G.type)return{type:"ERC20",contractAddress:G.contract_address,amount:G.amount};if("ERC721"===G.type)return{type:"ERC721",contractAddress:G.contract_address,tokenId:G.token_id};if("ERC1155"===G.type)return{type:"ERC1155",contractAddress:G.contract_address,tokenId:G.token_id,amount:G.amount};throw new Error("Sell items must be ERC20, ERC721 or ERC1155")}));return{id:G.id,orderId:G.order_id,buy:K,sell:ne,buyerFees:G.buyer_fees.map((G=>({amount:G.amount,recipientAddress:G.recipient_address,type:G.type}))),fees:G.fees.map((G=>({amount:G.amount,recipientAddress:G.recipient_address,type:G.type}))),chain:G.chain,indexedAt:G.indexed_at,blockchainMetadata:{blockNumber:G.blockchain_metadata.block_number,logIndex:G.blockchain_metadata.log_index,transactionHash:G.blockchain_metadata.transaction_hash,transactionIndex:G.blockchain_metadata.transaction_index},buyerAddress:G.buyer_address,makerAddress:G.maker_address,sellerAddress:G.seller_address,takerAddress:G.taker_address}}function mapFromOpenApiPage(G){return{nextCursor:G.next_cursor,previousCursor:G.previous_cursor}}!function(G){var K;(K=G.cancellation_type||(G.cancellation_type={})).ON_CHAIN="ON_CHAIN",K.OFF_CHAIN="OFF_CHAIN",K.UNDERFUNDED="UNDERFUNDED"}(Lj||(Lj={})),function(G){(G.reason_code||(G.reason_code={})).FILLED="FILLED"}(Uj||(Uj={})),function(G){var K;(K=G.type||(G.type={})).ROYALTY="ROYALTY",K.MAKER_ECOSYSTEM="MAKER_ECOSYSTEM",K.TAKER_ECOSYSTEM="TAKER_ECOSYSTEM",K.PROTOCOL="PROTOCOL"}($j||($j={})),function(G){var K;(K=G.type||(G.type={})).LISTING="LISTING",K.BID="BID",K.COLLECTION_BID="COLLECTION_BID"}(qj||(qj={})),function(G){G.PENDING="PENDING",G.ACTIVE="ACTIVE",G.INACTIVE="INACTIVE",G.FILLED="FILLED",G.EXPIRED="EXPIRED",G.CANCELLED="CANCELLED"}(Gj||(Gj={})),function(G){var K;(K=G.order_type||(G.order_type={})).FULL_RESTRICTED="FULL_RESTRICTED",K.PARTIAL_RESTRICTED="PARTIAL_RESTRICTED"}(jj||(jj={})),function(G){G.MAKER_ECOSYSTEM="MAKER_ECOSYSTEM",G.TAKER_ECOSYSTEM="TAKER_ECOSYSTEM",G.PROTOCOL="PROTOCOL",G.ROYALTY="ROYALTY"}(Hj||(Hj={})),function(G){G.TRANSACTION="TRANSACTION",G.SIGNABLE="SIGNABLE"}(Wj||(Wj={})),function(G){G.APPROVAL="APPROVAL",G.FULFILL_ORDER="FULFILL_ORDER",G.CANCEL="CANCEL"}(zj||(zj={})),function(G){G.CREATE_LISTING="CREATE_ORDER",G.CREATE_ORDER="CREATE_ORDER",G.OFF_CHAIN_CANCELLATION="OFF_CHAIN_CANCELLATION"}(Vj||(Vj={}));const Kj="ImmutableSeaport",Jj="1.5",Xj={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]};var Qj,Zj,Yj,eH;!function(G){G[G.FULL_OPEN=0]="FULL_OPEN",G[G.PARTIAL_OPEN=1]="PARTIAL_OPEN",G[G.FULL_RESTRICTED=2]="FULL_RESTRICTED",G[G.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(Qj||(Qj={})),function(G){G[G.NATIVE=0]="NATIVE",G[G.ERC20=1]="ERC20",G[G.ERC721=2]="ERC721",G[G.ERC1155=3]="ERC1155",G[G.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",G[G.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(Zj||(Zj={})),function(G){G[G.OFFER=0]="OFFER",G[G.CONSIDERATION=1]="CONSIDERATION"}(Yj||(Yj={})),function(G){G[G.ETH_TO_ERC721=0]="ETH_TO_ERC721",G[G.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",G[G.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",G[G.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",G[G.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",G[G.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(eH||(eH={}));const tH={integer:0,address:zeroPadValue("0x",20),bool:!1,bytes:"0x",string:""},isNullish=G=>void 0!==G&&(null!=G&&(["string","number"].includes(typeof G)&&0n===BigInt(G)||Array.isArray(G)&&G.every(isNullish)||"object"==typeof G&&Object.values(G).every(isNullish)||"boolean"==typeof G&&!1===G));class DefaultGetter{types;defaultValues={};constructor(G){this.types=G;for(const K in G){const G=this.getDefaultValue(K);if(this.defaultValues[K]=G,!isNullish(G))throw new Error(`Got non-empty value for type ${K} in default generator: ${G}`)}}static from(G,K){const{defaultValues:ne}=new DefaultGetter(G);return K?ne[K]:ne}getDefaultValue(G){if(this.defaultValues[G])return this.defaultValues[G];const K=function getDefaultForBaseType(G){const[,K]=G.match(/^bytes(\d+)$/)??[];return K?zeroPadValue("0x",parseInt(K)):(G.match(/^(u?)int(\d*)$/)&&(G="integer"),tH[G])}(G);if(void 0!==K)return K;const ne=G.match(/^(.*)(\x5b(\d*)\x5d)$/);if(ne){const G=ne[1],K=parseInt(ne[3]);if(K>0){const ne=this.getDefaultValue(G);return Array(K).fill(ne)}return[]}const ue=this.types[G];if(ue)return ue.reduce(((G,{name:K,type:ne})=>({...G,[K]:this.getDefaultValue(ne)})),{});throw new Error(`unknown type: ${G}`)}}const chunk=(G,K)=>((G,K)=>Array(G).fill(0).map(((G,ne)=>K(ne))))(Math.ceil(G.length/K),(ne=>G.slice(ne*K,(ne+1)*K))),hexToBuffer=G=>Buffer.from(G.slice(2),"hex"),bufferKeccak=G=>hexToBuffer(keccak256$1(G)),hashConcat=G=>bufferKeccak(concat$1(G)),fillArray=(G,K,ne)=>(K>G.length&&G.push(...Array(K-G.length).fill(ne)),G),getNextLayer=G=>chunk(G,2).map(hashConcat);class Eip712MerkleTree{types;rootType;leafType;elements;depth;tree;leafHasher;defaultNode;defaultLeaf;encoder;get completedSize(){return 2**this.depth}getCompleteElements(){const{elements:G}=this;return fillArray([...G],this.completedSize,this.defaultNode)}getCompleteLeaves(){const G=this.elements.map(this.leafHasher);return fillArray([...G],this.completedSize,this.defaultLeaf)}get root(){return this.tree.getHexRoot()}getProof(G){const K=this.getCompleteLeaves()[G];return{leaf:K,proof:this.tree.getHexProof(K,G),root:this.tree.getHexRoot()}}getEncodedProofAndSignature(G,K){const{proof:ne}=this.getProof(G);return((G,K,ne=`0x${"ff".repeat(64)}`)=>concat$1([ne,`0x${G.toString(16).padStart(6,"0")}`,KR.defaultAbiCoder().encode([`uint256[${K.length}]`],[K])]))(G,ne,K)}getDataToSign(){let G=this.getCompleteElements();for(;G.length>2;)G=chunk(G,2);return G}add(G){this.elements.push(G)}getBulkOrderHash(){const G=this.encoder.hashStruct("BulkOrder",{tree:this.getDataToSign()}),K=this.getCompleteLeaves().map(hexToBuffer),ne=(ue=((G,K=!0)=>{if(0===G.length)throw new Error("empty tree");const ne=G.map((G=>{const ne=Buffer.isBuffer(G)?G:hexToBuffer(G);return K?bufferKeccak(ne):ne})),ue=[ne];for(;ue[ue.length-1].length>1;)ue.push(getNextLayer(ue[ue.length-1]));return ue[ue.length-1][0]})(K,!1),toBeHex(ue.toString("hex")));var ue;const pe=keccak256$1(toUtf8Bytes$1(this.encoder.types.BulkOrder[0].type));if(keccak256$1(concat$1([pe,ne]))!==G)throw new Error("expected derived bulk order hash to match");return G}constructor(G,K,ne,ue,pe){this.types=G,this.rootType=K,this.leafType=ne,this.elements=ue,this.depth=pe;const he=TypedDataEncoder.from(G);var ye,me;this.encoder=he,this.leafHasher=G=>he.hashStruct(ne,G),this.defaultNode=DefaultGetter.from(G,ne),this.defaultLeaf=this.leafHasher(this.defaultNode),this.tree=(ye=this.getCompleteLeaves(),me=this.defaultLeaf,new LO.MerkleTree(ye.map(hexToBuffer),bufferKeccak,{complete:!0,sort:!1,hashLeaves:!1,fillDefaultHash:hexToBuffer(me)}))}}function getBulkOrderTree(G,K=0,ne=function getBulkOrderTreeHeight(G){return Math.max(Math.ceil(Math.log2(G)),1)}(G.length+K)){const ue=function getBulkOrderTypes(G){return{...Xj,BulkOrder:[{name:"tree",type:`OrderComponents${"[2]".repeat(G)}`}]}}(ne),pe=DefaultGetter.from(ue,"OrderComponents");let he=[...G];K>0&&(he=[...fillArray([],K,pe),...G]);return new Eip712MerkleTree(ue,"BulkOrder","OrderComponents",he,ne)}function orderTypeStringToEnum(G){if([Qj.FULL_OPEN,Qj.PARTIAL_OPEN,Qj.FULL_RESTRICTED,Qj.PARTIAL_RESTRICTED].includes(Number(G)))return Number(G);throw new Error(`Unknown order type ${G}`)}function itemTypeStringToEnum(G){if([Zj.NATIVE,Zj.ERC20,Zj.ERC721,Zj.ERC1155,Zj.ERC721_WITH_CRITERIA,Zj.ERC1155_WITH_CRITERIA].includes(Number(G)))return Number(G);throw new Error(`Unknown item type ${G}`)}function mapImmutableItemToSeaportOfferItem(G){switch(G.type){case"NATIVE":throw new Error("NATIVE items are not supported in the offer");case"ERC20":return{itemType:Zj.ERC20.valueOf(),token:G.contract_address,identifierOrCriteria:"0",startAmount:G.amount,endAmount:G.amount};case"ERC721":return{itemType:Zj.ERC721.valueOf(),token:G.contract_address,identifierOrCriteria:G.token_id,startAmount:"1",endAmount:"1"};case"ERC1155":return{itemType:Zj.ERC1155.valueOf(),token:G.contract_address,identifierOrCriteria:G.token_id,startAmount:G.amount,endAmount:G.amount};case"ERC721_COLLECTION":throw new Error("ERC721_COLLECTION items are not supported in the offer");case"ERC1155_COLLECTION":throw new Error("ERC1155_COLLECTION items are not supported in the offer");default:return exhaustiveSwitch()}}function mapImmutableOrderToSeaportOrderComponents(G){const K=G.sell.map(mapImmutableItemToSeaportOfferItem),ne=G.buy.map((K=>function mapImmutableItemToSeaportConsiderationItem(G,K){switch(G.type){case"NATIVE":return{itemType:Zj.NATIVE.valueOf(),startAmount:G.amount,endAmount:G.amount,token:ui,identifierOrCriteria:"0",recipient:K};case"ERC20":return{itemType:Zj.ERC20.valueOf(),startAmount:G.amount,endAmount:G.amount,token:G.contract_address,identifierOrCriteria:"0",recipient:K};case"ERC721":return{itemType:Zj.ERC721.valueOf(),startAmount:"1",endAmount:"1",token:G.contract_address,identifierOrCriteria:G.token_id,recipient:K};case"ERC1155":return{itemType:Zj.ERC1155.valueOf(),startAmount:G.amount,endAmount:G.amount,token:G.contract_address,identifierOrCriteria:G.token_id,recipient:K};case"ERC721_COLLECTION":return{itemType:Zj.ERC721_WITH_CRITERIA.valueOf(),startAmount:G.amount,endAmount:G.amount,token:G.contract_address,identifierOrCriteria:"0",recipient:K};case"ERC1155_COLLECTION":return{itemType:Zj.ERC1155_WITH_CRITERIA.valueOf(),startAmount:G.amount,endAmount:G.amount,token:G.contract_address,identifierOrCriteria:"0",recipient:K};default:return exhaustiveSwitch()}}(K,G.account_address))),ue=function(G){switch(G){case qj.type.LISTING:return ne[0];case qj.type.BID:case qj.type.COLLECTION_BID:return K[0];default:return exhaustiveSwitch()}}(G.type),pe=function(G){switch(G){case jj.order_type.FULL_RESTRICTED:return Qj.FULL_RESTRICTED;case jj.order_type.PARTIAL_RESTRICTED:return Qj.PARTIAL_RESTRICTED;default:return exhaustiveSwitch()}}(G.protocol_data.order_type),he=G.fees.map((G=>({amount:G.amount,itemType:ue.itemType,recipient:G.recipient_address,token:ue.token,identifierOrCriteria:ue.identifierOrCriteria})));return{orderComponents:{offerer:G.account_address,zone:G.protocol_data.zone_address,offer:K,consideration:ne,orderType:pe.valueOf(),startTime:Math.round(new Date(G.start_at).getTime()/1e3).toString(),endTime:Math.round(new Date(G.end_at).getTime()/1e3).toString(),zoneHash:Hi,salt:G.salt,conduitKey:Hi,counter:G.protocol_data.counter,totalOriginalConsiderationItems:ne.length},tips:he}}function prepareTransaction(G,K,ne){return async()=>{const ue=await G.buildTransaction(),pe={to:ue.to,from:ne,type:ue.type,maxFeePerGas:ue.maxFeePerGas?Oi.from(ue.maxFeePerGas):void 0,maxPriorityFeePerGas:ue.maxPriorityFeePerGas?Oi.from(ue.maxPriorityFeePerGas):void 0,value:ue.value?Oi.from(ue.value):void 0,data:ue.data,nonce:ue.nonce,chainId:K};return pe.gasLimit=Oi.from(await G.estimateGas()),pe.gasLimit=pe.gasLimit.add(pe.gasLimit.div(5)),pe}}function mapImmutableSdkItemToSeaportSdkCreateInputItem(G){switch(G.type){case"ERC20":return{token:G.contractAddress,amount:G.amount};case"ERC721":return{itemType:Zj.ERC721.valueOf(),token:G.contractAddress,identifier:G.tokenId};case"ERC1155":return{itemType:Zj.ERC1155.valueOf(),token:G.contractAddress,identifier:G.tokenId,amount:G.amount};default:return exhaustiveSwitch()}}function mapImmutableSdkItemToSeaportSdkConsiderationInputItem(G,K){switch(G.type){case"NATIVE":return{amount:G.amount,recipient:K};case"ERC20":return{token:G.contractAddress,amount:G.amount,recipient:K};case"ERC721":return{itemType:Zj.ERC721.valueOf(),token:G.contractAddress,identifier:G.tokenId,recipient:K};case"ERC1155":return{itemType:Zj.ERC1155.valueOf(),token:G.contractAddress,identifier:G.tokenId,amount:G.amount,recipient:K};case"ERC721_COLLECTION":return{itemType:Zj.ERC721.valueOf(),token:G.contractAddress,amount:G.amount,identifiers:[],recipient:K};case"ERC1155_COLLECTION":return{itemType:Zj.ERC1155.valueOf(),token:G.contractAddress,amount:G.amount,identifiers:[],recipient:K};default:return exhaustiveSwitch()}}class Seaport{seaportLibFactory;provider;seaportContractAddress;zoneContractAddress;rateLimitingKey;constructor(G,K,ne,ue,pe){this.seaportLibFactory=G,this.provider=K,this.seaportContractAddress=ne,this.zoneContractAddress=ue,this.rateLimitingKey=pe}async prepareBulkSeaportOrders(G,K){const{actions:ne}=await this.createSeaportOrders(G,K),ue=ne.filter((G=>"approval"===G.type)),pe=await this.provider.getNetwork(),he=ue.map((K=>({type:Wj.TRANSACTION,purpose:zj.APPROVAL,buildTransaction:prepareTransaction(K.transactionMethods,pe.chainId,G)}))),ye=ne.find((G=>"createBulk"===G.type));if(!ye)throw new Error("No create bulk order action found");const me=await ye.getMessageToSign(),{components:be,types:ve,value:_e}=function getBulkOrderComponentsFromMessage(G){const K=JSON.parse(G),ne=K.message.tree.flat(1/0).filter((G=>"0x0000000000000000000000000000000000000000"!==G.offerer)).map((G=>({...G,orderType:orderTypeStringToEnum(G.orderType),salt:Oi.from(G.salt).toHexString(),offer:G.offer.map((G=>({...G,itemType:itemTypeStringToEnum(G.itemType)}))),consideration:G.consideration.map((G=>({...G,itemType:itemTypeStringToEnum(G.itemType)})))})));return{components:ne,types:K.types,value:K.message}}(me);return he.push({type:Wj.SIGNABLE,purpose:Vj.CREATE_ORDER,message:await this.getTypedDataFromBulkOrderComponents(ve,_e)}),{actions:he,preparedOrders:be.map((G=>({orderComponents:G,orderHash:this.getSeaportLib().getOrderHash(G)})))}}async prepareSeaportOrder(G,K,ne,ue,pe,he){const{actions:ye}=await this.createSeaportOrder(G,K,ne,ue,pe,he),me=[],be=ye.find((G=>"approval"===G.type));be&&me.push({type:Wj.TRANSACTION,purpose:zj.APPROVAL,buildTransaction:prepareTransaction(be.transactionMethods,(await this.provider.getNetwork()).chainId,G)});const ve=ye.find((G=>"create"===G.type));if(!ve)throw new Error("No create order action found");const _e=function getOrderComponentsFromMessage(G){const K=JSON.parse(G).message;return{...K,orderType:orderTypeStringToEnum(K.orderType),salt:Oi.from(K.salt).toHexString(),offer:K.offer.map((G=>({...G,itemType:itemTypeStringToEnum(G.itemType)}))),consideration:K.consideration.map((G=>({...G,itemType:itemTypeStringToEnum(G.itemType)})))}}(await ve.getMessageToSign());return me.push({type:Wj.SIGNABLE,purpose:Vj.CREATE_ORDER,message:await this.getTypedDataFromOrderComponents(_e)}),{actions:me,orderComponents:_e,orderHash:this.getSeaportLib().getOrderHash(_e)}}async fulfillOrder(G,K,ne,ue,pe){const{orderComponents:he,tips:ye}=mapImmutableOrderToSeaportOrderComponents(G),me=this.getSeaportLib(G),be=(await this.provider.getNetwork()).chainId,ve={order:{parameters:he,signature:G.signature},unitsToFill:ue,extraData:ne,tips:ye};pe&&(ve.considerationCriteria=pe);const{actions:_e}=await me.fulfillOrders({accountAddress:K,fulfillOrderDetails:[ve]}),Te=[],Ee=_e.filter((G=>"approval"===G.type));Ee.length>0&&Ee.forEach((G=>{Te.push({type:Wj.TRANSACTION,buildTransaction:prepareTransaction(G.transactionMethods,be,K),purpose:zj.APPROVAL})}));const Pe=_e.find((G=>"exchange"===G.type));if(!Pe)throw new Error("No exchange action found");return Te.push({type:Wj.TRANSACTION,buildTransaction:prepareTransaction(Pe.transactionMethods,be,K),purpose:zj.FULFILL_ORDER}),{actions:Te,expiration:Seaport.getExpirationISOTimeFromExtraData(ne),order:mapOrderFromOpenApiOrder(G)}}async fulfillBulkOrders(G,K){const ne=G.map((G=>{const{orderComponents:K,tips:ne}=mapImmutableOrderToSeaportOrderComponents(G.order),ue={order:{parameters:K,signature:G.order.signature},unitsToFill:G.unitsToFill,extraData:G.extraData,tips:ne};return G.considerationCriteria&&G.considerationCriteria.length>0&&(ue.considerationCriteria=G.considerationCriteria),ue})),{actions:ue}=await this.getSeaportLib().fulfillOrders({fulfillOrderDetails:ne,accountAddress:K}),pe=[],he=ue.filter((G=>"approval"===G.type)),ye=(await this.provider.getNetwork()).chainId;he.length>0&&he.forEach((G=>{pe.push({type:Wj.TRANSACTION,buildTransaction:prepareTransaction(G.transactionMethods,ye,K),purpose:zj.APPROVAL})}));const me=ue.find((G=>"exchange"===G.type));if(!me)throw new Error("No exchange action found");return pe.push({type:Wj.TRANSACTION,buildTransaction:prepareTransaction(me.transactionMethods,(await this.provider.getNetwork()).chainId,K),purpose:zj.FULFILL_ORDER}),{actions:pe,expiration:ne.map((G=>Seaport.getExpirationISOTimeFromExtraData(G.extraData))).reduce(((G,K)=>new Date(G)<new Date(K)?G:K))}}async cancelOrders(G,K){const ne=G.map((G=>mapImmutableOrderToSeaportOrderComponents(G).orderComponents)),ue=this.getSeaportLib(G[0]),pe=await ue.cancelOrders(ne,K);return{type:Wj.TRANSACTION,buildTransaction:prepareTransaction(pe,(await this.provider.getNetwork()).chainId,K),purpose:zj.CANCEL}}createSeaportOrders(G,K){return this.getSeaportLib().createBulkOrders(K.map((K=>{const{offerItem:ne,considerationItem:ue,allowPartialFills:pe,orderStart:he,orderExpiry:ye}=K;return{allowPartialFills:pe,offer:[mapImmutableSdkItemToSeaportSdkCreateInputItem(ne)],consideration:[mapImmutableSdkItemToSeaportSdkConsiderationInputItem(ue,G)],startTime:(he.getTime()/1e3).toFixed(0),endTime:(ye.getTime()/1e3).toFixed(0),zone:this.zoneContractAddress,restrictedByZone:!0}})),G)}createSeaportOrder(G,K,ne,ue,pe,he){return this.getSeaportLib().createOrder({allowPartialFills:ue,offer:[mapImmutableSdkItemToSeaportSdkCreateInputItem(K)],consideration:[mapImmutableSdkItemToSeaportSdkConsiderationInputItem(ne,G)],startTime:(pe.getTime()/1e3).toFixed(0),endTime:(he.getTime()/1e3).toFixed(0),zone:this.zoneContractAddress,restrictedByZone:!0},G)}async getTypedDataFromBulkOrderComponents(G,K){delete G.EIP712Domain;const{chainId:ne}=await this.provider.getNetwork();return{domain:{name:Kj,version:Jj,chainId:ne,verifyingContract:this.seaportContractAddress},types:G,value:K}}async getTypedDataFromOrderComponents(G){const{chainId:K}=await this.provider.getNetwork();return{domain:{name:Kj,version:Jj,chainId:K,verifyingContract:this.seaportContractAddress},types:Xj,value:G}}getSeaportLib(G){const K=G?.protocol_data?.seaport_address??this.seaportContractAddress;return this.seaportLibFactory.create(K,this.rateLimitingKey)}static getExpirationISOTimeFromExtraData(G){const K=G.slice(44,60),ne=parseInt(K,16);return new Date(1e3*ne).toISOString()}}function mapSeaportItemToImmutableItem(G){switch(G.itemType){case Zj.NATIVE:return{type:"NATIVE",amount:G.startAmount};case Zj.ERC20:return{type:"ERC20",contract_address:G.token,amount:G.startAmount};case Zj.ERC721:return{type:"ERC721",contract_address:G.token,token_id:G.identifierOrCriteria};case Zj.ERC1155:return{type:"ERC1155",contract_address:G.token,token_id:G.identifierOrCriteria,amount:G.startAmount};case Zj.ERC721_WITH_CRITERIA:return{type:"ERC721_COLLECTION",contract_address:G.token,amount:G.startAmount};case Zj.ERC1155_WITH_CRITERIA:return{type:"ERC1155_COLLECTION",contract_address:G.token,amount:G.startAmount};default:return exhaustiveSwitch(G.itemType)}}function mapSeaportItemToImmutableERC20Item(G){if(G.itemType!==Zj.ERC20)throw new Error(`Expected ERC20 item, got ${G.itemType}`);return{type:"ERC20",contract_address:G.token,amount:G.startAmount}}function mapSeaportItemToImmutableAssetCollectionItem(G){switch(G.itemType){case Zj.ERC721_WITH_CRITERIA:return{type:"ERC721_COLLECTION",contract_address:G.token,amount:G.startAmount};case Zj.ERC1155_WITH_CRITERIA:return{type:"ERC1155_COLLECTION",contract_address:G.token,amount:G.startAmount};case Zj.ERC20:case Zj.NATIVE:case Zj.ERC721:case Zj.ERC1155:throw new Error(`Unsupported item type ${G.itemType}`);default:return exhaustiveSwitch(G.itemType)}}function mapSeaportOrderTypeToImmutableProtocolDataOrderType(G){switch(G){case Qj.FULL_RESTRICTED:return jj.order_type.FULL_RESTRICTED;case Qj.PARTIAL_RESTRICTED:return jj.order_type.PARTIAL_RESTRICTED;case Qj.FULL_OPEN:case Qj.PARTIAL_OPEN:throw new Error(`Unsupported order type ${G}`);default:return exhaustiveSwitch()}}class ImmutableApiClient{orderbookService;chainName;seaportAddress;constructor(G,K,ne){this.orderbookService=G,this.chainName=K,this.seaportAddress=ne}async fulfillmentData(G){return this.orderbookService.fulfillmentData({chainName:this.chainName,requestBody:G})}async getListing(G){return this.orderbookService.getListing({chainName:this.chainName,listingId:G})}async getBid(G){return this.orderbookService.getBid({chainName:this.chainName,bidId:G})}async getCollectionBid(G){return this.orderbookService.getCollectionBid({chainName:this.chainName,collectionBidId:G})}async getTrade(G){return this.orderbookService.getTrade({chainName:this.chainName,tradeId:G})}async listListings(G){return this.orderbookService.listListings({chainName:this.chainName,...G})}async listBids(G){return this.orderbookService.listBids({chainName:this.chainName,...G})}async listCollectionBids(G){return this.orderbookService.listCollectionBids({chainName:this.chainName,...G})}async listTrades(G){return this.orderbookService.listTrades({chainName:this.chainName,...G})}async cancelOrders(G,K,ne){return this.orderbookService.cancelOrders({chainName:this.chainName,requestBody:{account_address:K,orders:G,signature:ne}})}async createListing({orderHash:G,orderComponents:K,orderSignature:ne,makerFees:ue}){if(1!==K.offer.length)throw new Error("Only one item can be listed for a listing");if(1!==K.consideration.length)throw new Error("Only one item can be used as currency for a listing");if(![Zj.ERC721,Zj.ERC1155].includes(K.offer[0].itemType))throw new Error("Only ERC721 / ERC1155 tokens can be listed");if(![Zj.NATIVE,Zj.ERC20].includes(K.consideration[0].itemType))throw new Error("Only Native / ERC20 tokens can be used as currency items in a listing");return this.orderbookService.createListing({chainName:this.chainName,requestBody:{account_address:K.offerer,buy:K.consideration.map(mapSeaportItemToImmutableItem),fees:ue.map((G=>({type:$j.type.MAKER_ECOSYSTEM,amount:G.amount,recipient_address:G.recipientAddress}))),end_at:new Date(parseInt(`${K.endTime.toString()}000`,10)).toISOString(),order_hash:G,protocol_data:{order_type:mapSeaportOrderTypeToImmutableProtocolDataOrderType(K.orderType),zone_address:K.zone,seaport_address:this.seaportAddress,seaport_version:Jj,counter:K.counter.toString()},salt:K.salt,sell:K.offer.map(mapSeaportItemToImmutableItem),signature:ne,start_at:new Date(parseInt(`${K.startTime.toString()}000`,10)).toISOString()}})}async createBid({orderHash:G,orderComponents:K,orderSignature:ne,makerFees:ue}){if(1!==K.offer.length)throw new Error("Only one item can be listed for a bid");if(1!==K.consideration.length)throw new Error("Only one item can be used as currency for a bid");if(Zj.ERC20!==K.offer[0].itemType)throw new Error("Only ERC20 tokens can be used as the currency item in a bid");if(![Zj.ERC721,Zj.ERC1155].includes(K.consideration[0].itemType))throw new Error("Only ERC721 / ERC1155 tokens can be bid against");return this.orderbookService.createBid({chainName:this.chainName,requestBody:{account_address:K.offerer,buy:K.consideration.map(mapSeaportItemToImmutableItem),fees:ue.map((G=>({type:$j.type.MAKER_ECOSYSTEM,amount:G.amount,recipient_address:G.recipientAddress}))),end_at:new Date(parseInt(`${K.endTime.toString()}000`,10)).toISOString(),order_hash:G,protocol_data:{order_type:mapSeaportOrderTypeToImmutableProtocolDataOrderType(K.orderType),zone_address:K.zone,seaport_address:this.seaportAddress,seaport_version:Jj,counter:K.counter.toString()},salt:K.salt,sell:K.offer.map(mapSeaportItemToImmutableERC20Item),signature:ne,start_at:new Date(parseInt(`${K.startTime.toString()}000`,10)).toISOString()}})}async createCollectionBid({orderHash:G,orderComponents:K,orderSignature:ne,makerFees:ue}){if(1!==K.offer.length)throw new Error("Only one item can be listed for a collection bid");if(1!==K.consideration.length)throw new Error("Only one item can be used as currency for a collection bid");if(Zj.ERC20!==K.offer[0].itemType)throw new Error("Only ERC20 tokens can be used as the currency item in a collection bid");if(![Zj.ERC721_WITH_CRITERIA,Zj.ERC1155_WITH_CRITERIA].includes(K.consideration[0].itemType))throw new Error("Only ERC721 / ERC1155 collection based tokens can be bid against");return this.orderbookService.createCollectionBid({chainName:this.chainName,requestBody:{account_address:K.offerer,buy:K.consideration.map(mapSeaportItemToImmutableAssetCollectionItem),fees:ue.map((G=>({type:$j.type.MAKER_ECOSYSTEM,amount:G.amount,recipient_address:G.recipientAddress}))),end_at:new Date(parseInt(`${K.endTime.toString()}000`,10)).toISOString(),order_hash:G,protocol_data:{order_type:mapSeaportOrderTypeToImmutableProtocolDataOrderType(K.orderType),zone_address:K.zone,seaport_address:this.seaportAddress,seaport_version:Jj,counter:K.counter.toString()},salt:K.salt,sell:K.offer.map(mapSeaportItemToImmutableERC20Item),signature:ne,start_at:new Date(parseInt(`${K.startTime.toString()}000`,10)).toISOString()}})}}class ImmutableApiClientFactory{chainName;seaportAddress;orderbookClient;constructor(G,K,ne,ue){this.chainName=K,this.seaportAddress=ne,this.orderbookClient=new OrderBookClient({BASE:G,HEADERS:ue?{"x-api-key":ue}:void 0})}create(){return new ImmutableApiClient(this.orderbookClient.orders,this.chainName,this.seaportAddress)}}function getConfiguredProvider(G,K){return new Ju({url:G,headers:K?{"x-api-key":K}:void 0})}class SeaportLibFactory{defaultSeaportContractAddress;provider;constructor(G,K){this.defaultSeaportContractAddress=G,this.provider=K}create(G,K){const ne=G??this.defaultSeaportContractAddress;return new TN.Seaport(function convertToV6Provider(G,K){const ne=new FetchRequest(G.connection.url);K&&ne.setHeader("x-api-key",K);const ue=new JsonRpcProvider(ne);return ue.getSigner=async function getSigner(G){null==G&&(G=0);const K=this.send("eth_accounts",[]);if("number"==typeof G){const ne=await K;if(G>=ne.length)throw new Error("no such account");return new JsonRpcSigner(this,ne[G])}return new JsonRpcSigner(this,G)},ue}(this.provider,K),{balanceAndApprovalChecksOnOrderCreation:!0,overrides:{contractAddress:ne}})}}class Orderbook{apiClient;seaport;orderbookConfig;constructor(G){const K=function getOrderbookConfig(G){switch(G.baseConfig.environment){case Jn.SANDBOX:return{seaportContractAddress:"0x7d117aA8BD6D31c4fa91722f246388f38ab1942c",zoneContractAddress:"0x1004f9615E79462c711Ff05a386BdbA91a7628C3",apiEndpoint:"https://api.sandbox.immutable.com",chainName:"imtbl-zkevm-testnet",provider:getConfiguredProvider("https://rpc.testnet.immutable.com",G.baseConfig.rateLimitingKey)};case Jn.PRODUCTION:return{seaportContractAddress:"0x6c12aD6F0bD274191075Eb2E78D7dA5ba6453424",zoneContractAddress:"0x1004f9615E79462c711Ff05a386BdbA91a7628C3",apiEndpoint:"https://api.immutable.com",chainName:"imtbl-zkevm-mainnet",provider:getConfiguredProvider("https://rpc.immutable.com",G.baseConfig.rateLimitingKey)};default:return null}}(G),ne={...K,...G.overrides};if(G.overrides?.jsonRpcProviderUrl&&(ne.provider=getConfiguredProvider(G.overrides?.jsonRpcProviderUrl,G.baseConfig.rateLimitingKey)),!ne)throw new Error("Orderbook configuration not passed, please specify the environment under config.baseConfig.environment");this.orderbookConfig=ne;const{apiEndpoint:ue,chainName:pe}=this.orderbookConfig;if(!ue)throw new Error("API endpoint must be provided");this.apiClient=new ImmutableApiClientFactory(ue,pe,this.orderbookConfig.seaportContractAddress,G.baseConfig.rateLimitingKey).create();const he=new SeaportLibFactory(this.orderbookConfig.seaportContractAddress,this.orderbookConfig.provider);this.seaport=new Seaport(he,this.orderbookConfig.provider,this.orderbookConfig.seaportContractAddress,this.orderbookConfig.zoneContractAddress,G.baseConfig.rateLimitingKey)}static defaultOrderExpiry(){return new Date(Date.now()+63072e6)}config(){return this.orderbookConfig}async getListing(G){return{result:mapListingFromOpenApiOrder((await this.apiClient.getListing(G)).result)}}async getBid(G){return{result:mapBidFromOpenApiOrder((await this.apiClient.getBid(G)).result)}}async getCollectionBid(G){return{result:mapCollectionBidFromOpenApiOrder((await this.apiClient.getCollectionBid(G)).result)}}async getTrade(G){return{result:mapFromOpenApiTrade((await this.apiClient.getTrade(G)).result)}}async listListings(G){const K=await this.apiClient.listListings(G);return{page:mapFromOpenApiPage(K.page),result:K.result.map(mapListingFromOpenApiOrder)}}async listBids(G){const K=await this.apiClient.listBids(G);return{page:mapFromOpenApiPage(K.page),result:K.result.map(mapBidFromOpenApiOrder)}}async listCollectionBids(G){const K=await this.apiClient.listCollectionBids(G);return{page:mapFromOpenApiPage(K.page),result:K.result.map(mapCollectionBidFromOpenApiOrder)}}async listTrades(G){const K=await this.apiClient.listTrades(G);return{page:mapFromOpenApiPage(K.page),result:K.result.map(mapFromOpenApiTrade)}}async prepareBulkListings({makerAddress:G,listingParams:K}){if(K.length>20)throw new Error("Bulk listing creation is limited to 20 orders");if(1===K.length){const ne=await this.seaport.prepareSeaportOrder(G,K[0].sell,K[0].buy,"ERC1155"===K[0].sell.type,K[0].orderStart||new Date,K[0].orderExpiry||Orderbook.defaultOrderExpiry());return{actions:ne.actions,completeListings:async G=>{const ue=await this.createListing({makerFees:K[0].makerFees,orderComponents:ne.orderComponents,orderHash:ne.orderHash,orderSignature:"string"==typeof G?G:G[0]});return{result:[{success:!0,orderHash:ne.orderHash,order:ue.result}]}}}}if("0x"!==await this.orderbookConfig.provider.getCode(G)){Dn("orderbookmr","bulkListings",{walletType:"Passport",makerAddress:G,listingsCount:K.length});const ne=await Promise.all(K.map((K=>this.seaport.prepareSeaportOrder(G,K.sell,K.buy,"ERC1155"===K.sell.type,K.orderStart||new Date,K.orderExpiry||Orderbook.defaultOrderExpiry())))),ue=[],pe=ne.flatMap((G=>{const K=[];return G.actions.forEach((ne=>{if(ne.type===Wj.TRANSACTION){const pe=G.orderComponents.offer[0].token;ue.includes(pe)||(ue.push(pe),K.push(ne))}else K.push(ne)})),K}));return{actions:pe,completeListings:async G=>{if("string"==typeof G)throw new Error("A signature per listing must be provided for smart contract wallets");const ue=await Promise.all(ne.map(((ne,ue)=>{const pe=G[ue];return this.apiClient.createListing({makerFees:K[ue].makerFees,orderComponents:ne.orderComponents,orderHash:ne.orderHash,orderSignature:pe}).catch((()=>{}))})));return{result:ue.map(((G,K)=>({success:!!G,orderHash:ne[K].orderHash,order:G?mapListingFromOpenApiOrder(G.result):void 0})))}}}}Dn("orderbookmr","bulkListings",{walletType:"EOA",makerAddress:G,listingsCount:K.length});const{actions:ne,preparedOrders:ue}=await this.seaport.prepareBulkSeaportOrders(G,K.map((G=>({offerItem:G.sell,considerationItem:G.buy,allowPartialFills:"ERC1155"===G.sell.type,orderStart:G.orderStart||new Date,orderExpiry:G.orderExpiry||Orderbook.defaultOrderExpiry()}))));return{actions:ne,completeListings:async G=>{const ne="object"==typeof G;if(ne&&1!==G.length)throw new Error("Only a single signature is expected for bulk listing creation");const pe=ue.map((G=>G.orderComponents)),he=function getBulkSeaportOrderSignatures(G,K){const ne=getBulkOrderTree(K);return K.map(((K,ue)=>ne.getEncodedProofAndSignature(ue,G)))}(ne?G[0]:G,pe),ye=await Promise.all(pe.map(((G,ne)=>{const pe=he[ne],ye=ue[ne],me=K[ne];return this.apiClient.createListing({orderComponents:G,orderHash:ye.orderHash,orderSignature:pe,makerFees:me.makerFees}).catch((()=>{}))})));return{result:ye.map(((G,K)=>({success:!!G,orderHash:ue[K].orderHash,order:G?mapListingFromOpenApiOrder(G.result):void 0})))}}}}async prepareListing({makerAddress:G,sell:K,buy:ne,orderStart:ue,orderExpiry:pe}){return this.seaport.prepareSeaportOrder(G,K,ne,"ERC1155"===K.type,ue||new Date,pe||Orderbook.defaultOrderExpiry())}async createListing(G){return{result:mapListingFromOpenApiOrder((await this.apiClient.createListing(G)).result)}}async prepareBid({makerAddress:G,sell:K,buy:ne,orderStart:ue,orderExpiry:pe}){return this.seaport.prepareSeaportOrder(G,K,ne,"ERC1155"===ne.type,ue||new Date,pe||Orderbook.defaultOrderExpiry())}async createBid(G){return{result:mapBidFromOpenApiOrder((await this.apiClient.createBid(G)).result)}}async prepareCollectionBid({makerAddress:G,sell:K,buy:ne,orderStart:ue,orderExpiry:pe}){return this.seaport.prepareSeaportOrder(G,K,ne,!0,ue||new Date,pe||Orderbook.defaultOrderExpiry())}async createCollectionBid(G){return{result:mapCollectionBidFromOpenApiOrder((await this.apiClient.createCollectionBid(G)).result)}}async fulfillOrder(G,K,ne,ue,pe){const he={order_id:G,taker_address:K,fees:ne.map((G=>({type:$j.type.TAKER_ECOSYSTEM,amount:G.amount,recipient_address:G.recipientAddress})))},ye=pe?[{identifier:pe,proof:[]}]:void 0;pe&&(he.token_id=pe);const me=await this.apiClient.fulfillmentData([he]);if(me.result.unfulfillable_orders?.length>0)throw new Error(`Unable to prepare fulfillment data: ${me.result.unfulfillable_orders[0].reason}`);if(1!==me.result.fulfillable_orders?.length)throw new Error("unexpected fulfillable order result length");const be=me.result.fulfillable_orders[0].extra_data,ve=me.result.fulfillable_orders[0].order;if(ve.status.name!==Gj.ACTIVE)throw new Error(`Cannot fulfil order that is not active. Current status: ${ve.status}`);return this.seaport.fulfillOrder(ve,K,be,ue,ye)}async fulfillBulkOrders(G,K){const ne=G.map((G=>{const K="listingId"in G;return{orderId:K?G.listingId:G.orderId,takerFees:G.takerFees,amountToFill:G.amountToFill,tokenId:K?void 0:G.tokenId}})),ue=await this.apiClient.fulfillmentData(ne.map((G=>({order_id:G.orderId,taker_address:K,fees:G.takerFees.map((G=>({type:$j.type.TAKER_ECOSYSTEM,amount:G.amount,recipient_address:G.recipientAddress}))),token_id:G?.tokenId}))));try{const G=ue.result.fulfillable_orders.map((G=>{const K=ne.find((K=>K.orderId===G.order.id&&K.tokenId===G.token_id));if(!K){let K=`Could not find order for order ${G.order.id}`;throw G.token_id&&(K+=` and token ID ${G.token_id}`),new Error(K)}const ue=[];return K.tokenId&&ue.push({identifier:K.tokenId,proof:[]}),{extraData:G.extra_data,order:G.order,unitsToFill:K.amountToFill,considerationCriteria:ue}}));return{...await this.seaport.fulfillBulkOrders(G,K),fulfillableOrders:ue.result.fulfillable_orders.map((G=>mapOrderFromOpenApiOrder(G.order))),unfulfillableOrders:ue.result.unfulfillable_orders.map((G=>({orderId:G.order_id,tokenId:G.token_id,reason:G.reason}))),sufficientBalance:!0}}catch(G){if(String(G).includes("The fulfiller does not have the balances needed to fulfill."))return{fulfillableOrders:ue.result.fulfillable_orders.map((G=>mapOrderFromOpenApiOrder(G.order))),unfulfillableOrders:ue.result.unfulfillable_orders.map((G=>({orderId:G.order_id,reason:G.reason}))),sufficientBalance:!1};throw G}}async prepareOrderCancellations(G){const K={name:"imtbl-order-book",chainId:(await this.orderbookConfig.provider.getNetwork()).chainId,verifyingContract:this.orderbookConfig.seaportContractAddress},ne={orders:G.map((G=>({id:G})))};return{signableAction:{purpose:Vj.OFF_CHAIN_CANCELLATION,type:Wj.SIGNABLE,message:{domain:K,types:{CancelPayload:[{name:"orders",type:"Order[]"}],Order:[{name:"id",type:"string"}]},value:ne}}}}async cancelOrders(G,K,ne){return this.apiClient.cancelOrders(G,K,ne)}async cancelOrdersOnChain(G,K){const ne=Promise.all(G.map((G=>this.apiClient.getListing(G).catch((G=>{if(404!==G.status)throw G}))))),ue=Promise.all(G.map((G=>this.apiClient.getBid(G).catch((G=>{if(404!==G.status)throw G}))))),pe=Promise.all(G.map((G=>this.apiClient.getCollectionBid(G).catch((G=>{if(404!==G.status)throw G}))))),he=[await Promise.all([ne,ue,pe])].flat(2).filter((G=>void 0!==G)).map((G=>G.result));if(he.length!==G.length){const K=G.filter((G=>!he.some((K=>K.id===G))));throw new Error(`Orders ${K} not found`)}for(const G of he)if(G.account_address!==K.toLowerCase())throw new Error(`Only account ${G.account_address} can cancel order ${G.id}`);const ye=he.map((G=>G.protocol_data.seaport_address));if(1!==new Set(...[ye]).size)throw new Error("Cannot cancel multiple orders from different seaport contracts. Please group your orderIds accordingly");return{cancellationAction:await this.seaport.cancelOrders(he,K)}}}const rH={estimatedFulfillmentGasGwei:4e5};var nH=Object.freeze({__proto__:null,get ActionType(){return Wj},get FeeType(){return Hj},get OrderStatusName(){return Gj},Orderbook:Orderbook,get SignablePurpose(){return Vj},get TransactionPurpose(){return zj},constants:rH});function bind(G,K){return function wrap(){return G.apply(K,arguments)}}const{toString:aH}=Object.prototype,{getPrototypeOf:iH}=Object,sH=(G=>K=>{const ne=aH.call(K);return G[ne]||(G[ne]=ne.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=G=>(G=G.toLowerCase(),K=>sH(K)===G),typeOfTest=G=>K=>typeof K===G,{isArray:oH}=Array,cH=typeOfTest("undefined");const dH=kindOfTest("ArrayBuffer");const uH=typeOfTest("string"),fH=typeOfTest("function"),lH=typeOfTest("number"),isObject=G=>null!==G&&"object"==typeof G,isPlainObject=G=>{if("object"!==sH(G))return!1;const K=iH(G);return!(null!==K&&K!==Object.prototype&&null!==Object.getPrototypeOf(K)||Symbol.toStringTag in G||Symbol.iterator in G)},pH=kindOfTest("Date"),hH=kindOfTest("File"),yH=kindOfTest("Blob"),mH=kindOfTest("FileList"),bH=kindOfTest("URLSearchParams");function forEach(G,K,{allOwnKeys:ne=!1}={}){if(null==G)return;let ue,pe;if("object"!=typeof G&&(G=[G]),oH(G))for(ue=0,pe=G.length;ue<pe;ue++)K.call(null,G[ue],ue,G);else{const pe=ne?Object.getOwnPropertyNames(G):Object.keys(G),he=pe.length;let ye;for(ue=0;ue<he;ue++)ye=pe[ue],K.call(null,G[ye],ye,G)}}function findKey(G,K){K=K.toLowerCase();const ne=Object.keys(G);let ue,pe=ne.length;for(;pe-- >0;)if(ue=ne[pe],K===ue.toLowerCase())return ue;return null}const gH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,isContextDefined=G=>!cH(G)&&G!==gH;const vH=(G=>K=>G&&K instanceof G)("undefined"!=typeof Uint8Array&&iH(Uint8Array)),wH=kindOfTest("HTMLFormElement"),_H=(({hasOwnProperty:G})=>(K,ne)=>G.call(K,ne))(Object.prototype),TH=kindOfTest("RegExp"),reduceDescriptors=(G,K)=>{const ne=Object.getOwnPropertyDescriptors(G),ue={};forEach(ne,((ne,pe)=>{let he;!1!==(he=K(ne,pe,G))&&(ue[pe]=he||ne)})),Object.defineProperties(G,ue)},AH="abcdefghijklmnopqrstuvwxyz",EH="0123456789",PH={DIGIT:EH,ALPHA:AH,ALPHA_DIGIT:AH+AH.toUpperCase()+EH};const SH=kindOfTest("AsyncFunction");var IH={isArray:oH,isArrayBuffer:dH,isBuffer:function isBuffer(G){return null!==G&&!cH(G)&&null!==G.constructor&&!cH(G.constructor)&&fH(G.constructor.isBuffer)&&G.constructor.isBuffer(G)},isFormData:G=>{let K;return G&&("function"==typeof FormData&&G instanceof FormData||fH(G.append)&&("formdata"===(K=sH(G))||"object"===K&&fH(G.toString)&&"[object FormData]"===G.toString()))},isArrayBufferView:function isArrayBufferView(G){let K;return K="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(G):G&&G.buffer&&dH(G.buffer),K},isString:uH,isNumber:lH,isBoolean:G=>!0===G||!1===G,isObject:isObject,isPlainObject:isPlainObject,isUndefined:cH,isDate:pH,isFile:hH,isBlob:yH,isRegExp:TH,isFunction:fH,isStream:G=>isObject(G)&&fH(G.pipe),isURLSearchParams:bH,isTypedArray:vH,isFileList:mH,forEach:forEach,merge:function merge(){const{caseless:G}=isContextDefined(this)&&this||{},K={},assignValue=(ne,ue)=>{const pe=G&&findKey(K,ue)||ue;isPlainObject(K[pe])&&isPlainObject(ne)?K[pe]=merge(K[pe],ne):isPlainObject(ne)?K[pe]=merge({},ne):oH(ne)?K[pe]=ne.slice():K[pe]=ne};for(let G=0,K=arguments.length;G<K;G++)arguments[G]&&forEach(arguments[G],assignValue);return K},extend:(G,K,ne,{allOwnKeys:ue}={})=>(forEach(K,((K,ue)=>{ne&&fH(K)?G[ue]=bind(K,ne):G[ue]=K}),{allOwnKeys:ue}),G),trim:G=>G.trim?G.trim():G.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:G=>(65279===G.charCodeAt(0)&&(G=G.slice(1)),G),inherits:(G,K,ne,ue)=>{G.prototype=Object.create(K.prototype,ue),G.prototype.constructor=G,Object.defineProperty(G,"super",{value:K.prototype}),ne&&Object.assign(G.prototype,ne)},toFlatObject:(G,K,ne,ue)=>{let pe,he,ye;const me={};if(K=K||{},null==G)return K;do{for(pe=Object.getOwnPropertyNames(G),he=pe.length;he-- >0;)ye=pe[he],ue&&!ue(ye,G,K)||me[ye]||(K[ye]=G[ye],me[ye]=!0);G=!1!==ne&&iH(G)}while(G&&(!ne||ne(G,K))&&G!==Object.prototype);return K},kindOf:sH,kindOfTest:kindOfTest,endsWith:(G,K,ne)=>{G=String(G),(void 0===ne||ne>G.length)&&(ne=G.length),ne-=K.length;const ue=G.indexOf(K,ne);return-1!==ue&&ue===ne},toArray:G=>{if(!G)return null;if(oH(G))return G;let K=G.length;if(!lH(K))return null;const ne=new Array(K);for(;K-- >0;)ne[K]=G[K];return ne},forEachEntry:(G,K)=>{const ne=(G&&G[Symbol.iterator]).call(G);let ue;for(;(ue=ne.next())&&!ue.done;){const ne=ue.value;K.call(G,ne[0],ne[1])}},matchAll:(G,K)=>{let ne;const ue=[];for(;null!==(ne=G.exec(K));)ue.push(ne);return ue},isHTMLForm:wH,hasOwnProperty:_H,hasOwnProp:_H,reduceDescriptors:reduceDescriptors,freezeMethods:G=>{reduceDescriptors(G,((K,ne)=>{if(fH(G)&&-1!==["arguments","caller","callee"].indexOf(ne))return!1;const ue=G[ne];fH(ue)&&(K.enumerable=!1,"writable"in K?K.writable=!1:K.set||(K.set=()=>{throw Error("Can not rewrite read-only method '"+ne+"'")}))}))},toObjectSet:(G,K)=>{const ne={},define=G=>{G.forEach((G=>{ne[G]=!0}))};return oH(G)?define(G):define(String(G).split(K)),ne},toCamelCase:G=>G.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function replacer(G,K,ne){return K.toUpperCase()+ne})),noop:()=>{},toFiniteNumber:(G,K)=>(G=+G,Number.isFinite(G)?G:K),findKey:findKey,global:gH,isContextDefined:isContextDefined,ALPHABET:PH,generateString:(G=16,K=PH.ALPHA_DIGIT)=>{let ne="";const{length:ue}=K;for(;G--;)ne+=K[Math.random()*ue|0];return ne},isSpecCompliantForm:function isSpecCompliantForm(G){return!!(G&&fH(G.append)&&"FormData"===G[Symbol.toStringTag]&&G[Symbol.iterator])},toJSONObject:G=>{const K=new Array(10),visit=(G,ne)=>{if(isObject(G)){if(K.indexOf(G)>=0)return;if(!("toJSON"in G)){K[ne]=G;const ue=oH(G)?[]:{};return forEach(G,((G,K)=>{const pe=visit(G,ne+1);!cH(pe)&&(ue[K]=pe)})),K[ne]=void 0,ue}}return G};return visit(G,0)},isAsyncFn:SH,isThenable:G=>G&&(isObject(G)||fH(G))&&fH(G.then)&&fH(G.catch)};function AxiosError(G,K,ne,ue,pe){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=G,this.name="AxiosError",K&&(this.code=K),ne&&(this.config=ne),ue&&(this.request=ue),pe&&(this.response=pe)}IH.inherits(AxiosError,Error,{toJSON:function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:IH.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const CH=AxiosError.prototype,RH={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((G=>{RH[G]={value:G}})),Object.defineProperties(AxiosError,RH),Object.defineProperty(CH,"isAxiosError",{value:!0}),AxiosError.from=(G,K,ne,ue,pe,he)=>{const ye=Object.create(CH);return IH.toFlatObject(G,ye,(function filter(G){return G!==Error.prototype}),(G=>"isAxiosError"!==G)),AxiosError.call(ye,G.message,K,ne,ue,pe),ye.cause=G,ye.name=G.name,he&&Object.assign(ye,he),ye};function isVisitable(G){return IH.isPlainObject(G)||IH.isArray(G)}function removeBrackets(G){return IH.endsWith(G,"[]")?G.slice(0,-2):G}function renderKey(G,K,ne){return G?G.concat(K).map((function each(G,K){return G=removeBrackets(G),!ne&&K?"["+G+"]":G})).join(ne?".":""):K}const kH=IH.toFlatObject(IH,{},null,(function filter(G){return/^is[A-Z]/.test(G)}));function toFormData(G,K,ne){if(!IH.isObject(G))throw new TypeError("target must be an object");K=K||new FormData;const ue=(ne=IH.toFlatObject(ne,{metaTokens:!0,dots:!1,indexes:!1},!1,(function defined(G,K){return!IH.isUndefined(K[G])}))).metaTokens,pe=ne.visitor||defaultVisitor,he=ne.dots,ye=ne.indexes,me=(ne.Blob||"undefined"!=typeof Blob&&Blob)&&IH.isSpecCompliantForm(K);if(!IH.isFunction(pe))throw new TypeError("visitor must be a function");function convertValue(G){if(null===G)return"";if(IH.isDate(G))return G.toISOString();if(!me&&IH.isBlob(G))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return IH.isArrayBuffer(G)||IH.isTypedArray(G)?me&&"function"==typeof Blob?new Blob([G]):Buffer.from(G):G}function defaultVisitor(G,ne,pe){let me=G;if(G&&!pe&&"object"==typeof G)if(IH.endsWith(ne,"{}"))ne=ue?ne:ne.slice(0,-2),G=JSON.stringify(G);else if(IH.isArray(G)&&function isFlatArray(G){return IH.isArray(G)&&!G.some(isVisitable)}(G)||(IH.isFileList(G)||IH.endsWith(ne,"[]"))&&(me=IH.toArray(G)))return ne=removeBrackets(ne),me.forEach((function each(G,ue){!IH.isUndefined(G)&&null!==G&&K.append(!0===ye?renderKey([ne],ue,he):null===ye?ne:ne+"[]",convertValue(G))})),!1;return!!isVisitable(G)||(K.append(renderKey(pe,ne,he),convertValue(G)),!1)}const be=[],ve=Object.assign(kH,{defaultVisitor:defaultVisitor,convertValue:convertValue,isVisitable:isVisitable});if(!IH.isObject(G))throw new TypeError("data must be an object");return function build(G,ne){if(!IH.isUndefined(G)){if(-1!==be.indexOf(G))throw Error("Circular reference detected in "+ne.join("."));be.push(G),IH.forEach(G,(function each(G,ue){!0===(!(IH.isUndefined(G)||null===G)&&pe.call(K,G,IH.isString(ue)?ue.trim():ue,ne,ve))&&build(G,ne?ne.concat(ue):[ue])})),be.pop()}}(G),K}function encode$2(G){const K={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(G).replace(/[!'()~]|%20|%00/g,(function replacer(G){return K[G]}))}function AxiosURLSearchParams(G,K){this._pairs=[],G&&toFormData(G,this,K)}const OH=AxiosURLSearchParams.prototype;function encode$1(G){return encodeURIComponent(G).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(G,K,ne){if(!K)return G;const ue=ne&&ne.encode||encode$1,pe=ne&&ne.serialize;let he;if(he=pe?pe(K,ne):IH.isURLSearchParams(K)?K.toString():new AxiosURLSearchParams(K,ne).toString(ue),he){const K=G.indexOf("#");-1!==K&&(G=G.slice(0,K)),G+=(-1===G.indexOf("?")?"?":"&")+he}return G}OH.append=function append(G,K){this._pairs.push([G,K])},OH.toString=function toString(G){const K=G?function(K){return G.call(this,K,encode$2)}:encode$2;return this._pairs.map((function each(G){return K(G[0])+"="+K(G[1])}),"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(G,K,ne){return this.handlers.push({fulfilled:G,rejected:K,synchronous:!!ne&&ne.synchronous,runWhen:ne?ne.runWhen:null}),this.handlers.length-1}eject(G){this.handlers[G]&&(this.handlers[G]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(G){IH.forEach(this.handlers,(function forEachHandler(K){null!==K&&G(K)}))}}var xH={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},NH={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:AxiosURLSearchParams,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const MH="undefined"!=typeof window&&"undefined"!=typeof document,BH=(G=>MH&&["ReactNative","NativeScript","NS"].indexOf(G)<0)("undefined"!=typeof navigator&&navigator.product),FH="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var DH={...Object.freeze({__proto__:null,hasBrowserEnv:MH,hasStandardBrowserEnv:BH,hasStandardBrowserWebWorkerEnv:FH}),...NH};function formDataToJSON(G){function buildPath(G,K,ne,ue){let pe=G[ue++];if("__proto__"===pe)return!0;const he=Number.isFinite(+pe),ye=ue>=G.length;if(pe=!pe&&IH.isArray(ne)?ne.length:pe,ye)return IH.hasOwnProp(ne,pe)?ne[pe]=[ne[pe],K]:ne[pe]=K,!he;ne[pe]&&IH.isObject(ne[pe])||(ne[pe]=[]);return buildPath(G,K,ne[pe],ue)&&IH.isArray(ne[pe])&&(ne[pe]=function arrayToObject(G){const K={},ne=Object.keys(G);let ue;const pe=ne.length;let he;for(ue=0;ue<pe;ue++)he=ne[ue],K[he]=G[he];return K}(ne[pe])),!he}if(IH.isFormData(G)&&IH.isFunction(G.entries)){const K={};return IH.forEachEntry(G,((G,ne)=>{buildPath(function parsePropPath(G){return IH.matchAll(/\w+|\[(\w*)]/g,G).map((G=>"[]"===G[0]?"":G[1]||G[0]))}(G),ne,K,0)})),K}return null}const LH={transitional:xH,adapter:["xhr","http"],transformRequest:[function transformRequest(G,K){const ne=K.getContentType()||"",ue=ne.indexOf("application/json")>-1,pe=IH.isObject(G);pe&&IH.isHTMLForm(G)&&(G=new FormData(G));if(IH.isFormData(G))return ue&&ue?JSON.stringify(formDataToJSON(G)):G;if(IH.isArrayBuffer(G)||IH.isBuffer(G)||IH.isStream(G)||IH.isFile(G)||IH.isBlob(G))return G;if(IH.isArrayBufferView(G))return G.buffer;if(IH.isURLSearchParams(G))return K.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),G.toString();let he;if(pe){if(ne.indexOf("application/x-www-form-urlencoded")>-1)return function toURLEncodedForm(G,K){return toFormData(G,new DH.classes.URLSearchParams,Object.assign({visitor:function(G,K,ne,ue){return DH.isNode&&IH.isBuffer(G)?(this.append(K,G.toString("base64")),!1):ue.defaultVisitor.apply(this,arguments)}},K))}(G,this.formSerializer).toString();if((he=IH.isFileList(G))||ne.indexOf("multipart/form-data")>-1){const K=this.env&&this.env.FormData;return toFormData(he?{"files[]":G}:G,K&&new K,this.formSerializer)}}return pe||ue?(K.setContentType("application/json",!1),function stringifySafely(G,K,ne){if(IH.isString(G))try{return(K||JSON.parse)(G),IH.trim(G)}catch(G){if("SyntaxError"!==G.name)throw G}return(0,JSON.stringify)(G)}(G)):G}],transformResponse:[function transformResponse(G){const K=this.transitional||LH.transitional,ne=K&&K.forcedJSONParsing,ue="json"===this.responseType;if(G&&IH.isString(G)&&(ne&&!this.responseType||ue)){const ne=!(K&&K.silentJSONParsing)&&ue;try{return JSON.parse(G)}catch(G){if(ne){if("SyntaxError"===G.name)throw AxiosError.from(G,AxiosError.ERR_BAD_RESPONSE,this,null,this.response);throw G}}}return G}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:DH.classes.FormData,Blob:DH.classes.Blob},validateStatus:function validateStatus(G){return G>=200&&G<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};IH.forEach(["delete","get","head","post","put","patch"],(G=>{LH.headers[G]={}}));const UH=IH.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const $H=Symbol("internals");function normalizeHeader(G){return G&&String(G).trim().toLowerCase()}function normalizeValue(G){return!1===G||null==G?G:IH.isArray(G)?G.map(normalizeValue):String(G)}function matchHeaderValue(G,K,ne,ue,pe){return IH.isFunction(ue)?ue.call(this,K,ne):(pe&&(K=ne),IH.isString(K)?IH.isString(ue)?-1!==K.indexOf(ue):IH.isRegExp(ue)?ue.test(K):void 0:void 0)}class AxiosHeaders{constructor(G){G&&this.set(G)}set(G,K,ne){const ue=this;function setHeader(G,K,ne){const pe=normalizeHeader(K);if(!pe)throw new Error("header name must be a non-empty string");const he=IH.findKey(ue,pe);(!he||void 0===ue[he]||!0===ne||void 0===ne&&!1!==ue[he])&&(ue[he||K]=normalizeValue(G))}const setHeaders=(G,K)=>IH.forEach(G,((G,ne)=>setHeader(G,ne,K)));return IH.isPlainObject(G)||G instanceof this.constructor?setHeaders(G,K):IH.isString(G)&&(G=G.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(G.trim())?setHeaders((G=>{const K={};let ne,ue,pe;return G&&G.split("\n").forEach((function parser(G){pe=G.indexOf(":"),ne=G.substring(0,pe).trim().toLowerCase(),ue=G.substring(pe+1).trim(),!ne||K[ne]&&UH[ne]||("set-cookie"===ne?K[ne]?K[ne].push(ue):K[ne]=[ue]:K[ne]=K[ne]?K[ne]+", "+ue:ue)})),K})(G),K):null!=G&&setHeader(K,G,ne),this}get(G,K){if(G=normalizeHeader(G)){const ne=IH.findKey(this,G);if(ne){const G=this[ne];if(!K)return G;if(!0===K)return function parseTokens(G){const K=Object.create(null),ne=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let ue;for(;ue=ne.exec(G);)K[ue[1]]=ue[2];return K}(G);if(IH.isFunction(K))return K.call(this,G,ne);if(IH.isRegExp(K))return K.exec(G);throw new TypeError("parser must be boolean|regexp|function")}}}has(G,K){if(G=normalizeHeader(G)){const ne=IH.findKey(this,G);return!(!ne||void 0===this[ne]||K&&!matchHeaderValue(0,this[ne],ne,K))}return!1}delete(G,K){const ne=this;let ue=!1;function deleteHeader(G){if(G=normalizeHeader(G)){const pe=IH.findKey(ne,G);!pe||K&&!matchHeaderValue(0,ne[pe],pe,K)||(delete ne[pe],ue=!0)}}return IH.isArray(G)?G.forEach(deleteHeader):deleteHeader(G),ue}clear(G){const K=Object.keys(this);let ne=K.length,ue=!1;for(;ne--;){const pe=K[ne];G&&!matchHeaderValue(0,this[pe],pe,G,!0)||(delete this[pe],ue=!0)}return ue}normalize(G){const K=this,ne={};return IH.forEach(this,((ue,pe)=>{const he=IH.findKey(ne,pe);if(he)return K[he]=normalizeValue(ue),void delete K[pe];const ye=G?function formatHeader(G){return G.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((G,K,ne)=>K.toUpperCase()+ne))}(pe):String(pe).trim();ye!==pe&&delete K[pe],K[ye]=normalizeValue(ue),ne[ye]=!0})),this}concat(...G){return this.constructor.concat(this,...G)}toJSON(G){const K=Object.create(null);return IH.forEach(this,((ne,ue)=>{null!=ne&&!1!==ne&&(K[ue]=G&&IH.isArray(ne)?ne.join(", "):ne)})),K}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([G,K])=>G+": "+K)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(G){return G instanceof this?G:new this(G)}static concat(G,...K){const ne=new this(G);return K.forEach((G=>ne.set(G))),ne}static accessor(G){const K=(this[$H]=this[$H]={accessors:{}}).accessors,ne=this.prototype;function defineAccessor(G){const ue=normalizeHeader(G);K[ue]||(!function buildAccessors(G,K){const ne=IH.toCamelCase(" "+K);["get","set","has"].forEach((ue=>{Object.defineProperty(G,ue+ne,{value:function(G,ne,pe){return this[ue].call(this,K,G,ne,pe)},configurable:!0})}))}(ne,G),K[ue]=!0)}return IH.isArray(G)?G.forEach(defineAccessor):defineAccessor(G),this}}function transformData(G,K){const ne=this||LH,ue=K||ne,pe=AxiosHeaders.from(ue.headers);let he=ue.data;return IH.forEach(G,(function transform(G){he=G.call(ne,he,pe.normalize(),K?K.status:void 0)})),pe.normalize(),he}function isCancel(G){return!(!G||!G.__CANCEL__)}function CanceledError(G,K,ne){AxiosError.call(this,null==G?"canceled":G,AxiosError.ERR_CANCELED,K,ne),this.name="CanceledError"}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),IH.reduceDescriptors(AxiosHeaders.prototype,(({value:G},K)=>{let ne=K[0].toUpperCase()+K.slice(1);return{get:()=>G,set(G){this[ne]=G}}})),IH.freezeMethods(AxiosHeaders),IH.inherits(CanceledError,AxiosError,{__CANCEL__:!0});var qH=DH.hasStandardBrowserEnv?{write(G,K,ne,ue,pe,he){const ye=[G+"="+encodeURIComponent(K)];IH.isNumber(ne)&&ye.push("expires="+new Date(ne).toGMTString()),IH.isString(ue)&&ye.push("path="+ue),IH.isString(pe)&&ye.push("domain="+pe),!0===he&&ye.push("secure"),document.cookie=ye.join("; ")},read(G){const K=document.cookie.match(new RegExp("(^|;\\s*)("+G+")=([^;]*)"));return K?decodeURIComponent(K[3]):null},remove(G){this.write(G,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function buildFullPath(G,K){return G&&!function isAbsoluteURL(G){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(G)}(K)?function combineURLs(G,K){return K?G.replace(/\/?\/$/,"")+"/"+K.replace(/^\/+/,""):G}(G,K):K}var GH=DH.hasStandardBrowserEnv?function standardBrowserEnv(){const G=/(msie|trident)/i.test(navigator.userAgent),K=document.createElement("a");let ne;function resolveURL(ne){let ue=ne;return G&&(K.setAttribute("href",ue),ue=K.href),K.setAttribute("href",ue),{href:K.href,protocol:K.protocol?K.protocol.replace(/:$/,""):"",host:K.host,search:K.search?K.search.replace(/^\?/,""):"",hash:K.hash?K.hash.replace(/^#/,""):"",hostname:K.hostname,port:K.port,pathname:"/"===K.pathname.charAt(0)?K.pathname:"/"+K.pathname}}return ne=resolveURL(window.location.href),function isURLSameOrigin(G){const K=IH.isString(G)?resolveURL(G):G;return K.protocol===ne.protocol&&K.host===ne.host}}():function isURLSameOrigin(){return!0};function progressEventReducer(G,K){let ne=0;const ue=function speedometer(G,K){G=G||10;const ne=new Array(G),ue=new Array(G);let pe,he=0,ye=0;return K=void 0!==K?K:1e3,function push(me){const be=Date.now(),ve=ue[ye];pe||(pe=be),ne[he]=me,ue[he]=be;let _e=ye,Te=0;for(;_e!==he;)Te+=ne[_e++],_e%=G;if(he=(he+1)%G,he===ye&&(ye=(ye+1)%G),be-pe<K)return;const Ee=ve&&be-ve;return Ee?Math.round(1e3*Te/Ee):void 0}}(50,250);return pe=>{const he=pe.loaded,ye=pe.lengthComputable?pe.total:void 0,me=he-ne,be=ue(me);ne=he;const ve={loaded:he,total:ye,progress:ye?he/ye:void 0,bytes:me,rate:be||void 0,estimated:be&&ye&&he<=ye?(ye-he)/be:void 0,event:pe};ve[K?"download":"upload"]=!0,G(ve)}}var jH="undefined"!=typeof XMLHttpRequest&&function(G){return new Promise((function dispatchXhrRequest(K,ne){let ue=G.data;const pe=AxiosHeaders.from(G.headers).normalize();let he,ye,{responseType:me,withXSRFToken:be}=G;function done(){G.cancelToken&&G.cancelToken.unsubscribe(he),G.signal&&G.signal.removeEventListener("abort",he)}if(IH.isFormData(ue))if(DH.hasStandardBrowserEnv||DH.hasStandardBrowserWebWorkerEnv)pe.setContentType(!1);else if(!1!==(ye=pe.getContentType())){const[G,...K]=ye?ye.split(";").map((G=>G.trim())).filter(Boolean):[];pe.setContentType([G||"multipart/form-data",...K].join("; "))}let ve=new XMLHttpRequest;if(G.auth){const K=G.auth.username||"",ne=G.auth.password?unescape(encodeURIComponent(G.auth.password)):"";pe.set("Authorization","Basic "+btoa(K+":"+ne))}const _e=buildFullPath(G.baseURL,G.url);function onloadend(){if(!ve)return;const ue=AxiosHeaders.from("getAllResponseHeaders"in ve&&ve.getAllResponseHeaders());!function settle(G,K,ne){const ue=ne.config.validateStatus;ne.status&&ue&&!ue(ne.status)?K(new AxiosError("Request failed with status code "+ne.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(ne.status/100)-4],ne.config,ne.request,ne)):G(ne)}((function _resolve(G){K(G),done()}),(function _reject(G){ne(G),done()}),{data:me&&"text"!==me&&"json"!==me?ve.response:ve.responseText,status:ve.status,statusText:ve.statusText,headers:ue,config:G,request:ve}),ve=null}if(ve.open(G.method.toUpperCase(),buildURL(_e,G.params,G.paramsSerializer),!0),ve.timeout=G.timeout,"onloadend"in ve?ve.onloadend=onloadend:ve.onreadystatechange=function handleLoad(){ve&&4===ve.readyState&&(0!==ve.status||ve.responseURL&&0===ve.responseURL.indexOf("file:"))&&setTimeout(onloadend)},ve.onabort=function handleAbort(){ve&&(ne(new AxiosError("Request aborted",AxiosError.ECONNABORTED,G,ve)),ve=null)},ve.onerror=function handleError(){ne(new AxiosError("Network Error",AxiosError.ERR_NETWORK,G,ve)),ve=null},ve.ontimeout=function handleTimeout(){let K=G.timeout?"timeout of "+G.timeout+"ms exceeded":"timeout exceeded";const ue=G.transitional||xH;G.timeoutErrorMessage&&(K=G.timeoutErrorMessage),ne(new AxiosError(K,ue.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,G,ve)),ve=null},DH.hasStandardBrowserEnv&&(be&&IH.isFunction(be)&&(be=be(G)),be||!1!==be&&GH(_e))){const K=G.xsrfHeaderName&&G.xsrfCookieName&&qH.read(G.xsrfCookieName);K&&pe.set(G.xsrfHeaderName,K)}void 0===ue&&pe.setContentType(null),"setRequestHeader"in ve&&IH.forEach(pe.toJSON(),(function setRequestHeader(G,K){ve.setRequestHeader(K,G)})),IH.isUndefined(G.withCredentials)||(ve.withCredentials=!!G.withCredentials),me&&"json"!==me&&(ve.responseType=G.responseType),"function"==typeof G.onDownloadProgress&&ve.addEventListener("progress",progressEventReducer(G.onDownloadProgress,!0)),"function"==typeof G.onUploadProgress&&ve.upload&&ve.upload.addEventListener("progress",progressEventReducer(G.onUploadProgress)),(G.cancelToken||G.signal)&&(he=K=>{ve&&(ne(!K||K.type?new CanceledError(null,G,ve):K),ve.abort(),ve=null)},G.cancelToken&&G.cancelToken.subscribe(he),G.signal&&(G.signal.aborted?he():G.signal.addEventListener("abort",he)));const Te=function parseProtocol(G){const K=/^([-+\w]{1,25})(:?\/\/|:)/.exec(G);return K&&K[1]||""}(_e);Te&&-1===DH.protocols.indexOf(Te)?ne(new AxiosError("Unsupported protocol "+Te+":",AxiosError.ERR_BAD_REQUEST,G)):ve.send(ue||null)}))};const WH={http:null,xhr:jH};IH.forEach(WH,((G,K)=>{if(G){try{Object.defineProperty(G,"name",{value:K})}catch(G){}Object.defineProperty(G,"adapterName",{value:K})}}));const renderReason=G=>`- ${G}`,isResolvedHandle=G=>IH.isFunction(G)||null===G||!1===G;var adapters_getAdapter=G=>{G=IH.isArray(G)?G:[G];const{length:K}=G;let ne,ue;const pe={};for(let he=0;he<K;he++){let K;if(ne=G[he],ue=ne,!isResolvedHandle(ne)&&(ue=WH[(K=String(ne)).toLowerCase()],void 0===ue))throw new AxiosError(`Unknown adapter '${K}'`);if(ue)break;pe[K||"#"+he]=ue}if(!ue){const G=Object.entries(pe).map((([G,K])=>`adapter ${G} `+(!1===K?"is not supported by the environment":"is not available in the build")));throw new AxiosError("There is no suitable adapter to dispatch the request "+(K?G.length>1?"since :\n"+G.map(renderReason).join("\n"):" "+renderReason(G[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return ue};function throwIfCancellationRequested(G){if(G.cancelToken&&G.cancelToken.throwIfRequested(),G.signal&&G.signal.aborted)throw new CanceledError(null,G)}function dispatchRequest(G){throwIfCancellationRequested(G),G.headers=AxiosHeaders.from(G.headers),G.data=transformData.call(G,G.transformRequest),-1!==["post","put","patch"].indexOf(G.method)&&G.headers.setContentType("application/x-www-form-urlencoded",!1);return adapters_getAdapter(G.adapter||LH.adapter)(G).then((function onAdapterResolution(K){return throwIfCancellationRequested(G),K.data=transformData.call(G,G.transformResponse,K),K.headers=AxiosHeaders.from(K.headers),K}),(function onAdapterRejection(K){return isCancel(K)||(throwIfCancellationRequested(G),K&&K.response&&(K.response.data=transformData.call(G,G.transformResponse,K.response),K.response.headers=AxiosHeaders.from(K.response.headers))),Promise.reject(K)}))}const headersToObject=G=>G instanceof AxiosHeaders?G.toJSON():G;function mergeConfig(G,K){K=K||{};const ne={};function getMergedValue(G,K,ne){return IH.isPlainObject(G)&&IH.isPlainObject(K)?IH.merge.call({caseless:ne},G,K):IH.isPlainObject(K)?IH.merge({},K):IH.isArray(K)?K.slice():K}function mergeDeepProperties(G,K,ne){return IH.isUndefined(K)?IH.isUndefined(G)?void 0:getMergedValue(void 0,G,ne):getMergedValue(G,K,ne)}function valueFromConfig2(G,K){if(!IH.isUndefined(K))return getMergedValue(void 0,K)}function defaultToConfig2(G,K){return IH.isUndefined(K)?IH.isUndefined(G)?void 0:getMergedValue(void 0,G):getMergedValue(void 0,K)}function mergeDirectKeys(ne,ue,pe){return pe in K?getMergedValue(ne,ue):pe in G?getMergedValue(void 0,ne):void 0}const ue={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,withXSRFToken:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:(G,K)=>mergeDeepProperties(headersToObject(G),headersToObject(K),!0)};return IH.forEach(Object.keys(Object.assign({},G,K)),(function computeConfigValue(pe){const he=ue[pe]||mergeDeepProperties,ye=he(G[pe],K[pe],pe);IH.isUndefined(ye)&&he!==mergeDirectKeys||(ne[pe]=ye)})),ne}const zH="1.6.5",VH={};["object","boolean","number","function","string","symbol"].forEach(((G,K)=>{VH[G]=function validator(ne){return typeof ne===G||"a"+(K<1?"n ":" ")+G}}));const KH={};VH.transitional=function transitional(G,K,ne){function formatMessage(G,K){return"[Axios v1.6.5] Transitional option '"+G+"'"+K+(ne?". "+ne:"")}return(ne,ue,pe)=>{if(!1===G)throw new AxiosError(formatMessage(ue," has been removed"+(K?" in "+K:"")),AxiosError.ERR_DEPRECATED);return K&&!KH[ue]&&(KH[ue]=!0,console.warn(formatMessage(ue," has been deprecated since v"+K+" and will be removed in the near future"))),!G||G(ne,ue,pe)}};var JH={assertOptions:function assertOptions(G,K,ne){if("object"!=typeof G)throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const ue=Object.keys(G);let pe=ue.length;for(;pe-- >0;){const he=ue[pe],ye=K[he];if(ye){const K=G[he],ne=void 0===K||ye(K,he,G);if(!0!==ne)throw new AxiosError("option "+he+" must be "+ne,AxiosError.ERR_BAD_OPTION_VALUE)}else if(!0!==ne)throw new AxiosError("Unknown option "+he,AxiosError.ERR_BAD_OPTION)}},validators:VH};const XH=JH.validators;class Axios{constructor(G){this.defaults=G,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}request(G,K){"string"==typeof G?(K=K||{}).url=G:K=G||{},K=mergeConfig(this.defaults,K);const{transitional:ne,paramsSerializer:ue,headers:pe}=K;void 0!==ne&&JH.assertOptions(ne,{silentJSONParsing:XH.transitional(XH.boolean),forcedJSONParsing:XH.transitional(XH.boolean),clarifyTimeoutError:XH.transitional(XH.boolean)},!1),null!=ue&&(IH.isFunction(ue)?K.paramsSerializer={serialize:ue}:JH.assertOptions(ue,{encode:XH.function,serialize:XH.function},!0)),K.method=(K.method||this.defaults.method||"get").toLowerCase();let he=pe&&IH.merge(pe.common,pe[K.method]);pe&&IH.forEach(["delete","get","head","post","put","patch","common"],(G=>{delete pe[G]})),K.headers=AxiosHeaders.concat(he,pe);const ye=[];let me=!0;this.interceptors.request.forEach((function unshiftRequestInterceptors(G){"function"==typeof G.runWhen&&!1===G.runWhen(K)||(me=me&&G.synchronous,ye.unshift(G.fulfilled,G.rejected))}));const be=[];let ve;this.interceptors.response.forEach((function pushResponseInterceptors(G){be.push(G.fulfilled,G.rejected)}));let _e,Te=0;if(!me){const G=[dispatchRequest.bind(this),void 0];for(G.unshift.apply(G,ye),G.push.apply(G,be),_e=G.length,ve=Promise.resolve(K);Te<_e;)ve=ve.then(G[Te++],G[Te++]);return ve}_e=ye.length;let Ee=K;for(Te=0;Te<_e;){const G=ye[Te++],K=ye[Te++];try{Ee=G(Ee)}catch(G){K.call(this,G);break}}try{ve=dispatchRequest.call(this,Ee)}catch(G){return Promise.reject(G)}for(Te=0,_e=be.length;Te<_e;)ve=ve.then(be[Te++],be[Te++]);return ve}getUri(G){return buildURL(buildFullPath((G=mergeConfig(this.defaults,G)).baseURL,G.url),G.params,G.paramsSerializer)}}IH.forEach(["delete","get","head","options"],(function forEachMethodNoData(G){Axios.prototype[G]=function(K,ne){return this.request(mergeConfig(ne||{},{method:G,url:K,data:(ne||{}).data}))}})),IH.forEach(["post","put","patch"],(function forEachMethodWithData(G){function generateHTTPMethod(K){return function httpMethod(ne,ue,pe){return this.request(mergeConfig(pe||{},{method:G,headers:K?{"Content-Type":"multipart/form-data"}:{},url:ne,data:ue}))}}Axios.prototype[G]=generateHTTPMethod(),Axios.prototype[G+"Form"]=generateHTTPMethod(!0)}));class CancelToken{constructor(G){if("function"!=typeof G)throw new TypeError("executor must be a function.");let K;this.promise=new Promise((function promiseExecutor(G){K=G}));const ne=this;this.promise.then((G=>{if(!ne._listeners)return;let K=ne._listeners.length;for(;K-- >0;)ne._listeners[K](G);ne._listeners=null})),this.promise.then=G=>{let K;const ue=new Promise((G=>{ne.subscribe(G),K=G})).then(G);return ue.cancel=function reject(){ne.unsubscribe(K)},ue},G((function cancel(G,ue,pe){ne.reason||(ne.reason=new CanceledError(G,ue,pe),K(ne.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(G){this.reason?G(this.reason):this._listeners?this._listeners.push(G):this._listeners=[G]}unsubscribe(G){if(!this._listeners)return;const K=this._listeners.indexOf(G);-1!==K&&this._listeners.splice(K,1)}static source(){let G;const K=new CancelToken((function executor(K){G=K}));return{token:K,cancel:G}}}const QH={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(QH).forEach((([G,K])=>{QH[K]=G}));const ZH=function createInstance(G){const K=new Axios(G),ne=bind(Axios.prototype.request,K);return IH.extend(ne,Axios.prototype,K,{allOwnKeys:!0}),IH.extend(ne,K,null,{allOwnKeys:!0}),ne.create=function create(K){return createInstance(mergeConfig(G,K))},ne}(LH);ZH.Axios=Axios,ZH.CanceledError=CanceledError,ZH.CancelToken=CancelToken,ZH.isCancel=isCancel,ZH.VERSION=zH,ZH.toFormData=toFormData,ZH.AxiosError=AxiosError,ZH.Cancel=ZH.CanceledError,ZH.all=function all(G){return Promise.all(G)},ZH.spread=function spread(G){return function wrap(K){return G.apply(null,K)}},ZH.isAxiosError=function isAxiosError(G){return IH.isObject(G)&&!0===G.isAxiosError},ZH.mergeConfig=mergeConfig,ZH.AxiosHeaders=AxiosHeaders,ZH.formToJSON=G=>formDataToJSON(IH.isHTMLForm(G)?new FormData(G):G),ZH.getAdapter=adapters_getAdapter,ZH.HttpStatusCode=QH,ZH.default=ZH;var YH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}function getAugmentedNamespace(G){if(G.__esModule)return G;var K=G.default;if("function"==typeof K){var ne=function a(){return this instanceof a?Reflect.construct(K,arguments,this.constructor):K.apply(this,arguments)};ne.prototype=K.prototype}else ne={};return Object.defineProperty(ne,"__esModule",{value:!0}),Object.keys(G).forEach((function(K){var ue=Object.getOwnPropertyDescriptor(G,K);Object.defineProperty(ne,K,ue.get?ue:{enumerable:!0,get:function(){return G[K]}})})),ne}var eW={exports:{}},tW=getAugmentedNamespace(Object.freeze({__proto__:null,default:{}}));!function(G){!function(G,K){function assert(G,K){if(!G)throw new Error(K||"Assertion failed")}function inherits(G,K){G.super_=K;var TempCtor=function(){};TempCtor.prototype=K.prototype,G.prototype=new TempCtor,G.prototype.constructor=G}function BN(G,K,ne){if(BN.isBN(G))return G;this.negative=0,this.words=null,this.length=0,this.red=null,null!==G&&("le"!==K&&"be"!==K||(ne=K,K=10),this._init(G||0,K||10,ne||"be"))}var ne;"object"==typeof G?G.exports=BN:K.BN=BN,BN.BN=BN,BN.wordSize=26;try{ne="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:tW.Buffer}catch(G){}function parseHex4Bits(G,K){var ne=G.charCodeAt(K);return ne>=48&&ne<=57?ne-48:ne>=65&&ne<=70?ne-55:ne>=97&&ne<=102?ne-87:void assert(!1,"Invalid character in "+G)}function parseHexByte(G,K,ne){var ue=parseHex4Bits(G,ne);return ne-1>=K&&(ue|=parseHex4Bits(G,ne-1)<<4),ue}function parseBase(G,K,ne,ue){for(var pe=0,he=0,ye=Math.min(G.length,ne),me=K;me<ye;me++){var be=G.charCodeAt(me)-48;pe*=ue,he=be>=49?be-49+10:be>=17?be-17+10:be,assert(be>=0&&he<ue,"Invalid character"),pe+=he}return pe}function move(G,K){G.words=K.words,G.length=K.length,G.negative=K.negative,G.red=K.red}if(BN.isBN=function isBN(G){return G instanceof BN||null!==G&&"object"==typeof G&&G.constructor.wordSize===BN.wordSize&&Array.isArray(G.words)},BN.max=function max(G,K){return G.cmp(K)>0?G:K},BN.min=function min(G,K){return G.cmp(K)<0?G:K},BN.prototype._init=function init(G,K,ne){if("number"==typeof G)return this._initNumber(G,K,ne);if("object"==typeof G)return this._initArray(G,K,ne);"hex"===K&&(K=16),assert(K===(0|K)&&K>=2&&K<=36);var ue=0;"-"===(G=G.toString().replace(/\s+/g,""))[0]&&(ue++,this.negative=1),ue<G.length&&(16===K?this._parseHex(G,ue,ne):(this._parseBase(G,K,ue),"le"===ne&&this._initArray(this.toArray(),K,ne)))},BN.prototype._initNumber=function _initNumber(G,K,ne){G<0&&(this.negative=1,G=-G),G<67108864?(this.words=[67108863&G],this.length=1):G<4503599627370496?(this.words=[67108863&G,G/67108864&67108863],this.length=2):(assert(G<9007199254740992),this.words=[67108863&G,G/67108864&67108863,1],this.length=3),"le"===ne&&this._initArray(this.toArray(),K,ne)},BN.prototype._initArray=function _initArray(G,K,ne){if(assert("number"==typeof G.length),G.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(G.length/3),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he,ye=0;if("be"===ne)for(ue=G.length-1,pe=0;ue>=0;ue-=3)he=G[ue]|G[ue-1]<<8|G[ue-2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);else if("le"===ne)for(ue=0,pe=0;ue<G.length;ue+=3)he=G[ue]|G[ue+1]<<8|G[ue+2]<<16,this.words[pe]|=he<<ye&67108863,this.words[pe+1]=he>>>26-ye&67108863,(ye+=24)>=26&&(ye-=26,pe++);return this._strip()},BN.prototype._parseHex=function _parseHex(G,K,ne){this.length=Math.ceil((G.length-K)/6),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var pe,he=0,ye=0;if("be"===ne)for(ue=G.length-1;ue>=K;ue-=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;else for(ue=(G.length-K)%2==0?K+1:K;ue<G.length;ue+=2)pe=parseHexByte(G,K,ue)<<he,this.words[ye]|=67108863&pe,he>=18?(he-=18,ye+=1,this.words[ye]|=pe>>>26):he+=8;this._strip()},BN.prototype._parseBase=function _parseBase(G,K,ne){this.words=[0],this.length=1;for(var ue=0,pe=1;pe<=67108863;pe*=K)ue++;ue--,pe=pe/K|0;for(var he=G.length-ne,ye=he%ue,me=Math.min(he,he-ye)+ne,be=0,ve=ne;ve<me;ve+=ue)be=parseBase(G,ve,ve+ue,K),this.imuln(pe),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be);if(0!==ye){var _e=1;for(be=parseBase(G,ve,G.length,K),ve=0;ve<ye;ve++)_e*=K;this.imuln(_e),this.words[0]+be<67108864?this.words[0]+=be:this._iaddn(be)}this._strip()},BN.prototype.copy=function copy(G){G.words=new Array(this.length);for(var K=0;K<this.length;K++)G.words[K]=this.words[K];G.length=this.length,G.negative=this.negative,G.red=this.red},BN.prototype._move=function _move(G){move(G,this)},BN.prototype.clone=function clone(){var G=new BN(null);return this.copy(G),G},BN.prototype._expand=function _expand(G){for(;this.length<G;)this.words[this.length++]=0;return this},BN.prototype._strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(G){BN.prototype.inspect=inspect}else BN.prototype.inspect=inspect;function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var ue=["","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"],pe=[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],he=[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];BN.prototype.toString=function toString(G,K){var ne;if(K=0|K||1,16===(G=G||10)||"hex"===G){ne="";for(var ye=0,me=0,be=0;be<this.length;be++){var ve=this.words[be],_e=(16777215&(ve<<ye|me)).toString(16);me=ve>>>24-ye&16777215,(ye+=2)>=26&&(ye-=26,be--),ne=0!==me||be!==this.length-1?ue[6-_e.length]+_e+ne:_e+ne}for(0!==me&&(ne=me.toString(16)+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}if(G===(0|G)&&G>=2&&G<=36){var Te=pe[G],Ee=he[G];ne="";var Pe=this.clone();for(Pe.negative=0;!Pe.isZero();){var Se=Pe.modrn(Ee).toString(G);ne=(Pe=Pe.idivn(Ee)).isZero()?Se+ne:ue[Te-Se.length]+Se+ne}for(this.isZero()&&(ne="0"+ne);ne.length%K!=0;)ne="0"+ne;return 0!==this.negative&&(ne="-"+ne),ne}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var G=this.words[0];return 2===this.length?G+=67108864*this.words[1]:3===this.length&&1===this.words[2]?G+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-G:G},BN.prototype.toJSON=function toJSON(){return this.toString(16,2)},ne&&(BN.prototype.toBuffer=function toBuffer(G,K){return this.toArrayLike(ne,G,K)}),BN.prototype.toArray=function toArray(G,K){return this.toArrayLike(Array,G,K)};function smallMulTo(G,K,ne){ne.negative=K.negative^G.negative;var ue=G.length+K.length|0;ne.length=ue,ue=ue-1|0;var pe=0|G.words[0],he=0|K.words[0],ye=pe*he,me=67108863&ye,be=ye/67108864|0;ne.words[0]=me;for(var ve=1;ve<ue;ve++){for(var _e=be>>>26,Te=67108863&be,Ee=Math.min(ve,K.length-1),Pe=Math.max(0,ve-G.length+1);Pe<=Ee;Pe++){var Se=ve-Pe|0;_e+=(ye=(pe=0|G.words[Se])*(he=0|K.words[Pe])+Te)/67108864|0,Te=67108863&ye}ne.words[ve]=0|Te,be=0|_e}return 0!==be?ne.words[ve]=0|be:ne.length--,ne._strip()}BN.prototype.toArrayLike=function toArrayLike(G,K,ne){this._strip();var ue=this.byteLength(),pe=ne||Math.max(1,ue);assert(ue<=pe,"byte array longer than desired length"),assert(pe>0,"Requested array length <= 0");var he=function allocate(G,K){return G.allocUnsafe?G.allocUnsafe(K):new G(K)}(G,pe);return this["_toArrayLike"+("le"===K?"LE":"BE")](he,ue),he},BN.prototype._toArrayLikeLE=function _toArrayLikeLE(G,K){for(var ne=0,ue=0,pe=0,he=0;pe<this.length;pe++){var ye=this.words[pe]<<he|ue;G[ne++]=255&ye,ne<G.length&&(G[ne++]=ye>>8&255),ne<G.length&&(G[ne++]=ye>>16&255),6===he?(ne<G.length&&(G[ne++]=ye>>24&255),ue=0,he=0):(ue=ye>>>24,he+=2)}if(ne<G.length)for(G[ne++]=ue;ne<G.length;)G[ne++]=0},BN.prototype._toArrayLikeBE=function _toArrayLikeBE(G,K){for(var ne=G.length-1,ue=0,pe=0,he=0;pe<this.length;pe++){var ye=this.words[pe]<<he|ue;G[ne--]=255&ye,ne>=0&&(G[ne--]=ye>>8&255),ne>=0&&(G[ne--]=ye>>16&255),6===he?(ne>=0&&(G[ne--]=ye>>24&255),ue=0,he=0):(ue=ye>>>24,he+=2)}if(ne>=0)for(G[ne--]=ue;ne>=0;)G[ne--]=0},Math.clz32?BN.prototype._countBits=function _countBits(G){return 32-Math.clz32(G)}:BN.prototype._countBits=function _countBits(G){var K=G,ne=0;return K>=4096&&(ne+=13,K>>>=13),K>=64&&(ne+=7,K>>>=7),K>=8&&(ne+=4,K>>>=4),K>=2&&(ne+=2,K>>>=2),ne+K},BN.prototype._zeroBits=function _zeroBits(G){if(0===G)return 26;var K=G,ne=0;return 0==(8191&K)&&(ne+=13,K>>>=13),0==(127&K)&&(ne+=7,K>>>=7),0==(15&K)&&(ne+=4,K>>>=4),0==(3&K)&&(ne+=2,K>>>=2),0==(1&K)&&ne++,ne},BN.prototype.bitLength=function bitLength(){var G=this.words[this.length-1],K=this._countBits(G);return 26*(this.length-1)+K},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var G=0,K=0;K<this.length;K++){var ne=this._zeroBits(this.words[K]);if(G+=ne,26!==ne)break}return G},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(G){return 0!==this.negative?this.abs().inotn(G).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(G){return this.testn(G-1)?this.notn(G).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(G){for(;this.length<G.length;)this.words[this.length++]=0;for(var K=0;K<G.length;K++)this.words[K]=this.words[K]|G.words[K];return this._strip()},BN.prototype.ior=function ior(G){return assert(0==(this.negative|G.negative)),this.iuor(G)},BN.prototype.or=function or(G){return this.length>G.length?this.clone().ior(G):G.clone().ior(this)},BN.prototype.uor=function uor(G){return this.length>G.length?this.clone().iuor(G):G.clone().iuor(this)},BN.prototype.iuand=function iuand(G){var K;K=this.length>G.length?G:this;for(var ne=0;ne<K.length;ne++)this.words[ne]=this.words[ne]&G.words[ne];return this.length=K.length,this._strip()},BN.prototype.iand=function iand(G){return assert(0==(this.negative|G.negative)),this.iuand(G)},BN.prototype.and=function and(G){return this.length>G.length?this.clone().iand(G):G.clone().iand(this)},BN.prototype.uand=function uand(G){return this.length>G.length?this.clone().iuand(G):G.clone().iuand(this)},BN.prototype.iuxor=function iuxor(G){var K,ne;this.length>G.length?(K=this,ne=G):(K=G,ne=this);for(var ue=0;ue<ne.length;ue++)this.words[ue]=K.words[ue]^ne.words[ue];if(this!==K)for(;ue<K.length;ue++)this.words[ue]=K.words[ue];return this.length=K.length,this._strip()},BN.prototype.ixor=function ixor(G){return assert(0==(this.negative|G.negative)),this.iuxor(G)},BN.prototype.xor=function xor(G){return this.length>G.length?this.clone().ixor(G):G.clone().ixor(this)},BN.prototype.uxor=function uxor(G){return this.length>G.length?this.clone().iuxor(G):G.clone().iuxor(this)},BN.prototype.inotn=function inotn(G){assert("number"==typeof G&&G>=0);var K=0|Math.ceil(G/26),ne=G%26;this._expand(K),ne>0&&K--;for(var ue=0;ue<K;ue++)this.words[ue]=67108863&~this.words[ue];return ne>0&&(this.words[ue]=~this.words[ue]&67108863>>26-ne),this._strip()},BN.prototype.notn=function notn(G){return this.clone().inotn(G)},BN.prototype.setn=function setn(G,K){assert("number"==typeof G&&G>=0);var ne=G/26|0,ue=G%26;return this._expand(ne+1),this.words[ne]=K?this.words[ne]|1<<ue:this.words[ne]&~(1<<ue),this._strip()},BN.prototype.iadd=function iadd(G){var K,ne,ue;if(0!==this.negative&&0===G.negative)return this.negative=0,K=this.isub(G),this.negative^=1,this._normSign();if(0===this.negative&&0!==G.negative)return G.negative=0,K=this.isub(G),G.negative=1,K._normSign();this.length>G.length?(ne=this,ue=G):(ne=G,ue=this);for(var pe=0,he=0;he<ue.length;he++)K=(0|ne.words[he])+(0|ue.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;for(;0!==pe&&he<ne.length;he++)K=(0|ne.words[he])+pe,this.words[he]=67108863&K,pe=K>>>26;if(this.length=ne.length,0!==pe)this.words[this.length]=pe,this.length++;else if(ne!==this)for(;he<ne.length;he++)this.words[he]=ne.words[he];return this},BN.prototype.add=function add(G){var K;return 0!==G.negative&&0===this.negative?(G.negative=0,K=this.sub(G),G.negative^=1,K):0===G.negative&&0!==this.negative?(this.negative=0,K=G.sub(this),this.negative=1,K):this.length>G.length?this.clone().iadd(G):G.clone().iadd(this)},BN.prototype.isub=function isub(G){if(0!==G.negative){G.negative=0;var K=this.iadd(G);return G.negative=1,K._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(G),this.negative=1,this._normSign();var ne,ue,pe=this.cmp(G);if(0===pe)return this.negative=0,this.length=1,this.words[0]=0,this;pe>0?(ne=this,ue=G):(ne=G,ue=this);for(var he=0,ye=0;ye<ue.length;ye++)he=(K=(0|ne.words[ye])-(0|ue.words[ye])+he)>>26,this.words[ye]=67108863&K;for(;0!==he&&ye<ne.length;ye++)he=(K=(0|ne.words[ye])+he)>>26,this.words[ye]=67108863&K;if(0===he&&ye<ne.length&&ne!==this)for(;ye<ne.length;ye++)this.words[ye]=ne.words[ye];return this.length=Math.max(this.length,ye),ne!==this&&(this.negative=1),this._strip()},BN.prototype.sub=function sub(G){return this.clone().isub(G)};var ye=function comb10MulTo(G,K,ne){var ue,pe,he,ye=G.words,me=K.words,be=ne.words,ve=0,_e=0|ye[0],Te=8191&_e,Ee=_e>>>13,Pe=0|ye[1],Se=8191&Pe,Ce=Pe>>>13,ke=0|ye[2],Oe=8191&ke,xe=ke>>>13,Ne=0|ye[3],Me=8191&Ne,Be=Ne>>>13,Fe=0|ye[4],De=8191&Fe,Le=Fe>>>13,Ue=0|ye[5],je=8191&Ue,ze=Ue>>>13,Je=0|ye[6],Xe=8191&Je,Qe=Je>>>13,Ye=0|ye[7],et=8191&Ye,tt=Ye>>>13,rt=0|ye[8],nt=8191&rt,at=rt>>>13,it=0|ye[9],ot=8191&it,ct=it>>>13,dt=0|me[0],ut=8191&dt,ft=dt>>>13,yt=0|me[1],wt=8191&yt,At=yt>>>13,St=0|me[2],kt=8191&St,Bt=St>>>13,Lt=0|me[3],Ut=8191&Lt,$t=Lt>>>13,Ht=0|me[4],Vt=8191&Ht,er=Ht>>>13,tr=0|me[5],rr=8191&tr,cr=tr>>>13,dr=0|me[6],Rr=8191&dr,kr=dr>>>13,$r=0|me[7],qr=8191&$r,Hr=$r>>>13,Vr=0|me[8],Zr=8191&Vr,en=Vr>>>13,tn=0|me[9],an=8191&tn,sn=tn>>>13;ne.negative=G.negative^K.negative,ne.length=19;var un=(ve+(ue=Math.imul(Te,ut))|0)+((8191&(pe=(pe=Math.imul(Te,ft))+Math.imul(Ee,ut)|0))<<13)|0;ve=((he=Math.imul(Ee,ft))+(pe>>>13)|0)+(un>>>26)|0,un&=67108863,ue=Math.imul(Se,ut),pe=(pe=Math.imul(Se,ft))+Math.imul(Ce,ut)|0,he=Math.imul(Ce,ft);var fn=(ve+(ue=ue+Math.imul(Te,wt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,At)|0)+Math.imul(Ee,wt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,At)|0)+(pe>>>13)|0)+(fn>>>26)|0,fn&=67108863,ue=Math.imul(Oe,ut),pe=(pe=Math.imul(Oe,ft))+Math.imul(xe,ut)|0,he=Math.imul(xe,ft),ue=ue+Math.imul(Se,wt)|0,pe=(pe=pe+Math.imul(Se,At)|0)+Math.imul(Ce,wt)|0,he=he+Math.imul(Ce,At)|0;var pn=(ve+(ue=ue+Math.imul(Te,kt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Bt)|0)+Math.imul(Ee,kt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Bt)|0)+(pe>>>13)|0)+(pn>>>26)|0,pn&=67108863,ue=Math.imul(Me,ut),pe=(pe=Math.imul(Me,ft))+Math.imul(Be,ut)|0,he=Math.imul(Be,ft),ue=ue+Math.imul(Oe,wt)|0,pe=(pe=pe+Math.imul(Oe,At)|0)+Math.imul(xe,wt)|0,he=he+Math.imul(xe,At)|0,ue=ue+Math.imul(Se,kt)|0,pe=(pe=pe+Math.imul(Se,Bt)|0)+Math.imul(Ce,kt)|0,he=he+Math.imul(Ce,Bt)|0;var hn=(ve+(ue=ue+Math.imul(Te,Ut)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,$t)|0)+Math.imul(Ee,Ut)|0))<<13)|0;ve=((he=he+Math.imul(Ee,$t)|0)+(pe>>>13)|0)+(hn>>>26)|0,hn&=67108863,ue=Math.imul(De,ut),pe=(pe=Math.imul(De,ft))+Math.imul(Le,ut)|0,he=Math.imul(Le,ft),ue=ue+Math.imul(Me,wt)|0,pe=(pe=pe+Math.imul(Me,At)|0)+Math.imul(Be,wt)|0,he=he+Math.imul(Be,At)|0,ue=ue+Math.imul(Oe,kt)|0,pe=(pe=pe+Math.imul(Oe,Bt)|0)+Math.imul(xe,kt)|0,he=he+Math.imul(xe,Bt)|0,ue=ue+Math.imul(Se,Ut)|0,pe=(pe=pe+Math.imul(Se,$t)|0)+Math.imul(Ce,Ut)|0,he=he+Math.imul(Ce,$t)|0;var yn=(ve+(ue=ue+Math.imul(Te,Vt)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,er)|0)+Math.imul(Ee,Vt)|0))<<13)|0;ve=((he=he+Math.imul(Ee,er)|0)+(pe>>>13)|0)+(yn>>>26)|0,yn&=67108863,ue=Math.imul(je,ut),pe=(pe=Math.imul(je,ft))+Math.imul(ze,ut)|0,he=Math.imul(ze,ft),ue=ue+Math.imul(De,wt)|0,pe=(pe=pe+Math.imul(De,At)|0)+Math.imul(Le,wt)|0,he=he+Math.imul(Le,At)|0,ue=ue+Math.imul(Me,kt)|0,pe=(pe=pe+Math.imul(Me,Bt)|0)+Math.imul(Be,kt)|0,he=he+Math.imul(Be,Bt)|0,ue=ue+Math.imul(Oe,Ut)|0,pe=(pe=pe+Math.imul(Oe,$t)|0)+Math.imul(xe,Ut)|0,he=he+Math.imul(xe,$t)|0,ue=ue+Math.imul(Se,Vt)|0,pe=(pe=pe+Math.imul(Se,er)|0)+Math.imul(Ce,Vt)|0,he=he+Math.imul(Ce,er)|0;var mn=(ve+(ue=ue+Math.imul(Te,rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,cr)|0)+Math.imul(Ee,rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,cr)|0)+(pe>>>13)|0)+(mn>>>26)|0,mn&=67108863,ue=Math.imul(Xe,ut),pe=(pe=Math.imul(Xe,ft))+Math.imul(Qe,ut)|0,he=Math.imul(Qe,ft),ue=ue+Math.imul(je,wt)|0,pe=(pe=pe+Math.imul(je,At)|0)+Math.imul(ze,wt)|0,he=he+Math.imul(ze,At)|0,ue=ue+Math.imul(De,kt)|0,pe=(pe=pe+Math.imul(De,Bt)|0)+Math.imul(Le,kt)|0,he=he+Math.imul(Le,Bt)|0,ue=ue+Math.imul(Me,Ut)|0,pe=(pe=pe+Math.imul(Me,$t)|0)+Math.imul(Be,Ut)|0,he=he+Math.imul(Be,$t)|0,ue=ue+Math.imul(Oe,Vt)|0,pe=(pe=pe+Math.imul(Oe,er)|0)+Math.imul(xe,Vt)|0,he=he+Math.imul(xe,er)|0,ue=ue+Math.imul(Se,rr)|0,pe=(pe=pe+Math.imul(Se,cr)|0)+Math.imul(Ce,rr)|0,he=he+Math.imul(Ce,cr)|0;var bn=(ve+(ue=ue+Math.imul(Te,Rr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,kr)|0)+Math.imul(Ee,Rr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,kr)|0)+(pe>>>13)|0)+(bn>>>26)|0,bn&=67108863,ue=Math.imul(et,ut),pe=(pe=Math.imul(et,ft))+Math.imul(tt,ut)|0,he=Math.imul(tt,ft),ue=ue+Math.imul(Xe,wt)|0,pe=(pe=pe+Math.imul(Xe,At)|0)+Math.imul(Qe,wt)|0,he=he+Math.imul(Qe,At)|0,ue=ue+Math.imul(je,kt)|0,pe=(pe=pe+Math.imul(je,Bt)|0)+Math.imul(ze,kt)|0,he=he+Math.imul(ze,Bt)|0,ue=ue+Math.imul(De,Ut)|0,pe=(pe=pe+Math.imul(De,$t)|0)+Math.imul(Le,Ut)|0,he=he+Math.imul(Le,$t)|0,ue=ue+Math.imul(Me,Vt)|0,pe=(pe=pe+Math.imul(Me,er)|0)+Math.imul(Be,Vt)|0,he=he+Math.imul(Be,er)|0,ue=ue+Math.imul(Oe,rr)|0,pe=(pe=pe+Math.imul(Oe,cr)|0)+Math.imul(xe,rr)|0,he=he+Math.imul(xe,cr)|0,ue=ue+Math.imul(Se,Rr)|0,pe=(pe=pe+Math.imul(Se,kr)|0)+Math.imul(Ce,Rr)|0,he=he+Math.imul(Ce,kr)|0;var gn=(ve+(ue=ue+Math.imul(Te,qr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,Hr)|0)+Math.imul(Ee,qr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,Hr)|0)+(pe>>>13)|0)+(gn>>>26)|0,gn&=67108863,ue=Math.imul(nt,ut),pe=(pe=Math.imul(nt,ft))+Math.imul(at,ut)|0,he=Math.imul(at,ft),ue=ue+Math.imul(et,wt)|0,pe=(pe=pe+Math.imul(et,At)|0)+Math.imul(tt,wt)|0,he=he+Math.imul(tt,At)|0,ue=ue+Math.imul(Xe,kt)|0,pe=(pe=pe+Math.imul(Xe,Bt)|0)+Math.imul(Qe,kt)|0,he=he+Math.imul(Qe,Bt)|0,ue=ue+Math.imul(je,Ut)|0,pe=(pe=pe+Math.imul(je,$t)|0)+Math.imul(ze,Ut)|0,he=he+Math.imul(ze,$t)|0,ue=ue+Math.imul(De,Vt)|0,pe=(pe=pe+Math.imul(De,er)|0)+Math.imul(Le,Vt)|0,he=he+Math.imul(Le,er)|0,ue=ue+Math.imul(Me,rr)|0,pe=(pe=pe+Math.imul(Me,cr)|0)+Math.imul(Be,rr)|0,he=he+Math.imul(Be,cr)|0,ue=ue+Math.imul(Oe,Rr)|0,pe=(pe=pe+Math.imul(Oe,kr)|0)+Math.imul(xe,Rr)|0,he=he+Math.imul(xe,kr)|0,ue=ue+Math.imul(Se,qr)|0,pe=(pe=pe+Math.imul(Se,Hr)|0)+Math.imul(Ce,qr)|0,he=he+Math.imul(Ce,Hr)|0;var vn=(ve+(ue=ue+Math.imul(Te,Zr)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,en)|0)+Math.imul(Ee,Zr)|0))<<13)|0;ve=((he=he+Math.imul(Ee,en)|0)+(pe>>>13)|0)+(vn>>>26)|0,vn&=67108863,ue=Math.imul(ot,ut),pe=(pe=Math.imul(ot,ft))+Math.imul(ct,ut)|0,he=Math.imul(ct,ft),ue=ue+Math.imul(nt,wt)|0,pe=(pe=pe+Math.imul(nt,At)|0)+Math.imul(at,wt)|0,he=he+Math.imul(at,At)|0,ue=ue+Math.imul(et,kt)|0,pe=(pe=pe+Math.imul(et,Bt)|0)+Math.imul(tt,kt)|0,he=he+Math.imul(tt,Bt)|0,ue=ue+Math.imul(Xe,Ut)|0,pe=(pe=pe+Math.imul(Xe,$t)|0)+Math.imul(Qe,Ut)|0,he=he+Math.imul(Qe,$t)|0,ue=ue+Math.imul(je,Vt)|0,pe=(pe=pe+Math.imul(je,er)|0)+Math.imul(ze,Vt)|0,he=he+Math.imul(ze,er)|0,ue=ue+Math.imul(De,rr)|0,pe=(pe=pe+Math.imul(De,cr)|0)+Math.imul(Le,rr)|0,he=he+Math.imul(Le,cr)|0,ue=ue+Math.imul(Me,Rr)|0,pe=(pe=pe+Math.imul(Me,kr)|0)+Math.imul(Be,Rr)|0,he=he+Math.imul(Be,kr)|0,ue=ue+Math.imul(Oe,qr)|0,pe=(pe=pe+Math.imul(Oe,Hr)|0)+Math.imul(xe,qr)|0,he=he+Math.imul(xe,Hr)|0,ue=ue+Math.imul(Se,Zr)|0,pe=(pe=pe+Math.imul(Se,en)|0)+Math.imul(Ce,Zr)|0,he=he+Math.imul(Ce,en)|0;var Tn=(ve+(ue=ue+Math.imul(Te,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Te,sn)|0)+Math.imul(Ee,an)|0))<<13)|0;ve=((he=he+Math.imul(Ee,sn)|0)+(pe>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ue=Math.imul(ot,wt),pe=(pe=Math.imul(ot,At))+Math.imul(ct,wt)|0,he=Math.imul(ct,At),ue=ue+Math.imul(nt,kt)|0,pe=(pe=pe+Math.imul(nt,Bt)|0)+Math.imul(at,kt)|0,he=he+Math.imul(at,Bt)|0,ue=ue+Math.imul(et,Ut)|0,pe=(pe=pe+Math.imul(et,$t)|0)+Math.imul(tt,Ut)|0,he=he+Math.imul(tt,$t)|0,ue=ue+Math.imul(Xe,Vt)|0,pe=(pe=pe+Math.imul(Xe,er)|0)+Math.imul(Qe,Vt)|0,he=he+Math.imul(Qe,er)|0,ue=ue+Math.imul(je,rr)|0,pe=(pe=pe+Math.imul(je,cr)|0)+Math.imul(ze,rr)|0,he=he+Math.imul(ze,cr)|0,ue=ue+Math.imul(De,Rr)|0,pe=(pe=pe+Math.imul(De,kr)|0)+Math.imul(Le,Rr)|0,he=he+Math.imul(Le,kr)|0,ue=ue+Math.imul(Me,qr)|0,pe=(pe=pe+Math.imul(Me,Hr)|0)+Math.imul(Be,qr)|0,he=he+Math.imul(Be,Hr)|0,ue=ue+Math.imul(Oe,Zr)|0,pe=(pe=pe+Math.imul(Oe,en)|0)+Math.imul(xe,Zr)|0,he=he+Math.imul(xe,en)|0;var En=(ve+(ue=ue+Math.imul(Se,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Se,sn)|0)+Math.imul(Ce,an)|0))<<13)|0;ve=((he=he+Math.imul(Ce,sn)|0)+(pe>>>13)|0)+(En>>>26)|0,En&=67108863,ue=Math.imul(ot,kt),pe=(pe=Math.imul(ot,Bt))+Math.imul(ct,kt)|0,he=Math.imul(ct,Bt),ue=ue+Math.imul(nt,Ut)|0,pe=(pe=pe+Math.imul(nt,$t)|0)+Math.imul(at,Ut)|0,he=he+Math.imul(at,$t)|0,ue=ue+Math.imul(et,Vt)|0,pe=(pe=pe+Math.imul(et,er)|0)+Math.imul(tt,Vt)|0,he=he+Math.imul(tt,er)|0,ue=ue+Math.imul(Xe,rr)|0,pe=(pe=pe+Math.imul(Xe,cr)|0)+Math.imul(Qe,rr)|0,he=he+Math.imul(Qe,cr)|0,ue=ue+Math.imul(je,Rr)|0,pe=(pe=pe+Math.imul(je,kr)|0)+Math.imul(ze,Rr)|0,he=he+Math.imul(ze,kr)|0,ue=ue+Math.imul(De,qr)|0,pe=(pe=pe+Math.imul(De,Hr)|0)+Math.imul(Le,qr)|0,he=he+Math.imul(Le,Hr)|0,ue=ue+Math.imul(Me,Zr)|0,pe=(pe=pe+Math.imul(Me,en)|0)+Math.imul(Be,Zr)|0,he=he+Math.imul(Be,en)|0;var In=(ve+(ue=ue+Math.imul(Oe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Oe,sn)|0)+Math.imul(xe,an)|0))<<13)|0;ve=((he=he+Math.imul(xe,sn)|0)+(pe>>>13)|0)+(In>>>26)|0,In&=67108863,ue=Math.imul(ot,Ut),pe=(pe=Math.imul(ot,$t))+Math.imul(ct,Ut)|0,he=Math.imul(ct,$t),ue=ue+Math.imul(nt,Vt)|0,pe=(pe=pe+Math.imul(nt,er)|0)+Math.imul(at,Vt)|0,he=he+Math.imul(at,er)|0,ue=ue+Math.imul(et,rr)|0,pe=(pe=pe+Math.imul(et,cr)|0)+Math.imul(tt,rr)|0,he=he+Math.imul(tt,cr)|0,ue=ue+Math.imul(Xe,Rr)|0,pe=(pe=pe+Math.imul(Xe,kr)|0)+Math.imul(Qe,Rr)|0,he=he+Math.imul(Qe,kr)|0,ue=ue+Math.imul(je,qr)|0,pe=(pe=pe+Math.imul(je,Hr)|0)+Math.imul(ze,qr)|0,he=he+Math.imul(ze,Hr)|0,ue=ue+Math.imul(De,Zr)|0,pe=(pe=pe+Math.imul(De,en)|0)+Math.imul(Le,Zr)|0,he=he+Math.imul(Le,en)|0;var Rn=(ve+(ue=ue+Math.imul(Me,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Me,sn)|0)+Math.imul(Be,an)|0))<<13)|0;ve=((he=he+Math.imul(Be,sn)|0)+(pe>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,ue=Math.imul(ot,Vt),pe=(pe=Math.imul(ot,er))+Math.imul(ct,Vt)|0,he=Math.imul(ct,er),ue=ue+Math.imul(nt,rr)|0,pe=(pe=pe+Math.imul(nt,cr)|0)+Math.imul(at,rr)|0,he=he+Math.imul(at,cr)|0,ue=ue+Math.imul(et,Rr)|0,pe=(pe=pe+Math.imul(et,kr)|0)+Math.imul(tt,Rr)|0,he=he+Math.imul(tt,kr)|0,ue=ue+Math.imul(Xe,qr)|0,pe=(pe=pe+Math.imul(Xe,Hr)|0)+Math.imul(Qe,qr)|0,he=he+Math.imul(Qe,Hr)|0,ue=ue+Math.imul(je,Zr)|0,pe=(pe=pe+Math.imul(je,en)|0)+Math.imul(ze,Zr)|0,he=he+Math.imul(ze,en)|0;var Nn=(ve+(ue=ue+Math.imul(De,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(De,sn)|0)+Math.imul(Le,an)|0))<<13)|0;ve=((he=he+Math.imul(Le,sn)|0)+(pe>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,ue=Math.imul(ot,rr),pe=(pe=Math.imul(ot,cr))+Math.imul(ct,rr)|0,he=Math.imul(ct,cr),ue=ue+Math.imul(nt,Rr)|0,pe=(pe=pe+Math.imul(nt,kr)|0)+Math.imul(at,Rr)|0,he=he+Math.imul(at,kr)|0,ue=ue+Math.imul(et,qr)|0,pe=(pe=pe+Math.imul(et,Hr)|0)+Math.imul(tt,qr)|0,he=he+Math.imul(tt,Hr)|0,ue=ue+Math.imul(Xe,Zr)|0,pe=(pe=pe+Math.imul(Xe,en)|0)+Math.imul(Qe,Zr)|0,he=he+Math.imul(Qe,en)|0;var Bn=(ve+(ue=ue+Math.imul(je,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(je,sn)|0)+Math.imul(ze,an)|0))<<13)|0;ve=((he=he+Math.imul(ze,sn)|0)+(pe>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,ue=Math.imul(ot,Rr),pe=(pe=Math.imul(ot,kr))+Math.imul(ct,Rr)|0,he=Math.imul(ct,kr),ue=ue+Math.imul(nt,qr)|0,pe=(pe=pe+Math.imul(nt,Hr)|0)+Math.imul(at,qr)|0,he=he+Math.imul(at,Hr)|0,ue=ue+Math.imul(et,Zr)|0,pe=(pe=pe+Math.imul(et,en)|0)+Math.imul(tt,Zr)|0,he=he+Math.imul(tt,en)|0;var Fn=(ve+(ue=ue+Math.imul(Xe,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(Xe,sn)|0)+Math.imul(Qe,an)|0))<<13)|0;ve=((he=he+Math.imul(Qe,sn)|0)+(pe>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,ue=Math.imul(ot,qr),pe=(pe=Math.imul(ot,Hr))+Math.imul(ct,qr)|0,he=Math.imul(ct,Hr),ue=ue+Math.imul(nt,Zr)|0,pe=(pe=pe+Math.imul(nt,en)|0)+Math.imul(at,Zr)|0,he=he+Math.imul(at,en)|0;var Dn=(ve+(ue=ue+Math.imul(et,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(et,sn)|0)+Math.imul(tt,an)|0))<<13)|0;ve=((he=he+Math.imul(tt,sn)|0)+(pe>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,ue=Math.imul(ot,Zr),pe=(pe=Math.imul(ot,en))+Math.imul(ct,Zr)|0,he=Math.imul(ct,en);var Un=(ve+(ue=ue+Math.imul(nt,an)|0)|0)+((8191&(pe=(pe=pe+Math.imul(nt,sn)|0)+Math.imul(at,an)|0))<<13)|0;ve=((he=he+Math.imul(at,sn)|0)+(pe>>>13)|0)+(Un>>>26)|0,Un&=67108863;var $n=(ve+(ue=Math.imul(ot,an))|0)+((8191&(pe=(pe=Math.imul(ot,sn))+Math.imul(ct,an)|0))<<13)|0;return ve=((he=Math.imul(ct,sn))+(pe>>>13)|0)+($n>>>26)|0,$n&=67108863,be[0]=un,be[1]=fn,be[2]=pn,be[3]=hn,be[4]=yn,be[5]=mn,be[6]=bn,be[7]=gn,be[8]=vn,be[9]=Tn,be[10]=En,be[11]=In,be[12]=Rn,be[13]=Nn,be[14]=Bn,be[15]=Fn,be[16]=Dn,be[17]=Un,be[18]=$n,0!==ve&&(be[19]=ve,ne.length++),ne};function bigMulTo(G,K,ne){ne.negative=K.negative^G.negative,ne.length=G.length+K.length;for(var ue=0,pe=0,he=0;he<ne.length-1;he++){var ye=pe;pe=0;for(var me=67108863&ue,be=Math.min(he,K.length-1),ve=Math.max(0,he-G.length+1);ve<=be;ve++){var _e=he-ve,Te=(0|G.words[_e])*(0|K.words[ve]),Ee=67108863&Te;me=67108863&(Ee=Ee+me|0),pe+=(ye=(ye=ye+(Te/67108864|0)|0)+(Ee>>>26)|0)>>>26,ye&=67108863}ne.words[he]=me,ue=ye,ye=pe}return 0!==ue?ne.words[he]=ue:ne.length--,ne._strip()}function jumboMulTo(G,K,ne){return bigMulTo(G,K,ne)}Math.imul||(ye=smallMulTo),BN.prototype.mulTo=function mulTo(G,K){var ne=this.length+G.length;return 10===this.length&&10===G.length?ye(this,G,K):ne<63?smallMulTo(this,G,K):ne<1024?bigMulTo(this,G,K):jumboMulTo(this,G,K)},BN.prototype.mul=function mul(G){var K=new BN(null);return K.words=new Array(this.length+G.length),this.mulTo(G,K)},BN.prototype.mulf=function mulf(G){var K=new BN(null);return K.words=new Array(this.length+G.length),jumboMulTo(this,G,K)},BN.prototype.imul=function imul(G){return this.clone().mulTo(G,this)},BN.prototype.imuln=function imuln(G){var K=G<0;K&&(G=-G),assert("number"==typeof G),assert(G<67108864);for(var ne=0,ue=0;ue<this.length;ue++){var pe=(0|this.words[ue])*G,he=(67108863&pe)+(67108863&ne);ne>>=26,ne+=pe/67108864|0,ne+=he>>>26,this.words[ue]=67108863&he}return 0!==ne&&(this.words[ue]=ne,this.length++),K?this.ineg():this},BN.prototype.muln=function muln(G){return this.clone().imuln(G)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(G){var K=function toBitArray(G){for(var K=new Array(G.bitLength()),ne=0;ne<K.length;ne++){var ue=ne/26|0,pe=ne%26;K[ne]=G.words[ue]>>>pe&1}return K}(G);if(0===K.length)return new BN(1);for(var ne=this,ue=0;ue<K.length&&0===K[ue];ue++,ne=ne.sqr());if(++ue<K.length)for(var pe=ne.sqr();ue<K.length;ue++,pe=pe.sqr())0!==K[ue]&&(ne=ne.mul(pe));return ne},BN.prototype.iushln=function iushln(G){assert("number"==typeof G&&G>=0);var K,ne=G%26,ue=(G-ne)/26,pe=67108863>>>26-ne<<26-ne;if(0!==ne){var he=0;for(K=0;K<this.length;K++){var ye=this.words[K]&pe,me=(0|this.words[K])-ye<<ne;this.words[K]=me|he,he=ye>>>26-ne}he&&(this.words[K]=he,this.length++)}if(0!==ue){for(K=this.length-1;K>=0;K--)this.words[K+ue]=this.words[K];for(K=0;K<ue;K++)this.words[K]=0;this.length+=ue}return this._strip()},BN.prototype.ishln=function ishln(G){return assert(0===this.negative),this.iushln(G)},BN.prototype.iushrn=function iushrn(G,K,ne){var ue;assert("number"==typeof G&&G>=0),ue=K?(K-K%26)/26:0;var pe=G%26,he=Math.min((G-pe)/26,this.length),ye=67108863^67108863>>>pe<<pe,me=ne;if(ue-=he,ue=Math.max(0,ue),me){for(var be=0;be<he;be++)me.words[be]=this.words[be];me.length=he}if(0===he);else if(this.length>he)for(this.length-=he,be=0;be<this.length;be++)this.words[be]=this.words[be+he];else this.words[0]=0,this.length=1;var ve=0;for(be=this.length-1;be>=0&&(0!==ve||be>=ue);be--){var _e=0|this.words[be];this.words[be]=ve<<26-pe|_e>>>pe,ve=_e&ye}return me&&0!==ve&&(me.words[me.length++]=ve),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},BN.prototype.ishrn=function ishrn(G,K,ne){return assert(0===this.negative),this.iushrn(G,K,ne)},BN.prototype.shln=function shln(G){return this.clone().ishln(G)},BN.prototype.ushln=function ushln(G){return this.clone().iushln(G)},BN.prototype.shrn=function shrn(G){return this.clone().ishrn(G)},BN.prototype.ushrn=function ushrn(G){return this.clone().iushrn(G)},BN.prototype.testn=function testn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26,ue=1<<K;return!(this.length<=ne)&&!!(this.words[ne]&ue)},BN.prototype.imaskn=function imaskn(G){assert("number"==typeof G&&G>=0);var K=G%26,ne=(G-K)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=ne)return this;if(0!==K&&ne++,this.length=Math.min(ne,this.length),0!==K){var ue=67108863^67108863>>>K<<K;this.words[this.length-1]&=ue}return this._strip()},BN.prototype.maskn=function maskn(G){return this.clone().imaskn(G)},BN.prototype.iaddn=function iaddn(G){return assert("number"==typeof G),assert(G<67108864),G<0?this.isubn(-G):0!==this.negative?1===this.length&&(0|this.words[0])<=G?(this.words[0]=G-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(G),this.negative=1,this):this._iaddn(G)},BN.prototype._iaddn=function _iaddn(G){this.words[0]+=G;for(var K=0;K<this.length&&this.words[K]>=67108864;K++)this.words[K]-=67108864,K===this.length-1?this.words[K+1]=1:this.words[K+1]++;return this.length=Math.max(this.length,K+1),this},BN.prototype.isubn=function isubn(G){if(assert("number"==typeof G),assert(G<67108864),G<0)return this.iaddn(-G);if(0!==this.negative)return this.negative=0,this.iaddn(G),this.negative=1,this;if(this.words[0]-=G,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var K=0;K<this.length&&this.words[K]<0;K++)this.words[K]+=67108864,this.words[K+1]-=1;return this._strip()},BN.prototype.addn=function addn(G){return this.clone().iaddn(G)},BN.prototype.subn=function subn(G){return this.clone().isubn(G)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(G,K,ne){var ue,pe,he=G.length+ne;this._expand(he);var ye=0;for(ue=0;ue<G.length;ue++){pe=(0|this.words[ue+ne])+ye;var me=(0|G.words[ue])*K;ye=((pe-=67108863&me)>>26)-(me/67108864|0),this.words[ue+ne]=67108863&pe}for(;ue<this.length-ne;ue++)ye=(pe=(0|this.words[ue+ne])+ye)>>26,this.words[ue+ne]=67108863&pe;if(0===ye)return this._strip();for(assert(-1===ye),ye=0,ue=0;ue<this.length;ue++)ye=(pe=-(0|this.words[ue])+ye)>>26,this.words[ue]=67108863&pe;return this.negative=1,this._strip()},BN.prototype._wordDiv=function _wordDiv(G,K){var ne=(this.length,G.length),ue=this.clone(),pe=G,he=0|pe.words[pe.length-1];0!==(ne=26-this._countBits(he))&&(pe=pe.ushln(ne),ue.iushln(ne),he=0|pe.words[pe.length-1]);var ye,me=ue.length-pe.length;if("mod"!==K){(ye=new BN(null)).length=me+1,ye.words=new Array(ye.length);for(var be=0;be<ye.length;be++)ye.words[be]=0}var ve=ue.clone()._ishlnsubmul(pe,1,me);0===ve.negative&&(ue=ve,ye&&(ye.words[me]=1));for(var _e=me-1;_e>=0;_e--){var Te=67108864*(0|ue.words[pe.length+_e])+(0|ue.words[pe.length+_e-1]);for(Te=Math.min(Te/he|0,67108863),ue._ishlnsubmul(pe,Te,_e);0!==ue.negative;)Te--,ue.negative=0,ue._ishlnsubmul(pe,1,_e),ue.isZero()||(ue.negative^=1);ye&&(ye.words[_e]=Te)}return ye&&ye._strip(),ue._strip(),"div"!==K&&0!==ne&&ue.iushrn(ne),{div:ye||null,mod:ue}},BN.prototype.divmod=function divmod(G,K,ne){return assert(!G.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===G.negative?(he=this.neg().divmod(G,K),"mod"!==K&&(ue=he.div.neg()),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.iadd(G)),{div:ue,mod:pe}):0===this.negative&&0!==G.negative?(he=this.divmod(G.neg(),K),"mod"!==K&&(ue=he.div.neg()),{div:ue,mod:he.mod}):0!=(this.negative&G.negative)?(he=this.neg().divmod(G.neg(),K),"div"!==K&&(pe=he.mod.neg(),ne&&0!==pe.negative&&pe.isub(G)),{div:he.div,mod:pe}):G.length>this.length||this.cmp(G)<0?{div:new BN(0),mod:this}:1===G.length?"div"===K?{div:this.divn(G.words[0]),mod:null}:"mod"===K?{div:null,mod:new BN(this.modrn(G.words[0]))}:{div:this.divn(G.words[0]),mod:new BN(this.modrn(G.words[0]))}:this._wordDiv(G,K);var ue,pe,he},BN.prototype.div=function div(G){return this.divmod(G,"div",!1).div},BN.prototype.mod=function mod(G){return this.divmod(G,"mod",!1).mod},BN.prototype.umod=function umod(G){return this.divmod(G,"mod",!0).mod},BN.prototype.divRound=function divRound(G){var K=this.divmod(G);if(K.mod.isZero())return K.div;var ne=0!==K.div.negative?K.mod.isub(G):K.mod,ue=G.ushrn(1),pe=G.andln(1),he=ne.cmp(ue);return he<0||1===pe&&0===he?K.div:0!==K.div.negative?K.div.isubn(1):K.div.iaddn(1)},BN.prototype.modrn=function modrn(G){var K=G<0;K&&(G=-G),assert(G<=67108863);for(var ne=(1<<26)%G,ue=0,pe=this.length-1;pe>=0;pe--)ue=(ne*ue+(0|this.words[pe]))%G;return K?-ue:ue},BN.prototype.modn=function modn(G){return this.modrn(G)},BN.prototype.idivn=function idivn(G){var K=G<0;K&&(G=-G),assert(G<=67108863);for(var ne=0,ue=this.length-1;ue>=0;ue--){var pe=(0|this.words[ue])+67108864*ne;this.words[ue]=pe/G|0,ne=pe%G}return this._strip(),K?this.ineg():this},BN.prototype.divn=function divn(G){return this.clone().idivn(G)},BN.prototype.egcd=function egcd(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue=new BN(1),pe=new BN(0),he=new BN(0),ye=new BN(1),me=0;K.isEven()&&ne.isEven();)K.iushrn(1),ne.iushrn(1),++me;for(var be=ne.clone(),ve=K.clone();!K.isZero();){for(var _e=0,Te=1;0==(K.words[0]&Te)&&_e<26;++_e,Te<<=1);if(_e>0)for(K.iushrn(_e);_e-- >0;)(ue.isOdd()||pe.isOdd())&&(ue.iadd(be),pe.isub(ve)),ue.iushrn(1),pe.iushrn(1);for(var Ee=0,Pe=1;0==(ne.words[0]&Pe)&&Ee<26;++Ee,Pe<<=1);if(Ee>0)for(ne.iushrn(Ee);Ee-- >0;)(he.isOdd()||ye.isOdd())&&(he.iadd(be),ye.isub(ve)),he.iushrn(1),ye.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),ue.isub(he),pe.isub(ye)):(ne.isub(K),he.isub(ue),ye.isub(pe))}return{a:he,b:ye,gcd:ne.iushln(me)}},BN.prototype._invmp=function _invmp(G){assert(0===G.negative),assert(!G.isZero());var K=this,ne=G.clone();K=0!==K.negative?K.umod(G):K.clone();for(var ue,pe=new BN(1),he=new BN(0),ye=ne.clone();K.cmpn(1)>0&&ne.cmpn(1)>0;){for(var me=0,be=1;0==(K.words[0]&be)&&me<26;++me,be<<=1);if(me>0)for(K.iushrn(me);me-- >0;)pe.isOdd()&&pe.iadd(ye),pe.iushrn(1);for(var ve=0,_e=1;0==(ne.words[0]&_e)&&ve<26;++ve,_e<<=1);if(ve>0)for(ne.iushrn(ve);ve-- >0;)he.isOdd()&&he.iadd(ye),he.iushrn(1);K.cmp(ne)>=0?(K.isub(ne),pe.isub(he)):(ne.isub(K),he.isub(pe))}return(ue=0===K.cmpn(1)?pe:he).cmpn(0)<0&&ue.iadd(G),ue},BN.prototype.gcd=function gcd(G){if(this.isZero())return G.abs();if(G.isZero())return this.abs();var K=this.clone(),ne=G.clone();K.negative=0,ne.negative=0;for(var ue=0;K.isEven()&&ne.isEven();ue++)K.iushrn(1),ne.iushrn(1);for(;;){for(;K.isEven();)K.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var pe=K.cmp(ne);if(pe<0){var he=K;K=ne,ne=he}else if(0===pe||0===ne.cmpn(1))break;K.isub(ne)}return ne.iushln(ue)},BN.prototype.invm=function invm(G){return this.egcd(G).a.umod(G)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(G){return this.words[0]&G},BN.prototype.bincn=function bincn(G){assert("number"==typeof G);var K=G%26,ne=(G-K)/26,ue=1<<K;if(this.length<=ne)return this._expand(ne+1),this.words[ne]|=ue,this;for(var pe=ue,he=ne;0!==pe&&he<this.length;he++){var ye=0|this.words[he];pe=(ye+=pe)>>>26,ye&=67108863,this.words[he]=ye}return 0!==pe&&(this.words[he]=pe,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(G){var K,ne=G<0;if(0!==this.negative&&!ne)return-1;if(0===this.negative&&ne)return 1;if(this._strip(),this.length>1)K=1;else{ne&&(G=-G),assert(G<=67108863,"Number is too big");var ue=0|this.words[0];K=ue===G?0:ue<G?-1:1}return 0!==this.negative?0|-K:K},BN.prototype.cmp=function cmp(G){if(0!==this.negative&&0===G.negative)return-1;if(0===this.negative&&0!==G.negative)return 1;var K=this.ucmp(G);return 0!==this.negative?0|-K:K},BN.prototype.ucmp=function ucmp(G){if(this.length>G.length)return 1;if(this.length<G.length)return-1;for(var K=0,ne=this.length-1;ne>=0;ne--){var ue=0|this.words[ne],pe=0|G.words[ne];if(ue!==pe){ue<pe?K=-1:ue>pe&&(K=1);break}}return K},BN.prototype.gtn=function gtn(G){return 1===this.cmpn(G)},BN.prototype.gt=function gt(G){return 1===this.cmp(G)},BN.prototype.gten=function gten(G){return this.cmpn(G)>=0},BN.prototype.gte=function gte(G){return this.cmp(G)>=0},BN.prototype.ltn=function ltn(G){return-1===this.cmpn(G)},BN.prototype.lt=function lt(G){return-1===this.cmp(G)},BN.prototype.lten=function lten(G){return this.cmpn(G)<=0},BN.prototype.lte=function lte(G){return this.cmp(G)<=0},BN.prototype.eqn=function eqn(G){return 0===this.cmpn(G)},BN.prototype.eq=function eq(G){return 0===this.cmp(G)},BN.red=function red(G){return new Red(G)},BN.prototype.toRed=function toRed(G){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),G.convertTo(this)._forceRed(G)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(G){return this.red=G,this},BN.prototype.forceRed=function forceRed(G){return assert(!this.red,"Already a number in reduction context"),this._forceRed(G)},BN.prototype.redAdd=function redAdd(G){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,G)},BN.prototype.redIAdd=function redIAdd(G){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,G)},BN.prototype.redSub=function redSub(G){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,G)},BN.prototype.redISub=function redISub(G){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,G)},BN.prototype.redShl=function redShl(G){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,G)},BN.prototype.redMul=function redMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.mul(this,G)},BN.prototype.redIMul=function redIMul(G){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,G),this.red.imul(this,G)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(G){return assert(this.red&&!G.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,G)};var me={k256:null,p224:null,p192:null,p25519:null};function MPrime(G,K){this.name=G,this.p=new BN(K,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(G){if("string"==typeof G){var K=BN._prime(G);this.m=K.p,this.prime=K}else assert(G.gtn(1),"modulus must be greater than 1"),this.m=G,this.prime=null}function Mont(G){Red.call(this,G),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(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)}MPrime.prototype._tmp=function _tmp(){var G=new BN(null);return G.words=new Array(Math.ceil(this.n/13)),G},MPrime.prototype.ireduce=function ireduce(G){var K,ne=G;do{this.split(ne,this.tmp),K=(ne=(ne=this.imulK(ne)).iadd(this.tmp)).bitLength()}while(K>this.n);var ue=K<this.n?-1:ne.ucmp(this.p);return 0===ue?(ne.words[0]=0,ne.length=1):ue>0?ne.isub(this.p):void 0!==ne.strip?ne.strip():ne._strip(),ne},MPrime.prototype.split=function split(G,K){G.iushrn(this.n,0,K)},MPrime.prototype.imulK=function imulK(G){return G.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(G,K){for(var ne=4194303,ue=Math.min(G.length,9),pe=0;pe<ue;pe++)K.words[pe]=G.words[pe];if(K.length=ue,G.length<=9)return G.words[0]=0,void(G.length=1);var he=G.words[9];for(K.words[K.length++]=he&ne,pe=10;pe<G.length;pe++){var ye=0|G.words[pe];G.words[pe-10]=(ye&ne)<<4|he>>>22,he=ye}he>>>=22,G.words[pe-10]=he,0===he&&G.length>10?G.length-=10:G.length-=9},K256.prototype.imulK=function imulK(G){G.words[G.length]=0,G.words[G.length+1]=0,G.length+=2;for(var K=0,ne=0;ne<G.length;ne++){var ue=0|G.words[ne];K+=977*ue,G.words[ne]=67108863&K,K=64*ue+(K/67108864|0)}return 0===G.words[G.length-1]&&(G.length--,0===G.words[G.length-1]&&G.length--),G},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(G){for(var K=0,ne=0;ne<G.length;ne++){var ue=19*(0|G.words[ne])+K,pe=67108863&ue;ue>>>=26,G.words[ne]=pe,K=ue}return 0!==K&&(G.words[G.length++]=K),G},BN._prime=function prime(G){if(me[G])return me[G];var prime;if("k256"===G)prime=new K256;else if("p224"===G)prime=new P224;else if("p192"===G)prime=new P192;else{if("p25519"!==G)throw new Error("Unknown prime "+G);prime=new P25519}return me[G]=prime,prime},Red.prototype._verify1=function _verify1(G){assert(0===G.negative,"red works only with positives"),assert(G.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(G,K){assert(0==(G.negative|K.negative),"red works only with positives"),assert(G.red&&G.red===K.red,"red works only with red numbers")},Red.prototype.imod=function imod(G){return this.prime?this.prime.ireduce(G)._forceRed(this):(move(G,G.umod(this.m)._forceRed(this)),G)},Red.prototype.neg=function neg(G){return G.isZero()?G.clone():this.m.sub(G)._forceRed(this)},Red.prototype.add=function add(G,K){this._verify2(G,K);var ne=G.add(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Red.prototype.iadd=function iadd(G,K){this._verify2(G,K);var ne=G.iadd(K);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Red.prototype.sub=function sub(G,K){this._verify2(G,K);var ne=G.sub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Red.prototype.isub=function isub(G,K){this._verify2(G,K);var ne=G.isub(K);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Red.prototype.shl=function shl(G,K){return this._verify1(G),this.imod(G.ushln(K))},Red.prototype.imul=function imul(G,K){return this._verify2(G,K),this.imod(G.imul(K))},Red.prototype.mul=function mul(G,K){return this._verify2(G,K),this.imod(G.mul(K))},Red.prototype.isqr=function isqr(G){return this.imul(G,G.clone())},Red.prototype.sqr=function sqr(G){return this.mul(G,G)},Red.prototype.sqrt=function sqrt(G){if(G.isZero())return G.clone();var K=this.m.andln(3);if(assert(K%2==1),3===K){var ne=this.m.add(new BN(1)).iushrn(2);return this.pow(G,ne)}for(var ue=this.m.subn(1),pe=0;!ue.isZero()&&0===ue.andln(1);)pe++,ue.iushrn(1);assert(!ue.isZero());var he=new BN(1).toRed(this),ye=he.redNeg(),me=this.m.subn(1).iushrn(1),be=this.m.bitLength();for(be=new BN(2*be*be).toRed(this);0!==this.pow(be,me).cmp(ye);)be.redIAdd(ye);for(var ve=this.pow(be,ue),_e=this.pow(G,ue.addn(1).iushrn(1)),Te=this.pow(G,ue),Ee=pe;0!==Te.cmp(he);){for(var Pe=Te,Se=0;0!==Pe.cmp(he);Se++)Pe=Pe.redSqr();assert(Se<Ee);var Ce=this.pow(ve,new BN(1).iushln(Ee-Se-1));_e=_e.redMul(Ce),ve=Ce.redSqr(),Te=Te.redMul(ve),Ee=Se}return _e},Red.prototype.invm=function invm(G){var K=G._invmp(this.m);return 0!==K.negative?(K.negative=0,this.imod(K).redNeg()):this.imod(K)},Red.prototype.pow=function pow(G,K){if(K.isZero())return new BN(1).toRed(this);if(0===K.cmpn(1))return G.clone();var ne=new Array(16);ne[0]=new BN(1).toRed(this),ne[1]=G;for(var ue=2;ue<ne.length;ue++)ne[ue]=this.mul(ne[ue-1],G);var pe=ne[0],he=0,ye=0,me=K.bitLength()%26;for(0===me&&(me=26),ue=K.length-1;ue>=0;ue--){for(var be=K.words[ue],ve=me-1;ve>=0;ve--){var _e=be>>ve&1;pe!==ne[0]&&(pe=this.sqr(pe)),0!==_e||0!==he?(he<<=1,he|=_e,(4===++ye||0===ue&&0===ve)&&(pe=this.mul(pe,ne[he]),ye=0,he=0)):ye=0}me=26}return pe},Red.prototype.convertTo=function convertTo(G){var K=G.umod(this.m);return K===G?K.clone():K},Red.prototype.convertFrom=function convertFrom(G){var K=G.clone();return K.red=null,K},BN.mont=function mont(G){return new Mont(G)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(G){return this.imod(G.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(G){var K=this.imod(G.mul(this.rinv));return K.red=null,K},Mont.prototype.imul=function imul(G,K){if(G.isZero()||K.isZero())return G.words[0]=0,G.length=1,G;var ne=G.imul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.mul=function mul(G,K){if(G.isZero()||K.isZero())return new BN(0)._forceRed(this);var ne=G.mul(K),ue=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),pe=ne.isub(ue).iushrn(this.shift),he=pe;return pe.cmp(this.m)>=0?he=pe.isub(this.m):pe.cmpn(0)<0&&(he=pe.iadd(this.m)),he._forceRed(this)},Mont.prototype.invm=function invm(G){return this.imod(G._invmp(this.m).mul(this.r2))._forceRed(this)}}(G,YH)}(eW);var rW=getDefaultExportFromCjs(eW.exports);let nW=!1,aW=!1;const iW={debug:1,default:2,info:2,warning:3,error:4,off:5};let sW=iW.default,oW=null;const cW=function _checkNormalize(){try{const G=[];if(["NFD","NFC","NFKD","NFKC"].forEach((K=>{try{if("test"!=="test".normalize(K))throw new Error("bad normalize")}catch(ne){G.push(K)}})),G.length)throw new Error("missing "+G.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(G){return G.message}return null}();var dW,uW;!function(G){G.DEBUG="DEBUG",G.INFO="INFO",G.WARNING="WARNING",G.ERROR="ERROR",G.OFF="OFF"}(dW||(dW={})),function(G){G.UNKNOWN_ERROR="UNKNOWN_ERROR",G.NOT_IMPLEMENTED="NOT_IMPLEMENTED",G.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",G.NETWORK_ERROR="NETWORK_ERROR",G.SERVER_ERROR="SERVER_ERROR",G.TIMEOUT="TIMEOUT",G.BUFFER_OVERRUN="BUFFER_OVERRUN",G.NUMERIC_FAULT="NUMERIC_FAULT",G.MISSING_NEW="MISSING_NEW",G.INVALID_ARGUMENT="INVALID_ARGUMENT",G.MISSING_ARGUMENT="MISSING_ARGUMENT",G.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",G.CALL_EXCEPTION="CALL_EXCEPTION",G.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",G.NONCE_EXPIRED="NONCE_EXPIRED",G.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",G.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",G.TRANSACTION_REPLACED="TRANSACTION_REPLACED",G.ACTION_REJECTED="ACTION_REJECTED"}(uW||(uW={}));const fW="0123456789abcdef";class Logger{constructor(G){Object.defineProperty(this,"version",{enumerable:!0,value:G,writable:!1})}_log(G,K){const ne=G.toLowerCase();null==iW[ne]&&this.throwArgumentError("invalid log level name","logLevel",G),sW>iW[ne]||console.log.apply(console,K)}debug(...G){this._log(Logger.levels.DEBUG,G)}info(...G){this._log(Logger.levels.INFO,G)}warn(...G){this._log(Logger.levels.WARNING,G)}makeError(G,K,ne){if(aW)return this.makeError("censored error",K,{});K||(K=Logger.errors.UNKNOWN_ERROR),ne||(ne={});const ue=[];Object.keys(ne).forEach((G=>{const K=ne[G];try{if(K instanceof Uint8Array){let ne="";for(let G=0;G<K.length;G++)ne+=fW[K[G]>>4],ne+=fW[15&K[G]];ue.push(G+"=Uint8Array(0x"+ne+")")}else ue.push(G+"="+JSON.stringify(K))}catch(K){ue.push(G+"="+JSON.stringify(ne[G].toString()))}})),ue.push(`code=${K}`),ue.push(`version=${this.version}`);const pe=G;let he="";switch(K){case uW.NUMERIC_FAULT:{he="NUMERIC_FAULT";const K=G;switch(K){case"overflow":case"underflow":case"division-by-zero":he+="-"+K;break;case"negative-power":case"negative-width":he+="-unsupported";break;case"unbound-bitwise-result":he+="-unbound-result"}break}case uW.CALL_EXCEPTION:case uW.INSUFFICIENT_FUNDS:case uW.MISSING_NEW:case uW.NONCE_EXPIRED:case uW.REPLACEMENT_UNDERPRICED:case uW.TRANSACTION_REPLACED:case uW.UNPREDICTABLE_GAS_LIMIT:he=K}he&&(G+=" [ See: https://links.ethers.org/v5-errors-"+he+" ]"),ue.length&&(G+=" ("+ue.join(", ")+")");const ye=new Error(G);return ye.reason=pe,ye.code=K,Object.keys(ne).forEach((function(G){ye[G]=ne[G]})),ye}throwError(G,K,ne){throw this.makeError(G,K,ne)}throwArgumentError(G,K,ne){return this.throwError(G,Logger.errors.INVALID_ARGUMENT,{argument:K,value:ne})}assert(G,K,ne,ue){G||this.throwError(K,ne,ue)}assertArgument(G,K,ne,ue){G||this.throwArgumentError(K,ne,ue)}checkNormalize(G){cW&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:cW})}checkSafeUint53(G,K){"number"==typeof G&&(null==K&&(K="value not safe"),(G<0||G>=9007199254740991)&&this.throwError(K,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:G}),G%1&&this.throwError(K,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:G}))}checkArgumentCount(G,K,ne){ne=ne?": "+ne:"",G<K&&this.throwError("missing argument"+ne,Logger.errors.MISSING_ARGUMENT,{count:G,expectedCount:K}),G>K&&this.throwError("too many arguments"+ne,Logger.errors.UNEXPECTED_ARGUMENT,{count:G,expectedCount:K})}checkNew(G,K){G!==Object&&null!=G||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:K.name})}checkAbstract(G,K){G===K?this.throwError("cannot instantiate abstract class "+JSON.stringify(K.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:G.name,operation:"new"}):G!==Object&&null!=G||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:K.name})}static globalLogger(){return oW||(oW=new Logger("logger/5.7.0")),oW}static setCensorship(G,K){if(!G&&K&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nW){if(!G)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}aW=!!G,nW=!!K}static setLogLevel(G){const K=iW[G.toLowerCase()];null!=K?sW=K:Logger.globalLogger().warn("invalid log level - "+G)}static from(G){return new Logger(G)}}Logger.errors=uW,Logger.levels=dW;const lW=new Logger("bytes/5.7.0");function isHexable(G){return!!G.toHexString}function addSlice(G){return G.slice||(G.slice=function(){const K=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(G,K)))}),G}function isInteger(G){return"number"==typeof G&&G==G&&G%1==0}function isBytes(G){if(null==G)return!1;if(G.constructor===Uint8Array)return!0;if("string"==typeof G)return!1;if(!isInteger(G.length)||G.length<0)return!1;for(let K=0;K<G.length;K++){const ne=G[K];if(!isInteger(ne)||ne<0||ne>=256)return!1}return!0}function arrayify(G,K){if(K||(K={}),"number"==typeof G){lW.checkSafeUint53(G,"invalid arrayify value");const K=[];for(;G;)K.unshift(255&G),G=parseInt(String(G/256));return 0===K.length&&K.push(0),addSlice(new Uint8Array(K))}if(K.allowMissingPrefix&&"string"==typeof G&&"0x"!==G.substring(0,2)&&(G="0x"+G),isHexable(G)&&(G=G.toHexString()),isHexString(G)){let ne=G.substring(2);ne.length%2&&("left"===K.hexPad?ne="0"+ne:"right"===K.hexPad?ne+="0":lW.throwArgumentError("hex data is odd-length","value",G));const ue=[];for(let G=0;G<ne.length;G+=2)ue.push(parseInt(ne.substring(G,G+2),16));return addSlice(new Uint8Array(ue))}return isBytes(G)?addSlice(new Uint8Array(G)):lW.throwArgumentError("invalid arrayify value","value",G)}function concat(G){const K=G.map((G=>arrayify(G))),ne=K.reduce(((G,K)=>G+K.length),0),ue=new Uint8Array(ne);return K.reduce(((G,K)=>(ue.set(K,G),G+K.length)),0),addSlice(ue)}function zeroPad(G,K){(G=arrayify(G)).length>K&&lW.throwArgumentError("value out of range","value",arguments[0]);const ne=new Uint8Array(K);return ne.set(G,K-G.length),addSlice(ne)}function isHexString(G,K){return!("string"!=typeof G||!G.match(/^0x[0-9A-Fa-f]*$/))&&(!K||G.length===2+2*K)}const pW="0123456789abcdef";function hexlify(G,K){if(K||(K={}),"number"==typeof G){lW.checkSafeUint53(G,"invalid hexlify value");let K="";for(;G;)K=pW[15&G]+K,G=Math.floor(G/16);return K.length?(K.length%2&&(K="0"+K),"0x"+K):"0x00"}if("bigint"==typeof G)return(G=G.toString(16)).length%2?"0x0"+G:"0x"+G;if(K.allowMissingPrefix&&"string"==typeof G&&"0x"!==G.substring(0,2)&&(G="0x"+G),isHexable(G))return G.toHexString();if(isHexString(G))return G.length%2&&("left"===K.hexPad?G="0x0"+G.substring(2):"right"===K.hexPad?G+="0":lW.throwArgumentError("hex data is odd-length","value",G)),G.toLowerCase();if(isBytes(G)){let K="0x";for(let ne=0;ne<G.length;ne++){let ue=G[ne];K+=pW[(240&ue)>>4]+pW[15&ue]}return K}return lW.throwArgumentError("invalid hexlify value","value",G)}function hexDataSlice(G,K,ne){return"string"!=typeof G?G=hexlify(G):(!isHexString(G)||G.length%2)&&lW.throwArgumentError("invalid hexData","value",G),K=2+2*K,null!=ne?"0x"+G.substring(K,2+2*ne):"0x"+G.substring(K)}function hexValue(G){const K=function hexStripZeros(G){"string"!=typeof G&&(G=hexlify(G));isHexString(G)||lW.throwArgumentError("invalid hex string","value",G);G=G.substring(2);let K=0;for(;K<G.length&&"0"===G[K];)K++;return"0x"+G.substring(K)}(hexlify(G,{hexPad:"left"}));return"0x"===K?"0x0":K}function hexZeroPad(G,K){for("string"!=typeof G?G=hexlify(G):isHexString(G)||lW.throwArgumentError("invalid hex string","value",G),G.length>2*K+2&&lW.throwArgumentError("value out of range","value",arguments[1]);G.length<2*K+2;)G="0x0"+G.substring(2);return G}var hW=rW.BN;const yW=new Logger("bignumber/5.7.0"),mW={},bW=9007199254740991;let gW=!1;class BigNumber{constructor(G,K){G!==mW&&yW.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=K,this._isBigNumber=!0,Object.freeze(this)}fromTwos(G){return toBigNumber(toBN(this).fromTwos(G))}toTwos(G){return toBigNumber(toBN(this).toTwos(G))}abs(){return"-"===this._hex[0]?BigNumber.from(this._hex.substring(1)):this}add(G){return toBigNumber(toBN(this).add(toBN(G)))}sub(G){return toBigNumber(toBN(this).sub(toBN(G)))}div(G){return BigNumber.from(G).isZero()&&throwFault("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(G)))}mul(G){return toBigNumber(toBN(this).mul(toBN(G)))}mod(G){const K=toBN(G);return K.isNeg()&&throwFault("division-by-zero","mod"),toBigNumber(toBN(this).umod(K))}pow(G){const K=toBN(G);return K.isNeg()&&throwFault("negative-power","pow"),toBigNumber(toBN(this).pow(K))}and(G){const K=toBN(G);return(this.isNegative()||K.isNeg())&&throwFault("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(K))}or(G){const K=toBN(G);return(this.isNegative()||K.isNeg())&&throwFault("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(K))}xor(G){const K=toBN(G);return(this.isNegative()||K.isNeg())&&throwFault("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(K))}mask(G){return(this.isNegative()||G<0)&&throwFault("negative-width","mask"),toBigNumber(toBN(this).maskn(G))}shl(G){return(this.isNegative()||G<0)&&throwFault("negative-width","shl"),toBigNumber(toBN(this).shln(G))}shr(G){return(this.isNegative()||G<0)&&throwFault("negative-width","shr"),toBigNumber(toBN(this).shrn(G))}eq(G){return toBN(this).eq(toBN(G))}lt(G){return toBN(this).lt(toBN(G))}lte(G){return toBN(this).lte(toBN(G))}gt(G){return toBN(this).gt(toBN(G))}gte(G){return toBN(this).gte(toBN(G))}isNegative(){return"-"===this._hex[0]}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(G){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(G){}return yW.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?gW||(gW=!0,yW.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?yW.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):yW.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(G){return{type:"BigNumber",hex:this.toHexString()}}static from(G){if(G instanceof BigNumber)return G;if("string"==typeof G)return G.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(mW,toHex$2(G)):G.match(/^-?[0-9]+$/)?new BigNumber(mW,toHex$2(new hW(G))):yW.throwArgumentError("invalid BigNumber string","value",G);if("number"==typeof G)return G%1&&throwFault("underflow","BigNumber.from",G),(G>=bW||G<=-bW)&&throwFault("overflow","BigNumber.from",G),BigNumber.from(String(G));const K=G;if("bigint"==typeof K)return BigNumber.from(K.toString());if(isBytes(K))return BigNumber.from(hexlify(K));if(K)if(K.toHexString){const G=K.toHexString();if("string"==typeof G)return BigNumber.from(G)}else{let G=K._hex;if(null==G&&"BigNumber"===K.type&&(G=K.hex),"string"==typeof G&&(isHexString(G)||"-"===G[0]&&isHexString(G.substring(1))))return BigNumber.from(G)}return yW.throwArgumentError("invalid BigNumber value","value",G)}static isBigNumber(G){return!(!G||!G._isBigNumber)}}function toHex$2(G){if("string"!=typeof G)return toHex$2(G.toString(16));if("-"===G[0])return"-"===(G=G.substring(1))[0]&&yW.throwArgumentError("invalid hex","value",G),"0x00"===(G=toHex$2(G))?G:"-"+G;if("0x"!==G.substring(0,2)&&(G="0x"+G),"0x"===G)return"0x00";for(G.length%2&&(G="0x0"+G.substring(2));G.length>4&&"0x00"===G.substring(0,4);)G="0x"+G.substring(4);return G}function toBigNumber(G){return BigNumber.from(toHex$2(G))}function toBN(G){const K=BigNumber.from(G).toHexString();return"-"===K[0]?new hW("-"+K.substring(3),16):new hW(K.substring(2),16)}function throwFault(G,K,ne){const ue={fault:G,operation:K};return null!=ne&&(ue.value=ne),yW.throwError(G,Logger.errors.NUMERIC_FAULT,ue)}var __awaiter$3=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const vW=new Logger("properties/5.7.0");function defineReadOnly(G,K,ne){Object.defineProperty(G,K,{enumerable:!0,value:ne,writable:!1})}function getStatic(G,K){for(let ne=0;ne<32;ne++){if(G[K])return G[K];if(!G.prototype||"object"!=typeof G.prototype)break;G=Object.getPrototypeOf(G.prototype).constructor}return null}function resolveProperties(G){return __awaiter$3(this,void 0,void 0,(function*(){const K=Object.keys(G).map((K=>{const ne=G[K];return Promise.resolve(ne).then((G=>({key:K,value:G})))}));return(yield Promise.all(K)).reduce(((G,K)=>(G[K.key]=K.value,G)),{})}))}function shallowCopy(G){const K={};for(const ne in G)K[ne]=G[ne];return K}const wW={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(G){if(null==G||wW[typeof G])return!0;if(Array.isArray(G)||"object"==typeof G){if(!Object.isFrozen(G))return!1;const K=Object.keys(G);for(let ne=0;ne<K.length;ne++){let ue=null;try{ue=G[K[ne]]}catch(G){continue}if(!_isFrozen(ue))return!1}return!0}return vW.throwArgumentError("Cannot deepCopy "+typeof G,"object",G)}function _deepCopy(G){if(_isFrozen(G))return G;if(Array.isArray(G))return Object.freeze(G.map((G=>deepCopy(G))));if("object"==typeof G){const K={};for(const ne in G){const ue=G[ne];void 0!==ue&&defineReadOnly(K,ne,deepCopy(ue))}return K}return vW.throwArgumentError("Cannot deepCopy "+typeof G,"object",G)}function deepCopy(G){return _deepCopy(G)}class Description{constructor(G){for(const K in G)this[K]=deepCopy(G[K])}}const _W="abi/5.7.0",TW=new Logger(_W),AW={};let EW={calldata:!0,memory:!0,storage:!0},PW={calldata:!0,memory:!0};function checkModifier(G,K){if("bytes"===G||"string"===G){if(EW[K])return!0}else if("address"===G){if("payable"===K)return!0}else if((G.indexOf("[")>=0||"tuple"===G)&&PW[K])return!0;return(EW[K]||"payable"===K)&&TW.throwArgumentError("invalid modifier","name",K),!1}function populate(G,K){for(let ne in K)defineReadOnly(G,ne,K[ne])}const SW=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),IW=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(G,K){G!==AW&&TW.throwError("use fromString",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,K);let ne=this.type.match(IW);populate(this,ne?{arrayLength:parseInt(ne[2]||"-1"),arrayChildren:ParamType.fromObject({type:ne[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(G){if(G||(G=SW.sighash),SW[G]||TW.throwArgumentError("invalid format type","format",G),G===SW.json){let K={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(K.indexed=this.indexed),this.components&&(K.components=this.components.map((K=>JSON.parse(K.format(G))))),JSON.stringify(K)}let K="";return"array"===this.baseType?(K+=this.arrayChildren.format(G),K+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(G!==SW.sighash&&(K+=this.type),K+="("+this.components.map((K=>K.format(G))).join(G===SW.full?", ":",")+")"):K+=this.type,G!==SW.sighash&&(!0===this.indexed&&(K+=" indexed"),G===SW.full&&this.name&&(K+=" "+this.name)),K}static from(G,K){return"string"==typeof G?ParamType.fromString(G,K):ParamType.fromObject(G)}static fromObject(G){return ParamType.isParamType(G)?G:new ParamType(AW,{name:G.name||null,type:verifyType(G.type),indexed:null==G.indexed?null:!!G.indexed,components:G.components?G.components.map(ParamType.fromObject):null})}static fromString(G,K){return function ParamTypify(G){return ParamType.fromObject({name:G.name,type:G.type,indexed:G.indexed,components:G.components})}(function parseParamType(G,K){let ne=G;function throwError(K){TW.throwArgumentError(`unexpected character at position ${K}`,"param",G)}function newNode(G){let ne={type:"",name:"",parent:G,state:{allowType:!0}};return K&&(ne.indexed=!1),ne}G=G.replace(/\s/g," ");let ue={type:"",name:"",state:{allowType:!0}},pe=ue;for(let ne=0;ne<G.length;ne++){let ue=G[ne];switch(ue){case"(":pe.state.allowType&&""===pe.type?pe.type="tuple":pe.state.allowParams||throwError(ne),pe.state.allowType=!1,pe.type=verifyType(pe.type),pe.components=[newNode(pe)],pe=pe.components[0];break;case")":delete pe.state,"indexed"===pe.name&&(K||throwError(ne),pe.indexed=!0,pe.name=""),checkModifier(pe.type,pe.name)&&(pe.name=""),pe.type=verifyType(pe.type);let G=pe;pe=pe.parent,pe||throwError(ne),delete G.parent,pe.state.allowParams=!1,pe.state.allowName=!0,pe.state.allowArray=!0;break;case",":delete pe.state,"indexed"===pe.name&&(K||throwError(ne),pe.indexed=!0,pe.name=""),checkModifier(pe.type,pe.name)&&(pe.name=""),pe.type=verifyType(pe.type);let he=newNode(pe.parent);pe.parent.components.push(he),delete pe.parent,pe=he;break;case" ":pe.state.allowType&&""!==pe.type&&(pe.type=verifyType(pe.type),delete pe.state.allowType,pe.state.allowName=!0,pe.state.allowParams=!0),pe.state.allowName&&""!==pe.name&&("indexed"===pe.name?(K||throwError(ne),pe.indexed&&throwError(ne),pe.indexed=!0,pe.name=""):checkModifier(pe.type,pe.name)?pe.name="":pe.state.allowName=!1);break;case"[":pe.state.allowArray||throwError(ne),pe.type+=ue,pe.state.allowArray=!1,pe.state.allowName=!1,pe.state.readArray=!0;break;case"]":pe.state.readArray||throwError(ne),pe.type+=ue,pe.state.readArray=!1,pe.state.allowArray=!0,pe.state.allowName=!0;break;default:pe.state.allowType?(pe.type+=ue,pe.state.allowParams=!0,pe.state.allowArray=!0):pe.state.allowName?(pe.name+=ue,delete pe.state.allowArray):pe.state.readArray?pe.type+=ue:throwError(ne)}}return pe.parent&&TW.throwArgumentError("unexpected eof","param",G),delete ue.state,"indexed"===pe.name?(K||throwError(ne.length-7),pe.indexed&&throwError(ne.length-7),pe.indexed=!0,pe.name=""):checkModifier(pe.type,pe.name)&&(pe.name=""),ue.type=verifyType(ue.type),ue}(G,!!K))}static isParamType(G){return!(null==G||!G._isParamType)}}function parseParams(G,K){return function splitNesting(G){G=G.trim();let K=[],ne="",ue=0;for(let pe=0;pe<G.length;pe++){let he=G[pe];","===he&&0===ue?(K.push(ne),ne=""):(ne+=he,"("===he?ue++:")"===he&&(ue--,-1===ue&&TW.throwArgumentError("unbalanced parenthesis","value",G)))}ne&&K.push(ne);return K}(G).map((G=>ParamType.fromString(G,K)))}class Fragment{constructor(G,K){G!==AW&&TW.throwError("use a static from method",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,K),this._isFragment=!0,Object.freeze(this)}static from(G){return Fragment.isFragment(G)?G:"string"==typeof G?Fragment.fromString(G):Fragment.fromObject(G)}static fromObject(G){if(Fragment.isFragment(G))return G;switch(G.type){case"function":return FunctionFragment.fromObject(G);case"event":return EventFragment.fromObject(G);case"constructor":return ConstructorFragment.fromObject(G);case"error":return ErrorFragment.fromObject(G);case"fallback":case"receive":return null}return TW.throwArgumentError("invalid fragment object","value",G)}static fromString(G){return"event"===(G=(G=(G=G.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?EventFragment.fromString(G.substring(5).trim()):"function"===G.split(" ")[0]?FunctionFragment.fromString(G.substring(8).trim()):"constructor"===G.split("(")[0].trim()?ConstructorFragment.fromString(G.trim()):"error"===G.split(" ")[0]?ErrorFragment.fromString(G.substring(5).trim()):TW.throwArgumentError("unsupported fragment","value",G)}static isFragment(G){return!(!G||!G._isFragment)}}class EventFragment extends Fragment{format(G){if(G||(G=SW.sighash),SW[G]||TW.throwArgumentError("invalid format type","format",G),G===SW.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==SW.sighash&&(K+="event "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===SW.full?", ":",")+") ",G!==SW.sighash&&this.anonymous&&(K+="anonymous "),K.trim()}static from(G){return"string"==typeof G?EventFragment.fromString(G):EventFragment.fromObject(G)}static fromObject(G){if(EventFragment.isEventFragment(G))return G;"event"!==G.type&&TW.throwArgumentError("invalid event object","value",G);const K={name:verifyIdentifier(G.name),anonymous:G.anonymous,inputs:G.inputs?G.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(AW,K)}static fromString(G){let K=G.match(RW);K||TW.throwArgumentError("invalid event string","value",G);let ne=!1;return K[3].split(" ").forEach((G=>{switch(G.trim()){case"anonymous":ne=!0;break;case"":break;default:TW.warn("unknown modifier: "+G)}})),EventFragment.fromObject({name:K[1].trim(),anonymous:ne,inputs:parseParams(K[2],!0),type:"event"})}static isEventFragment(G){return G&&G._isFragment&&"event"===G.type}}function parseGas(G,K){K.gas=null;let ne=G.split("@");return 1!==ne.length?(ne.length>2&&TW.throwArgumentError("invalid human-readable ABI signature","value",G),ne[1].match(/^[0-9]+$/)||TW.throwArgumentError("invalid human-readable ABI signature gas","value",G),K.gas=BigNumber.from(ne[1]),ne[0]):G}function parseModifiers(G,K){K.constant=!1,K.payable=!1,K.stateMutability="nonpayable",G.split(" ").forEach((G=>{switch(G.trim()){case"constant":K.constant=!0;break;case"payable":K.payable=!0,K.stateMutability="payable";break;case"nonpayable":K.payable=!1,K.stateMutability="nonpayable";break;case"pure":K.constant=!0,K.stateMutability="pure";break;case"view":K.constant=!0,K.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+G)}}))}function verifyState(G){let K={constant:!1,payable:!0,stateMutability:"payable"};return null!=G.stateMutability?(K.stateMutability=G.stateMutability,K.constant="view"===K.stateMutability||"pure"===K.stateMutability,null!=G.constant&&!!G.constant!==K.constant&&TW.throwArgumentError("cannot have constant function with mutability "+K.stateMutability,"value",G),K.payable="payable"===K.stateMutability,null!=G.payable&&!!G.payable!==K.payable&&TW.throwArgumentError("cannot have payable function with mutability "+K.stateMutability,"value",G)):null!=G.payable?(K.payable=!!G.payable,null!=G.constant||K.payable||"constructor"===G.type||TW.throwArgumentError("unable to determine stateMutability","value",G),K.constant=!!G.constant,K.constant?K.stateMutability="view":K.stateMutability=K.payable?"payable":"nonpayable",K.payable&&K.constant&&TW.throwArgumentError("cannot have constant payable function","value",G)):null!=G.constant?(K.constant=!!G.constant,K.payable=!K.constant,K.stateMutability=K.constant?"view":"payable"):"constructor"!==G.type&&TW.throwArgumentError("unable to determine stateMutability","value",G),K}class ConstructorFragment extends Fragment{format(G){if(G||(G=SW.sighash),SW[G]||TW.throwArgumentError("invalid format type","format",G),G===SW.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});G===SW.sighash&&TW.throwError("cannot format a constructor for sighash",Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let K="constructor("+this.inputs.map((K=>K.format(G))).join(G===SW.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(K+=this.stateMutability+" "),K.trim()}static from(G){return"string"==typeof G?ConstructorFragment.fromString(G):ConstructorFragment.fromObject(G)}static fromObject(G){if(ConstructorFragment.isConstructorFragment(G))return G;"constructor"!==G.type&&TW.throwArgumentError("invalid constructor object","value",G);let K=verifyState(G);K.constant&&TW.throwArgumentError("constructor cannot be constant","value",G);const ne={name:null,type:G.type,inputs:G.inputs?G.inputs.map(ParamType.fromObject):[],payable:K.payable,stateMutability:K.stateMutability,gas:G.gas?BigNumber.from(G.gas):null};return new ConstructorFragment(AW,ne)}static fromString(G){let K={type:"constructor"},ne=(G=parseGas(G,K)).match(RW);return ne&&"constructor"===ne[1].trim()||TW.throwArgumentError("invalid constructor string","value",G),K.inputs=parseParams(ne[2].trim(),!1),parseModifiers(ne[3].trim(),K),ConstructorFragment.fromObject(K)}static isConstructorFragment(G){return G&&G._isFragment&&"constructor"===G.type}}class FunctionFragment extends ConstructorFragment{format(G){if(G||(G=SW.sighash),SW[G]||TW.throwArgumentError("invalid format type","format",G),G===SW.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((K=>JSON.parse(K.format(G)))),outputs:this.outputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==SW.sighash&&(K+="function "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===SW.full?", ":",")+") ",G!==SW.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(K+=this.stateMutability+" "):this.constant&&(K+="view "),this.outputs&&this.outputs.length&&(K+="returns ("+this.outputs.map((K=>K.format(G))).join(", ")+") "),null!=this.gas&&(K+="@"+this.gas.toString()+" ")),K.trim()}static from(G){return"string"==typeof G?FunctionFragment.fromString(G):FunctionFragment.fromObject(G)}static fromObject(G){if(FunctionFragment.isFunctionFragment(G))return G;"function"!==G.type&&TW.throwArgumentError("invalid function object","value",G);let K=verifyState(G);const ne={type:G.type,name:verifyIdentifier(G.name),constant:K.constant,inputs:G.inputs?G.inputs.map(ParamType.fromObject):[],outputs:G.outputs?G.outputs.map(ParamType.fromObject):[],payable:K.payable,stateMutability:K.stateMutability,gas:G.gas?BigNumber.from(G.gas):null};return new FunctionFragment(AW,ne)}static fromString(G){let K={type:"function"},ne=(G=parseGas(G,K)).split(" returns ");ne.length>2&&TW.throwArgumentError("invalid function string","value",G);let ue=ne[0].match(RW);if(ue||TW.throwArgumentError("invalid function signature","value",G),K.name=ue[1].trim(),K.name&&verifyIdentifier(K.name),K.inputs=parseParams(ue[2],!1),parseModifiers(ue[3].trim(),K),ne.length>1){let ue=ne[1].match(RW);""==ue[1].trim()&&""==ue[3].trim()||TW.throwArgumentError("unexpected tokens","value",G),K.outputs=parseParams(ue[2],!1)}else K.outputs=[];return FunctionFragment.fromObject(K)}static isFunctionFragment(G){return G&&G._isFragment&&"function"===G.type}}function checkForbidden(G){const K=G.format();return"Error(string)"!==K&&"Panic(uint256)"!==K||TW.throwArgumentError(`cannot specify user defined ${K} error`,"fragment",G),G}class ErrorFragment extends Fragment{format(G){if(G||(G=SW.sighash),SW[G]||TW.throwArgumentError("invalid format type","format",G),G===SW.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((K=>JSON.parse(K.format(G))))});let K="";return G!==SW.sighash&&(K+="error "),K+=this.name+"("+this.inputs.map((K=>K.format(G))).join(G===SW.full?", ":",")+") ",K.trim()}static from(G){return"string"==typeof G?ErrorFragment.fromString(G):ErrorFragment.fromObject(G)}static fromObject(G){if(ErrorFragment.isErrorFragment(G))return G;"error"!==G.type&&TW.throwArgumentError("invalid error object","value",G);const K={type:G.type,name:verifyIdentifier(G.name),inputs:G.inputs?G.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(AW,K))}static fromString(G){let K={type:"error"},ne=G.match(RW);return ne||TW.throwArgumentError("invalid error signature","value",G),K.name=ne[1].trim(),K.name&&verifyIdentifier(K.name),K.inputs=parseParams(ne[2],!1),checkForbidden(ErrorFragment.fromObject(K))}static isErrorFragment(G){return G&&G._isFragment&&"error"===G.type}}function verifyType(G){return G.match(/^uint($|[^1-9])/)?G="uint256"+G.substring(4):G.match(/^int($|[^1-9])/)&&(G="int256"+G.substring(3)),G}const CW=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(G){return G&&G.match(CW)||TW.throwArgumentError(`invalid identifier "${G}"`,"value",G),G}const RW=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const kW=new Logger(_W);class Coder{constructor(G,K,ne,ue){this.name=G,this.type=K,this.localName=ne,this.dynamic=ue}_throwError(G,K){kW.throwArgumentError(G,this.localName,K)}}class Writer{constructor(G){defineReadOnly(this,"wordSize",G||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(G)}get data(){return function hexConcat(G){let K="0x";return G.forEach((G=>{K+=hexlify(G).substring(2)})),K}(this._data)}get length(){return this._dataLength}_writeData(G){return this._data.push(G),this._dataLength+=G.length,G.length}appendWriter(G){return this._writeData(concat(G._data))}writeBytes(G){let K=arrayify(G);const ne=K.length%this.wordSize;return ne&&(K=concat([K,this._padding.slice(ne)])),this._writeData(K)}_getValue(G){let K=arrayify(BigNumber.from(G));return K.length>this.wordSize&&kW.throwError("value out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:K.length}),K.length%this.wordSize&&(K=concat([this._padding.slice(K.length%this.wordSize),K])),K}writeValue(G){return this._writeData(this._getValue(G))}writeUpdatableValue(){const G=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,K=>{this._data[G]=this._getValue(K)}}}class Reader{constructor(G,K,ne,ue){defineReadOnly(this,"_data",arrayify(G)),defineReadOnly(this,"wordSize",K||32),defineReadOnly(this,"_coerceFunc",ne),defineReadOnly(this,"allowLoose",ue),this._offset=0}get data(){return hexlify(this._data)}get consumed(){return this._offset}static coerce(G,K){let ne=G.match("^u?int([0-9]+)$");return ne&&parseInt(ne[1])<=48&&(K=K.toNumber()),K}coerce(G,K){return this._coerceFunc?this._coerceFunc(G,K):Reader.coerce(G,K)}_peekBytes(G,K,ne){let ue=Math.ceil(K/this.wordSize)*this.wordSize;return this._offset+ue>this._data.length&&(this.allowLoose&&ne&&this._offset+K<=this._data.length?ue=K:kW.throwError("data out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+ue})),this._data.slice(this._offset,this._offset+ue)}subReader(G){return new Reader(this._data.slice(this._offset+G),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(G,K){let ne=this._peekBytes(0,G,!!K);return this._offset+=ne.length,ne.slice(0,G)}readValue(){return BigNumber.from(this.readBytes(this.wordSize))}}var OW={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(G){!function(){var K="input is invalid type",ne="object"==typeof window,ue=ne?window:{};ue.JS_SHA3_NO_WINDOW&&(ne=!1);var pe=!ne&&"object"==typeof self;!ue.JS_SHA3_NO_NODE_JS&&!1?ue=YH:pe&&(ue=self);var he=!ue.JS_SHA3_NO_COMMON_JS&&G.exports,ye=!ue.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,me="0123456789abcdef".split(""),be=[4,1024,262144,67108864],ve=[0,8,16,24],_e=[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],Te=[224,256,384,512],Ee=[128,256],Pe=["hex","buffer","arrayBuffer","array","digest"],Se={128:168,256:136};!ue.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(G){return"[object Array]"===Object.prototype.toString.call(G)}),!ye||!ue.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(G){return"object"==typeof G&&G.buffer&&G.buffer.constructor===ArrayBuffer});for(var createOutputMethod=function(G,K,ne){return function(ue){return new Keccak(G,K,G).update(ue)[ne]()}},createShakeOutputMethod=function(G,K,ne){return function(ue,pe){return new Keccak(G,K,pe).update(ue)[ne]()}},createCshakeOutputMethod=function(G,K,ne){return function(K,ue,pe,he){return ke["cshake"+G].update(K,ue,pe,he)[ne]()}},createKmacOutputMethod=function(G,K,ne){return function(K,ue,pe,he){return ke["kmac"+G].update(K,ue,pe,he)[ne]()}},createOutputMethods=function(G,K,ne,ue){for(var pe=0;pe<Pe.length;++pe){var he=Pe[pe];G[he]=K(ne,ue,he)}return G},createMethod=function(G,K){var ne=createOutputMethod(G,K,"hex");return ne.create=function(){return new Keccak(G,K,G)},ne.update=function(G){return ne.create().update(G)},createOutputMethods(ne,createOutputMethod,G,K)},Ce=[{name:"keccak",padding:[1,256,65536,16777216],bits:Te,createMethod:createMethod},{name:"sha3",padding:[6,1536,393216,100663296],bits:Te,createMethod:createMethod},{name:"shake",padding:[31,7936,2031616,520093696],bits:Ee,createMethod:function(G,K){var ne=createShakeOutputMethod(G,K,"hex");return ne.create=function(ne){return new Keccak(G,K,ne)},ne.update=function(G,K){return ne.create(K).update(G)},createOutputMethods(ne,createShakeOutputMethod,G,K)}},{name:"cshake",padding:be,bits:Ee,createMethod:function(G,K){var ne=Se[G],ue=createCshakeOutputMethod(G,0,"hex");return ue.create=function(ue,pe,he){return pe||he?new Keccak(G,K,ue).bytepad([pe,he],ne):ke["shake"+G].create(ue)},ue.update=function(G,K,ne,pe){return ue.create(K,ne,pe).update(G)},createOutputMethods(ue,createCshakeOutputMethod,G,K)}},{name:"kmac",padding:be,bits:Ee,createMethod:function(G,K){var ne=Se[G],ue=createKmacOutputMethod(G,0,"hex");return ue.create=function(ue,pe,he){return new Kmac(G,K,pe).bytepad(["KMAC",he],ne).bytepad([ue],ne)},ue.update=function(G,K,ne,pe){return ue.create(G,ne,pe).update(K)},createOutputMethods(ue,createKmacOutputMethod,G,K)}}],ke={},Oe=[],xe=0;xe<Ce.length;++xe)for(var Ne=Ce[xe],Me=Ne.bits,Be=0;Be<Me.length;++Be){var Fe=Ne.name+"_"+Me[Be];if(Oe.push(Fe),ke[Fe]=Ne.createMethod(Me[Be],Ne.padding),"sha3"!==Ne.name){var De=Ne.name+Me[Be];Oe.push(De),ke[De]=ke[Fe]}}function Keccak(G,K,ne){this.blocks=[],this.s=[],this.padding=K,this.outputBits=ne,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(G<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=ne>>5,this.extraBytes=(31&ne)>>3;for(var ue=0;ue<50;++ue)this.s[ue]=0}function Kmac(G,K,ne){Keccak.call(this,G,K,ne)}Keccak.prototype.update=function(G){if(this.finalized)throw new Error("finalize already called");var ne,ue=typeof G;if("string"!==ue){if("object"!==ue)throw new Error(K);if(null===G)throw new Error(K);if(ye&&G.constructor===ArrayBuffer)G=new Uint8Array(G);else if(!(Array.isArray(G)||ye&&ArrayBuffer.isView(G)))throw new Error(K);ne=!0}for(var pe,he,me=this.blocks,be=this.byteCount,_e=G.length,Te=this.blockCount,Ee=0,Pe=this.s;Ee<_e;){if(this.reset)for(this.reset=!1,me[0]=this.block,pe=1;pe<Te+1;++pe)me[pe]=0;if(ne)for(pe=this.start;Ee<_e&&pe<be;++Ee)me[pe>>2]|=G[Ee]<<ve[3&pe++];else for(pe=this.start;Ee<_e&&pe<be;++Ee)(he=G.charCodeAt(Ee))<128?me[pe>>2]|=he<<ve[3&pe++]:he<2048?(me[pe>>2]|=(192|he>>6)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]):he<55296||he>=57344?(me[pe>>2]|=(224|he>>12)<<ve[3&pe++],me[pe>>2]|=(128|he>>6&63)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]):(he=65536+((1023&he)<<10|1023&G.charCodeAt(++Ee)),me[pe>>2]|=(240|he>>18)<<ve[3&pe++],me[pe>>2]|=(128|he>>12&63)<<ve[3&pe++],me[pe>>2]|=(128|he>>6&63)<<ve[3&pe++],me[pe>>2]|=(128|63&he)<<ve[3&pe++]);if(this.lastByteIndex=pe,pe>=be){for(this.start=pe-be,this.block=me[Te],pe=0;pe<Te;++pe)Pe[pe]^=me[pe];f(Pe),this.reset=!0}else this.start=pe}return this},Keccak.prototype.encode=function(G,K){var ne=255&G,ue=1,pe=[ne];for(ne=255&(G>>=8);ne>0;)pe.unshift(ne),ne=255&(G>>=8),++ue;return K?pe.push(ue):pe.unshift(ue),this.update(pe),pe.length},Keccak.prototype.encodeString=function(G){var ne,ue=typeof G;if("string"!==ue){if("object"!==ue)throw new Error(K);if(null===G)throw new Error(K);if(ye&&G.constructor===ArrayBuffer)G=new Uint8Array(G);else if(!(Array.isArray(G)||ye&&ArrayBuffer.isView(G)))throw new Error(K);ne=!0}var pe=0,he=G.length;if(ne)pe=he;else for(var me=0;me<G.length;++me){var be=G.charCodeAt(me);be<128?pe+=1:be<2048?pe+=2:be<55296||be>=57344?pe+=3:(be=65536+((1023&be)<<10|1023&G.charCodeAt(++me)),pe+=4)}return pe+=this.encode(8*pe),this.update(G),pe},Keccak.prototype.bytepad=function(G,K){for(var ne=this.encode(K),ue=0;ue<G.length;++ue)ne+=this.encodeString(G[ue]);var pe=K-ne%K,he=[];return he.length=pe,this.update(he),this},Keccak.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var G=this.blocks,K=this.lastByteIndex,ne=this.blockCount,ue=this.s;if(G[K>>2]|=this.padding[3&K],this.lastByteIndex===this.byteCount)for(G[0]=G[ne],K=1;K<ne+1;++K)G[K]=0;for(G[ne-1]|=2147483648,K=0;K<ne;++K)ue[K]^=G[K];f(ue)}},Keccak.prototype.toString=Keccak.prototype.hex=function(){this.finalize();for(var G,K=this.blockCount,ne=this.s,ue=this.outputBlocks,pe=this.extraBytes,he=0,ye=0,be="";ye<ue;){for(he=0;he<K&&ye<ue;++he,++ye)G=ne[he],be+=me[G>>4&15]+me[15&G]+me[G>>12&15]+me[G>>8&15]+me[G>>20&15]+me[G>>16&15]+me[G>>28&15]+me[G>>24&15];ye%K==0&&(f(ne),he=0)}return pe&&(G=ne[he],be+=me[G>>4&15]+me[15&G],pe>1&&(be+=me[G>>12&15]+me[G>>8&15]),pe>2&&(be+=me[G>>20&15]+me[G>>16&15])),be},Keccak.prototype.arrayBuffer=function(){this.finalize();var G,K=this.blockCount,ne=this.s,ue=this.outputBlocks,pe=this.extraBytes,he=0,ye=0,me=this.outputBits>>3;G=pe?new ArrayBuffer(ue+1<<2):new ArrayBuffer(me);for(var be=new Uint32Array(G);ye<ue;){for(he=0;he<K&&ye<ue;++he,++ye)be[ye]=ne[he];ye%K==0&&f(ne)}return pe&&(be[he]=ne[he],G=G.slice(0,me)),G},Keccak.prototype.buffer=Keccak.prototype.arrayBuffer,Keccak.prototype.digest=Keccak.prototype.array=function(){this.finalize();for(var G,K,ne=this.blockCount,ue=this.s,pe=this.outputBlocks,he=this.extraBytes,ye=0,me=0,be=[];me<pe;){for(ye=0;ye<ne&&me<pe;++ye,++me)G=me<<2,K=ue[ye],be[G]=255&K,be[G+1]=K>>8&255,be[G+2]=K>>16&255,be[G+3]=K>>24&255;me%ne==0&&f(ue)}return he&&(G=me<<2,K=ue[ye],be[G]=255&K,he>1&&(be[G+1]=K>>8&255),he>2&&(be[G+2]=K>>16&255)),be},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0),Keccak.prototype.finalize.call(this)};var f=function(G){var K,ne,ue,pe,he,ye,me,be,ve,Te,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue,je,ze,Je,Xe,Qe,Ye,et,tt,rt,nt,at,it,ot,ct,dt,ut,ft,yt,wt,At,St,kt,Bt,Lt,Ut,$t,Ht,Vt,er,tr,rr,cr,dr,Rr,kr,$r,qr,Hr,Vr;for(ue=0;ue<48;ue+=2)pe=G[0]^G[10]^G[20]^G[30]^G[40],he=G[1]^G[11]^G[21]^G[31]^G[41],ye=G[2]^G[12]^G[22]^G[32]^G[42],me=G[3]^G[13]^G[23]^G[33]^G[43],be=G[4]^G[14]^G[24]^G[34]^G[44],ve=G[5]^G[15]^G[25]^G[35]^G[45],Te=G[6]^G[16]^G[26]^G[36]^G[46],Ee=G[7]^G[17]^G[27]^G[37]^G[47],K=(Pe=G[8]^G[18]^G[28]^G[38]^G[48])^(ye<<1|me>>>31),ne=(Se=G[9]^G[19]^G[29]^G[39]^G[49])^(me<<1|ye>>>31),G[0]^=K,G[1]^=ne,G[10]^=K,G[11]^=ne,G[20]^=K,G[21]^=ne,G[30]^=K,G[31]^=ne,G[40]^=K,G[41]^=ne,K=pe^(be<<1|ve>>>31),ne=he^(ve<<1|be>>>31),G[2]^=K,G[3]^=ne,G[12]^=K,G[13]^=ne,G[22]^=K,G[23]^=ne,G[32]^=K,G[33]^=ne,G[42]^=K,G[43]^=ne,K=ye^(Te<<1|Ee>>>31),ne=me^(Ee<<1|Te>>>31),G[4]^=K,G[5]^=ne,G[14]^=K,G[15]^=ne,G[24]^=K,G[25]^=ne,G[34]^=K,G[35]^=ne,G[44]^=K,G[45]^=ne,K=be^(Pe<<1|Se>>>31),ne=ve^(Se<<1|Pe>>>31),G[6]^=K,G[7]^=ne,G[16]^=K,G[17]^=ne,G[26]^=K,G[27]^=ne,G[36]^=K,G[37]^=ne,G[46]^=K,G[47]^=ne,K=Te^(pe<<1|he>>>31),ne=Ee^(he<<1|pe>>>31),G[8]^=K,G[9]^=ne,G[18]^=K,G[19]^=ne,G[28]^=K,G[29]^=ne,G[38]^=K,G[39]^=ne,G[48]^=K,G[49]^=ne,Ce=G[0],ke=G[1],kt=G[11]<<4|G[10]>>>28,Bt=G[10]<<4|G[11]>>>28,Xe=G[20]<<3|G[21]>>>29,Qe=G[21]<<3|G[20]>>>29,$r=G[31]<<9|G[30]>>>23,qr=G[30]<<9|G[31]>>>23,yt=G[40]<<18|G[41]>>>14,wt=G[41]<<18|G[40]>>>14,nt=G[2]<<1|G[3]>>>31,at=G[3]<<1|G[2]>>>31,Oe=G[13]<<12|G[12]>>>20,xe=G[12]<<12|G[13]>>>20,Lt=G[22]<<10|G[23]>>>22,Ut=G[23]<<10|G[22]>>>22,Ye=G[33]<<13|G[32]>>>19,et=G[32]<<13|G[33]>>>19,Hr=G[42]<<2|G[43]>>>30,Vr=G[43]<<2|G[42]>>>30,tr=G[5]<<30|G[4]>>>2,rr=G[4]<<30|G[5]>>>2,it=G[14]<<6|G[15]>>>26,ot=G[15]<<6|G[14]>>>26,Ne=G[25]<<11|G[24]>>>21,Me=G[24]<<11|G[25]>>>21,$t=G[34]<<15|G[35]>>>17,Ht=G[35]<<15|G[34]>>>17,tt=G[45]<<29|G[44]>>>3,rt=G[44]<<29|G[45]>>>3,Ue=G[6]<<28|G[7]>>>4,je=G[7]<<28|G[6]>>>4,cr=G[17]<<23|G[16]>>>9,dr=G[16]<<23|G[17]>>>9,ct=G[26]<<25|G[27]>>>7,dt=G[27]<<25|G[26]>>>7,Be=G[36]<<21|G[37]>>>11,Fe=G[37]<<21|G[36]>>>11,Vt=G[47]<<24|G[46]>>>8,er=G[46]<<24|G[47]>>>8,At=G[8]<<27|G[9]>>>5,St=G[9]<<27|G[8]>>>5,ze=G[18]<<20|G[19]>>>12,Je=G[19]<<20|G[18]>>>12,Rr=G[29]<<7|G[28]>>>25,kr=G[28]<<7|G[29]>>>25,ut=G[38]<<8|G[39]>>>24,ft=G[39]<<8|G[38]>>>24,De=G[48]<<14|G[49]>>>18,Le=G[49]<<14|G[48]>>>18,G[0]=Ce^~Oe&Ne,G[1]=ke^~xe&Me,G[10]=Ue^~ze&Xe,G[11]=je^~Je&Qe,G[20]=nt^~it&ct,G[21]=at^~ot&dt,G[30]=At^~kt&Lt,G[31]=St^~Bt&Ut,G[40]=tr^~cr&Rr,G[41]=rr^~dr&kr,G[2]=Oe^~Ne&Be,G[3]=xe^~Me&Fe,G[12]=ze^~Xe&Ye,G[13]=Je^~Qe&et,G[22]=it^~ct&ut,G[23]=ot^~dt&ft,G[32]=kt^~Lt&$t,G[33]=Bt^~Ut&Ht,G[42]=cr^~Rr&$r,G[43]=dr^~kr&qr,G[4]=Ne^~Be&De,G[5]=Me^~Fe&Le,G[14]=Xe^~Ye&tt,G[15]=Qe^~et&rt,G[24]=ct^~ut&yt,G[25]=dt^~ft&wt,G[34]=Lt^~$t&Vt,G[35]=Ut^~Ht&er,G[44]=Rr^~$r&Hr,G[45]=kr^~qr&Vr,G[6]=Be^~De&Ce,G[7]=Fe^~Le&ke,G[16]=Ye^~tt&Ue,G[17]=et^~rt&je,G[26]=ut^~yt&nt,G[27]=ft^~wt&at,G[36]=$t^~Vt&At,G[37]=Ht^~er&St,G[46]=$r^~Hr&tr,G[47]=qr^~Vr&rr,G[8]=De^~Ce&Oe,G[9]=Le^~ke&xe,G[18]=tt^~Ue&ze,G[19]=rt^~je&Je,G[28]=yt^~nt&it,G[29]=wt^~at&ot,G[38]=Vt^~At&kt,G[39]=er^~St&Bt,G[48]=Hr^~tr&cr,G[49]=Vr^~rr&dr,G[0]^=_e[ue],G[1]^=_e[ue+1]};if(he)G.exports=ke;else for(xe=0;xe<Oe.length;++xe)ue[Oe[xe]]=ke[Oe[xe]]}()}(OW);var xW=getDefaultExportFromCjs(OW.exports);function keccak256(G){return"0x"+xW.keccak_256(arrayify(G))}const NW=new Logger("rlp/5.7.0");function arrayifyInteger(G){const K=[];for(;G;)K.unshift(255&G),G>>=8;return K}function _encode(G){if(Array.isArray(G)){let K=[];if(G.forEach((function(G){K=K.concat(_encode(G))})),K.length<=55)return K.unshift(192+K.length),K;const ne=arrayifyInteger(K.length);return ne.unshift(247+ne.length),ne.concat(K)}(function isBytesLike(G){return isHexString(G)&&!(G.length%2)||isBytes(G)})(G)||NW.throwArgumentError("RLP object must be BytesLike","object",G);const K=Array.prototype.slice.call(arrayify(G));if(1===K.length&&K[0]<=127)return K;if(K.length<=55)return K.unshift(128+K.length),K;const ne=arrayifyInteger(K.length);return ne.unshift(183+ne.length),ne.concat(K)}const MW=new Logger("address/5.7.0");function getChecksumAddress(G){isHexString(G,20)||MW.throwArgumentError("invalid address","address",G);const K=(G=G.toLowerCase()).substring(2).split(""),ne=new Uint8Array(40);for(let G=0;G<40;G++)ne[G]=K[G].charCodeAt(0);const ue=arrayify(keccak256(ne));for(let G=0;G<40;G+=2)ue[G>>1]>>4>=8&&(K[G]=K[G].toUpperCase()),(15&ue[G>>1])>=8&&(K[G+1]=K[G+1].toUpperCase());return"0x"+K.join("")}const BW={};for(let G=0;G<10;G++)BW[String(G)]=String(G);for(let G=0;G<26;G++)BW[String.fromCharCode(65+G)]=String(10+G);const FW=Math.floor(function log10(G){return Math.log10?Math.log10(G):Math.log(G)/Math.LN10}(9007199254740991));function getAddress(G){let K=null;if("string"!=typeof G&&MW.throwArgumentError("invalid address","address",G),G.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==G.substring(0,2)&&(G="0x"+G),K=getChecksumAddress(G),G.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&K!==G&&MW.throwArgumentError("bad address checksum","address",G);else if(G.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(G.substring(2,4)!==function ibanChecksum(G){let K=(G=(G=G.toUpperCase()).substring(4)+G.substring(0,2)+"00").split("").map((G=>BW[G])).join("");for(;K.length>=FW;){let G=K.substring(0,FW);K=parseInt(G,10)%97+K.substring(G.length)}let ne=String(98-parseInt(K,10)%97);for(;ne.length<2;)ne="0"+ne;return ne}(G)&&MW.throwArgumentError("bad icap checksum","address",G),K=function _base36To16(G){return new hW(G,36).toString(16)}(G.substring(4));K.length<40;)K="0"+K;K=getChecksumAddress("0x"+K)}else MW.throwArgumentError("invalid address","address",G);return K}function isAddress(G){try{return getAddress(G),!0}catch(G){}return!1}function getContractAddress(G){let K=null;try{K=getAddress(G.from)}catch(K){MW.throwArgumentError("missing from address","transaction",G)}return getAddress(hexDataSlice(keccak256(function encode(G){return hexlify(_encode(G))}([K,function stripZeros(G){let K=arrayify(G);if(0===K.length)return K;let ne=0;for(;ne<K.length&&0===K[ne];)ne++;return ne&&(K=K.slice(ne)),K}(arrayify(BigNumber.from(G.nonce).toHexString()))])),12))}class AddressCoder extends Coder{constructor(G){super("address","address",G,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(G,K){try{K=getAddress(K)}catch(G){this._throwError(G.message,K)}return G.writeValue(K)}decode(G){return getAddress(hexZeroPad(G.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(G){super(G.name,G.type,void 0,G.dynamic),this.coder=G}defaultValue(){return this.coder.defaultValue()}encode(G,K){return this.coder.encode(G,K)}decode(G){return this.coder.decode(G)}}const DW=new Logger(_W);function pack(G,K,ne){let ue=null;if(Array.isArray(ne))ue=ne;else if(ne&&"object"==typeof ne){let G={};ue=K.map((K=>{const ue=K.localName;return ue||DW.throwError("cannot encode object for signature with missing names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:K,value:ne}),G[ue]&&DW.throwError("cannot encode object for signature with duplicate names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:K,value:ne}),G[ue]=!0,ne[ue]}))}else DW.throwArgumentError("invalid tuple value","tuple",ne);K.length!==ue.length&&DW.throwArgumentError("types/value length mismatch","tuple",ne);let pe=new Writer(G.wordSize),he=new Writer(G.wordSize),ye=[];K.forEach(((G,K)=>{let ne=ue[K];if(G.dynamic){let K=he.length;G.encode(he,ne);let ue=pe.writeUpdatableValue();ye.push((G=>{ue(G+K)}))}else G.encode(pe,ne)})),ye.forEach((G=>{G(pe.length)}));let me=G.appendWriter(pe);return me+=G.appendWriter(he),me}function unpack(G,K){let ne=[],ue=G.subReader(0);K.forEach((K=>{let pe=null;if(K.dynamic){let ne=G.readValue(),he=ue.subReader(ne.toNumber());try{pe=K.decode(he)}catch(G){if(G.code===Logger.errors.BUFFER_OVERRUN)throw G;pe=G,pe.baseType=K.name,pe.name=K.localName,pe.type=K.type}}else try{pe=K.decode(G)}catch(G){if(G.code===Logger.errors.BUFFER_OVERRUN)throw G;pe=G,pe.baseType=K.name,pe.name=K.localName,pe.type=K.type}null!=pe&&ne.push(pe)}));const pe=K.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});K.forEach(((G,K)=>{let ue=G.localName;if(!ue||1!==pe[ue])return;if("length"===ue&&(ue="_length"),null!=ne[ue])return;const he=ne[K];he instanceof Error?Object.defineProperty(ne,ue,{enumerable:!0,get:()=>{throw he}}):ne[ue]=he}));for(let G=0;G<ne.length;G++){const K=ne[G];K instanceof Error&&Object.defineProperty(ne,G,{enumerable:!0,get:()=>{throw K}})}return Object.freeze(ne)}class ArrayCoder extends Coder{constructor(G,K,ne){super("array",G.type+"["+(K>=0?K:"")+"]",ne,-1===K||G.dynamic),this.coder=G,this.length=K}defaultValue(){const G=this.coder.defaultValue(),K=[];for(let ne=0;ne<this.length;ne++)K.push(G);return K}encode(G,K){Array.isArray(K)||this._throwError("expected array value",K);let ne=this.length;-1===ne&&(ne=K.length,G.writeValue(K.length)),DW.checkArgumentCount(K.length,ne,"coder array"+(this.localName?" "+this.localName:""));let ue=[];for(let G=0;G<K.length;G++)ue.push(this.coder);return pack(G,ue,K)}decode(G){let K=this.length;-1===K&&(K=G.readValue().toNumber(),32*K>G._data.length&&DW.throwError("insufficient data length",Logger.errors.BUFFER_OVERRUN,{length:G._data.length,count:K}));let ne=[];for(let G=0;G<K;G++)ne.push(new AnonymousCoder(this.coder));return G.coerce(this.name,unpack(G,ne))}}class BooleanCoder extends Coder{constructor(G){super("bool","bool",G,!1)}defaultValue(){return!1}encode(G,K){return G.writeValue(K?1:0)}decode(G){return G.coerce(this.type,!G.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(G,K){super(G,G,K,!0)}defaultValue(){return"0x"}encode(G,K){K=arrayify(K);let ne=G.writeValue(K.length);return ne+=G.writeBytes(K),ne}decode(G){return G.readBytes(G.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(G){super("bytes",G)}decode(G){return G.coerce(this.name,hexlify(super.decode(G)))}}class FixedBytesCoder extends Coder{constructor(G,K){let ne="bytes"+String(G);super(ne,ne,K,!1),this.size=G}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(G,K){let ne=arrayify(K);return ne.length!==this.size&&this._throwError("incorrect data length",K),G.writeBytes(ne)}decode(G){return G.coerce(this.name,hexlify(G.readBytes(this.size)))}}class NullCoder extends Coder{constructor(G){super("null","",G,!1)}defaultValue(){return null}encode(G,K){return null!=K&&this._throwError("not null",K),G.writeBytes([])}decode(G){return G.readBytes(0),G.coerce(this.name,null)}}const LW="0x0000000000000000000000000000000000000000",UW=BigNumber.from(-1),$W=BigNumber.from(0),qW=BigNumber.from(1),GW=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class NumberCoder extends Coder{constructor(G,K,ne){const ue=(K?"int":"uint")+8*G;super(ue,ue,ne,!1),this.size=G,this.signed=K}defaultValue(){return 0}encode(G,K){let ne=BigNumber.from(K),ue=GW.mask(8*G.wordSize);if(this.signed){let G=ue.mask(8*this.size-1);(ne.gt(G)||ne.lt(G.add(qW).mul(UW)))&&this._throwError("value out-of-bounds",K)}else(ne.lt($W)||ne.gt(ue.mask(8*this.size)))&&this._throwError("value out-of-bounds",K);return ne=ne.toTwos(8*this.size).mask(8*this.size),this.signed&&(ne=ne.fromTwos(8*this.size).toTwos(8*G.wordSize)),G.writeValue(ne)}decode(G){let K=G.readValue().mask(8*this.size);return this.signed&&(K=K.fromTwos(8*this.size)),G.coerce(this.name,K)}}const jW=new Logger("strings/5.7.0");var HW,WW;function ignoreFunc(G,K,ne,ue,pe){if(G===WW.BAD_PREFIX||G===WW.UNEXPECTED_CONTINUE){let G=0;for(let ue=K+1;ue<ne.length&&ne[ue]>>6==2;ue++)G++;return G}return G===WW.OVERRUN?ne.length-K-1:0}!function(G){G.current="",G.NFC="NFC",G.NFD="NFD",G.NFKC="NFKC",G.NFKD="NFKD"}(HW||(HW={})),function(G){G.UNEXPECTED_CONTINUE="unexpected continuation byte",G.BAD_PREFIX="bad codepoint prefix",G.OVERRUN="string overrun",G.MISSING_CONTINUE="missing continuation byte",G.OUT_OF_RANGE="out of UTF-8 range",G.UTF16_SURROGATE="UTF-16 surrogate",G.OVERLONG="overlong representation"}(WW||(WW={}));const zW=Object.freeze({error:function errorFunc(G,K,ne,ue,pe){return jW.throwArgumentError(`invalid codepoint at offset ${K}; ${G}`,"bytes",ne)},ignore:ignoreFunc,replace:function replaceFunc(G,K,ne,ue,pe){return G===WW.OVERLONG?(ue.push(pe),0):(ue.push(65533),ignoreFunc(G,K,ne))}});function toUtf8Bytes(G,K=HW.current){K!=HW.current&&(jW.checkNormalize(),G=G.normalize(K));let ne=[];for(let K=0;K<G.length;K++){const ue=G.charCodeAt(K);if(ue<128)ne.push(ue);else if(ue<2048)ne.push(ue>>6|192),ne.push(63&ue|128);else if(55296==(64512&ue)){K++;const pe=G.charCodeAt(K);if(K>=G.length||56320!=(64512&pe))throw new Error("invalid utf-8 string");const he=65536+((1023&ue)<<10)+(1023&pe);ne.push(he>>18|240),ne.push(he>>12&63|128),ne.push(he>>6&63|128),ne.push(63&he|128)}else ne.push(ue>>12|224),ne.push(ue>>6&63|128),ne.push(63&ue|128)}return arrayify(ne)}function toUtf8String(G,K){return function _toUtf8String(G){return G.map((G=>G<=65535?String.fromCharCode(G):(G-=65536,String.fromCharCode(55296+(G>>10&1023),56320+(1023&G))))).join("")}(function getUtf8CodePoints(G,K){null==K&&(K=zW.error),G=arrayify(G);const ne=[];let ue=0;for(;ue<G.length;){const pe=G[ue++];if(pe>>7==0){ne.push(pe);continue}let he=null,ye=null;if(192==(224&pe))he=1,ye=127;else if(224==(240&pe))he=2,ye=2047;else{if(240!=(248&pe)){ue+=K(128==(192&pe)?WW.UNEXPECTED_CONTINUE:WW.BAD_PREFIX,ue-1,G,ne);continue}he=3,ye=65535}if(ue-1+he>=G.length){ue+=K(WW.OVERRUN,ue-1,G,ne);continue}let me=pe&(1<<8-he-1)-1;for(let pe=0;pe<he;pe++){let pe=G[ue];if(128!=(192&pe)){ue+=K(WW.MISSING_CONTINUE,ue,G,ne),me=null;break}me=me<<6|63&pe,ue++}null!==me&&(me>1114111?ue+=K(WW.OUT_OF_RANGE,ue-1-he,G,ne,me):me>=55296&&me<=57343?ue+=K(WW.UTF16_SURROGATE,ue-1-he,G,ne,me):me<=ye?ue+=K(WW.OVERLONG,ue-1-he,G,ne,me):ne.push(me))}return ne}(G,K))}class StringCoder extends DynamicBytesCoder{constructor(G){super("string",G)}defaultValue(){return""}encode(G,K){return super.encode(G,toUtf8Bytes(K))}decode(G){return toUtf8String(super.decode(G))}}class TupleCoder extends Coder{constructor(G,K){let ne=!1;const ue=[];G.forEach((G=>{G.dynamic&&(ne=!0),ue.push(G.type)}));super("tuple","tuple("+ue.join(",")+")",K,ne),this.coders=G}defaultValue(){const G=[];this.coders.forEach((K=>{G.push(K.defaultValue())}));const K=this.coders.reduce(((G,K)=>{const ne=K.localName;return ne&&(G[ne]||(G[ne]=0),G[ne]++),G}),{});return this.coders.forEach(((ne,ue)=>{let pe=ne.localName;pe&&1===K[pe]&&("length"===pe&&(pe="_length"),null==G[pe]&&(G[pe]=G[ue]))})),Object.freeze(G)}encode(G,K){return pack(G,this.coders,K)}decode(G){return G.coerce(this.name,unpack(G,this.coders))}}const VW=new Logger(_W),KW=new RegExp(/^bytes([0-9]*)$/),JW=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(G){defineReadOnly(this,"coerceFunc",G||null)}_getCoder(G){switch(G.baseType){case"address":return new AddressCoder(G.name);case"bool":return new BooleanCoder(G.name);case"string":return new StringCoder(G.name);case"bytes":return new BytesCoder(G.name);case"array":return new ArrayCoder(this._getCoder(G.arrayChildren),G.arrayLength,G.name);case"tuple":return new TupleCoder((G.components||[]).map((G=>this._getCoder(G))),G.name);case"":return new NullCoder(G.name)}let K=G.type.match(JW);if(K){let ne=parseInt(K[2]||"256");return(0===ne||ne>256||ne%8!=0)&&VW.throwArgumentError("invalid "+K[1]+" bit length","param",G),new NumberCoder(ne/8,"int"===K[1],G.name)}if(K=G.type.match(KW),K){let ne=parseInt(K[1]);return(0===ne||ne>32)&&VW.throwArgumentError("invalid bytes length","param",G),new FixedBytesCoder(ne,G.name)}return VW.throwArgumentError("invalid type","type",G.type)}_getWordSize(){return 32}_getReader(G,K){return new Reader(G,this._getWordSize(),this.coerceFunc,K)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(G){const K=G.map((G=>this._getCoder(ParamType.from(G))));return new TupleCoder(K,"_").defaultValue()}encode(G,K){G.length!==K.length&&VW.throwError("types/values length mismatch",Logger.errors.INVALID_ARGUMENT,{count:{types:G.length,values:K.length},value:{types:G,values:K}});const ne=G.map((G=>this._getCoder(ParamType.from(G)))),ue=new TupleCoder(ne,"_"),pe=this._getWriter();return ue.encode(pe,K),pe.data}decode(G,K,ne){const ue=G.map((G=>this._getCoder(ParamType.from(G))));return new TupleCoder(ue,"_").decode(this._getReader(arrayify(K),ne))}}const XW=new AbiCoder;function id(G){return keccak256(toUtf8Bytes(G))}const QW=new Logger(_W);class LogDescription extends Description{}class TransactionDescription extends Description{}class ErrorDescription extends Description{}class Indexed extends Description{static isIndexed(G){return!(!G||!G._isIndexed)}}const ZW={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(G,K){const ne=new Error(`deferred error during ABI decoding triggered accessing ${G}`);return ne.error=K,ne}class Interface{constructor(G){let K=[];K="string"==typeof G?JSON.parse(G):G,defineReadOnly(this,"fragments",K.map((G=>Fragment.from(G))).filter((G=>null!=G))),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach((G=>{let K=null;switch(G.type){case"constructor":return this.deploy?void QW.warn("duplicate definition - constructor"):void defineReadOnly(this,"deploy",G);case"function":K=this.functions;break;case"event":K=this.events;break;case"error":K=this.errors;break;default:return}let ne=G.format();K[ne]?QW.warn("duplicate definition - "+ne):K[ne]=G})),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(G){G||(G=SW.full),G===SW.sighash&&QW.throwArgumentError("interface does not support formatting sighash","format",G);const K=this.fragments.map((K=>K.format(G)));return G===SW.json?JSON.stringify(K.map((G=>JSON.parse(G)))):K}static getAbiCoder(){return XW}static getAddress(G){return getAddress(G)}static getSighash(G){return hexDataSlice(id(G.format()),0,4)}static getEventTopic(G){return id(G.format())}getFunction(G){if(isHexString(G)){for(const K in this.functions)if(G===this.getSighash(K))return this.functions[K];QW.throwArgumentError("no matching function","sighash",G)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.functions).filter((G=>G.split("(")[0]===K));return 0===ne.length?QW.throwArgumentError("no matching function","name",K):ne.length>1&&QW.throwArgumentError("multiple matching functions","name",K),this.functions[ne[0]]}const K=this.functions[FunctionFragment.fromString(G).format()];return K||QW.throwArgumentError("no matching function","signature",G),K}getEvent(G){if(isHexString(G)){const K=G.toLowerCase();for(const G in this.events)if(K===this.getEventTopic(G))return this.events[G];QW.throwArgumentError("no matching event","topichash",K)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.events).filter((G=>G.split("(")[0]===K));return 0===ne.length?QW.throwArgumentError("no matching event","name",K):ne.length>1&&QW.throwArgumentError("multiple matching events","name",K),this.events[ne[0]]}const K=this.events[EventFragment.fromString(G).format()];return K||QW.throwArgumentError("no matching event","signature",G),K}getError(G){if(isHexString(G)){const K=getStatic(this.constructor,"getSighash");for(const ne in this.errors){if(G===K(this.errors[ne]))return this.errors[ne]}QW.throwArgumentError("no matching error","sighash",G)}if(-1===G.indexOf("(")){const K=G.trim(),ne=Object.keys(this.errors).filter((G=>G.split("(")[0]===K));return 0===ne.length?QW.throwArgumentError("no matching error","name",K):ne.length>1&&QW.throwArgumentError("multiple matching errors","name",K),this.errors[ne[0]]}const K=this.errors[FunctionFragment.fromString(G).format()];return K||QW.throwArgumentError("no matching error","signature",G),K}getSighash(G){if("string"==typeof G)try{G=this.getFunction(G)}catch(K){try{G=this.getError(G)}catch(G){throw K}}return getStatic(this.constructor,"getSighash")(G)}getEventTopic(G){return"string"==typeof G&&(G=this.getEvent(G)),getStatic(this.constructor,"getEventTopic")(G)}_decodeParams(G,K){return this._abiCoder.decode(G,K)}_encodeParams(G,K){return this._abiCoder.encode(G,K)}encodeDeploy(G){return this._encodeParams(this.deploy.inputs,G||[])}decodeErrorResult(G,K){"string"==typeof G&&(G=this.getError(G));const ne=arrayify(K);return hexlify(ne.slice(0,4))!==this.getSighash(G)&&QW.throwArgumentError(`data signature does not match error ${G.name}.`,"data",hexlify(ne)),this._decodeParams(G.inputs,ne.slice(4))}encodeErrorResult(G,K){return"string"==typeof G&&(G=this.getError(G)),hexlify(concat([this.getSighash(G),this._encodeParams(G.inputs,K||[])]))}decodeFunctionData(G,K){"string"==typeof G&&(G=this.getFunction(G));const ne=arrayify(K);return hexlify(ne.slice(0,4))!==this.getSighash(G)&&QW.throwArgumentError(`data signature does not match function ${G.name}.`,"data",hexlify(ne)),this._decodeParams(G.inputs,ne.slice(4))}encodeFunctionData(G,K){return"string"==typeof G&&(G=this.getFunction(G)),hexlify(concat([this.getSighash(G),this._encodeParams(G.inputs,K||[])]))}decodeFunctionResult(G,K){"string"==typeof G&&(G=this.getFunction(G));let ne=arrayify(K),ue=null,pe="",he=null,ye=null,me=null;switch(ne.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(G.outputs,ne)}catch(G){}break;case 4:{const G=hexlify(ne.slice(0,4)),K=ZW[G];if(K)he=this._abiCoder.decode(K.inputs,ne.slice(4)),ye=K.name,me=K.signature,K.reason&&(ue=he[0]),"Error"===ye?pe=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(he[0])}`:"Panic"===ye&&(pe=`; VM Exception while processing transaction: reverted with panic code ${he[0]}`);else try{const K=this.getError(G);he=this._abiCoder.decode(K.inputs,ne.slice(4)),ye=K.name,me=K.format()}catch(G){}break}}return QW.throwError("call revert exception"+pe,Logger.errors.CALL_EXCEPTION,{method:G.format(),data:hexlify(K),errorArgs:he,errorName:ye,errorSignature:me,reason:ue})}encodeFunctionResult(G,K){return"string"==typeof G&&(G=this.getFunction(G)),hexlify(this._abiCoder.encode(G.outputs,K||[]))}encodeFilterTopics(G,K){"string"==typeof G&&(G=this.getEvent(G)),K.length>G.inputs.length&&QW.throwError("too many arguments for "+G.format(),Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:K});let ne=[];G.anonymous||ne.push(this.getEventTopic(G));const encodeTopic=(G,K)=>"string"===G.type?id(K):"bytes"===G.type?keccak256(hexlify(K)):("bool"===G.type&&"boolean"==typeof K&&(K=K?"0x01":"0x00"),G.type.match(/^u?int/)&&(K=BigNumber.from(K).toHexString()),"address"===G.type&&this._abiCoder.encode(["address"],[K]),hexZeroPad(hexlify(K),32));for(K.forEach(((K,ue)=>{let pe=G.inputs[ue];pe.indexed?null==K?ne.push(null):"array"===pe.baseType||"tuple"===pe.baseType?QW.throwArgumentError("filtering with tuples or arrays not supported","contract."+pe.name,K):Array.isArray(K)?ne.push(K.map((G=>encodeTopic(pe,G)))):ne.push(encodeTopic(pe,K)):null!=K&&QW.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+pe.name,K)}));ne.length&&null===ne[ne.length-1];)ne.pop();return ne}encodeEventLog(G,K){"string"==typeof G&&(G=this.getEvent(G));const ne=[],ue=[],pe=[];return G.anonymous||ne.push(this.getEventTopic(G)),K.length!==G.inputs.length&&QW.throwArgumentError("event arguments/values mismatch","values",K),G.inputs.forEach(((G,he)=>{const ye=K[he];if(G.indexed)if("string"===G.type)ne.push(id(ye));else if("bytes"===G.type)ne.push(keccak256(ye));else{if("tuple"===G.baseType||"array"===G.baseType)throw new Error("not implemented");ne.push(this._abiCoder.encode([G.type],[ye]))}else ue.push(G),pe.push(ye)})),{data:this._abiCoder.encode(ue,pe),topics:ne}}decodeEventLog(G,K,ne){if("string"==typeof G&&(G=this.getEvent(G)),null!=ne&&!G.anonymous){let K=this.getEventTopic(G);isHexString(ne[0],32)&&ne[0].toLowerCase()===K||QW.throwError("fragment/topic mismatch",Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:K,value:ne[0]}),ne=ne.slice(1)}let ue=[],pe=[],he=[];G.inputs.forEach(((G,K)=>{G.indexed?"string"===G.type||"bytes"===G.type||"tuple"===G.baseType||"array"===G.baseType?(ue.push(ParamType.fromObject({type:"bytes32",name:G.name})),he.push(!0)):(ue.push(G),he.push(!1)):(pe.push(G),he.push(!1))}));let ye=null!=ne?this._abiCoder.decode(ue,concat(ne)):null,me=this._abiCoder.decode(pe,K,!0),be=[],ve=0,_e=0;G.inputs.forEach(((G,K)=>{if(G.indexed)if(null==ye)be[K]=new Indexed({_isIndexed:!0,hash:null});else if(he[K])be[K]=new Indexed({_isIndexed:!0,hash:ye[_e++]});else try{be[K]=ye[_e++]}catch(G){be[K]=G}else try{be[K]=me[ve++]}catch(G){be[K]=G}if(G.name&&null==be[G.name]){const ne=be[K];ne instanceof Error?Object.defineProperty(be,G.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(G.name)}`,ne)}}):be[G.name]=ne}}));for(let G=0;G<be.length;G++){const K=be[G];K instanceof Error&&Object.defineProperty(be,G,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${G}`,K)}})}return Object.freeze(be)}parseTransaction(G){let K=this.getFunction(G.data.substring(0,10).toLowerCase());return K?new TransactionDescription({args:this._abiCoder.decode(K.inputs,"0x"+G.data.substring(10)),functionFragment:K,name:K.name,signature:K.format(),sighash:this.getSighash(K),value:BigNumber.from(G.value||"0")}):null}parseLog(G){let K=this.getEvent(G.topics[0]);return!K||K.anonymous?null:new LogDescription({eventFragment:K,name:K.name,signature:K.format(),topic:this.getEventTopic(K),args:this.decodeEventLog(K,G.data,G.topics)})}parseError(G){const K=hexlify(G);let ne=this.getError(K.substring(0,10).toLowerCase());return ne?new ErrorDescription({args:this._abiCoder.decode(ne.inputs,"0x"+K.substring(10)),errorFragment:ne,name:ne.name,signature:ne.format(),sighash:this.getSighash(ne)}):null}static isInterface(G){return!(!G||!G._isInterface)}}var __awaiter$2=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const YW=new Logger("abstract-provider/5.7.0");class Provider{constructor(){YW.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$2(this,void 0,void 0,(function*(){const{block:G,gasPrice:K}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((G=>null))});let ne=null,ue=null,pe=null;return G&&G.baseFeePerGas&&(ne=G.baseFeePerGas,pe=BigNumber.from("1500000000"),ue=G.baseFeePerGas.mul(2).add(pe)),{lastBaseFeePerGas:ne,maxFeePerGas:ue,maxPriorityFeePerGas:pe,gasPrice:K}}))}addListener(G,K){return this.on(G,K)}removeListener(G,K){return this.off(G,K)}static isProvider(G){return!(!G||!G._isProvider)}}var __awaiter$1=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const ez=new Logger("abstract-signer/5.7.0"),tz=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],rz=[Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){ez.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(G){return __awaiter$1(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),G)}))}getTransactionCount(G){return __awaiter$1(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),G)}))}estimateGas(G){return __awaiter$1(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const K=yield resolveProperties(this.checkTransaction(G));return yield this.provider.estimateGas(K)}))}call(G,K){return __awaiter$1(this,void 0,void 0,(function*(){this._checkProvider("call");const ne=yield resolveProperties(this.checkTransaction(G));return yield this.provider.call(ne,K)}))}sendTransaction(G){return __awaiter$1(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const K=yield this.populateTransaction(G),ne=yield this.signTransaction(K);return yield this.provider.sendTransaction(ne)}))}getChainId(){return __awaiter$1(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return __awaiter$1(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return __awaiter$1(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(G){return __awaiter$1(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(G)}))}checkTransaction(G){for(const K in G)-1===tz.indexOf(K)&&ez.throwArgumentError("invalid transaction key: "+K,"transaction",G);const K=shallowCopy(G);return null==K.from?K.from=this.getAddress():K.from=Promise.all([Promise.resolve(K.from),this.getAddress()]).then((K=>(K[0].toLowerCase()!==K[1].toLowerCase()&&ez.throwArgumentError("from address mismatch","transaction",G),K[0]))),K}populateTransaction(G){return __awaiter$1(this,void 0,void 0,(function*(){const K=yield resolveProperties(this.checkTransaction(G));null!=K.to&&(K.to=Promise.resolve(K.to).then((G=>__awaiter$1(this,void 0,void 0,(function*(){if(null==G)return null;const K=yield this.resolveName(G);return null==K&&ez.throwArgumentError("provided ENS name resolves to null","tx.to",G),K})))),K.to.catch((G=>{})));const ne=null!=K.maxFeePerGas||null!=K.maxPriorityFeePerGas;if(null==K.gasPrice||2!==K.type&&!ne?0!==K.type&&1!==K.type||!ne||ez.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",G):ez.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",G),2!==K.type&&null!=K.type||null==K.maxFeePerGas||null==K.maxPriorityFeePerGas)if(0===K.type||1===K.type)null==K.gasPrice&&(K.gasPrice=this.getGasPrice());else{const G=yield this.getFeeData();if(null==K.type)if(null!=G.maxFeePerGas&&null!=G.maxPriorityFeePerGas)if(K.type=2,null!=K.gasPrice){const G=K.gasPrice;delete K.gasPrice,K.maxFeePerGas=G,K.maxPriorityFeePerGas=G}else null==K.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null==K.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas);else null!=G.gasPrice?(ne&&ez.throwError("network does not support EIP-1559",Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==K.gasPrice&&(K.gasPrice=G.gasPrice),K.type=0):ez.throwError("failed to get consistent fee data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===K.type&&(null==K.maxFeePerGas&&(K.maxFeePerGas=G.maxFeePerGas),null==K.maxPriorityFeePerGas&&(K.maxPriorityFeePerGas=G.maxPriorityFeePerGas))}else K.type=2;return null==K.nonce&&(K.nonce=this.getTransactionCount("pending")),null==K.gasLimit&&(K.gasLimit=this.estimateGas(K).catch((G=>{if(rz.indexOf(G.code)>=0)throw G;return ez.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:G,tx:K})}))),null==K.chainId?K.chainId=this.getChainId():K.chainId=Promise.all([Promise.resolve(K.chainId),this.getChainId()]).then((K=>(0!==K[1]&&K[0]!==K[1]&&ez.throwArgumentError("chainId address mismatch","transaction",G),K[0]))),yield resolveProperties(K)}))}_checkProvider(G){this.provider||ez.throwError("missing provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:G||"_checkProvider"})}static isSigner(G){return!(!G||!G._isSigner)}}class VoidSigner extends Signer{constructor(G,K){super(),defineReadOnly(this,"address",G),defineReadOnly(this,"provider",K||null)}getAddress(){return Promise.resolve(this.address)}_fail(G,K){return Promise.resolve().then((()=>{ez.throwError(G,Logger.errors.UNSUPPORTED_OPERATION,{operation:K})}))}signMessage(G){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(G){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(G,K,ne){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(G){return new VoidSigner(this.address,G)}}const nz=new Logger("transactions/5.7.0");var az;function accessSetify(G,K){return{address:getAddress(G),storageKeys:(K||[]).map(((K,ne)=>(32!==function hexDataLength(G){if("string"!=typeof G)G=hexlify(G);else if(!isHexString(G)||G.length%2)return null;return(G.length-2)/2}(K)&&nz.throwArgumentError("invalid access list storageKey",`accessList[${G}:${ne}]`,K),K.toLowerCase())))}}!function(G){G[G.legacy=0]="legacy",G[G.eip2930=1]="eip2930",G[G.eip1559=2]="eip1559"}(az||(az={}));var __awaiter=function(G,K,ne,ue){return new(ne||(ne=Promise))((function(pe,he){function fulfilled(G){try{step(ue.next(G))}catch(G){he(G)}}function rejected(G){try{step(ue.throw(G))}catch(G){he(G)}}function step(G){G.done?pe(G.value):function adopt(G){return G instanceof ne?G:new ne((function(K){K(G)}))}(G.value).then(fulfilled,rejected)}step((ue=ue.apply(G,K||[])).next())}))};const iz=new Logger("contracts/5.7.0");function resolveName(G,K){return __awaiter(this,void 0,void 0,(function*(){const ne=yield K;"string"!=typeof ne&&iz.throwArgumentError("invalid address or ENS name","name",ne);try{return getAddress(ne)}catch(G){}G||iz.throwError("a provider or signer is needed to resolve ENS names",Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const ue=yield G.resolveName(ne);return null==ue&&iz.throwArgumentError("resolver or addr is not configured for ENS name","name",ne),ue}))}function resolveAddresses(G,K,ne){return __awaiter(this,void 0,void 0,(function*(){return Array.isArray(ne)?yield Promise.all(ne.map(((ne,ue)=>resolveAddresses(G,Array.isArray(K)?K[ue]:K[ne.name],ne)))):"address"===ne.type?yield resolveName(G,K):"tuple"===ne.type?yield resolveAddresses(G,K,ne.components):"array"===ne.baseType?Array.isArray(K)?yield Promise.all(K.map((K=>resolveAddresses(G,K,ne.arrayChildren)))):Promise.reject(iz.makeError("invalid value for array",Logger.errors.INVALID_ARGUMENT,{argument:"value",value:K})):K}))}function populateTransaction(G,K,ne){return __awaiter(this,void 0,void 0,(function*(){let ue={};ne.length===K.inputs.length+1&&"object"==typeof ne[ne.length-1]&&(ue=shallowCopy(ne.pop())),iz.checkArgumentCount(ne.length,K.inputs.length,"passed to contract"),G.signer?ue.from?ue.from=resolveProperties({override:resolveName(G.signer,ue.from),signer:G.signer.getAddress()}).then((G=>__awaiter(this,void 0,void 0,(function*(){return getAddress(G.signer)!==G.override&&iz.throwError("Contract with a Signer cannot override from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),G.override})))):ue.from=G.signer.getAddress():ue.from&&(ue.from=resolveName(G.provider,ue.from));const pe=yield resolveProperties({args:resolveAddresses(G.signer||G.provider,ne,K.inputs),address:G.resolvedAddress,overrides:resolveProperties(ue)||{}}),he=G.interface.encodeFunctionData(K,pe.args),ye={data:he,to:pe.address},me=pe.overrides;if(null!=me.nonce&&(ye.nonce=BigNumber.from(me.nonce).toNumber()),null!=me.gasLimit&&(ye.gasLimit=BigNumber.from(me.gasLimit)),null!=me.gasPrice&&(ye.gasPrice=BigNumber.from(me.gasPrice)),null!=me.maxFeePerGas&&(ye.maxFeePerGas=BigNumber.from(me.maxFeePerGas)),null!=me.maxPriorityFeePerGas&&(ye.maxPriorityFeePerGas=BigNumber.from(me.maxPriorityFeePerGas)),null!=me.from&&(ye.from=me.from),null!=me.type&&(ye.type=me.type),null!=me.accessList&&(ye.accessList=function accessListify(G){if(Array.isArray(G))return G.map(((G,K)=>Array.isArray(G)?(G.length>2&&nz.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${K}]`,G),accessSetify(G[0],G[1])):accessSetify(G.address,G.storageKeys)));const K=Object.keys(G).map((K=>{const ne=G[K].reduce(((G,K)=>(G[K]=!0,G)),{});return accessSetify(K,Object.keys(ne).sort())}));return K.sort(((G,K)=>G.address.localeCompare(K.address))),K}(me.accessList)),null==ye.gasLimit&&null!=K.gas){let G=21e3;const ne=arrayify(he);for(let K=0;K<ne.length;K++)G+=4,ne[K]&&(G+=64);ye.gasLimit=BigNumber.from(K.gas).add(G)}if(me.value){const G=BigNumber.from(me.value);G.isZero()||K.payable||iz.throwError("non-payable method cannot override value",Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:ue.value}),ye.value=G}me.customData&&(ye.customData=shallowCopy(me.customData)),me.ccipReadEnabled&&(ye.ccipReadEnabled=!!me.ccipReadEnabled),delete ue.nonce,delete ue.gasLimit,delete ue.gasPrice,delete ue.from,delete ue.value,delete ue.type,delete ue.accessList,delete ue.maxFeePerGas,delete ue.maxPriorityFeePerGas,delete ue.customData,delete ue.ccipReadEnabled;const be=Object.keys(ue).filter((G=>null!=ue[G]));return be.length&&iz.throwError(`cannot override ${be.map((G=>JSON.stringify(G))).join(",")}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:be}),ye}))}function buildCall(G,K,ne){const ue=G.signer||G.provider;return function(...pe){return __awaiter(this,void 0,void 0,(function*(){let he;if(pe.length===K.inputs.length+1&&"object"==typeof pe[pe.length-1]){const G=shallowCopy(pe.pop());null!=G.blockTag&&(he=yield G.blockTag),delete G.blockTag,pe.push(G)}null!=G.deployTransaction&&(yield G._deployed(he));const ye=yield populateTransaction(G,K,pe),me=yield ue.call(ye,he);try{let ue=G.interface.decodeFunctionResult(K,me);return ne&&1===K.outputs.length&&(ue=ue[0]),ue}catch(K){throw K.code===Logger.errors.CALL_EXCEPTION&&(K.address=G.address,K.args=pe,K.transaction=ye),K}}))}}function buildSend(G,K){return function(...ne){return __awaiter(this,void 0,void 0,(function*(){G.signer||iz.throwError("sending a transaction requires a signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=G.deployTransaction&&(yield G._deployed());const ue=yield populateTransaction(G,K,ne),pe=yield G.signer.sendTransaction(ue);return function addContractWait(G,K){const ne=K.wait.bind(K);K.wait=K=>ne(K).then((K=>(K.events=K.logs.map((ne=>{let ue=deepCopy(ne),pe=null;try{pe=G.interface.parseLog(ne)}catch(G){}return pe&&(ue.args=pe.args,ue.decode=(K,ne)=>G.interface.decodeEventLog(pe.eventFragment,K,ne),ue.event=pe.name,ue.eventSignature=pe.signature),ue.removeListener=()=>G.provider,ue.getBlock=()=>G.provider.getBlock(K.blockHash),ue.getTransaction=()=>G.provider.getTransaction(K.transactionHash),ue.getTransactionReceipt=()=>Promise.resolve(K),ue})),K)))}(G,pe),pe}))}}function buildDefault(G,K,ne){return K.constant?buildCall(G,K,ne):buildSend(G,K)}function getEventTag(G){return!G.address||null!=G.topics&&0!==G.topics.length?(G.address||"*")+"@"+(G.topics?G.topics.map((G=>Array.isArray(G)?G.join("|"):G)).join(":"):""):"*"}class RunningEvent{constructor(G,K){defineReadOnly(this,"tag",G),defineReadOnly(this,"filter",K),this._listeners=[]}addListener(G,K){this._listeners.push({listener:G,once:K})}removeListener(G){let K=!1;this._listeners=this._listeners.filter((ne=>!(!K&&ne.listener===G)||(K=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((G=>G.listener))}listenerCount(){return this._listeners.length}run(G){const K=this.listenerCount();return this._listeners=this._listeners.filter((K=>{const ne=G.slice();return setTimeout((()=>{K.listener.apply(this,ne)}),0),!K.once})),K}prepareEvent(G){}getEmit(G){return[G]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(G,K,ne,ue){const pe={address:G};let he=K.getEventTopic(ne);ue?(he!==ue[0]&&iz.throwArgumentError("topic mismatch","topics",ue),pe.topics=ue.slice()):pe.topics=[he],super(getEventTag(pe),pe),defineReadOnly(this,"address",G),defineReadOnly(this,"interface",K),defineReadOnly(this,"fragment",ne)}prepareEvent(G){super.prepareEvent(G),G.event=this.fragment.name,G.eventSignature=this.fragment.format(),G.decode=(G,K)=>this.interface.decodeEventLog(this.fragment,G,K);try{G.args=this.interface.decodeEventLog(this.fragment,G.data,G.topics)}catch(K){G.args=null,G.decodeError=K}}getEmit(G){const K=function checkResultErrors(G){const K=[],checkErrors=function(G,ne){if(Array.isArray(ne))for(let ue in ne){const pe=G.slice();pe.push(ue);try{checkErrors(pe,ne[ue])}catch(G){K.push({path:pe,error:G})}}};return checkErrors([],G),K}(G.args);if(K.length)throw K[0].error;const ne=(G.args||[]).slice();return ne.push(G),ne}}class WildcardRunningEvent extends RunningEvent{constructor(G,K){super("*",{address:G}),defineReadOnly(this,"address",G),defineReadOnly(this,"interface",K)}prepareEvent(G){super.prepareEvent(G);try{const K=this.interface.parseLog(G);G.event=K.name,G.eventSignature=K.signature,G.decode=(G,ne)=>this.interface.decodeEventLog(K.eventFragment,G,ne),G.args=K.args}catch(G){}}}class BaseContract{constructor(G,K,ne){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(K)),null==ne?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer.isSigner(ne)?(defineReadOnly(this,"provider",ne.provider||null),defineReadOnly(this,"signer",ne)):Provider.isProvider(ne)?(defineReadOnly(this,"provider",ne),defineReadOnly(this,"signer",null)):iz.throwArgumentError("invalid signer or provider","signerOrProvider",ne),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const G={};Object.keys(this.interface.events).forEach((K=>{const ne=this.interface.events[K];defineReadOnly(this.filters,K,((...G)=>({address:this.address,topics:this.interface.encodeFilterTopics(ne,G)}))),G[ne.name]||(G[ne.name]=[]),G[ne.name].push(K)})),Object.keys(G).forEach((K=>{const ne=G[K];1===ne.length?defineReadOnly(this.filters,K,this.filters[ne[0]]):iz.warn(`Duplicate definition of ${K} (${ne.join(", ")})`)}))}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),null==G&&iz.throwArgumentError("invalid contract address or ENS name","addressOrName",G),defineReadOnly(this,"address",G),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,G));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress(G)))}catch(G){iz.throwError("provider is required to use ENS name as contract address",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((G=>{}));const ue={},pe={};Object.keys(this.interface.functions).forEach((G=>{const K=this.interface.functions[G];if(pe[G])iz.warn(`Duplicate ABI entry for ${JSON.stringify(G)}`);else{pe[G]=!0;{const ne=K.name;ue[`%${ne}`]||(ue[`%${ne}`]=[]),ue[`%${ne}`].push(G)}null==this[G]&&defineReadOnly(this,G,buildDefault(this,K,!0)),null==this.functions[G]&&defineReadOnly(this.functions,G,buildDefault(this,K,!1)),null==this.callStatic[G]&&defineReadOnly(this.callStatic,G,buildCall(this,K,!0)),null==this.populateTransaction[G]&&defineReadOnly(this.populateTransaction,G,function buildPopulate(G,K){return function(...ne){return populateTransaction(G,K,ne)}}(this,K)),null==this.estimateGas[G]&&defineReadOnly(this.estimateGas,G,function buildEstimate(G,K){const ne=G.signer||G.provider;return function(...ue){return __awaiter(this,void 0,void 0,(function*(){ne||iz.throwError("estimate require a provider or signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const pe=yield populateTransaction(G,K,ue);return yield ne.estimateGas(pe)}))}}(this,K))}})),Object.keys(ue).forEach((G=>{const K=ue[G];if(K.length>1)return;G=G.substring(1);const ne=K[0];try{null==this[G]&&defineReadOnly(this,G,this[ne])}catch(G){}null==this.functions[G]&&defineReadOnly(this.functions,G,this.functions[ne]),null==this.callStatic[G]&&defineReadOnly(this.callStatic,G,this.callStatic[ne]),null==this.populateTransaction[G]&&defineReadOnly(this.populateTransaction,G,this.populateTransaction[ne]),null==this.estimateGas[G]&&defineReadOnly(this.estimateGas,G,this.estimateGas[ne])}))}static getContractAddress(G){return getContractAddress(G)}static getInterface(G){return Interface.isInterface(G)?G:new Interface(G)}deployed(){return this._deployed()}_deployed(G){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,G).then((G=>("0x"===G&&iz.throwError("contract not deployed",Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(G){this.signer||iz.throwError("sending a transactions require a signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const K=shallowCopy(G||{});return["from","to"].forEach((function(G){null!=K[G]&&iz.throwError("cannot override "+G,Logger.errors.UNSUPPORTED_OPERATION,{operation:G})})),K.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(K)))}connect(G){"string"==typeof G&&(G=new VoidSigner(G,this.provider));const K=new this.constructor(this.address,this.interface,G);return this.deployTransaction&&defineReadOnly(K,"deployTransaction",this.deployTransaction),K}attach(G){return new this.constructor(G,this.interface,this.signer||this.provider)}static isIndexed(G){return Indexed.isIndexed(G)}_normalizeRunningEvent(G){return this._runningEvents[G.tag]?this._runningEvents[G.tag]:G}_getRunningEvent(G){if("string"==typeof G){if("error"===G)return this._normalizeRunningEvent(new ErrorRunningEvent);if("event"===G)return this._normalizeRunningEvent(new RunningEvent("event",null));if("*"===G)return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const K=this.interface.getEvent(G);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,K))}if(G.topics&&G.topics.length>0){try{const K=G.topics[0];if("string"!=typeof K)throw new Error("invalid topic");const ne=this.interface.getEvent(K);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,ne,G.topics))}catch(G){}const K={address:this.address,topics:G.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag(K),K))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(G){if(0===G.listenerCount()){delete this._runningEvents[G.tag];const K=this._wrappedEmits[G.tag];K&&G.filter&&(this.provider.off(G.filter,K),delete this._wrappedEmits[G.tag])}}_wrapEvent(G,K,ne){const ue=deepCopy(K);return ue.removeListener=()=>{ne&&(G.removeListener(ne),this._checkRunningEvents(G))},ue.getBlock=()=>this.provider.getBlock(K.blockHash),ue.getTransaction=()=>this.provider.getTransaction(K.transactionHash),ue.getTransactionReceipt=()=>this.provider.getTransactionReceipt(K.transactionHash),G.prepareEvent(ue),ue}_addEventListener(G,K,ne){if(this.provider||iz.throwError("events require a provider or a signer with a provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),G.addListener(K,ne),this._runningEvents[G.tag]=G,!this._wrappedEmits[G.tag]){const wrappedEmit=ne=>{let ue=this._wrapEvent(G,ne,K);if(null==ue.decodeError)try{const K=G.getEmit(ue);this.emit(G.filter,...K)}catch(G){ue.decodeError=G.error}null!=G.filter&&this.emit("event",ue),null!=ue.decodeError&&this.emit("error",ue.decodeError,ue)};this._wrappedEmits[G.tag]=wrappedEmit,null!=G.filter&&this.provider.on(G.filter,wrappedEmit)}}queryFilter(G,K,ne){const ue=this._getRunningEvent(G),pe=shallowCopy(ue.filter);return"string"==typeof K&&isHexString(K,32)?(null!=ne&&iz.throwArgumentError("cannot specify toBlock with blockhash","toBlock",ne),pe.blockHash=K):(pe.fromBlock=null!=K?K:0,pe.toBlock=null!=ne?ne:"latest"),this.provider.getLogs(pe).then((G=>G.map((G=>this._wrapEvent(ue,G,null)))))}on(G,K){return this._addEventListener(this._getRunningEvent(G),K,!1),this}once(G,K){return this._addEventListener(this._getRunningEvent(G),K,!0),this}emit(G,...K){if(!this.provider)return!1;const ne=this._getRunningEvent(G),ue=ne.run(K)>0;return this._checkRunningEvents(ne),ue}listenerCount(G){return this.provider?null==G?Object.keys(this._runningEvents).reduce(((G,K)=>G+this._runningEvents[K].listenerCount()),0):this._getRunningEvent(G).listenerCount():0}listeners(G){if(!this.provider)return[];if(null==G){const G=[];for(let K in this._runningEvents)this._runningEvents[K].listeners().forEach((K=>{G.push(K)}));return G}return this._getRunningEvent(G).listeners()}removeAllListeners(G){if(!this.provider)return this;if(null==G){for(const G in this._runningEvents){const K=this._runningEvents[G];K.removeAllListeners(),this._checkRunningEvents(K)}return this}const K=this._getRunningEvent(G);return K.removeAllListeners(),this._checkRunningEvents(K),this}off(G,K){if(!this.provider)return this;const ne=this._getRunningEvent(G);return ne.removeListener(K),this._checkRunningEvents(ne),this}removeListener(G,K){return this.off(G,K)}}class Contract extends BaseContract{}const sz=[{inputs:[{internalType:"address",name:"_gateway",type:"address"},{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"CallerNotBridge",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidChildBridgeAdaptor",type:"error"},{inputs:[],name:"InvalidChildChain",type:"error"},{inputs:[],name:"InvalidSourceAddress",type:"error"},{inputs:[],name:"InvalidSourceChain",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NotApprovedByGateway",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[],name:"UnsupportedOperation",type:"error"},{inputs:[],name:"ZeroAddresses",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"sourceChain",type:"string"},{indexed:!1,internalType:"string",name:"sourceAddress_",type:"string"},{indexed:!1,internalType:"bytes",name:"payload_",type:"bytes"}],name:"AdaptorExecute",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"string",name:"childChain",type:"string"},{indexed:!0,internalType:"string",name:"childBridgeAdaptor",type:"string"},{indexed:!0,internalType:"bytes",name:"payload",type:"bytes"}],name:"AxelarMessageSent",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"oldChildBridgeAdaptor",type:"string"},{indexed:!1,internalType:"string",name:"newChildBridgeAdaptor",type:"string"}],name:"ChildBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"string",name:"oldChildChain",type:"string"},{indexed:!0,internalType:"string",name:"newChildChain",type:"string"}],name:"ChildChainUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldGasService",type:"address"},{indexed:!0,internalType:"address",name:"newGasService",type:"address"}],name:"GasServiceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldRootBridge",type:"address"},{indexed:!0,internalType:"address",name:"newRootBridge",type:"address"}],name:"RootBridgeUpdated",type:"event"},{inputs:[],name:"BRIDGE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"GAS_SERVICE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TARGET_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"childBridgeAdaptor",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"childChainId",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"commandId",type:"bytes32"},{internalType:"string",name:"sourceChain",type:"string"},{internalType:"string",name:"sourceAddress",type:"string"},{internalType:"bytes",name:"payload",type:"bytes"}],name:"execute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"commandId",type:"bytes32"},{internalType:"string",name:"sourceChain",type:"string"},{internalType:"string",name:"sourceAddress",type:"string"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"executeWithToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"gasService",outputs:[{internalType:"contract IAxelarGasService",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"gateway",outputs:[{internalType:"contract IAxelarGateway",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantBridgeManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantGasServiceManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantTargetManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"bridgeManager",type:"address"},{internalType:"address",name:"gasServiceManager",type:"address"},{internalType:"address",name:"targetManager",type:"address"}],internalType:"struct IRootAxelarBridgeAdaptor.InitializationRoles",name:"_adaptorRoles",type:"tuple"},{internalType:"address",name:"_rootBridge",type:"address"},{internalType:"string",name:"_childChainId",type:"string"},{internalType:"string",name:"_childBridgeAdaptor",type:"string"},{internalType:"address",name:"_gasService",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeBridgeManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeGasServiceManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeTargetManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootBridge",outputs:[{internalType:"contract IRootERC20Bridge",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"address",name:"refundRecipient",type:"address"}],name:"sendMessage",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"newChildBridgeAdaptor",type:"string"}],name:"updateChildBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newChildChain",type:"string"}],name:"updateChildChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newGasService",type:"address"}],name:"updateGasService",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRootBridge",type:"address"}],name:"updateRootBridge",outputs:[],stateMutability:"nonpayable",type:"function"}];var oz,cz,dz,uz;!function(G){G.SUCCESS="SUCCESS",G.PENDING="PENDING",G.FAILED="FAILED"}(oz||(oz={})),function(G){G.DEPOSIT="DEPOSIT",G.WITHDRAW="WITHDRAW",G.FINALISE_WITHDRAWAL="FINALISE_WITHDRAWAL"}(cz||(cz={})),function(G){G[G.DEPOSIT_SOURCE=15e4]="DEPOSIT_SOURCE",G[G.DEPOSIT_DESTINATION=25e4]="DEPOSIT_DESTINATION",G[G.WITHDRAW_SOURCE=25e4]="WITHDRAW_SOURCE",G[G.WITHDRAW_DESTINATION=25e4]="WITHDRAW_DESTINATION",G[G.MAP_TOKEN_SOURCE=2e5]="MAP_TOKEN_SOURCE",G[G.MAP_TOKEN_DESTINATION=2e5]="MAP_TOKEN_DESTINATION",G[G.FINALISE_WITHDRAWAL=2e5]="FINALISE_WITHDRAWAL",G[G.APPROVE_TOKEN=55e3]="APPROVE_TOKEN"}(dz||(dz={})),function(G){G.PENDING="PENDING",G.PROCESSING="PROCESSING",G.COMPLETE="COMPLETE",G.RETRY="RETRY",G.ERROR="ERROR",G.NOT_ENOUGH_GAS="NOT_ENOUGH_GAS",G.FLOW_RATE_CONTROLLED="FLOW_RATE_CONTROLLED"}(uz||(uz={}));const fz="NATIVE",lz="11155111",pz="15003",hz="13473",yz="13371",mz={mainnet:"0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d",testnet:"0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439",devnet:""},bz={mainnet:"0xf57e7e7c23978c3caec3c3548e3d615c346e79ff",testnet:"0xe2629e08f4125d14e446660028bD98ee60EE69F2",devnet:""},gz={mainnet:"0x52a6c53869ce09a731cd772f245b97a4401d3348",testnet:"0xe9E96d1aad82562b7588F03f49aD34186f996478",devnet:""},vz={mainnet:"0x4f49b53928a71e553bb1b0f66a5bcb54fd4e8932",testnet:"0x6328Ac88ba8D466a0F551FC7C42C61d1aC7f92ab",devnet:""},wz={mainnet:"0x4f49b53928a71e553bb1b0f66a5bcb54fd4e8932",testnet:"0x6328Ac88ba8D466a0F551FC7C42C61d1aC7f92ab",devnet:""},_z={mainnet:"immutable",testnet:"immutable",devnet:""},Tz={mainnet:"0x4F4495243837681061C4743b74B3eEdf548D56A5",testnet:"0xe432150cce91c13a887f7D836923d5597adD8E31",devnet:""},Az={rootChainID:lz,childChainID:pz},Ez={rootChainID:lz,childChainID:hz},Pz={rootChainID:"1",childChainID:yz},Sz={mainnet:"https://api.gmp.axelarscan.io",testnet:"https://testnet.api.gmp.axelarscan.io",devnet:"https://stagenet.api.gmp.axelarscan.io"},Iz={mainnet:"https://bridge-api.immutable.com/v1/tenderly/estimate",testnet:"https://bridge-api.sandbox.immutable.com/v1/tenderly/estimate",devnet:"https://bridge-api.dev.immutable.com/v1/tenderly/estimate"},Cz={11155111:{id:"ethereum-sepolia",symbol:"ETH"},1:{id:"ethereum",symbol:"ETH"},15003:{id:"immutable",symbol:"IMX"},13473:{id:"immutable",symbol:"IMX"},13371:{id:"immutable",symbol:"IMX"}},Rz={token:"deposit",tokenTo:"depositTo",native:"depositETH",nativeTo:"depositToETH"},kz={token:"withdraw",tokenTo:"withdrawTo",native:"withdrawIMX",nativeTo:"withdrawIMXTo"};var Oz;!function(G){G.UNSUPPORTED_ERROR="UNSUPPORTED_ERROR",G.INVALID_ADDRESS="INVALID_ADDRESS",G.INVALID_AMOUNT="INVALID_AMOUNT",G.INTERNAL_ERROR="INTERNAL_ERROR",G.PROVIDER_ERROR="PROVIDER_ERROR",G.ROOT_PROVIDER_ERROR="ROOT_PROVIDER_ERROR",G.CHILD_PROVIDER_ERROR="CHILD_PROVIDER_ERROR",G.TRANSACTION_REVERTED="TRANSACTION_REVERTED",G.INVALID_TOKEN="INVALID_TOKEN",G.INVALID_TRANSACTION="INVALID_TRANSACTION",G.INVALID_SOURCE_CHAIN_ID="INVALID_SOURCE_CHAIN_ID",G.INVALID_DESTINATION_CHAIN_ID="INVALID_DESTINATION_CHAIN_ID",G.INVALID_SOURCE_OR_DESTINATION_CHAIN="INVALID_SOURCE_OR_DESTINATION_CHAIN",G.CHAIN_IDS_MATCH="CHAIN_IDS_MATCH",G.AXELAR_CHAIN_NOT_FOUND="AXELAR_CHAIN_NOT_FOUND",G.AXELAR_GAS_ESTIMATE_FAILED="AXELAR_GAS_ESTIMATE_FAILED",G.TENDERLY_GAS_ESTIMATE_FAILED="TENDERLY_GAS_ESTIMATE_FAILED",G.INVALID_RECIPIENT="INVALID_RECIPIENT",G.FLOW_RATE_ERROR="FLOW_RATE_ERROR",G.INVALID_FLOWRATE_INDEX="INVALID_FLOWRATE_INDEX"}(Oz||(Oz={}));class BridgeError extends Error{type;constructor(G,K){super(G),this.type=K}}const withBridgeError=async(G,K,ne)=>{try{return await G()}catch(G){let ne=`${K}: ${G.message}`||"UnknownError";throw new BridgeError(ne,K)}};async function createContract(G,K,ne){return await withBridgeError((async()=>new Contract(G,K,ne)),Oz.PROVIDER_ERROR)}function getAddresses(G,K){let ne;return ne=G===Pz.rootChainID||G===Pz.childChainID?K.mainnet:G===Ez.rootChainID||G===Ez.childChainID?K.testnet:K.devnet,ne}function isChildETH(G,K){return G.toUpperCase()===function getChildETH(G){return getAddresses(G,gz)}(K).toUpperCase()}function getRootIMX(G){return getAddresses(G,bz)}function getAxelarEndpoint(G){return getAddresses(G,Sz)}function isWrappedIMX(G,K){return G.toUpperCase()===function getWrappedIMX(G){return getAddresses(G,mz)}(K).toUpperCase()}function isValidDeposit(G,K){return G.sourceChainId===K.rootChainID&&G.destinationChainId===K.childChainID&&G.action===cz.DEPOSIT}function isValidWithdraw(G,K){return G.sourceChainId===K.childChainID&&G.destinationChainId===K.rootChainID&&G.action===cz.WITHDRAW}async function checkReceiver(G,K,ne,ue){let pe;if(K===ue.bridgeInstance.rootChainID){if(!isChildETH(G,K))return;pe=ue.rootProvider}else{if(!function isRootIMX(G,K){return G.toUpperCase()===getRootIMX(K).toUpperCase()}(G,K))return;pe=ue.childProvider}if((await pe.getCode(ne)).length<=2)return;const he=await createContract(ne,["function receive()"],pe);try{await he.estimateGas.receive()}catch{try{await pe.estimateGas({to:ne})}catch{throw new BridgeError(`address ${ne} is not a valid receipient`,Oz.INVALID_RECIPIENT)}}}async function validateChainIds(G,K,ne){if(!(G===ne.bridgeInstance.rootChainID||G===ne.bridgeInstance.childChainID))throw new BridgeError(`the sourceChainId ${G} is not a valid`,Oz.INVALID_SOURCE_CHAIN_ID);if(!(K===ne.bridgeInstance.rootChainID||K===ne.bridgeInstance.childChainID))throw new BridgeError(`the destinationChainId ${K} is not a valid`,Oz.INVALID_DESTINATION_CHAIN_ID);if(G===K)throw new BridgeError(`the sourceChainId ${G} cannot be the same as the destinationChainId ${K}`,Oz.CHAIN_IDS_MATCH)}async function validateBridgeReqArgs(G,K){if(await validateChainIds(G.sourceChainId,G.destinationChainId,K),!isAddress(G.senderAddress)||!isAddress(G.recipientAddress))throw new BridgeError(`address ${G.senderAddress} or ${G.recipientAddress} is not a valid address`,Oz.INVALID_ADDRESS);if(G.amount.isNegative()||G.amount.isZero())throw new BridgeError(`deposit amount ${G.amount.toString()} is invalid`,Oz.INVALID_AMOUNT);if(G.token.toUpperCase()!==fz&&!isAddress(G.token))throw new BridgeError(`token address ${G.token} is not a valid address`,Oz.INVALID_ADDRESS)}function calculateGasFee$1(G,K){const ne=(G=>(G=>!!G.maxFeePerGas&&!!G.maxPriorityFeePerGas&&!!G.lastBaseFeePerGas)(G)?BigNumber.from(G.lastBaseFeePerGas).add(BigNumber.from(G.maxPriorityFeePerGas)):G.gasPrice?BigNumber.from(G.gasPrice):null)(G);return ne?ne.mul(K):BigNumber.from(0)}const xz=[{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:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"userAddress",type:"address"},{indexed:!1,internalType:"address",name:"relayerAddress",type:"address"},{indexed:!1,internalType:"bytes",name:"functionSignature",type:"bytes"}],name:"MetaTransactionExecuted",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"},{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:[],name:"bridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[{internalType:"bool",name:"",type:"bool"}],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:[{internalType:"address",name:"userAddress",type:"address"},{internalType:"bytes",name:"functionSignature",type:"bytes"},{internalType:"bytes32",name:"sigR",type:"bytes32"},{internalType:"bytes32",name:"sigS",type:"bytes32"},{internalType:"uint8",name:"sigV",type:"uint8"}],name:"executeMetaTransaction",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",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:[{internalType:"address",name:"rootToken_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"offset",type:"uint256"}],name:"invalidateNext",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",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:"rootToken",outputs:[{internalType:"address",name:"",type:"address"}],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"}];async function getWithdrawRootToken(G,K,ne){if(G.toUpperCase()===fz||isWrappedIMX(G,K))return getRootIMX(K);const ue=await async function createChildErc20Contract(G,K){return createContract(G,xz,K)}(G,ne);return withBridgeError((()=>ue.rootToken()),Oz.PROVIDER_ERROR)}async function submitTenderlySimulations(G,K,ne){let ue;const pe=function getTenderlyEndpoint(G){return getAddresses(G,Iz)}(G),he=ne?function unwrapStateObjects(G){const K={};return G.forEach((G=>{const{contractAddress:ne,stateDiff:ue}=G,{storageSlot:pe,value:he}=ue;void 0===K[ne]&&(K[ne]={stateDiff:{}}),K[ne].stateDiff[pe]=he})),K}(ne):void 0;try{ue=await ZH.post(pe,{jsonrpc:"2.0",id:0,method:"tenderly_simulateBundle",params:[K,"latest",he]},{headers:{"Content-Type":"application/json"}})}catch(G){ue=G.response}if(ue.data.error)throw new BridgeError(`Estimating gas failed with the reason: ${ue.data.error.message}`,Oz.TENDERLY_GAS_ESTIMATE_FAILED);const ye=ue.data.result;if(ye.length!==K.length)throw new BridgeError("Estimating gas failed with mismatched responses",Oz.TENDERLY_GAS_ESTIMATE_FAILED);const me=[];let be=!1,ve=!1,_e=!1,Te=0,Ee=!1;const Pe=void 0!==K.find((G=>G.data?.startsWith("0x84a3291a0")));for(let G=0;G<ye.length;G++){if(ye[G].error)throw new BridgeError(`Estimating deposit gas failed with the reason: ${ye[G].error.message}`,Oz.TENDERLY_GAS_ESTIMATE_FAILED);if(void 0===ye[G].gasUsed)throw new BridgeError("Estimating gas did not return simulation results",Oz.TENDERLY_GAS_ESTIMATE_FAILED);if(Pe&&void 0!==ye[G].logs){const K=ye[G].logs.find((G=>"QueuedWithdrawal"===G.name));if(void 0!==K){const G=new Map(K.inputs.map((G=>[G.name,G.value])));be=G.get("delayWithdrawalLargeAmount")||!1,ve=G.get("delayWithdrawalUnknownToken")||!1,_e=G.get("withdrawalQueueActivated")||!1}}if(Pe&&void 0!==ye[G].trace){const K=ye[G].trace.find((G=>"largeTransferThresholds"===G.method));void 0!==K&&(Te=K.output,Ee=!0)}Ee||me.push(ye[G].gasUsed)}return{gas:me,delayWithdrawalLargeAmount:be,delayWithdrawalUnknownToken:ve,withdrawalQueueActivated:_e,largeTransferThresholds:Te}}const Nz=[{inputs:[{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMapped",type:"error"},{inputs:[{internalType:"uint256",name:"actualBalance",type:"uint256"},{internalType:"uint256",name:"expectedBalance",type:"uint256"}],name:"BalanceInvariantCheckFailed",type:"error"},{inputs:[],name:"CantMapETH",type:"error"},{inputs:[],name:"CantMapIMX",type:"error"},{inputs:[],name:"CantMapWETH",type:"error"},{inputs:[],name:"ImxDepositLimitExceeded",type:"error"},{inputs:[],name:"ImxDepositLimitTooLow",type:"error"},{inputs:[{internalType:"uint256",name:"lengthOfQueue",type:"uint256"},{internalType:"uint256",name:"requestedIndex",type:"uint256"}],name:"IndexOutsideWithdrawalQueue",type:"error"},{inputs:[],name:"InsufficientValue",type:"error"},{inputs:[],name:"InvalidCapacity",type:"error"},{inputs:[],name:"InvalidChildChain",type:"error"},{inputs:[{internalType:"string",name:"reason",type:"string"}],name:"InvalidData",type:"error"},{inputs:[],name:"InvalidRefillRate",type:"error"},{inputs:[],name:"InvalidToken",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"actualToken",type:"address"}],name:"MixedTokens",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NonWrappedNativeTransfer",type:"error"},{inputs:[],name:"NotBridgeAdaptor",type:"error"},{inputs:[],name:"NotMapped",type:"error"},{inputs:[],name:"ProvideAtLeastOneIndex",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"TokenIsZero",type:"error"},{inputs:[],name:"TokenNotSupported",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"WithdrawalAlreadyProcessed",type:"error"},{inputs:[{internalType:"uint256",name:"timeNow",type:"uint256"},{internalType:"uint256",name:"currentWithdrawalTime",type:"uint256"}],name:"WithdrawalRequestTooEarly",type:"error"},{inputs:[],name:"WrongInitializer",type:"error"},{inputs:[],name:"ZeroAddress",type:"error"},{inputs:[],name:"ZeroAmount",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"who",type:"address"}],name:"ActivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[],name:"AutoActivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"who",type:"address"}],name:"DeactivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"EnQueuedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"IMXDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"}],name:"L1TokenMapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeEthDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldImxDepositLimit",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newImxDepositLimit",type:"uint256"}],name:"NewImxDepositLimit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"ProcessedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bool",name:"delayWithdrawalLargeAmount",type:"bool"},{indexed:!1,internalType:"bool",name:"delayWithdrawalUnknownToken",type:"bool"},{indexed:!1,internalType:"bool",name:"withdrawalQueueActivated",type:"bool"}],name:"QueuedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"capacity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"refillRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"largeTransferThreshold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousCapacity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousRefillRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousLargeTransferThreshold",type:"uint256"}],name:"RateControlThresholdSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRootBridgeAdaptor",type:"address"},{indexed:!1,internalType:"address",name:"newRootBridgeAdaptor",type:"address"}],name:"RootBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RootChainERC20Withdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RootChainETHWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"WETHDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"delay",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousDelay",type:"uint256"}],name:"WithdrawalDelayUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"WithdrawalForNonFlowRatedToken",type:"event"},{inputs:[],name:"ADAPTOR_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEPOSIT_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAP_TOKEN_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_IMX",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNLIMITED_DEPOSIT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNPAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"VARIABLE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WITHDRAW_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"activateWithdrawalQueue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"childERC20Bridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childTokenTemplate",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"deactivateWithdrawalQueue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositToETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"finaliseQueuedWithdrawal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256[]",name:"indices",type:"uint256[]"}],name:"finaliseQueuedWithdrawalsAggregated",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"startIndex",type:"uint256"},{internalType:"uint256",name:"stopIndex",type:"uint256"},{internalType:"uint256",name:"maxFind",type:"uint256"}],name:"findPendingWithdrawals",outputs:[{components:[{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"}],internalType:"struct FlowRateWithdrawalQueue.FindPendingWithdrawal[]",name:"found",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"flowRateBuckets",outputs:[{internalType:"uint256",name:"capacity",type:"uint256"},{internalType:"uint256",name:"depth",type:"uint256"},{internalType:"uint256",name:"refillTime",type:"uint256"},{internalType:"uint256",name:"refillRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256[]",name:"indices",type:"uint256[]"}],name:"getPendingWithdrawals",outputs:[{components:[{internalType:"address",name:"withdrawer",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"}],internalType:"struct FlowRateWithdrawalQueue.PendingWithdrawal[]",name:"pending",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"getPendingWithdrawalsLength",outputs:[{internalType:"uint256",name:"length",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantPauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantVariableManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"imxCumulativeDepositLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"variableManager",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"}],internalType:"struct IRootERC20Bridge.InitializationRoles",name:"newRoles",type:"tuple"},{internalType:"address",name:"newRootBridgeAdaptor",type:"address"},{internalType:"address",name:"newChildERC20Bridge",type:"address"},{internalType:"address",name:"newChildTokenTemplate",type:"address"},{internalType:"address",name:"newRootIMXToken",type:"address"},{internalType:"address",name:"newRootWETHToken",type:"address"},{internalType:"uint256",name:"newImxCumulativeDepositLimit",type:"uint256"},{internalType:"address",name:"rateAdmin",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"variableManager",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"}],internalType:"struct IRootERC20Bridge.InitializationRoles",name:"",type:"tuple"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"pure",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"largeTransferThresholds",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"}],name:"mapToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"onMessageReceive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokePauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeVariableManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootBridgeAdaptor",outputs:[{internalType:"contract IRootBridgeAdaptor",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"rootIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rootTokenToChildToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"rootWETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"capacity",type:"uint256"},{internalType:"uint256",name:"refillRate",type:"uint256"},{internalType:"uint256",name:"largeTransferThreshold",type:"uint256"}],name:"setRateControlThreshold",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"delay",type:"uint256"}],name:"setWithdrawalDelay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newImxCumulativeDepositLimit",type:"uint256"}],name:"updateImxCumulativeDepositLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRootBridgeAdaptor",type:"address"}],name:"updateRootBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"withdrawalDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"withdrawalQueueActivated",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],Mz=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],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:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",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:[],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:[{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"}],Bz=[{inputs:[{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMapped",type:"error"},{inputs:[{internalType:"uint256",name:"actualBalance",type:"uint256"},{internalType:"uint256",name:"expectedBalance",type:"uint256"}],name:"BalanceInvariantCheckFailed",type:"error"},{inputs:[],name:"BridgeNotSet",type:"error"},{inputs:[],name:"BurnFailed",type:"error"},{inputs:[],name:"CantMapETH",type:"error"},{inputs:[],name:"CantMapIMX",type:"error"},{inputs:[],name:"EmptyTokenContract",type:"error"},{inputs:[],name:"IncorrectBridgeAddress",type:"error"},{inputs:[],name:"InsufficientIMX",type:"error"},{inputs:[],name:"InsufficientValue",type:"error"},{inputs:[{internalType:"string",name:"reason",type:"string"}],name:"InvalidData",type:"error"},{inputs:[],name:"MintFailed",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NonWrappedNativeTransfer",type:"error"},{inputs:[],name:"NotBridgeAdaptor",type:"error"},{inputs:[],name:"NotMapped",type:"error"},{inputs:[],name:"TransferWIMXFailed",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[],name:"ZeroAddress",type:"error"},{inputs:[],name:"ZeroAddressRootToken",type:"error"},{inputs:[],name:"ZeroAmount",type:"error"},{inputs:[],name:"ZeroValue",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldChildBridgeAdaptor",type:"address"},{indexed:!1,internalType:"address",name:"newChildBridgeAdaptor",type:"address"}],name:"ChildBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Withdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainEthWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainNativeIMXWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainWrappedIMXWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"IMXDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"rootToken",type:"address"},{indexed:!1,internalType:"address",name:"childToken",type:"address"}],name:"L2TokenMapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeEthDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"PrivilegedDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"ADAPTOR_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEPOSIT_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAP_TOKEN_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_IMX",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PRIVILEGED_DEPOSITOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNPAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WITHDRAW_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"childBridgeAdaptor",outputs:[{internalType:"contract IChildBridgeAdaptor",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childTokenTemplate",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantPauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"},{internalType:"address",name:"initialDepositor",type:"address"},{internalType:"address",name:"treasuryManager",type:"address"}],internalType:"struct IChildERC20Bridge.InitializationRoles",name:"newRoles",type:"tuple"},{internalType:"address",name:"newBridgeAdaptor",type:"address"},{internalType:"address",name:"newChildTokenTemplate",type:"address"},{internalType:"address",name:"newRootIMXToken",type:"address"},{internalType:"address",name:"newWIMXToken",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"onMessageReceive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"privilegedDeposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokePauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rootTokenToChildToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newBridgeAdaptor",type:"address"}],name:"updateChildBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IChildERC20",name:"childToken",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawETHTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawIMX",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawIMXTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IChildERC20",name:"childToken",type:"address"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawWIMX",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawWIMXTo",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}];var Fz,Dz;!function(G){G.SRC_GATEWAY_CALLED="source_gateway_called",G.DEST_GATEWAY_APPROVED="destination_gateway_approved",G.DEST_EXECUTED="destination_executed",G.EXPRESS_EXECUTED="express_executed",G.DEST_EXECUTE_ERROR="error",G.DEST_EXECUTING="executing",G.APPROVING="approving",G.FORECALLED="forecalled",G.FORECALLED_WITHOUT_GAS_PAID="forecalled_without_gas_paid",G.NOT_EXECUTED="not_executed",G.NOT_EXECUTED_WITHOUT_GAS_PAID="not_executed_without_gas_paid",G.INSUFFICIENT_FEE="insufficient_fee",G.UNKNOWN_ERROR="unknown_error",G.CANNOT_FETCH_STATUS="cannot_fetch_status",G.SRC_GATEWAY_CONFIRMED="confirmed"}(Fz||(Fz={})),function(G){G.GAS_UNPAID="gas_unpaid",G.GAS_PAID="gas_paid",G.GAS_PAID_NOT_ENOUGH_GAS="gas_paid_not_enough_gas",G.GAS_PAID_ENOUGH_GAS="gas_paid_enough_gas"}(Dz||(Dz={}));const parseGMPStatus=G=>{const{error:K,status:ne}=G;return"error"===ne&&K?Fz.DEST_EXECUTE_ERROR:"executed"===ne?Fz.DEST_EXECUTED:"approved"===ne?Fz.DEST_GATEWAY_APPROVED:"called"===ne?Fz.SRC_GATEWAY_CALLED:"executing"===ne?Fz.DEST_EXECUTING:ne},fetchGMPTransaction=async(G,K,ne)=>(async(G,K)=>fetch(`${G}?${new URLSearchParams(K).toString()}`,{method:"GET",headers:{"Content-Type":"application/json"},cache:"no-store"}).then((G=>G.json())).then((G=>G.data)))(G,{method:"searchGMP",txHash:K,txLogIndex:ne}).then((G=>G.find((G=>G.id.indexOf(K)>-1||G.call.transactionHash.indexOf(K)>-1)))).catch((()=>{})),queryTransactionStatus=async(G,K,ne)=>{const ue=await fetchGMPTransaction(G,K,ne);if(!ue)return{status:Fz.CANNOT_FETCH_STATUS};const{call:pe,gas_status:he,gas_paid:ye,executed:me,express_executed:be,approved:ve,callback:_e}=ue,Te={status:he,details:ye},Ee=ue.time_spent;return Ee&&(Ee.total=Ee.total||Object.values(Ee).reduce(((G,K)=>G+K),0)),{status:parseGMPStatus(ue),error:(Pe=ue,Pe.error?{message:Pe.error.error.message,txHash:Pe.error.error.transactionHash,chain:Pe.error.chain}:Pe.is_insufficient_fee?{message:"Insufficient fee",txHash:Pe.call.transaction.hash,chain:Pe.call.chain}:void 0),timeSpent:Ee,gasPaidInfo:Te,callTx:pe,executed:me,expressExecuted:be,approved:ve,callback:_e};var Pe};class TokenBridge{config;initialised;constructor(G){this.config=G,this.initialised=!1}async initialise(){this.initialised||(await async function validateChainConfiguration(G){const K="Please upgrade to the latest version of the Bridge SDK or provide valid configuration",ne=await withBridgeError((async()=>G.rootProvider.getNetwork()),Oz.ROOT_PROVIDER_ERROR);if(ne.chainId.toString()!==G.bridgeInstance.rootChainID)throw new BridgeError(`Rootchain provider chainID ${ne.chainId} does not match expected chainID ${G.bridgeInstance.rootChainID}. ${K}`,Oz.UNSUPPORTED_ERROR);const ue=await withBridgeError((async()=>G.childProvider.getNetwork()),Oz.CHILD_PROVIDER_ERROR);if(ue.chainId.toString()!==G.bridgeInstance.childChainID)throw new BridgeError(`Childchain provider chainID ${ue.chainId} does not match expected chainID ${G.bridgeInstance.childChainID}. ${K} `,Oz.UNSUPPORTED_ERROR)}(this.config),this.initialised=!0)}async getFee(G){const[,,K]=await Promise.all([this.initialise(),async()=>{G.action!==cz.FINALISE_WITHDRAWAL&&await validateChainIds(G.sourceChainId,G.destinationChainId,this.config)},this.getFeePrivate(G)]);return K}async getFinaliseWithdrawFee(){return calculateGasFee$1(await this.config.rootProvider.getFeeData(),dz.FINALISE_WITHDRAWAL)}async getDepositOrWithdrawFee(G){let K;K=G.sourceChainId===this.config.bridgeInstance.rootChainID?await this.config.rootProvider.getFeeData():await this.config.childProvider.getFeeData();let ne,ue,pe=BigNumber.from(0),he=BigNumber.from(0),ye=BigNumber.from(0);if(G.action===cz.DEPOSIT)ne={sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,action:cz.DEPOSIT};else{if(G.action!==cz.WITHDRAW)throw new BridgeError("Invalid action",Oz.INTERNAL_ERROR);ne={sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,action:cz.WITHDRAW}}if(!isValidDeposit(ne,this.config.bridgeInstance)&&!isValidWithdraw(ne,this.config.bridgeInstance))throw new BridgeError("Invalid direction",Oz.INTERNAL_ERROR);return function isNativeTokenBridgeFeeRequest(G){return!("token"in G)||G.token.toUpperCase()===fz}(G)||(isValidDeposit(ne,this.config.bridgeInstance)||"token"in G&&function isWithdrawWrappedIMX(G,K,ne){return isValidWithdraw(K,ne)&&isWrappedIMX(G,K.sourceChainId)}(G.token,ne,this.config.bridgeInstance))&&(he=calculateGasFee$1(K,dz.APPROVE_TOKEN)),G.action===cz.DEPOSIT?(pe=calculateGasFee$1(K,dz.DEPOSIT_SOURCE),ue=dz.DEPOSIT_DESTINATION):(pe=calculateGasFee$1(K,dz.WITHDRAW_SOURCE),ue=dz.WITHDRAW_DESTINATION),ye=await this.getAxelarFee(G.sourceChainId,G.destinationChainId,ue,G.gasMultiplier),{sourceChainFee:pe,approvalFee:he,bridgeFee:ye}}async getFeePrivate(G){!function validateGetFee(G,K){if(G.action===cz.FINALISE_WITHDRAWAL&&G.sourceChainId!==K.bridgeInstance.rootChainID)throw new BridgeError(`Finalised withdrawals must be on the root chain (${K.bridgeInstance.rootChainID})`,Oz.INVALID_SOURCE_CHAIN_ID);if(!("destinationChainId"in G))throw new BridgeError("DEPOSIT or WITHDRAW used without destinationChainId",Oz.INVALID_DESTINATION_CHAIN_ID);const ne={sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,action:G.action};if(!isValidDeposit(ne,K.bridgeInstance)&&!isValidWithdraw(ne,K.bridgeInstance))throw new BridgeError("This request is neither a valid deposit nor a valid withdrawal",Oz.INVALID_SOURCE_OR_DESTINATION_CHAIN)}(G,this.config);let K=BigNumber.from(0),ne=BigNumber.from(0),ue=BigNumber.from(0);if(G.action===cz.FINALISE_WITHDRAWAL)K=await this.getFinaliseWithdrawFee();else{const pe=await this.getDepositOrWithdrawFee(G);K=pe.sourceChainFee,ne=pe.approvalFee,ue=pe.bridgeFee}const pe=K.add(ne).add(ue);return{sourceChainGas:K,approvalFee:ne,bridgeFee:ue,imtblFee:BigNumber.from("0"),totalFees:pe}}async getUnsignedApproveBridgeTx(G){const K=await this.getUnsignedBridgeBundledTx({senderAddress:G.senderAddress,recipientAddress:G.senderAddress,token:G.token,amount:G.amount,sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,gasMultiplier:1.1});return{contractToApprove:K.contractToApprove,unsignedTx:K.unsignedApprovalTx}}async getBridgeMethods(G){let K;return K=isValidDeposit(G,this.config.bridgeInstance)?Rz:kz,K}async getBridgeContract(G){if(isValidDeposit(G,this.config.bridgeInstance)){const G=this.config.bridgeContracts.rootERC20BridgeFlowRate;return await createContract(G,Nz,this.config.rootProvider)}const K=this.config.bridgeContracts.childERC20Bridge;return await createContract(K,Bz,this.config.childProvider)}async getConfigAndBridgeTxCalldata(G,K,ne,ue,pe){return async function getBridgeTxCalldata(G,K,ne,ue,pe,he){let ye,me;if(ue.toUpperCase()===fz)G===K?(ye=pe.native,me=[ne]):(ye=pe.nativeTo,me=[K,ne]);else{const he=getAddress(ue);G===K?(ye=pe.token,me=[he,ne]):(ye=pe.tokenTo,me=[he,K,ne])}return await withBridgeError((async()=>he.interface.encodeFunctionData(ye,me)),Oz.INTERNAL_ERROR)}(G,K,ne,ue,await this.getBridgeMethods(pe),await this.getBridgeContract(pe))}async getUnsignedBridgeTx(G){const K=await this.getUnsignedBridgeBundledTx({senderAddress:G.senderAddress,recipientAddress:G.senderAddress,token:G.token,amount:G.amount,sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,gasMultiplier:G.gasMultiplier});return{feeData:K.feeData,unsignedTx:K.unsignedBridgeTx}}async getUnsignedBridgeBundledTx(G){const[,,,K]=await Promise.all([this.initialise(),validateBridgeReqArgs(G,this.config),checkReceiver(G.token,G.destinationChainId,G.recipientAddress,this.config),this.getUnsignedBridgeBundledTxPrivate(G)]);return K}async getUnsignedBridgeBundledTxPrivate(G){let K;if(K=function shouldBeDepositOrFinaliseWithdraw(G,K){return G===K.rootChainID}(G.sourceChainId,this.config.bridgeInstance)?{sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,action:cz.DEPOSIT}:{sourceChainId:G.sourceChainId,destinationChainId:G.destinationChainId,action:cz.WITHDRAW},isValidDeposit(K,this.config.bridgeInstance))return this.getUnsignedBridgeDepositBundledTxPrivate(K,G.senderAddress,G.recipientAddress,G.token,G.amount,G.gasMultiplier);if(isValidWithdraw(K,this.config.bridgeInstance))return this.getUnsignedBridgeWithdrawBundledTxPrivate(K,G.senderAddress,G.recipientAddress,G.token,G.amount,G.gasMultiplier);throw new BridgeError("Invalid Bridge Bundled TX",Oz.INVALID_TRANSACTION)}async getUnsignedBridgeDepositBundledTxPrivate(G,K,ne,ue,pe,he){const[ye,me,be,ve]=await Promise.all([this.getAllowance(G,ue,K),this.config.rootProvider.getFeeData(),this.getDynamicDepositGas(this.config.bridgeInstance.rootChainID,K,ne,ue,pe),this.getAxelarFee(this.config.bridgeInstance.rootChainID,this.config.bridgeInstance.childChainID,dz.DEPOSIT_DESTINATION,he)]);let _e,Te,Ee=BigNumber.from(0),Pe=BigNumber.from(0);const Se=ve,Ce=BigNumber.from(0);if(ue.toUpperCase()!==fz&&ye.lt(pe)){_e=ue;const G=await createContract(ue,Mz,this.config.rootProvider);Te={data:await withBridgeError((async()=>G.interface.encodeFunctionData("approve",[this.config.bridgeContracts.rootERC20BridgeFlowRate,pe])),Oz.INTERNAL_ERROR),to:ue,value:0,from:K,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)},Pe=calculateGasFee$1(me,be.approvalGas)}else _e=null,Te=null;const ke=await this.getConfigAndBridgeTxCalldata(K,ne,pe,ue,G),Oe=ue.toUpperCase()===fz?pe.add(Se).toString():Se.toString(),xe={data:ke,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:Oe,from:K,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)};Ee=calculateGasFee$1(me,be.sourceChainGas);const Ne=Ee.add(Pe).add(Se).add(Ce);return{feeData:{sourceChainGas:Ee,approvalFee:Pe,bridgeFee:Se,imtblFee:Ce,totalFees:Ne},contractToApprove:_e,unsignedApprovalTx:Te,unsignedBridgeTx:xe,delayWithdrawalLargeAmount:null,delayWithdrawalUnknownToken:null,withdrawalQueueActivated:null,largeTransferThresholds:null}}async getUnsignedBridgeWithdrawBundledTxPrivate(G,K,ne,ue,pe,he){const[ye,me,be]=await Promise.all([this.getAllowance(G,ue,K),this.config.childProvider.getFeeData(),await this.getDynamicWithdrawGasRootChain(G.destinationChainId,K,ne,ue,pe)]),ve=be.gas[0],_e=await this.getAxelarFee(this.config.bridgeInstance.childChainID,this.config.bridgeInstance.rootChainID,ve,he);let Te,Ee,Pe=BigNumber.from(0),Se=BigNumber.from(0);const Ce=_e,ke=BigNumber.from(0);if(isWrappedIMX(ue,this.config.bridgeInstance.childChainID)&&ye.lt(pe)){Te=ue;const G=await createContract(ue,Mz,this.config.childProvider);Ee={data:await withBridgeError((async()=>G.interface.encodeFunctionData("approve",[this.config.bridgeContracts.childERC20Bridge,pe])),Oz.INTERNAL_ERROR),to:ue,value:0,from:K,chainId:parseInt(this.config.bridgeInstance.childChainID,10)},Se=calculateGasFee$1(me,dz.APPROVE_TOKEN)}else Te=null,Ee=null;const Oe=await this.getConfigAndBridgeTxCalldata(K,ne,pe,ue,G),xe=ue.toUpperCase()===fz?pe.add(Ce).toString():Ce.toString(),Ne={data:Oe,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:xe,from:K,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)};Pe=calculateGasFee$1(me,dz.WITHDRAW_SOURCE);const Me=Pe.add(Se).add(Ce).add(ke);return{feeData:{sourceChainGas:Pe,approvalFee:Se,bridgeFee:Ce,imtblFee:ke,totalFees:Me},contractToApprove:Te,unsignedApprovalTx:Ee,unsignedBridgeTx:Ne,delayWithdrawalLargeAmount:be.delayWithdrawalLargeAmount,delayWithdrawalUnknownToken:be.delayWithdrawalUnknownToken,withdrawalQueueActivated:be.withdrawalQueueActivated,largeTransferThresholds:be.largeTransferThresholds}}async getDynamicDepositGas(G,K,ne,ue,pe){const he=[];if(ue.toUpperCase()!==fz){const G=await createContract(ue,Mz,this.config.rootProvider),ne=await withBridgeError((async()=>G.interface.encodeFunctionData("approve",[this.config.bridgeContracts.rootERC20BridgeFlowRate,pe])),Oz.INTERNAL_ERROR);he.push({from:K,to:ue,data:ne})}const ye={action:cz.DEPOSIT,sourceChainId:G,destinationChainId:this.config.bridgeInstance.childChainID},me=await this.getConfigAndBridgeTxCalldata(K,ne,pe,ue,ye),be=ue.toUpperCase()!==fz?"0x1":hexValue(pe.add("1").toHexString());he.push({from:K,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,data:me,value:be});const{gas:ve}=await submitTenderlySimulations(G,he),_e={};return 1===ve.length?(_e.approvalGas=0,[_e.sourceChainGas]=ve):[_e.approvalGas,_e.sourceChainGas]=ve,_e}async getDynamicWithdrawGasRootChain(G,K,ne,ue,pe){const he=await getWithdrawRootToken(ue,G,this.config.childProvider),ye=function genAxelarWithdrawPayload(G,K,ne,ue){return XW.encode(["bytes32","address","address","address","uint256"],["0x7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e982869",G,K,ne,ue])}(he,K,ne,pe.toString()),me=function genUniqueAxelarCommandId(G){return keccak256(XW.encode(["bytes","uint256"],[G,(new Date).getTime()]))}(ye),be=function getChildchain(G){return getAddresses(G,_z)}(G),ve=getAddress(function getChildAdaptor(G){return getAddresses(G,vz)}(G)).toString(),_e=function getRootAdaptor(G){return getAddresses(G,wz)}(G),Te=keccak256(ye),Ee=keccak256(XW.encode(["bytes32","bytes32","string","string","address","bytes32"],["0x07b0d4304f82012bd3b70b1d531c160e326067c90829e2a3d386722ad10b89c3",me,be,ve,_e,Te])),Pe=keccak256(concat([Ee,hexlify(zeroPad(hexlify(4),32))])),Se=await createContract(_e,sz,this.config.rootProvider),Ce=await withBridgeError((async()=>Se.interface.encodeFunctionData("execute",[me,be,ve,ye])),Oz.INTERNAL_ERROR),ke=function getAxelarGateway(G){return getAddresses(G,Tz)}(G),Oe=[{from:K,to:_e,data:Ce}],xe=this.config.bridgeContracts.rootERC20BridgeFlowRate,Ne=await createContract(xe,Nz,this.config.rootProvider),Me=await withBridgeError((async()=>Ne.interface.encodeFunctionData("largeTransferThresholds",[he])),Oz.INTERNAL_ERROR);Oe.push({from:K,to:xe,data:Me});const Be={contractAddress:ke,stateDiff:{storageSlot:Pe,value:"0x0000000000000000000000000000000000000000000000000000000000000001"}};return await submitTenderlySimulations(G,Oe,[Be])}async getAllowance(G,K,ne){if(K.toUpperCase()===fz)return BigNumber.from(0);if(function isWithdrawNativeIMX(G,K,ne){return isValidWithdraw(K,ne)&&!isWrappedIMX(G,K.sourceChainId)}(K,G,this.config.bridgeInstance))return BigNumber.from(0);let ue,pe;isValidDeposit(G,this.config.bridgeInstance)?(ue=this.config.rootProvider,pe=this.config.bridgeContracts.rootERC20BridgeFlowRate):(ue=this.config.childProvider,pe=this.config.bridgeContracts.childERC20Bridge);const he=await createContract(K,Mz,ue);return await withBridgeError((()=>he.allowance(ne,pe)),Oz.PROVIDER_ERROR)}async getAxelarFee(G,K,ne,ue="auto"){const pe=Cz[G],he=Cz[K];if(!pe)throw new BridgeError(`Source chainID ${G} can not be matched to an Axelar chain.`,Oz.AXELAR_CHAIN_NOT_FOUND);if(!he)throw new BridgeError(`Destination chainID ${K} can not be matched to an Axelar chain.`,Oz.AXELAR_CHAIN_NOT_FOUND);const ye=getAxelarEndpoint(G),me={method:"estimateGasFee",sourceChain:pe.id,destinationChain:he.id,symbol:pe.symbol,gasLimit:ne,gasMultiplier:ue};let be;try{be=await ZH.post(ye,me)}catch(G){be=G.response}if(be.data.error)throw new BridgeError(`Estimating Axelar Gas failed with the reason: ${be.data.message}`,Oz.AXELAR_GAS_ESTIMATE_FAILED);try{return BigNumber.from(`${be.data}`)}catch(G){throw new BridgeError(`Estimating Axelar Gas failed with the reason: ${G}`,Oz.AXELAR_GAS_ESTIMATE_FAILED)}}async getTransactionStatus(G){const K={transactions:[]},ne=await this.getAxelarStatus(G.transactions,G.sourceChainId),ue=await this.getUniqueReceivers(ne,G.sourceChainId),pe=[];for(const G of ue)pe.push(this.getPendingWithdrawals({recipient:G}));let he=[];try{he=await Promise.all(pe)}catch(G){throw new BridgeError(`Failed to fetch the pending withdrawals with: ${G}`,Oz.FLOW_RATE_ERROR)}K.transactions=ne;for(const G of K.transactions)G.status===uz.COMPLETE&&(()=>{for(const K of he){const ne=K.pending.findIndex((K=>K.amount.toString()===G.amount.toString()&&K.token===G.token&&K.withdrawer===G.sender&&K.recipient===G.recipient));if(-1!==ne)return G.status=uz.FLOW_RATE_CONTROLLED,G.data={canWithdraw:K.pending[ne].canWithdraw,timeoutStart:K.pending[ne].timeoutStart,timeoutEnd:K.pending[ne].timeoutEnd},void K.pending.splice(ne,1)}})();return K}async getUniqueReceivers(G,K){const ne=[],ue=[pz,hz,yz].includes(K);for(let K=0,pe=G.length;K<pe;K++)if(G[K].status===uz.COMPLETE&&ue&&G[K].recipient){-1===ne.findIndex((ne=>ne===G[K].recipient))&&ne.push(G[K].recipient)}return ne}async getAxelarStatus(G,K){const ne=[],ue=[],pe=getAxelarEndpoint(K),he=[Dz.GAS_UNPAID,Dz.GAS_PAID_NOT_ENOUGH_GAS],ye=new AbiCoder;for(const K of G)ue.push(queryTransactionStatus(pe,K.txHash));let me;try{me=await Promise.all(ue)}catch(G){throw new BridgeError(`Failed to fetch the Axelar Status with the reason: ${G}`,Oz.AXELAR_GAS_ESTIMATE_FAILED)}for(let K=0,ue=me.length;K<ue;K++){let ue;switch(me[K].status){case Fz.CANNOT_FETCH_STATUS:ue=uz.PENDING;break;case Fz.SRC_GATEWAY_CALLED:case Fz.DEST_GATEWAY_APPROVED:case Fz.DEST_EXECUTING:case Fz.SRC_GATEWAY_CONFIRMED:case Fz.APPROVING:ue=uz.PROCESSING;break;case Fz.NOT_EXECUTED:ue=uz.RETRY;break;case Fz.NOT_EXECUTED_WITHOUT_GAS_PAID:case Fz.INSUFFICIENT_FEE:ue=uz.NOT_ENOUGH_GAS;break;case Fz.DEST_EXECUTED:ue=uz.COMPLETE;break;default:ue=uz.ERROR}me[K].gasPaidInfo&&he.includes(me[K].gasPaidInfo.status)&&(ue=uz.NOT_ENOUGH_GAS);let pe,be={txHash:G[K].txHash,status:ue,data:{gmpResponse:me[K].status}};me[K]?.callTx?.returnValues?.payload&&(pe=ye.decode(["bytes32","address","address","address","uint256"],me[K].callTx.returnValues.payload),be={...be,token:pe[1],sender:pe[2],recipient:pe[3],amount:pe[4]}),ne.push(be)}return ne}async getFlowRateInfo(G){if(!G.tokens||0===G.tokens.length)throw new BridgeError(`invalid tokens array ${G.tokens}`,Oz.INVALID_TOKEN);const K=this.config.bridgeContracts.rootERC20BridgeFlowRate,ne=await createContract(K,Nz,this.config.rootProvider),ue=[];ue.push(ne.withdrawalQueueActivated()),ue.push(ne.withdrawalDelay());for(let K of G.tokens)K.toUpperCase()===fz&&(K="0x0000000000000000000000000000000000000eee"),ue.push(ne.flowRateBuckets(K)),ue.push(ne.largeTransferThresholds(K));let pe;try{pe=await Promise.all(ue)}catch(G){throw new BridgeError("unable to query contract for flowrate info",Oz.INTERNAL_ERROR)}const he={},ye=pe[0],me=pe[1].toNumber();pe.splice(0,2);for(let K=0,ne=G.tokens.length;K<ne;K++){const ne=2*K;he[G.tokens[K]]={capacity:pe[ne].capacity,depth:pe[ne].depth,refillTime:pe[ne].refillTime.toNumber(),refillRate:pe[ne].refillRate,largeTransferThreshold:pe[ne+1]}}return{withdrawalQueueActivated:ye,withdrawalDelay:me,tokens:he}}async getPendingWithdrawals(G){if(!G.recipient)throw new BridgeError(`invalid recipient ${G.recipient}`,Oz.INVALID_RECIPIENT);const K=this.config.bridgeContracts.rootERC20BridgeFlowRate,ne=await createContract(K,Nz,this.config.rootProvider),ue=await ne.getPendingWithdrawalsLength(G.recipient),pe={pending:[]};if(0===ue.toNumber())return pe;const he=[];for(let G=0;G<ue.toNumber();G++)he.push(G);const ye=await ne.getPendingWithdrawals(G.recipient,he),me=Math.floor(Date.now()/1e3),be=await ne.withdrawalDelay();for(let K=0,ne=ye.length;K<ne;K++){const ne=ye[K].timestamp.add(be).toNumber();pe.pending[K]=ne>me?{canWithdraw:!1}:{canWithdraw:!0},pe.pending[K].recipient=G.recipient,pe.pending[K].withdrawer=ye[K].withdrawer,pe.pending[K].token=ye[K].token,pe.pending[K].amount=ye[K].amount,pe.pending[K].timeoutStart=ye[K].timestamp.toNumber(),pe.pending[K].timeoutEnd=ne}return pe}async getFlowRateWithdrawTx(G){if(!G.recipient)throw new BridgeError(`invalid recipient ${G.recipient}`,Oz.INVALID_RECIPIENT);if(G.index<0)throw new BridgeError(`invalid index ${G.index}`,Oz.INVALID_FLOWRATE_INDEX);const K=this.config.bridgeContracts.rootERC20BridgeFlowRate,ne=await createContract(K,Nz,this.config.rootProvider),ue=await ne.getPendingWithdrawals(G.recipient,[G.index]);if(ue[0].withdrawer===LW||ue[0].token===LW||ue[0].amount===BigNumber.from(0)||ue[0].timestamp===BigNumber.from(0))throw new BridgeError(`pending withdrawal not found for ${G.recipient} at index ${G.index}`,Oz.FLOW_RATE_ERROR);const pe=await ne.withdrawalDelay(),he=ue[0].timestamp.add(pe).toNumber();if(he>Math.floor(Date.now()/1e3))return{pendingWithdrawal:{canWithdraw:!1,withdrawer:ue[0].withdrawer,recipient:G.recipient,token:ue[0].token,amount:ue[0].amount,timeoutStart:ue[0].timestamp.toNumber(),timeoutEnd:he},unsignedTx:null};const ye=await withBridgeError((async()=>ne.interface.encodeFunctionData("finaliseQueuedWithdrawal",[G.recipient,G.index])),Oz.INTERNAL_ERROR);return{pendingWithdrawal:{canWithdraw:!0,withdrawer:ue[0].withdrawer,recipient:G.recipient,token:ue[0].token,amount:ue[0].amount,timeoutStart:ue[0].timestamp.toNumber(),timeoutEnd:he},unsignedTx:{data:ye,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:0,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)}}}async getTokenMapping(G){if(G.rootToken.toUpperCase()===fz||G.rootToken===this.config.bridgeContracts.rootChainWrappedETH){const K=this.config.bridgeContracts.childERC20Bridge,ne=await createContract(K,Bz,this.config.childProvider),ue=await ne.childETHToken();return{rootToken:G.rootToken,childToken:ue}}const K=this.config.bridgeContracts.rootERC20BridgeFlowRate,ne=await createContract(K,Nz,this.config.rootProvider),ue=await ne.rootTokenToChildToken(G.rootToken);return ue===LW?{rootToken:G.rootToken,childToken:null}:ue===G.rootToken?{rootToken:G.rootToken,childToken:fz}:{rootToken:G.rootToken,childToken:ue}}}
/**
   * tiny-lru
   *
   * @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
   * @license BSD-3-Clause
   * @version 11.2.5
   */class LRU{constructor(G=0,K=0,ne=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=G,this.resetTtl=ne,this.size=0,this.ttl=K}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(G){if(this.has(G)){const K=this.items[G];delete this.items[G],this.size--,null!==K.prev&&(K.prev.next=K.next),null!==K.next&&(K.next.prev=K.prev),this.first===K&&(this.first=K.next),this.last===K&&(this.last=K.prev)}return this}entries(G=this.keys()){return G.map((G=>[G,this.get(G)]))}evict(G=!1){if(G||this.size>0){const G=this.first;delete this.items[G.key],0==--this.size?(this.first=null,this.last=null):(this.first=G.next,this.first.prev=null)}return this}expiresAt(G){let K;return this.has(G)&&(K=this.items[G].expiry),K}get(G){let K;if(this.has(G)){const ne=this.items[G];this.ttl>0&&ne.expiry<=Date.now()?this.delete(G):(K=ne.value,this.set(G,K,!0))}return K}has(G){return G in this.items}keys(){const G=[];let K=this.first;for(;null!==K;)G.push(K.key),K=K.next;return G}set(G,K,ne=!1,ue=this.resetTtl){let pe;if(ne||this.has(G)){if(pe=this.items[G],pe.value=K,!1===ne&&ue&&(pe.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.last!==pe){const G=this.last,K=pe.next,ne=pe.prev;this.first===pe&&(this.first=pe.next),pe.next=null,pe.prev=this.last,G.next=pe,null!==ne&&(ne.next=K),null!==K&&(K.prev=ne)}}else this.max>0&&this.size===this.max&&this.evict(!0),pe=this.items[G]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:G,prev:this.last,next:null,value:K},1==++this.size?this.first=pe:this.last.next=pe;return this.last=pe,this}values(G=this.keys()){return G.map((G=>this.get(G)))}}const Lz={max:1e3},memorise=(G,K={})=>{const{cache:ne,cacheKeyResolver:ue=defaultGenCacheKey,onHit:pe,lruOptions:he={}}=K,ye={...Lz,...he},me=ne||function lru(G=1e3,K=0,ne=!1){if(isNaN(G)||G<0)throw new TypeError("Invalid max value");if(isNaN(K)||K<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof ne)throw new TypeError("Invalid resetTtl value");return new LRU(G,K,ne)}(ye.max,ye.ttl);function returnFn(...K){const ne=ue(...K),he=me.get(ne);if(me.has(ne))return pe&&pe(ne,he,me),he;const ye=G.apply(this,K);return me.set(ne,ye),ye}return returnFn._cache=me,returnFn},defaultGenCacheKey=(...G)=>0===G.length?"no-args":G.map((G=>void 0===G?"undefined":null===G?"null":Array.isArray(G)?`[${defaultGenCacheKey(...G)}]`:"object"==typeof G?`{${defaultGenCacheKey(...sortedObjectEntries(G))}}`:JSON.stringify(G))).join(","),sortedObjectEntries=G=>Object.entries(G).sort(((G,K)=>G[0]<K[0]?-1:1));var Uz={};Object.defineProperty(Uz,"__esModule",{value:!0}),Uz.clearGlobalNamespace=qz=Uz.getGlobalisedValue=void 0;const $z={},getGlobalObject=()=>"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:$z,createGlobalisedKey=G=>`globalise__singleton__${G}`,getGlobalScopedObject=G=>{const K=getGlobalObject(),ne=createGlobalisedKey(G);return K[ne]||(K[ne]={}),K[ne]};var qz=Uz.getGlobalisedValue=(G,K,ne)=>{((G,K)=>{if("string"!=typeof G)throw"Invalid namespace key";if("string"!=typeof K)throw"Invalid item key"})(G,K);const ue=((G,K)=>getGlobalScopedObject(G)[K]||void 0)(G,K);return void 0!==ue?ue:(((G,K,ne)=>{getGlobalScopedObject(G)[K]=ne})(G,K,ne),ne)};Uz.clearGlobalNamespace=G=>{const K=getGlobalObject(),ne=createGlobalisedKey(G);void 0!==K[ne]&&delete K[ne]};const isNode=()=>"undefined"==typeof window,isBrowser=()=>!isNode(),hasLocalstorage=()=>isBrowser()&&window.localStorage,genKey=G=>`__IMX-${G}`;function getItem(G){if(hasLocalstorage())return(G=>{if(null!==G)try{return JSON.parse(G)}catch(K){return G}})(window.localStorage.getItem(genKey(G)))}const setItem=(G,K)=>!!hasLocalstorage()&&(window.localStorage.setItem(genKey(G),(G=>"string"==typeof G?G:JSON.stringify(G))(K)),!0);let Gz=0;const getCorrectedTime=()=>{const G=(new Date).getTime()+Gz;return new Date(G).toISOString()};var jz;!function(G){G.RUNTIME_ID="rid",G.PASSPORT_CLIENT_ID="passportClientId",G.ENVIRONMENT="env",G.PUBLISHABLE_API_KEY="pak",G.IDENTITY="uid",G.DOMAIN="domain",G.SDK_VERSION="sdkVersion"}(jz||(jz={}));async function post(G,K){const ne=ZH.create({baseURL:"https://api.immutable.com"}),ue=JSON.stringify(K),pe={payload:Buffer.from(ue).toString("base64")};return(await ne.post(G,pe)).data}var Hz;let Wz,zz;!function(G){G.EVENTS="metrics-events",G.RUNTIME="metrics-runtime"}(Hz||(Hz={}));Wz=getItem(Hz.EVENTS)||[],zz=getItem(Hz.RUNTIME)||{};const storeDetail=(G,K)=>{zz={...zz,[G]:K},setItem(Hz.RUNTIME,zz)},getDetail$1=G=>{if(void 0!==zz[G])return zz[G]},flattenProperties=G=>{const K=[];return Object.entries(G).forEach((([G,ne])=>{"string"!=typeof G&&"string"!=typeof ne&&"number"!=typeof ne&&"boolean"!=typeof ne||K.push([G,ne.toString()])})),K},Vz="1.78.11",runtimeHost=()=>{if(isNode())return"";let G;try{window.self!==window.top&&(G=isNode()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"")}catch(G){}return G||(G=window.location.hostname),G};let Kz=!1;const initialise=async()=>{Kz=!0;try{const G=flattenProperties((()=>{if(storeDetail(jz.SDK_VERSION,Vz),isNode())return{browser:"nodejs",sdkVersion:Vz};const G=runtimeHost();return G&&storeDetail(jz.DOMAIN,G),{sdkVersion:Vz,browser:window.navigator.userAgent,domain:G,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}})()),K=getDetail$1(jz.RUNTIME_ID),ne={version:1,data:{runtimeDetails:G,runtimeId:K,uId:getDetail$1(jz.IDENTITY)}},ue=await post("/v1/sdk/initialise",ne),{runtimeId:pe,sTime:he}=ue;storeDetail(jz.RUNTIME_ID,pe),(G=>{const K=1e3*parseInt(G,10),ne=new Date(K),ue=new Date;Gz=ne.getTime()-ue.getTime()})(he)}catch(G){Kz=!1}};function errorBoundary(G,K){return(...ne)=>{try{const ue=G(...ne);return ue instanceof Promise?ue.catch((()=>K)):ue}catch(G){return K}}}const Jz=errorBoundary((function isTestEnvironmentFn(){return isBrowser(),!1}),!1),Xz="imtbl__metrics",getGlobalisedValue=(G,K)=>qz(Xz,G,K);errorBoundary(((G,K)=>{const ne=memorise(K,{lruOptions:{ttl:5e3,max:1e3}});return qz(Xz,G,ne)})("track",((G,K,ne)=>{(G=>{Wz.push(G),setItem(Hz.EVENTS,Wz)})({event:`${G}.${K}`,time:getCorrectedTime(),...ne&&{properties:flattenProperties(ne)}})})));const Qz=errorBoundary((async()=>{if(!1===Kz)return void await initialise();const G=Wz;if(0===G.length)return;const K=G.length,ne={version:1,data:{events:G,details:zz}};var ue;await post("/v1/sdk/metrics",ne)instanceof Error||(ue=K,Wz=Wz.slice(ue),setItem(Hz.EVENTS,Wz))})),flushPoll=async()=>{await Qz(),setTimeout(flushPoll,5e3)};let Zz=!1;const startFlushing=()=>{Zz||(Zz=!0,flushPoll())};Jz()||errorBoundary(getGlobalisedValue("startFlushing",startFlushing))();errorBoundary(getGlobalisedValue("setEnvironment",(G=>{storeDetail(jz.ENVIRONMENT,G)})));errorBoundary(getGlobalisedValue("setPassportClientId",(G=>{storeDetail(jz.PASSPORT_CLIENT_ID,G)})));var Yz,eV;errorBoundary(getGlobalisedValue("setPublishableApiKey",(G=>{storeDetail(jz.PUBLISHABLE_API_KEY,G)}))),errorBoundary(getGlobalisedValue("getDetail",getDetail$1)),function(G){G.PRODUCTION="production",G.SANDBOX="sandbox"}(Yz||(Yz={})),function(G){G.API_KEY="x-immutable-api-key",G.PUBLISHABLE_KEY="x-immutable-publishable-key",G.RATE_LIMITING_KEY="x-api-key"}(eV||(eV={}));const tV=[Az,Ez],rV=[Pz],nV={[Yz.SANDBOX]:tV,[Yz.PRODUCTION]:rV},aV=(new Map).set(Az,{rootERC20BridgeFlowRate:"0x0",childERC20Bridge:"0x0",rootChainIMX:"0x0",rootChainWrappedETH:"0x0",childChainWrappedETH:"0x0",childChainWrappedIMX:"0x0"}).set(Ez,{rootERC20BridgeFlowRate:"0x0D3C59c779Fd552C27b23F723E80246c840100F5",childERC20Bridge:"0x0D3C59c779Fd552C27b23F723E80246c840100F5",rootChainIMX:"0xe2629e08f4125d14e446660028bD98ee60EE69F2",rootChainWrappedETH:"0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",childChainWrappedETH:"0xe9E96d1aad82562b7588F03f49aD34186f996478",childChainWrappedIMX:"0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439"}).set(Pz,{rootERC20BridgeFlowRate:"0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6",childERC20Bridge:"0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6",rootChainIMX:"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",rootChainWrappedETH:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",childChainWrappedETH:"0x52a6c53869ce09a731cd772f245b97a4401d3348",childChainWrappedIMX:"0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d"});class BridgeConfiguration{baseConfig;bridgeInstance;bridgeContracts;rootProvider;childProvider;constructor({bridgeInstance:G,rootProvider:K,childProvider:ne,baseConfig:ue,overrides:pe}){if(this.baseConfig=ue,this.bridgeInstance=G,this.rootProvider=K,this.childProvider=ne,pe)return void(this.bridgeContracts=pe.bridgeContracts);if(!nV[ue.environment].includes(G))throw new Error(`Bridge instance with rootchain ${G.rootChainID} and childchain ${G.childChainID} is not supported in environment ${ue.environment}`);if(!aV.has(G))throw new Error(`Bridge instance with rootchain ${G.rootChainID} and childchain ${G.childChainID} is not supported in environment ${ue.environment}`);const he=aV.get(G);if(!he)throw new Error(`Bridge instance with rootchain ${G.rootChainID} and childchain ${G.childChainID} is not supported in environment ${ue.environment}`);this.bridgeContracts=he}}var iV={exports:{}};!function(G,K){G.exports=function(){var G=Math.imul,K=Math.clz32,ne=Math.abs,ue=Math.max,pe=Math.floor;class o extends Array{constructor(G,K){if(super(G),this.sign=K,G>o.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(G){var K=Number.isFinite;if("number"==typeof G){if(0===G)return o.__zero();if(o.__isOneDigitInt(G))return 0>G?o.__oneDigit(-G,!0):o.__oneDigit(G,!1);if(!K(G)||pe(G)!==G)throw new RangeError("The number "+G+" cannot be converted to BigInt because it is not an integer");return o.__fromDouble(G)}if("string"==typeof G){const K=o.__fromString(G);if(null===K)throw new SyntaxError("Cannot convert "+G+" to a BigInt");return K}if("boolean"==typeof G)return!0===G?o.__oneDigit(1,!1):o.__zero();if("object"==typeof G){if(G.constructor===o)return G;const K=o.__toPrimitive(G);return o.BigInt(K)}throw new TypeError("Cannot convert "+G+" to a BigInt")}toDebugString(){const G=["BigInt["];for(const K of this)G.push((K?(K>>>0).toString(16):K)+", ");return G.push("]"),G.join("")}toString(G=10){if(2>G||36<G)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(G&G-1)?o.__toStringBasePowerOfTwo(this,G):o.__toStringGeneric(this,G,!1)}static toNumber(G){const K=G.length;if(0===K)return 0;if(1===K){const K=G.__unsignedDigit(0);return G.sign?-K:K}const ne=G.__digit(K-1),ue=o.__clz30(ne),pe=30*K-ue;if(1024<pe)return G.sign?-1/0:1/0;let he=pe-1,ye=ne,me=K-1;const be=ue+3;let ve=32===be?0:ye<<be;ve>>>=12;const _e=be-12;let Te=12<=be?0:ye<<20+be,Ee=20+be;for(0<_e&&0<me&&(me--,ye=G.__digit(me),ve|=ye>>>30-_e,Te=ye<<_e+2,Ee=_e+2);0<Ee&&0<me;)me--,ye=G.__digit(me),Te|=30<=Ee?ye<<Ee-30:ye>>>30-Ee,Ee-=30;const Pe=o.__decideRounding(G,Ee,me,ye);if((1===Pe||0===Pe&&1==(1&Te))&&(Te=Te+1>>>0,0===Te&&(ve++,0!=ve>>>20&&(ve=0,he++,1023<he))))return G.sign?-1/0:1/0;const Se=G.sign?-2147483648:0;return he=he+1023<<20,o.__kBitConversionInts[1]=Se|he|ve,o.__kBitConversionInts[0]=Te,o.__kBitConversionDouble[0]}static unaryMinus(G){if(0===G.length)return G;const K=G.__copy();return K.sign=!G.sign,K}static bitwiseNot(G){return G.sign?o.__absoluteSubOne(G).__trim():o.__absoluteAddOne(G,!0)}static exponentiate(G,K){if(K.sign)throw new RangeError("Exponent must be positive");if(0===K.length)return o.__oneDigit(1,!1);if(0===G.length)return G;if(1===G.length&&1===G.__digit(0))return G.sign&&0==(1&K.__digit(0))?o.unaryMinus(G):G;if(1<K.length)throw new RangeError("BigInt too big");let ne=K.__unsignedDigit(0);if(1===ne)return G;if(ne>=o.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===G.length&&2===G.__digit(0)){const K=1+(0|ne/30),ue=G.sign&&0!=(1&ne),pe=new o(K,ue);pe.__initializeDigits();const he=1<<ne%30;return pe.__setDigit(K-1,he),pe}let ue=null,pe=G;for(0!=(1&ne)&&(ue=G),ne>>=1;0!==ne;ne>>=1)pe=o.multiply(pe,pe),0!=(1&ne)&&(ue=null===ue?pe:o.multiply(ue,pe));return ue}static multiply(G,K){if(0===G.length)return G;if(0===K.length)return K;let ne=G.length+K.length;30<=G.__clzmsd()+K.__clzmsd()&&ne--;const ue=new o(ne,G.sign!==K.sign);ue.__initializeDigits();for(let ne=0;ne<G.length;ne++)o.__multiplyAccumulate(K,G.__digit(ne),ue,ne);return ue.__trim()}static divide(G,K){if(0===K.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(G,K))return o.__zero();const ne=G.sign!==K.sign,ue=K.__unsignedDigit(0);let pe;if(1===K.length&&32767>=ue){if(1===ue)return ne===G.sign?G:o.unaryMinus(G);pe=o.__absoluteDivSmall(G,ue,null)}else pe=o.__absoluteDivLarge(G,K,!0,!1);return pe.sign=ne,pe.__trim()}static remainder(G,K){if(0===K.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(G,K))return G;const ne=K.__unsignedDigit(0);if(1===K.length&&32767>=ne){if(1===ne)return o.__zero();const K=o.__absoluteModSmall(G,ne);return 0===K?o.__zero():o.__oneDigit(K,G.sign)}const ue=o.__absoluteDivLarge(G,K,!1,!0);return ue.sign=G.sign,ue.__trim()}static add(G,K){const ne=G.sign;return ne===K.sign?o.__absoluteAdd(G,K,ne):0<=o.__absoluteCompare(G,K)?o.__absoluteSub(G,K,ne):o.__absoluteSub(K,G,!ne)}static subtract(G,K){const ne=G.sign;return ne===K.sign?0<=o.__absoluteCompare(G,K)?o.__absoluteSub(G,K,ne):o.__absoluteSub(K,G,!ne):o.__absoluteAdd(G,K,ne)}static leftShift(G,K){return 0===K.length||0===G.length?G:K.sign?o.__rightShiftByAbsolute(G,K):o.__leftShiftByAbsolute(G,K)}static signedRightShift(G,K){return 0===K.length||0===G.length?G:K.sign?o.__leftShiftByAbsolute(G,K):o.__rightShiftByAbsolute(G,K)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(G,K){return 0>o.__compareToBigInt(G,K)}static lessThanOrEqual(G,K){return 0>=o.__compareToBigInt(G,K)}static greaterThan(G,K){return 0<o.__compareToBigInt(G,K)}static greaterThanOrEqual(G,K){return 0<=o.__compareToBigInt(G,K)}static equal(G,K){if(G.sign!==K.sign)return!1;if(G.length!==K.length)return!1;for(let ne=0;ne<G.length;ne++)if(G.__digit(ne)!==K.__digit(ne))return!1;return!0}static notEqual(G,K){return!o.equal(G,K)}static bitwiseAnd(G,K){if(!G.sign&&!K.sign)return o.__absoluteAnd(G,K).__trim();if(G.sign&&K.sign){const ne=ue(G.length,K.length)+1;let pe=o.__absoluteSubOne(G,ne);const he=o.__absoluteSubOne(K);return pe=o.__absoluteOr(pe,he,pe),o.__absoluteAddOne(pe,!0,pe).__trim()}return G.sign&&([G,K]=[K,G]),o.__absoluteAndNot(G,o.__absoluteSubOne(K)).__trim()}static bitwiseXor(G,K){if(!G.sign&&!K.sign)return o.__absoluteXor(G,K).__trim();if(G.sign&&K.sign){const ne=ue(G.length,K.length),pe=o.__absoluteSubOne(G,ne),he=o.__absoluteSubOne(K);return o.__absoluteXor(pe,he,pe).__trim()}const ne=ue(G.length,K.length)+1;G.sign&&([G,K]=[K,G]);let pe=o.__absoluteSubOne(K,ne);return pe=o.__absoluteXor(pe,G,pe),o.__absoluteAddOne(pe,!0,pe).__trim()}static bitwiseOr(G,K){const ne=ue(G.length,K.length);if(!G.sign&&!K.sign)return o.__absoluteOr(G,K).__trim();if(G.sign&&K.sign){let ue=o.__absoluteSubOne(G,ne);const pe=o.__absoluteSubOne(K);return ue=o.__absoluteAnd(ue,pe,ue),o.__absoluteAddOne(ue,!0,ue).__trim()}G.sign&&([G,K]=[K,G]);let pe=o.__absoluteSubOne(K,ne);return pe=o.__absoluteAndNot(pe,G,pe),o.__absoluteAddOne(pe,!0,pe).__trim()}static asIntN(G,K){if(0===K.length)return K;if(0>(G=pe(G)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===G)return o.__zero();if(G>=o.__kMaxLengthBits)return K;const ne=0|(G+29)/30;if(K.length<ne)return K;const ue=K.__unsignedDigit(ne-1),he=1<<(G-1)%30;if(K.length===ne&&ue<he)return K;if((ue&he)!==he)return o.__truncateToNBits(G,K);if(!K.sign)return o.__truncateAndSubFromPowerOfTwo(G,K,!0);if(0==(ue&he-1)){for(let ue=ne-2;0<=ue;ue--)if(0!==K.__digit(ue))return o.__truncateAndSubFromPowerOfTwo(G,K,!1);return K.length===ne&&ue===he?K:o.__truncateToNBits(G,K)}return o.__truncateAndSubFromPowerOfTwo(G,K,!1)}static asUintN(G,K){if(0===K.length)return K;if(0>(G=pe(G)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===G)return o.__zero();if(K.sign){if(G>o.__kMaxLengthBits)throw new RangeError("BigInt too big");return o.__truncateAndSubFromPowerOfTwo(G,K,!1)}if(G>=o.__kMaxLengthBits)return K;const ne=0|(G+29)/30;if(K.length<ne)return K;const ue=G%30;if(K.length==ne){if(0===ue)return K;if(0==K.__digit(ne-1)>>>ue)return K}return o.__truncateToNBits(G,K)}static ADD(G,K){if(G=o.__toPrimitive(G),K=o.__toPrimitive(K),"string"==typeof G)return"string"!=typeof K&&(K=K.toString()),G+K;if("string"==typeof K)return G.toString()+K;if(G=o.__toNumeric(G),K=o.__toNumeric(K),o.__isBigInt(G)&&o.__isBigInt(K))return o.add(G,K);if("number"==typeof G&&"number"==typeof K)return G+K;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(G,K){return o.__compare(G,K,0)}static LE(G,K){return o.__compare(G,K,1)}static GT(G,K){return o.__compare(G,K,2)}static GE(G,K){return o.__compare(G,K,3)}static EQ(G,K){for(;;){if(o.__isBigInt(G))return o.__isBigInt(K)?o.equal(G,K):o.EQ(K,G);if("number"==typeof G){if(o.__isBigInt(K))return o.__equalToNumber(K,G);if("object"!=typeof K)return G==K;K=o.__toPrimitive(K)}else if("string"==typeof G){if(o.__isBigInt(K))return null!==(G=o.__fromString(G))&&o.equal(G,K);if("object"!=typeof K)return G==K;K=o.__toPrimitive(K)}else if("boolean"==typeof G){if(o.__isBigInt(K))return o.__equalToNumber(K,+G);if("object"!=typeof K)return G==K;K=o.__toPrimitive(K)}else if("symbol"==typeof G){if(o.__isBigInt(K))return!1;if("object"!=typeof K)return G==K;K=o.__toPrimitive(K)}else{if("object"!=typeof G)return G==K;if("object"==typeof K&&K.constructor!==o)return G==K;G=o.__toPrimitive(G)}}}static NE(G,K){return!o.EQ(G,K)}static __zero(){return new o(0,!1)}static __oneDigit(G,K){const ne=new o(1,K);return ne.__setDigit(0,G),ne}__copy(){const G=new o(this.length,this.sign);for(let K=0;K<this.length;K++)G[K]=this[K];return G}__trim(){let G=this.length,K=this[G-1];for(;0===K;)G--,K=this[G-1],this.pop();return 0===G&&(this.sign=!1),this}__initializeDigits(){for(let G=0;G<this.length;G++)this[G]=0}static __decideRounding(G,K,ne,ue){if(0<K)return-1;let pe;if(0>K)pe=-K-1;else{if(0===ne)return-1;ne--,ue=G.__digit(ne),pe=29}let he=1<<pe;if(0==(ue&he))return-1;if(he-=1,0!=(ue&he))return 1;for(;0<ne;)if(ne--,0!==G.__digit(ne))return 1;return 0}static __fromDouble(G){o.__kBitConversionDouble[0]=G;const K=(2047&o.__kBitConversionInts[1]>>>20)-1023,ne=1+(0|K/30),ue=new o(ne,0>G);let pe=1048575&o.__kBitConversionInts[1]|1048576,he=o.__kBitConversionInts[0];const ye=20,me=K%30;let be,ve=0;if(20>me){const G=ye-me;ve=G+32,be=pe>>>G,pe=pe<<32-G|he>>>G,he<<=32-G}else if(20===me)ve=32,be=pe,pe=he,he=0;else{const G=me-ye;ve=32-G,be=pe<<G|he>>>32-G,pe=he<<G,he=0}ue.__setDigit(ne-1,be);for(let G=ne-2;0<=G;G--)0<ve?(ve-=30,be=pe>>>2,pe=pe<<30|he>>>2,he<<=30):be=0,ue.__setDigit(G,be);return ue.__trim()}static __isWhitespace(G){return!!(13>=G&&9<=G)||(159>=G?32==G:131071>=G?160==G||5760==G:196607>=G?10>=(G&=131071)||40==G||41==G||47==G||95==G||4096==G:65279==G)}static __fromString(G,K=0){let ne=0;const ue=G.length;let pe=0;if(pe===ue)return o.__zero();let he=G.charCodeAt(pe);for(;o.__isWhitespace(he);){if(++pe===ue)return o.__zero();he=G.charCodeAt(pe)}if(43===he){if(++pe===ue)return null;he=G.charCodeAt(pe),ne=1}else if(45===he){if(++pe===ue)return null;he=G.charCodeAt(pe),ne=-1}if(0===K){if(K=10,48===he){if(++pe===ue)return o.__zero();if(he=G.charCodeAt(pe),88===he||120===he){if(K=16,++pe===ue)return null;he=G.charCodeAt(pe)}else if(79===he||111===he){if(K=8,++pe===ue)return null;he=G.charCodeAt(pe)}else if(66===he||98===he){if(K=2,++pe===ue)return null;he=G.charCodeAt(pe)}}}else if(16===K&&48===he){if(++pe===ue)return o.__zero();if(he=G.charCodeAt(pe),88===he||120===he){if(++pe===ue)return null;he=G.charCodeAt(pe)}}if(0!=ne&&10!==K)return null;for(;48===he;){if(++pe===ue)return o.__zero();he=G.charCodeAt(pe)}const ye=ue-pe;let me=o.__kMaxBitsPerChar[K],be=o.__kBitsPerCharTableMultiplier-1;if(ye>1073741824/me)return null;const ve=me*ye+be>>>o.__kBitsPerCharTableShift,_e=new o(0|(ve+29)/30,!1),Te=10>K?K:10,Ee=10<K?K-10:0;if(0==(K&K-1)){me>>=o.__kBitsPerCharTableShift;const K=[],ne=[];let ye=!1;do{let be=0,ve=0;for(;;){let K;if(he-48>>>0<Te)K=he-48;else{if(!((32|he)-97>>>0<Ee)){ye=!0;break}K=(32|he)-87}if(ve+=me,be=be<<me|K,++pe===ue){ye=!0;break}if(he=G.charCodeAt(pe),30<ve+me)break}K.push(be),ne.push(ve)}while(!ye);o.__fillFromParts(_e,K,ne)}else{_e.__initializeDigits();let ne=!1,ye=0;do{let ve=0,Pe=1;for(;;){let me;if(he-48>>>0<Te)me=he-48;else{if(!((32|he)-97>>>0<Ee)){ne=!0;break}me=(32|he)-87}const be=Pe*K;if(1073741823<be)break;if(Pe=be,ve=ve*K+me,ye++,++pe===ue){ne=!0;break}he=G.charCodeAt(pe)}be=30*o.__kBitsPerCharTableMultiplier-1;const Se=0|(me*ye+be>>>o.__kBitsPerCharTableShift)/30;_e.__inplaceMultiplyAdd(Pe,ve,Se)}while(!ne)}if(pe!==ue){if(!o.__isWhitespace(he))return null;for(pe++;pe<ue;pe++)if(he=G.charCodeAt(pe),!o.__isWhitespace(he))return null}return _e.sign=-1==ne,_e.__trim()}static __fillFromParts(G,K,ne){let ue=0,pe=0,he=0;for(let ye=K.length-1;0<=ye;ye--){const me=K[ye],be=ne[ye];pe|=me<<he,he+=be,30===he?(G.__setDigit(ue++,pe),he=0,pe=0):30<he&&(G.__setDigit(ue++,1073741823&pe),he-=30,pe=me>>>be-he)}if(0!==pe){if(ue>=G.length)throw new Error("implementation bug");G.__setDigit(ue++,pe)}for(;ue<G.length;ue++)G.__setDigit(ue,0)}static __toStringBasePowerOfTwo(G,K){const ne=G.length;let ue=K-1;ue=(85&ue>>>1)+(85&ue),ue=(51&ue>>>2)+(51&ue),ue=(15&ue>>>4)+(15&ue);const pe=ue,he=K-1,ye=G.__digit(ne-1);let me=0|(30*ne-o.__clz30(ye)+pe-1)/pe;if(G.sign&&me++,268435456<me)throw new Error("string too long");const be=Array(me);let ve=me-1,_e=0,Te=0;for(let K=0;K<ne-1;K++){const ne=G.__digit(K),ue=(_e|ne<<Te)&he;be[ve--]=o.__kConversionChars[ue];const ye=pe-Te;for(_e=ne>>>ye,Te=30-ye;Te>=pe;)be[ve--]=o.__kConversionChars[_e&he],_e>>>=pe,Te-=pe}const Ee=(_e|ye<<Te)&he;for(be[ve--]=o.__kConversionChars[Ee],_e=ye>>>pe-Te;0!==_e;)be[ve--]=o.__kConversionChars[_e&he],_e>>>=pe;if(G.sign&&(be[ve--]="-"),-1!=ve)throw new Error("implementation bug");return be.join("")}static __toStringGeneric(G,K,ne){const ue=G.length;if(0===ue)return"";if(1===ue){let ue=G.__unsignedDigit(0).toString(K);return!1===ne&&G.sign&&(ue="-"+ue),ue}const pe=30*ue-o.__clz30(G.__digit(ue-1)),he=o.__kMaxBitsPerChar[K]-1;let ye=pe*o.__kBitsPerCharTableMultiplier;ye+=he-1,ye=0|ye/he;const me=ye+1>>1,be=o.exponentiate(o.__oneDigit(K,!1),o.__oneDigit(me,!1));let ve,_e;const Te=be.__unsignedDigit(0);if(1===be.length&&32767>=Te){ve=new o(G.length,!1),ve.__initializeDigits();let ne=0;for(let K=2*G.length-1;0<=K;K--){const ue=ne<<15|G.__halfDigit(K);ve.__setHalfDigit(K,0|ue/Te),ne=0|ue%Te}_e=ne.toString(K)}else{const ne=o.__absoluteDivLarge(G,be,!0,!0);ve=ne.quotient;const ue=ne.remainder.__trim();_e=o.__toStringGeneric(ue,K,!0)}ve.__trim();let Ee=o.__toStringGeneric(ve,K,!0);for(;_e.length<me;)_e="0"+_e;return!1===ne&&G.sign&&(Ee="-"+Ee),Ee+_e}static __unequalSign(G){return G?-1:1}static __absoluteGreater(G){return G?-1:1}static __absoluteLess(G){return G?1:-1}static __compareToBigInt(G,K){const ne=G.sign;if(ne!==K.sign)return o.__unequalSign(ne);const ue=o.__absoluteCompare(G,K);return 0<ue?o.__absoluteGreater(ne):0>ue?o.__absoluteLess(ne):0}static __compareToNumber(G,K){if(o.__isOneDigitInt(K)){const ue=G.sign,pe=0>K;if(ue!==pe)return o.__unequalSign(ue);if(0===G.length){if(pe)throw new Error("implementation bug");return 0===K?0:-1}if(1<G.length)return o.__absoluteGreater(ue);const he=ne(K),ye=G.__unsignedDigit(0);return ye>he?o.__absoluteGreater(ue):ye<he?o.__absoluteLess(ue):0}return o.__compareToDouble(G,K)}static __compareToDouble(G,K){if(K!=K)return K;if(K===1/0)return-1;if(K===-1/0)return 1;const ne=G.sign;if(ne!==0>K)return o.__unequalSign(ne);if(0===K)throw new Error("implementation bug: should be handled elsewhere");if(0===G.length)return-1;o.__kBitConversionDouble[0]=K;const ue=2047&o.__kBitConversionInts[1]>>>20;if(2047==ue)throw new Error("implementation bug: handled elsewhere");const pe=ue-1023;if(0>pe)return o.__absoluteGreater(ne);const he=G.length;let ye=G.__digit(he-1);const me=o.__clz30(ye),be=30*he-me,ve=pe+1;if(be<ve)return o.__absoluteLess(ne);if(be>ve)return o.__absoluteGreater(ne);let _e=1048576|1048575&o.__kBitConversionInts[1],Te=o.__kBitConversionInts[0];const Ee=20,Pe=29-me;if(Pe!==(0|(be-1)%30))throw new Error("implementation bug");let Se,Ce=0;if(20>Pe){const G=Ee-Pe;Ce=G+32,Se=_e>>>G,_e=_e<<32-G|Te>>>G,Te<<=32-G}else if(20===Pe)Ce=32,Se=_e,_e=Te,Te=0;else{const G=Pe-Ee;Ce=32-G,Se=_e<<G|Te>>>32-G,_e=Te<<G,Te=0}if(ye>>>=0,Se>>>=0,ye>Se)return o.__absoluteGreater(ne);if(ye<Se)return o.__absoluteLess(ne);for(let K=he-2;0<=K;K--){0<Ce?(Ce-=30,Se=_e>>>2,_e=_e<<30|Te>>>2,Te<<=30):Se=0;const ue=G.__unsignedDigit(K);if(ue>Se)return o.__absoluteGreater(ne);if(ue<Se)return o.__absoluteLess(ne)}if(0!==_e||0!==Te){if(0===Ce)throw new Error("implementation bug");return o.__absoluteLess(ne)}return 0}static __equalToNumber(G,K){return o.__isOneDigitInt(K)?0===K?0===G.length:1===G.length&&G.sign===0>K&&G.__unsignedDigit(0)===ne(K):0===o.__compareToDouble(G,K)}static __comparisonResultToBool(G,K){return 0===K?0>G:1===K?0>=G:2===K?0<G:3===K?0<=G:void 0}static __compare(G,K,ne){if(G=o.__toPrimitive(G),K=o.__toPrimitive(K),"string"==typeof G&&"string"==typeof K)switch(ne){case 0:return G<K;case 1:return G<=K;case 2:return G>K;case 3:return G>=K}if(o.__isBigInt(G)&&"string"==typeof K)return null!==(K=o.__fromString(K))&&o.__comparisonResultToBool(o.__compareToBigInt(G,K),ne);if("string"==typeof G&&o.__isBigInt(K))return null!==(G=o.__fromString(G))&&o.__comparisonResultToBool(o.__compareToBigInt(G,K),ne);if(G=o.__toNumeric(G),K=o.__toNumeric(K),o.__isBigInt(G)){if(o.__isBigInt(K))return o.__comparisonResultToBool(o.__compareToBigInt(G,K),ne);if("number"!=typeof K)throw new Error("implementation bug");return o.__comparisonResultToBool(o.__compareToNumber(G,K),ne)}if("number"!=typeof G)throw new Error("implementation bug");if(o.__isBigInt(K))return o.__comparisonResultToBool(o.__compareToNumber(K,G),2^ne);if("number"!=typeof K)throw new Error("implementation bug");return 0===ne?G<K:1===ne?G<=K:2===ne?G>K:3===ne?G>=K:void 0}__clzmsd(){return o.__clz30(this.__digit(this.length-1))}static __absoluteAdd(G,K,ne){if(G.length<K.length)return o.__absoluteAdd(K,G,ne);if(0===G.length)return G;if(0===K.length)return G.sign===ne?G:o.unaryMinus(G);let ue=G.length;(0===G.__clzmsd()||K.length===G.length&&0===K.__clzmsd())&&ue++;const pe=new o(ue,ne);let he=0,ye=0;for(;ye<K.length;ye++){const ne=G.__digit(ye)+K.__digit(ye)+he;he=ne>>>30,pe.__setDigit(ye,1073741823&ne)}for(;ye<G.length;ye++){const K=G.__digit(ye)+he;he=K>>>30,pe.__setDigit(ye,1073741823&K)}return ye<pe.length&&pe.__setDigit(ye,he),pe.__trim()}static __absoluteSub(G,K,ne){if(0===G.length)return G;if(0===K.length)return G.sign===ne?G:o.unaryMinus(G);const ue=new o(G.length,ne);let pe=0,he=0;for(;he<K.length;he++){const ne=G.__digit(he)-K.__digit(he)-pe;pe=1&ne>>>30,ue.__setDigit(he,1073741823&ne)}for(;he<G.length;he++){const K=G.__digit(he)-pe;pe=1&K>>>30,ue.__setDigit(he,1073741823&K)}return ue.__trim()}static __absoluteAddOne(G,K,ne=null){const ue=G.length;null===ne?ne=new o(ue,K):ne.sign=K;let pe=1;for(let K=0;K<ue;K++){const ue=G.__digit(K)+pe;pe=ue>>>30,ne.__setDigit(K,1073741823&ue)}return 0!=pe&&ne.__setDigitGrow(ue,1),ne}static __absoluteSubOne(G,K){const ne=G.length,ue=new o(K=K||ne,!1);let pe=1;for(let K=0;K<ne;K++){const ne=G.__digit(K)-pe;pe=1&ne>>>30,ue.__setDigit(K,1073741823&ne)}if(0!=pe)throw new Error("implementation bug");for(let G=ne;G<K;G++)ue.__setDigit(G,0);return ue}static __absoluteAnd(G,K,ne=null){let ue=G.length,pe=K.length,he=pe;if(ue<pe){he=ue;const ne=G,ye=ue;G=K,ue=pe,K=ne,pe=ye}let ye=he;null===ne?ne=new o(ye,!1):ye=ne.length;let me=0;for(;me<he;me++)ne.__setDigit(me,G.__digit(me)&K.__digit(me));for(;me<ye;me++)ne.__setDigit(me,0);return ne}static __absoluteAndNot(G,K,ne=null){const ue=G.length,pe=K.length;let he=pe;ue<pe&&(he=ue);let ye=ue;null===ne?ne=new o(ye,!1):ye=ne.length;let me=0;for(;me<he;me++)ne.__setDigit(me,G.__digit(me)&~K.__digit(me));for(;me<ue;me++)ne.__setDigit(me,G.__digit(me));for(;me<ye;me++)ne.__setDigit(me,0);return ne}static __absoluteOr(G,K,ne=null){let ue=G.length,pe=K.length,he=pe;if(ue<pe){he=ue;const ne=G,ye=ue;G=K,ue=pe,K=ne,pe=ye}let ye=ue;null===ne?ne=new o(ye,!1):ye=ne.length;let me=0;for(;me<he;me++)ne.__setDigit(me,G.__digit(me)|K.__digit(me));for(;me<ue;me++)ne.__setDigit(me,G.__digit(me));for(;me<ye;me++)ne.__setDigit(me,0);return ne}static __absoluteXor(G,K,ne=null){let ue=G.length,pe=K.length,he=pe;if(ue<pe){he=ue;const ne=G,ye=ue;G=K,ue=pe,K=ne,pe=ye}let ye=ue;null===ne?ne=new o(ye,!1):ye=ne.length;let me=0;for(;me<he;me++)ne.__setDigit(me,G.__digit(me)^K.__digit(me));for(;me<ue;me++)ne.__setDigit(me,G.__digit(me));for(;me<ye;me++)ne.__setDigit(me,0);return ne}static __absoluteCompare(G,K){const ne=G.length-K.length;if(0!=ne)return ne;let ue=G.length-1;for(;0<=ue&&G.__digit(ue)===K.__digit(ue);)ue--;return 0>ue?0:G.__unsignedDigit(ue)>K.__unsignedDigit(ue)?1:-1}static __multiplyAccumulate(G,K,ne,ue){if(0===K)return;const pe=32767&K,he=K>>>15;let ye=0,me=0;for(let K,be=0;be<G.length;be++,ue++){K=ne.__digit(ue);const ve=G.__digit(be),_e=32767&ve,Te=ve>>>15,Ee=o.__imul(_e,pe),Pe=o.__imul(_e,he),Se=o.__imul(Te,pe);K+=me+Ee+ye,ye=K>>>30,K&=1073741823,K+=((32767&Pe)<<15)+((32767&Se)<<15),ye+=K>>>30,me=o.__imul(Te,he)+(Pe>>>15)+(Se>>>15),ne.__setDigit(ue,1073741823&K)}for(;0!=ye||0!==me;ue++){let G=ne.__digit(ue);G+=ye+me,me=0,ye=G>>>30,ne.__setDigit(ue,1073741823&G)}}static __internalMultiplyAdd(G,K,ne,ue,pe){let he=ne,ye=0;for(let ne=0;ne<ue;ne++){const ue=G.__digit(ne),me=o.__imul(32767&ue,K),be=o.__imul(ue>>>15,K),ve=me+((32767&be)<<15)+ye+he;he=ve>>>30,ye=be>>>15,pe.__setDigit(ne,1073741823&ve)}if(pe.length>ue)for(pe.__setDigit(ue++,he+ye);ue<pe.length;)pe.__setDigit(ue++,0);else if(0!==he+ye)throw new Error("implementation bug")}__inplaceMultiplyAdd(G,K,ne){ne>this.length&&(ne=this.length);const ue=32767&G,pe=G>>>15;let he=0,ye=K;for(let G=0;G<ne;G++){const K=this.__digit(G),ne=32767&K,me=K>>>15,be=o.__imul(ne,ue),ve=o.__imul(ne,pe),_e=o.__imul(me,ue);let Te=ye+be+he;he=Te>>>30,Te&=1073741823,Te+=((32767&ve)<<15)+((32767&_e)<<15),he+=Te>>>30,ye=o.__imul(me,pe)+(ve>>>15)+(_e>>>15),this.__setDigit(G,1073741823&Te)}if(0!=he||0!==ye)throw new Error("implementation bug")}static __absoluteDivSmall(G,K,ne=null){null===ne&&(ne=new o(G.length,!1));let ue=0;for(let pe,he=2*G.length-1;0<=he;he-=2){pe=(ue<<15|G.__halfDigit(he))>>>0;const ye=0|pe/K;ue=0|pe%K,pe=(ue<<15|G.__halfDigit(he-1))>>>0;const me=0|pe/K;ue=0|pe%K,ne.__setDigit(he>>>1,ye<<15|me)}return ne}static __absoluteModSmall(G,K){let ne=0;for(let ue=2*G.length-1;0<=ue;ue--)ne=0|((ne<<15|G.__halfDigit(ue))>>>0)%K;return ne}static __absoluteDivLarge(G,K,ne,ue){const pe=K.__halfDigitLength(),he=K.length,ye=G.__halfDigitLength()-pe;let me=null;ne&&(me=new o(ye+2>>>1,!1),me.__initializeDigits());const be=new o(pe+2>>>1,!1);be.__initializeDigits();const ve=o.__clz15(K.__halfDigit(pe-1));0<ve&&(K=o.__specialLeftShift(K,ve,0));const _e=o.__specialLeftShift(G,ve,1),Te=K.__halfDigit(pe-1);let Ee=0;for(let G,ue=ye;0<=ue;ue--){G=32767;const ye=_e.__halfDigit(ue+pe);if(ye!==Te){const ne=(ye<<15|_e.__halfDigit(ue+pe-1))>>>0;G=0|ne/Te;let he=0|ne%Te;const me=K.__halfDigit(pe-2),be=_e.__halfDigit(ue+pe-2);for(;o.__imul(G,me)>>>0>(he<<16|be)>>>0&&(G--,he+=Te,!(32767<he)););}o.__internalMultiplyAdd(K,G,0,he,be);let ve=_e.__inplaceSub(be,ue,pe+1);0!==ve&&(ve=_e.__inplaceAdd(K,ue,pe),_e.__setHalfDigit(ue+pe,32767&_e.__halfDigit(ue+pe)+ve),G--),ne&&(1&ue?Ee=G<<15:me.__setDigit(ue>>>1,Ee|G))}if(ue)return _e.__inplaceRightShift(ve),ne?{quotient:me,remainder:_e}:_e;if(ne)return me;throw new Error("unreachable")}static __clz15(G){return o.__clz30(G)-15}__inplaceAdd(G,K,ne){let ue=0;for(let pe=0;pe<ne;pe++){const ne=this.__halfDigit(K+pe)+G.__halfDigit(pe)+ue;ue=ne>>>15,this.__setHalfDigit(K+pe,32767&ne)}return ue}__inplaceSub(G,K,ne){let ue=0;if(1&K){K>>=1;let pe=this.__digit(K),he=32767&pe,ye=0;for(;ye<ne-1>>>1;ye++){const ne=G.__digit(ye),me=(pe>>>15)-(32767&ne)-ue;ue=1&me>>>15,this.__setDigit(K+ye,(32767&me)<<15|32767&he),pe=this.__digit(K+ye+1),he=(32767&pe)-(ne>>>15)-ue,ue=1&he>>>15}const me=G.__digit(ye),be=(pe>>>15)-(32767&me)-ue;if(ue=1&be>>>15,this.__setDigit(K+ye,(32767&be)<<15|32767&he),K+ye+1>=this.length)throw new RangeError("out of bounds");0==(1&ne)&&(pe=this.__digit(K+ye+1),he=(32767&pe)-(me>>>15)-ue,ue=1&he>>>15,this.__setDigit(K+G.length,1073709056&pe|32767&he))}else{K>>=1;let pe=0;for(;pe<G.length-1;pe++){const ne=this.__digit(K+pe),he=G.__digit(pe),ye=(32767&ne)-(32767&he)-ue;ue=1&ye>>>15;const me=(ne>>>15)-(he>>>15)-ue;ue=1&me>>>15,this.__setDigit(K+pe,(32767&me)<<15|32767&ye)}const he=this.__digit(K+pe),ye=G.__digit(pe),me=(32767&he)-(32767&ye)-ue;ue=1&me>>>15;let be=0;0==(1&ne)&&(be=(he>>>15)-(ye>>>15)-ue,ue=1&be>>>15),this.__setDigit(K+pe,(32767&be)<<15|32767&me)}return ue}__inplaceRightShift(G){if(0===G)return;let K=this.__digit(0)>>>G;const ne=this.length-1;for(let ue=0;ue<ne;ue++){const ne=this.__digit(ue+1);this.__setDigit(ue,1073741823&ne<<30-G|K),K=ne>>>G}this.__setDigit(ne,K)}static __specialLeftShift(G,K,ne){const ue=G.length,pe=new o(ue+ne,!1);if(0===K){for(let K=0;K<ue;K++)pe.__setDigit(K,G.__digit(K));return 0<ne&&pe.__setDigit(ue,0),pe}let he=0;for(let ne=0;ne<ue;ne++){const ue=G.__digit(ne);pe.__setDigit(ne,1073741823&ue<<K|he),he=ue>>>30-K}return 0<ne&&pe.__setDigit(ue,he),pe}static __leftShiftByAbsolute(G,K){const ne=o.__toShiftAmount(K);if(0>ne)throw new RangeError("BigInt too big");const ue=0|ne/30,pe=ne%30,he=G.length,ye=0!==pe&&0!=G.__digit(he-1)>>>30-pe,me=he+ue+(ye?1:0),be=new o(me,G.sign);if(0===pe){let K=0;for(;K<ue;K++)be.__setDigit(K,0);for(;K<me;K++)be.__setDigit(K,G.__digit(K-ue))}else{let K=0;for(let G=0;G<ue;G++)be.__setDigit(G,0);for(let ne=0;ne<he;ne++){const he=G.__digit(ne);be.__setDigit(ne+ue,1073741823&he<<pe|K),K=he>>>30-pe}if(ye)be.__setDigit(he+ue,K);else if(0!==K)throw new Error("implementation bug")}return be.__trim()}static __rightShiftByAbsolute(G,K){const ne=G.length,ue=G.sign,pe=o.__toShiftAmount(K);if(0>pe)return o.__rightShiftByMaximum(ue);const he=0|pe/30,ye=pe%30;let me=ne-he;if(0>=me)return o.__rightShiftByMaximum(ue);let be=!1;if(ue)if(0!=(G.__digit(he)&(1<<ye)-1))be=!0;else for(let K=0;K<he;K++)if(0!==G.__digit(K)){be=!0;break}be&&0===ye&&0==~G.__digit(ne-1)&&me++;let ve=new o(me,ue);if(0===ye){ve.__setDigit(me-1,0);for(let K=he;K<ne;K++)ve.__setDigit(K-he,G.__digit(K))}else{let K=G.__digit(he)>>>ye;const ue=ne-he-1;for(let ne=0;ne<ue;ne++){const ue=G.__digit(ne+he+1);ve.__setDigit(ne,1073741823&ue<<30-ye|K),K=ue>>>ye}ve.__setDigit(ue,K)}return be&&(ve=o.__absoluteAddOne(ve,!0,ve)),ve.__trim()}static __rightShiftByMaximum(G){return G?o.__oneDigit(1,!0):o.__zero()}static __toShiftAmount(G){if(1<G.length)return-1;const K=G.__unsignedDigit(0);return K>o.__kMaxLengthBits?-1:K}static __toPrimitive(G,K="default"){if("object"!=typeof G)return G;if(G.constructor===o)return G;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){const ne=G[Symbol.toPrimitive];if(ne){const G=ne(K);if("object"!=typeof G)return G;throw new TypeError("Cannot convert object to primitive value")}}const ne=G.valueOf;if(ne){const K=ne.call(G);if("object"!=typeof K)return K}const ue=G.toString;if(ue){const K=ue.call(G);if("object"!=typeof K)return K}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(G){return o.__isBigInt(G)?G:+G}static __isBigInt(G){return"object"==typeof G&&null!==G&&G.constructor===o}static __truncateToNBits(G,K){const ne=0|(G+29)/30,ue=new o(ne,K.sign),pe=ne-1;for(let G=0;G<pe;G++)ue.__setDigit(G,K.__digit(G));let he=K.__digit(pe);if(0!=G%30){const K=32-G%30;he=he<<K>>>K}return ue.__setDigit(pe,he),ue.__trim()}static __truncateAndSubFromPowerOfTwo(G,K,ne){var ue=Math.min;const pe=0|(G+29)/30,he=new o(pe,ne);let ye=0;const me=pe-1;let be=0;for(const G=ue(me,K.length);ye<G;ye++){const G=0-K.__digit(ye)-be;be=1&G>>>30,he.__setDigit(ye,1073741823&G)}for(;ye<me;ye++)he.__setDigit(ye,0|1073741823&-be);let ve=me<K.length?K.__digit(me):0;const _e=G%30;let Te;if(0==_e)Te=0-ve-be,Te&=1073741823;else{const G=32-_e;ve=ve<<G>>>G;const K=1<<32-G;Te=K-ve-be,Te&=K-1}return he.__setDigit(me,Te),he.__trim()}__digit(G){return this[G]}__unsignedDigit(G){return this[G]>>>0}__setDigit(G,K){this[G]=0|K}__setDigitGrow(G,K){this[G]=0|K}__halfDigitLength(){const G=this.length;return 32767>=this.__unsignedDigit(G-1)?2*G-1:2*G}__halfDigit(G){return 32767&this[G>>>1]>>>15*(1&G)}__setHalfDigit(G,K){const ne=G>>>1,ue=this.__digit(ne),pe=1&G?32767&ue|K<<15:1073709056&ue|32767&K;this.__setDigit(ne,pe)}static __digitPow(G,K){let ne=1;for(;0<K;)1&K&&(ne*=G),K>>>=1,G*=G;return ne}static __isOneDigitInt(G){return(1073741823&G)===G}}return o.__kMaxLength=33554432,o.__kMaxLengthBits=o.__kMaxLength<<5,o.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],o.__kBitsPerCharTableShift=5,o.__kBitsPerCharTableMultiplier=1<<o.__kBitsPerCharTableShift,o.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],o.__kBitConversionBuffer=new ArrayBuffer(8),o.__kBitConversionDouble=new Float64Array(o.__kBitConversionBuffer),o.__kBitConversionInts=new Int32Array(o.__kBitConversionBuffer),o.__clz30=K?function(G){return K(G)-2}:function(G){var K=Math.LN2,ne=Math.log;return 0===G?30:0|29-(0|ne(G>>>0)/K)},o.__imul=G||function(G,K){return 0|G*K},o}()}(iV);var sV=iV.exports,oV=getDefaultExportFromCjs$1(sV),cV="Invariant failed";function invariant(G,K){throw new Error(cV)}var dV={exports:{}};
/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */!function(G){!function(K){var ne,ue=1e9,pe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},he=!0,ye="[DecimalError] ",me=ye+"Invalid argument: ",be=ye+"Exponent out of range: ",ve=Math.floor,_e=Math.pow,Te=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ee=1e7,Pe=7,Se=9007199254740991,Ce=ve(Se/Pe),ke={};function add(G,K){var ne,ue,pe,ye,me,be,ve,_e,Te=G.constructor,Se=Te.precision;if(!G.s||!K.s)return K.s||(K=new Te(G)),he?round(K,Se):K;if(ve=G.d,_e=K.d,me=G.e,pe=K.e,ve=ve.slice(),ye=me-pe){for(ye<0?(ue=ve,ye=-ye,be=_e.length):(ue=_e,pe=me,be=ve.length),ye>(be=(me=Math.ceil(Se/Pe))>be?me+1:be+1)&&(ye=be,ue.length=1),ue.reverse();ye--;)ue.push(0);ue.reverse()}for((be=ve.length)-(ye=_e.length)<0&&(ye=be,ue=_e,_e=ve,ve=ue),ne=0;ye;)ne=(ve[--ye]=ve[ye]+_e[ye]+ne)/Ee|0,ve[ye]%=Ee;for(ne&&(ve.unshift(ne),++pe),be=ve.length;0==ve[--be];)ve.pop();return K.d=ve,K.e=pe,he?round(K,Se):K}function checkInt32(G,K,ne){if(G!==~~G||G<K||G>ne)throw Error(me+G)}function digitsToString(G){var K,ne,ue,pe=G.length-1,he="",ye=G[0];if(pe>0){for(he+=ye,K=1;K<pe;K++)ue=G[K]+"",(ne=Pe-ue.length)&&(he+=getZeroString(ne)),he+=ue;ye=G[K],(ne=Pe-(ue=ye+"").length)&&(he+=getZeroString(ne))}else if(0===ye)return"0";for(;ye%10==0;)ye/=10;return he+ye}ke.absoluteValue=ke.abs=function(){var G=new this.constructor(this);return G.s&&(G.s=1),G},ke.comparedTo=ke.cmp=function(G){var K,ne,ue,pe,he=this;if(G=new he.constructor(G),he.s!==G.s)return he.s||-G.s;if(he.e!==G.e)return he.e>G.e^he.s<0?1:-1;for(K=0,ne=(ue=he.d.length)<(pe=G.d.length)?ue:pe;K<ne;++K)if(he.d[K]!==G.d[K])return he.d[K]>G.d[K]^he.s<0?1:-1;return ue===pe?0:ue>pe^he.s<0?1:-1},ke.decimalPlaces=ke.dp=function(){var G=this,K=G.d.length-1,ne=(K-G.e)*Pe;if(K=G.d[K])for(;K%10==0;K/=10)ne--;return ne<0?0:ne},ke.dividedBy=ke.div=function(G){return Oe(this,new this.constructor(G))},ke.dividedToIntegerBy=ke.idiv=function(G){var K=this.constructor;return round(Oe(this,new K(G),0,1),K.precision)},ke.equals=ke.eq=function(G){return!this.cmp(G)},ke.exponent=function(){return getBase10Exponent(this)},ke.greaterThan=ke.gt=function(G){return this.cmp(G)>0},ke.greaterThanOrEqualTo=ke.gte=function(G){return this.cmp(G)>=0},ke.isInteger=ke.isint=function(){return this.e>this.d.length-2},ke.isNegative=ke.isneg=function(){return this.s<0},ke.isPositive=ke.ispos=function(){return this.s>0},ke.isZero=function(){return 0===this.s},ke.lessThan=ke.lt=function(G){return this.cmp(G)<0},ke.lessThanOrEqualTo=ke.lte=function(G){return this.cmp(G)<1},ke.logarithm=ke.log=function(G){var K,ue=this,pe=ue.constructor,me=pe.precision,be=me+5;if(void 0===G)G=new pe(10);else if((G=new pe(G)).s<1||G.eq(ne))throw Error(ye+"NaN");if(ue.s<1)throw Error(ye+(ue.s?"NaN":"-Infinity"));return ue.eq(ne)?new pe(0):(he=!1,K=Oe(ln(ue,be),ln(G,be),be),he=!0,round(K,me))},ke.minus=ke.sub=function(G){var K=this;return G=new K.constructor(G),K.s==G.s?subtract(K,G):add(K,(G.s=-G.s,G))},ke.modulo=ke.mod=function(G){var K,ne=this,ue=ne.constructor,pe=ue.precision;if(!(G=new ue(G)).s)throw Error(ye+"NaN");return ne.s?(he=!1,K=Oe(ne,G,0,1).times(G),he=!0,ne.minus(K)):round(new ue(ne),pe)},ke.naturalExponential=ke.exp=function(){return exp(this)},ke.naturalLogarithm=ke.ln=function(){return ln(this)},ke.negated=ke.neg=function(){var G=new this.constructor(this);return G.s=-G.s||0,G},ke.plus=ke.add=function(G){var K=this;return G=new K.constructor(G),K.s==G.s?add(K,G):subtract(K,(G.s=-G.s,G))},ke.precision=ke.sd=function(G){var K,ne,ue,pe=this;if(void 0!==G&&G!==!!G&&1!==G&&0!==G)throw Error(me+G);if(K=getBase10Exponent(pe)+1,ne=(ue=pe.d.length-1)*Pe+1,ue=pe.d[ue]){for(;ue%10==0;ue/=10)ne--;for(ue=pe.d[0];ue>=10;ue/=10)ne++}return G&&K>ne?K:ne},ke.squareRoot=ke.sqrt=function(){var G,K,ne,ue,pe,me,be,_e=this,Te=_e.constructor;if(_e.s<1){if(!_e.s)return new Te(0);throw Error(ye+"NaN")}for(G=getBase10Exponent(_e),he=!1,0==(pe=Math.sqrt(+_e))||pe==1/0?(((K=digitsToString(_e.d)).length+G)%2==0&&(K+="0"),pe=Math.sqrt(K),G=ve((G+1)/2)-(G<0||G%2),ue=new Te(K=pe==1/0?"5e"+G:(K=pe.toExponential()).slice(0,K.indexOf("e")+1)+G)):ue=new Te(pe.toString()),pe=be=(ne=Te.precision)+3;;)if(ue=(me=ue).plus(Oe(_e,me,be+2)).times(.5),digitsToString(me.d).slice(0,be)===(K=digitsToString(ue.d)).slice(0,be)){if(K=K.slice(be-3,be+1),pe==be&&"4999"==K){if(round(me,ne+1,0),me.times(me).eq(_e)){ue=me;break}}else if("9999"!=K)break;be+=4}return he=!0,round(ue,ne)},ke.times=ke.mul=function(G){var K,ne,ue,pe,ye,me,be,ve,_e,Te=this,Pe=Te.constructor,Se=Te.d,Ce=(G=new Pe(G)).d;if(!Te.s||!G.s)return new Pe(0);for(G.s*=Te.s,ne=Te.e+G.e,(ve=Se.length)<(_e=Ce.length)&&(ye=Se,Se=Ce,Ce=ye,me=ve,ve=_e,_e=me),ye=[],ue=me=ve+_e;ue--;)ye.push(0);for(ue=_e;--ue>=0;){for(K=0,pe=ve+ue;pe>ue;)be=ye[pe]+Ce[ue]*Se[pe-ue-1]+K,ye[pe--]=be%Ee|0,K=be/Ee|0;ye[pe]=(ye[pe]+K)%Ee|0}for(;!ye[--me];)ye.pop();return K?++ne:ye.shift(),G.d=ye,G.e=ne,he?round(G,Pe.precision):G},ke.toDecimalPlaces=ke.todp=function(G,K){var ne=this,pe=ne.constructor;return ne=new pe(ne),void 0===G?ne:(checkInt32(G,0,ue),void 0===K?K=pe.rounding:checkInt32(K,0,8),round(ne,G+getBase10Exponent(ne)+1,K))},ke.toExponential=function(G,K){var ne,pe=this,he=pe.constructor;return void 0===G?ne=toString(pe,!0):(checkInt32(G,0,ue),void 0===K?K=he.rounding:checkInt32(K,0,8),ne=toString(pe=round(new he(pe),G+1,K),!0,G+1)),ne},ke.toFixed=function(G,K){var ne,pe,he=this,ye=he.constructor;return void 0===G?toString(he):(checkInt32(G,0,ue),void 0===K?K=ye.rounding:checkInt32(K,0,8),ne=toString((pe=round(new ye(he),G+getBase10Exponent(he)+1,K)).abs(),!1,G+getBase10Exponent(pe)+1),he.isneg()&&!he.isZero()?"-"+ne:ne)},ke.toInteger=ke.toint=function(){var G=this,K=G.constructor;return round(new K(G),getBase10Exponent(G)+1,K.rounding)},ke.toNumber=function(){return+this},ke.toPower=ke.pow=function(G){var K,ue,pe,me,be,_e,Te=this,Ee=Te.constructor,Ce=+(G=new Ee(G));if(!G.s)return new Ee(ne);if(!(Te=new Ee(Te)).s){if(G.s<1)throw Error(ye+"Infinity");return Te}if(Te.eq(ne))return Te;if(pe=Ee.precision,G.eq(ne))return round(Te,pe);if(_e=(K=G.e)>=(ue=G.d.length-1),be=Te.s,_e){if((ue=Ce<0?-Ce:Ce)<=Se){for(me=new Ee(ne),K=Math.ceil(pe/Pe+4),he=!1;ue%2&&truncate((me=me.times(Te)).d,K),0!==(ue=ve(ue/2));)truncate((Te=Te.times(Te)).d,K);return he=!0,G.s<0?new Ee(ne).div(me):round(me,pe)}}else if(be<0)throw Error(ye+"NaN");return be=be<0&&1&G.d[Math.max(K,ue)]?-1:1,Te.s=1,he=!1,me=G.times(ln(Te,pe+12)),he=!0,(me=exp(me)).s=be,me},ke.toPrecision=function(G,K){var ne,pe,he=this,ye=he.constructor;return void 0===G?pe=toString(he,(ne=getBase10Exponent(he))<=ye.toExpNeg||ne>=ye.toExpPos):(checkInt32(G,1,ue),void 0===K?K=ye.rounding:checkInt32(K,0,8),pe=toString(he=round(new ye(he),G,K),G<=(ne=getBase10Exponent(he))||ne<=ye.toExpNeg,G)),pe},ke.toSignificantDigits=ke.tosd=function(G,K){var ne=this.constructor;return void 0===G?(G=ne.precision,K=ne.rounding):(checkInt32(G,1,ue),void 0===K?K=ne.rounding:checkInt32(K,0,8)),round(new ne(this),G,K)},ke.toString=ke.valueOf=ke.val=ke.toJSON=function(){var G=this,K=getBase10Exponent(G),ne=G.constructor;return toString(G,K<=ne.toExpNeg||K>=ne.toExpPos)};var Oe=function(){function multiplyInteger(G,K){var ne,ue=0,pe=G.length;for(G=G.slice();pe--;)ne=G[pe]*K+ue,G[pe]=ne%Ee|0,ue=ne/Ee|0;return ue&&G.unshift(ue),G}function compare(G,K,ne,ue){var pe,he;if(ne!=ue)he=ne>ue?1:-1;else for(pe=he=0;pe<ne;pe++)if(G[pe]!=K[pe]){he=G[pe]>K[pe]?1:-1;break}return he}function subtract(G,K,ne){for(var ue=0;ne--;)G[ne]-=ue,ue=G[ne]<K[ne]?1:0,G[ne]=ue*Ee+G[ne]-K[ne];for(;!G[0]&&G.length>1;)G.shift()}return function(G,K,ne,ue){var pe,he,me,be,ve,_e,Te,Se,Ce,ke,Oe,xe,Ne,Me,Be,Fe,De,Le,Ue=G.constructor,je=G.s==K.s?1:-1,ze=G.d,Je=K.d;if(!G.s)return new Ue(G);if(!K.s)throw Error(ye+"Division by zero");for(he=G.e-K.e,De=Je.length,Be=ze.length,Se=(Te=new Ue(je)).d=[],me=0;Je[me]==(ze[me]||0);)++me;if(Je[me]>(ze[me]||0)&&--he,(xe=null==ne?ne=Ue.precision:ue?ne+(getBase10Exponent(G)-getBase10Exponent(K))+1:ne)<0)return new Ue(0);if(xe=xe/Pe+2|0,me=0,1==De)for(be=0,Je=Je[0],xe++;(me<Be||be)&&xe--;me++)Ne=be*Ee+(ze[me]||0),Se[me]=Ne/Je|0,be=Ne%Je|0;else{for((be=Ee/(Je[0]+1)|0)>1&&(Je=multiplyInteger(Je,be),ze=multiplyInteger(ze,be),De=Je.length,Be=ze.length),Me=De,ke=(Ce=ze.slice(0,De)).length;ke<De;)Ce[ke++]=0;(Le=Je.slice()).unshift(0),Fe=Je[0],Je[1]>=Ee/2&&++Fe;do{be=0,(pe=compare(Je,Ce,De,ke))<0?(Oe=Ce[0],De!=ke&&(Oe=Oe*Ee+(Ce[1]||0)),(be=Oe/Fe|0)>1?(be>=Ee&&(be=Ee-1),1==(pe=compare(ve=multiplyInteger(Je,be),Ce,_e=ve.length,ke=Ce.length))&&(be--,subtract(ve,De<_e?Le:Je,_e))):(0==be&&(pe=be=1),ve=Je.slice()),(_e=ve.length)<ke&&ve.unshift(0),subtract(Ce,ve,ke),-1==pe&&(pe=compare(Je,Ce,De,ke=Ce.length))<1&&(be++,subtract(Ce,De<ke?Le:Je,ke)),ke=Ce.length):0===pe&&(be++,Ce=[0]),Se[me++]=be,pe&&Ce[0]?Ce[ke++]=ze[Me]||0:(Ce=[ze[Me]],ke=1)}while((Me++<Be||void 0!==Ce[0])&&xe--)}return Se[0]||Se.shift(),Te.e=he,round(Te,ue?ne+getBase10Exponent(Te)+1:ne)}}();function exp(G,K){var ue,pe,ye,me,ve,Te=0,Ee=0,Pe=G.constructor,Se=Pe.precision;if(getBase10Exponent(G)>16)throw Error(be+getBase10Exponent(G));if(!G.s)return new Pe(ne);for(null==K?(he=!1,ve=Se):ve=K,me=new Pe(.03125);G.abs().gte(.1);)G=G.times(me),Ee+=5;for(ve+=Math.log(_e(2,Ee))/Math.LN10*2+5|0,ue=pe=ye=new Pe(ne),Pe.precision=ve;;){if(pe=round(pe.times(G),ve),ue=ue.times(++Te),digitsToString((me=ye.plus(Oe(pe,ue,ve))).d).slice(0,ve)===digitsToString(ye.d).slice(0,ve)){for(;Ee--;)ye=round(ye.times(ye),ve);return Pe.precision=Se,null==K?(he=!0,round(ye,Se)):ye}ye=me}}function getBase10Exponent(G){for(var K=G.e*Pe,ne=G.d[0];ne>=10;ne/=10)K++;return K}function getLn10(G,K,ne){if(K>G.LN10.sd())throw he=!0,ne&&(G.precision=ne),Error(ye+"LN10 precision limit exceeded");return round(new G(G.LN10),K)}function getZeroString(G){for(var K="";G--;)K+="0";return K}function ln(G,K){var ue,pe,me,be,ve,_e,Te,Ee,Pe,Se=1,Ce=G,ke=Ce.d,xe=Ce.constructor,Ne=xe.precision;if(Ce.s<1)throw Error(ye+(Ce.s?"NaN":"-Infinity"));if(Ce.eq(ne))return new xe(0);if(null==K?(he=!1,Ee=Ne):Ee=K,Ce.eq(10))return null==K&&(he=!0),getLn10(xe,Ee);if(Ee+=10,xe.precision=Ee,pe=(ue=digitsToString(ke)).charAt(0),be=getBase10Exponent(Ce),!(Math.abs(be)<15e14))return Te=getLn10(xe,Ee+2,Ne).times(be+""),Ce=ln(new xe(pe+"."+ue.slice(1)),Ee-10).plus(Te),xe.precision=Ne,null==K?(he=!0,round(Ce,Ne)):Ce;for(;pe<7&&1!=pe||1==pe&&ue.charAt(1)>3;)pe=(ue=digitsToString((Ce=Ce.times(G)).d)).charAt(0),Se++;for(be=getBase10Exponent(Ce),pe>1?(Ce=new xe("0."+ue),be++):Ce=new xe(pe+"."+ue.slice(1)),_e=ve=Ce=Oe(Ce.minus(ne),Ce.plus(ne),Ee),Pe=round(Ce.times(Ce),Ee),me=3;;){if(ve=round(ve.times(Pe),Ee),digitsToString((Te=_e.plus(Oe(ve,new xe(me),Ee))).d).slice(0,Ee)===digitsToString(_e.d).slice(0,Ee))return _e=_e.times(2),0!==be&&(_e=_e.plus(getLn10(xe,Ee+2,Ne).times(be+""))),_e=Oe(_e,new xe(Se),Ee),xe.precision=Ne,null==K?(he=!0,round(_e,Ne)):_e;_e=Te,me+=2}}function parseDecimal(G,K){var ne,ue,pe;for((ne=K.indexOf("."))>-1&&(K=K.replace(".","")),(ue=K.search(/e/i))>0?(ne<0&&(ne=ue),ne+=+K.slice(ue+1),K=K.substring(0,ue)):ne<0&&(ne=K.length),ue=0;48===K.charCodeAt(ue);)++ue;for(pe=K.length;48===K.charCodeAt(pe-1);)--pe;if(K=K.slice(ue,pe)){if(pe-=ue,ne=ne-ue-1,G.e=ve(ne/Pe),G.d=[],ue=(ne+1)%Pe,ne<0&&(ue+=Pe),ue<pe){for(ue&&G.d.push(+K.slice(0,ue)),pe-=Pe;ue<pe;)G.d.push(+K.slice(ue,ue+=Pe));K=K.slice(ue),ue=Pe-K.length}else ue-=pe;for(;ue--;)K+="0";if(G.d.push(+K),he&&(G.e>Ce||G.e<-Ce))throw Error(be+ne)}else G.s=0,G.e=0,G.d=[0];return G}function round(G,K,ne){var ue,pe,ye,me,Te,Se,ke,Oe,xe=G.d;for(me=1,ye=xe[0];ye>=10;ye/=10)me++;if((ue=K-me)<0)ue+=Pe,pe=K,ke=xe[Oe=0];else{if((Oe=Math.ceil((ue+1)/Pe))>=(ye=xe.length))return G;for(ke=ye=xe[Oe],me=1;ye>=10;ye/=10)me++;pe=(ue%=Pe)-Pe+me}if(void 0!==ne&&(Te=ke/(ye=_e(10,me-pe-1))%10|0,Se=K<0||void 0!==xe[Oe+1]||ke%ye,Se=ne<4?(Te||Se)&&(0==ne||ne==(G.s<0?3:2)):Te>5||5==Te&&(4==ne||Se||6==ne&&(ue>0?pe>0?ke/_e(10,me-pe):0:xe[Oe-1])%10&1||ne==(G.s<0?8:7))),K<1||!xe[0])return Se?(ye=getBase10Exponent(G),xe.length=1,K=K-ye-1,xe[0]=_e(10,(Pe-K%Pe)%Pe),G.e=ve(-K/Pe)||0):(xe.length=1,xe[0]=G.e=G.s=0),G;if(0==ue?(xe.length=Oe,ye=1,Oe--):(xe.length=Oe+1,ye=_e(10,Pe-ue),xe[Oe]=pe>0?(ke/_e(10,me-pe)%_e(10,pe)|0)*ye:0),Se)for(;;){if(0==Oe){(xe[0]+=ye)==Ee&&(xe[0]=1,++G.e);break}if(xe[Oe]+=ye,xe[Oe]!=Ee)break;xe[Oe--]=0,ye=1}for(ue=xe.length;0===xe[--ue];)xe.pop();if(he&&(G.e>Ce||G.e<-Ce))throw Error(be+getBase10Exponent(G));return G}function subtract(G,K){var ne,ue,pe,ye,me,be,ve,_e,Te,Se,Ce=G.constructor,ke=Ce.precision;if(!G.s||!K.s)return K.s?K.s=-K.s:K=new Ce(G),he?round(K,ke):K;if(ve=G.d,Se=K.d,ue=K.e,_e=G.e,ve=ve.slice(),me=_e-ue){for((Te=me<0)?(ne=ve,me=-me,be=Se.length):(ne=Se,ue=_e,be=ve.length),me>(pe=Math.max(Math.ceil(ke/Pe),be)+2)&&(me=pe,ne.length=1),ne.reverse(),pe=me;pe--;)ne.push(0);ne.reverse()}else{for((Te=(pe=ve.length)<(be=Se.length))&&(be=pe),pe=0;pe<be;pe++)if(ve[pe]!=Se[pe]){Te=ve[pe]<Se[pe];break}me=0}for(Te&&(ne=ve,ve=Se,Se=ne,K.s=-K.s),be=ve.length,pe=Se.length-be;pe>0;--pe)ve[be++]=0;for(pe=Se.length;pe>me;){if(ve[--pe]<Se[pe]){for(ye=pe;ye&&0===ve[--ye];)ve[ye]=Ee-1;--ve[ye],ve[pe]+=Ee}ve[pe]-=Se[pe]}for(;0===ve[--be];)ve.pop();for(;0===ve[0];ve.shift())--ue;return ve[0]?(K.d=ve,K.e=ue,he?round(K,ke):K):new Ce(0)}function toString(G,K,ne){var ue,pe=getBase10Exponent(G),he=digitsToString(G.d),ye=he.length;return K?(ne&&(ue=ne-ye)>0?he=he.charAt(0)+"."+he.slice(1)+getZeroString(ue):ye>1&&(he=he.charAt(0)+"."+he.slice(1)),he=he+(pe<0?"e":"e+")+pe):pe<0?(he="0."+getZeroString(-pe-1)+he,ne&&(ue=ne-ye)>0&&(he+=getZeroString(ue))):pe>=ye?(he+=getZeroString(pe+1-ye),ne&&(ue=ne-pe-1)>0&&(he=he+"."+getZeroString(ue))):((ue=pe+1)<ye&&(he=he.slice(0,ue)+"."+he.slice(ue)),ne&&(ue=ne-ye)>0&&(pe+1===ye&&(he+="."),he+=getZeroString(ue))),G.s<0?"-"+he:he}function truncate(G,K){if(G.length>K)return G.length=K,!0}function config(G){if(!G||"object"!=typeof G)throw Error(ye+"Object expected");var K,ne,pe,he=["precision",1,ue,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(K=0;K<he.length;K+=3)if(void 0!==(pe=G[ne=he[K]])){if(!(ve(pe)===pe&&pe>=he[K+1]&&pe<=he[K+2]))throw Error(me+ne+": "+pe);this[ne]=pe}if(void 0!==(pe=G[ne="LN10"])){if(pe!=Math.LN10)throw Error(me+ne+": "+pe);this[ne]=new this(pe)}return this}pe=function clone(G){var K,ne,ue;function Decimal(G){var K=this;if(!(K instanceof Decimal))return new Decimal(G);if(K.constructor=Decimal,G instanceof Decimal)return K.s=G.s,K.e=G.e,void(K.d=(G=G.d)?G.slice():G);if("number"==typeof G){if(0*G!=0)throw Error(me+G);if(G>0)K.s=1;else{if(!(G<0))return K.s=0,K.e=0,void(K.d=[0]);G=-G,K.s=-1}return G===~~G&&G<1e7?(K.e=0,void(K.d=[G])):parseDecimal(K,G.toString())}if("string"!=typeof G)throw Error(me+G);if(45===G.charCodeAt(0)?(G=G.slice(1),K.s=-1):K.s=1,!Te.test(G))throw Error(me+G);parseDecimal(K,G)}if(Decimal.prototype=ke,Decimal.ROUND_UP=0,Decimal.ROUND_DOWN=1,Decimal.ROUND_CEIL=2,Decimal.ROUND_FLOOR=3,Decimal.ROUND_HALF_UP=4,Decimal.ROUND_HALF_DOWN=5,Decimal.ROUND_HALF_EVEN=6,Decimal.ROUND_HALF_CEIL=7,Decimal.ROUND_HALF_FLOOR=8,Decimal.clone=clone,Decimal.config=Decimal.set=config,void 0===G&&(G={}),G)for(ue=["precision","rounding","toExpNeg","toExpPos","LN10"],K=0;K<ue.length;)G.hasOwnProperty(ne=ue[K++])||(G[ne]=this[ne]);return Decimal.config(G),Decimal}(pe),pe.default=pe.Decimal=pe,ne=new pe(1),G.exports?G.exports=pe:(K||(K="undefined"!=typeof self&&self&&self.self==self?self:Function("return this")()),K.Decimal=pe)}(pn)}(dV);var uV=getDefaultExportFromCjs$1(dV.exports),fV={exports:{}};!function(G){!function(K){var ne,ue=1e6,pe=1e6,he="[big.js] ",ye=he+"Invalid ",me=ye+"decimal places",be=ye+"rounding mode",ve=he+"Division by zero",_e={},Te=void 0,Ee=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function round(G,K,ne,ue){var pe=G.c,he=G.e+K+1;if(he<pe.length){if(1===ne)ue=pe[he]>=5;else if(2===ne)ue=pe[he]>5||5==pe[he]&&(ue||he<0||pe[he+1]!==Te||1&pe[he-1]);else if(3===ne)ue=ue||!!pe[0];else if(ue=!1,0!==ne)throw Error(be);if(he<1)pe.length=1,ue?(G.e=-K,pe[0]=1):pe[0]=G.e=0;else{if(pe.length=he--,ue)for(;++pe[he]>9;)pe[he]=0,he--||(++G.e,pe.unshift(1));for(he=pe.length;!pe[--he];)pe.pop()}}else if(ne<0||ne>3||ne!==~~ne)throw Error(be);return G}function stringify(G,K,ne,pe){var he,be,ve=G.constructor,_e=!G.c[0];if(ne!==Te){if(ne!==~~ne||ne<(3==K)||ne>ue)throw Error(3==K?ye+"precision":me);for(ne=pe-(G=new ve(G)).e,G.c.length>++pe&&round(G,ne,ve.RM),2==K&&(pe=G.e+ne+1);G.c.length<pe;)G.c.push(0)}if(he=G.e,ne=(be=G.c.join("")).length,2!=K&&(1==K||3==K&&pe<=he||he<=ve.NE||he>=ve.PE))be=be.charAt(0)+(ne>1?"."+be.slice(1):"")+(he<0?"e":"e+")+he;else if(he<0){for(;++he;)be="0"+be;be="0."+be}else if(he>0)if(++he>ne)for(he-=ne;he--;)be+="0";else he<ne&&(be=be.slice(0,he)+"."+be.slice(he));else ne>1&&(be=be.charAt(0)+"."+be.slice(1));return G.s<0&&(!_e||4==K)?"-"+be:be}_e.abs=function(){var G=new this.constructor(this);return G.s=1,G},_e.cmp=function(G){var K,ne=this,ue=ne.c,pe=(G=new ne.constructor(G)).c,he=ne.s,ye=G.s,me=ne.e,be=G.e;if(!ue[0]||!pe[0])return ue[0]?he:pe[0]?-ye:0;if(he!=ye)return he;if(K=he<0,me!=be)return me>be^K?1:-1;for(ye=(me=ue.length)<(be=pe.length)?me:be,he=-1;++he<ye;)if(ue[he]!=pe[he])return ue[he]>pe[he]^K?1:-1;return me==be?0:me>be^K?1:-1},_e.div=function(G){var K=this,ne=K.constructor,pe=K.c,he=(G=new ne(G)).c,ye=K.s==G.s?1:-1,be=ne.DP;if(be!==~~be||be<0||be>ue)throw Error(me);if(!he[0])throw Error(ve);if(!pe[0])return new ne(0*ye);var _e,Ee,Pe,Se,Ce,ke=he.slice(),Oe=_e=he.length,xe=pe.length,Ne=pe.slice(0,_e),Me=Ne.length,Be=G,Fe=Be.c=[],De=0,Le=be+(Be.e=K.e-G.e)+1;for(Be.s=ye,ye=Le<0?0:Le,ke.unshift(0);Me++<_e;)Ne.push(0);do{for(Pe=0;Pe<10;Pe++){if(_e!=(Me=Ne.length))Se=_e>Me?1:-1;else for(Ce=-1,Se=0;++Ce<_e;)if(he[Ce]!=Ne[Ce]){Se=he[Ce]>Ne[Ce]?1:-1;break}if(!(Se<0))break;for(Ee=Me==_e?he:ke;Me;){if(Ne[--Me]<Ee[Me]){for(Ce=Me;Ce&&!Ne[--Ce];)Ne[Ce]=9;--Ne[Ce],Ne[Me]+=10}Ne[Me]-=Ee[Me]}for(;!Ne[0];)Ne.shift()}Fe[De++]=Se?Pe:++Pe,Ne[0]&&Se?Ne[Me]=pe[Oe]||0:Ne=[pe[Oe]]}while((Oe++<xe||Ne[0]!==Te)&&ye--);return Fe[0]||1==De||(Fe.shift(),Be.e--),De>Le&&round(Be,be,ne.RM,Ne[0]!==Te),Be},_e.eq=function(G){return!this.cmp(G)},_e.gt=function(G){return this.cmp(G)>0},_e.gte=function(G){return this.cmp(G)>-1},_e.lt=function(G){return this.cmp(G)<0},_e.lte=function(G){return this.cmp(G)<1},_e.minus=_e.sub=function(G){var K,ne,ue,pe,he=this,ye=he.constructor,me=he.s,be=(G=new ye(G)).s;if(me!=be)return G.s=-be,he.plus(G);var ve=he.c.slice(),_e=he.e,Te=G.c,Ee=G.e;if(!ve[0]||!Te[0])return Te[0]?(G.s=-be,G):new ye(ve[0]?he:0);if(me=_e-Ee){for((pe=me<0)?(me=-me,ue=ve):(Ee=_e,ue=Te),ue.reverse(),be=me;be--;)ue.push(0);ue.reverse()}else for(ne=((pe=ve.length<Te.length)?ve:Te).length,me=be=0;be<ne;be++)if(ve[be]!=Te[be]){pe=ve[be]<Te[be];break}if(pe&&(ue=ve,ve=Te,Te=ue,G.s=-G.s),(be=(ne=Te.length)-(K=ve.length))>0)for(;be--;)ve[K++]=0;for(be=K;ne>me;){if(ve[--ne]<Te[ne]){for(K=ne;K&&!ve[--K];)ve[K]=9;--ve[K],ve[ne]+=10}ve[ne]-=Te[ne]}for(;0===ve[--be];)ve.pop();for(;0===ve[0];)ve.shift(),--Ee;return ve[0]||(G.s=1,ve=[Ee=0]),G.c=ve,G.e=Ee,G},_e.mod=function(G){var K,ne=this,ue=ne.constructor,pe=ne.s,he=(G=new ue(G)).s;if(!G.c[0])throw Error(ve);return ne.s=G.s=1,K=1==G.cmp(ne),ne.s=pe,G.s=he,K?new ue(ne):(pe=ue.DP,he=ue.RM,ue.DP=ue.RM=0,ne=ne.div(G),ue.DP=pe,ue.RM=he,this.minus(ne.times(G)))},_e.plus=_e.add=function(G){var K,ne=this,ue=ne.constructor,pe=ne.s,he=(G=new ue(G)).s;if(pe!=he)return G.s=-he,ne.minus(G);var ye=ne.e,me=ne.c,be=G.e,ve=G.c;if(!me[0]||!ve[0])return ve[0]?G:new ue(me[0]?ne:0*pe);if(me=me.slice(),pe=ye-be){for(pe>0?(be=ye,K=ve):(pe=-pe,K=me),K.reverse();pe--;)K.push(0);K.reverse()}for(me.length-ve.length<0&&(K=ve,ve=me,me=K),pe=ve.length,he=0;pe;me[pe]%=10)he=(me[--pe]=me[pe]+ve[pe]+he)/10|0;for(he&&(me.unshift(he),++be),pe=me.length;0===me[--pe];)me.pop();return G.c=me,G.e=be,G},_e.pow=function(G){var K=this,ne=new K.constructor(1),ue=ne,he=G<0;if(G!==~~G||G<-1e6||G>pe)throw Error(ye+"exponent");for(he&&(G=-G);1&G&&(ue=ue.times(K)),G>>=1;)K=K.times(K);return he?ne.div(ue):ue},_e.round=function(G,K){var ne=this.constructor;if(G===Te)G=0;else if(G!==~~G||G<-ue||G>ue)throw Error(me);return round(new ne(this),G,K===Te?ne.RM:K)},_e.sqrt=function(){var G,K,ne,ue=this,pe=ue.constructor,ye=ue.s,me=ue.e,be=new pe(.5);if(!ue.c[0])return new pe(ue);if(ye<0)throw Error(he+"No square root");0===(ye=Math.sqrt(ue+""))||ye===1/0?((K=ue.c.join("")).length+me&1||(K+="0"),me=((me+1)/2|0)-(me<0||1&me),G=new pe(((ye=Math.sqrt(K))==1/0?"1e":(ye=ye.toExponential()).slice(0,ye.indexOf("e")+1))+me)):G=new pe(ye),me=G.e+(pe.DP+=4);do{ne=G,G=be.times(ne.plus(ue.div(ne)))}while(ne.c.slice(0,me).join("")!==G.c.slice(0,me).join(""));return round(G,pe.DP-=4,pe.RM)},_e.times=_e.mul=function(G){var K,ne=this,ue=ne.constructor,pe=ne.c,he=(G=new ue(G)).c,ye=pe.length,me=he.length,be=ne.e,ve=G.e;if(G.s=ne.s==G.s?1:-1,!pe[0]||!he[0])return new ue(0*G.s);for(G.e=be+ve,ye<me&&(K=pe,pe=he,he=K,ve=ye,ye=me,me=ve),K=new Array(ve=ye+me);ve--;)K[ve]=0;for(be=me;be--;){for(me=0,ve=ye+be;ve>be;)me=K[ve]+he[be]*pe[ve-be-1]+me,K[ve--]=me%10,me=me/10|0;K[ve]=(K[ve]+me)%10}for(me?++G.e:K.shift(),be=K.length;!K[--be];)K.pop();return G.c=K,G},_e.toExponential=function(G){return stringify(this,1,G,G)},_e.toFixed=function(G){return stringify(this,2,G,this.e+G)},_e.toPrecision=function(G){return stringify(this,3,G,G-1)},_e.toString=function(){return stringify(this)},_e.valueOf=_e.toJSON=function(){return stringify(this,4)},ne=function _Big_(){function Big(G){var K=this;if(!(K instanceof Big))return G===Te?_Big_():new Big(G);G instanceof Big?(K.s=G.s,K.e=G.e,K.c=G.c.slice()):function parse(G,K){var ne,ue,pe;if(0===K&&1/K<0)K="-0";else if(!Ee.test(K+=""))throw Error(ye+"number");G.s="-"==K.charAt(0)?(K=K.slice(1),-1):1,(ne=K.indexOf("."))>-1&&(K=K.replace(".",""));(ue=K.search(/e/i))>0?(ne<0&&(ne=ue),ne+=+K.slice(ue+1),K=K.substring(0,ue)):ne<0&&(ne=K.length);for(pe=K.length,ue=0;ue<pe&&"0"==K.charAt(ue);)++ue;if(ue==pe)G.c=[G.e=0];else{for(;pe>0&&"0"==K.charAt(--pe););for(G.e=ne-ue-1,G.c=[],ne=0;ue<=pe;)G.c[ne++]=+K.charAt(ue++)}return G}(K,G),K.constructor=Big}return Big.prototype=_e,Big.DP=20,Big.RM=1,Big.NE=-7,Big.PE=21,Big.version="5.2.2",Big}(),ne.default=ne.Big=ne,G.exports?G.exports=ne:K.Big=ne}(pn)}(fV);var lV=getDefaultExportFromCjs$1(fV.exports),pV={exports:{}};!function(G){G.exports&&(G.exports=function toFormat(G){return G.prototype.toFormat=function toFormat(G,K,ne){if(!this.e&&0!==this.e)return this.toString();var ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe=this.format||{},Ne=this.constructor.format||{};if(G!=me?"object"==typeof G?(ne=G,G=me):K!=me?"object"==typeof K?(ne=K,K=me):"object"!=typeof ne&&(ne={}):ne={}:ne={},_e=(ue=this.toFixed(G,K).split("."))[0],Te=ue[1],be=(ve=this.s<0?_e.slice(1):_e).length,(Ee=ne.decimalSeparator)==me&&(Ee=xe.decimalSeparator)==me&&(Ee=Ne.decimalSeparator)==me&&(Ee="."),(Pe=ne.groupSeparator)==me&&(Pe=xe.groupSeparator)==me&&(Pe=Ne.groupSeparator),Pe&&((Se=ne.groupSize)==me&&(Se=xe.groupSize)==me&&(Se=Ne.groupSize)==me&&(Se=0),(Ce=ne.secondaryGroupSize)==me&&(Ce=xe.secondaryGroupSize)==me&&(Ce=Ne.secondaryGroupSize)==me&&(Ce=0),Ce?(pe=+Ce,be-=he=+Se):(pe=+Se,he=+Ce),pe>0&&be>0)){for(ye=be%pe||pe,_e=ve.substr(0,ye);ye<be;ye+=pe)_e+=Pe+ve.substr(ye,pe);he>0&&(_e+=Pe+ve.slice(ye)),this.s<0&&(_e="-"+_e)}return Te?((ke=ne.fractionGroupSeparator)==me&&(ke=xe.fractionGroupSeparator)==me&&(ke=Ne.fractionGroupSeparator),ke&&((Oe=ne.fractionGroupSize)==me&&(Oe=xe.fractionGroupSize)==me&&(Oe=Ne.fractionGroupSize)==me&&(Oe=0),(Oe=+Oe)&&(Te=Te.replace(new RegExp("\\d{"+Oe+"}\\B","g"),"$&"+ke))),_e+Ee+Te):_e},G.format={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},G})}(pV);var hV,yV,mV,bV=getDefaultExportFromCjs$1(pV.exports);!function(G){G[G.MAINNET=1]="MAINNET",G[G.GOERLI=5]="GOERLI",G[G.SEPOLIA=11155111]="SEPOLIA",G[G.ARBITRUM_ONE=42161]="ARBITRUM_ONE",G[G.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",G[G.OPTIMISM=10]="OPTIMISM",G[G.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",G[G.POLYGON=137]="POLYGON",G[G.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",G[G.CELO=42220]="CELO",G[G.CELO_ALFAJORES=44787]="CELO_ALFAJORES",G[G.BNB=56]="BNB"}(hV||(hV={})),function(G){G[G.EXACT_INPUT=0]="EXACT_INPUT",G[G.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(yV||(yV={})),function(G){G[G.ROUND_DOWN=0]="ROUND_DOWN",G[G.ROUND_HALF_UP=1]="ROUND_HALF_UP",G[G.ROUND_UP=2]="ROUND_UP"}(mV||(mV={}));var gV,vV,wV=oV.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function _createClass$5(G,K,ne){return K&&function _defineProperties$5(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _inheritsLoose$4(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}var _V=bV(uV),TV=bV(lV),AV=((gV={})[mV.ROUND_DOWN]=_V.ROUND_DOWN,gV[mV.ROUND_HALF_UP]=_V.ROUND_HALF_UP,gV[mV.ROUND_UP]=_V.ROUND_UP,gV),EV=((vV={})[mV.ROUND_DOWN]=0,vV[mV.ROUND_HALF_UP]=1,vV[mV.ROUND_UP]=3,vV),PV=function(){function Fraction(G,K){void 0===K&&(K=oV.BigInt(1)),this.numerator=oV.BigInt(G),this.denominator=oV.BigInt(K)}Fraction.tryParseFraction=function tryParseFraction(G){if(G instanceof oV||"number"==typeof G||"string"==typeof G)return new Fraction(G);if("numerator"in G&&"denominator"in G)return G;throw new Error("Could not parse fraction")};var G=Fraction.prototype;return G.invert=function invert(){return new Fraction(this.denominator,this.numerator)},G.add=function add(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.add(this.numerator,K.numerator),this.denominator):new Fraction(oV.add(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.subtract=function subtract(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.subtract(this.numerator,K.numerator),this.denominator):new Fraction(oV.subtract(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.lessThan=function lessThan(G){var K=Fraction.tryParseFraction(G);return oV.lessThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.equalTo=function equalTo(G){var K=Fraction.tryParseFraction(G);return oV.equal(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.greaterThan=function greaterThan(G){var K=Fraction.tryParseFraction(G);return oV.greaterThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.multiply=function multiply(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.numerator),oV.multiply(this.denominator,K.denominator))},G.divide=function divide(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.denominator),oV.multiply(this.denominator,K.numerator))},G.toSignificant=function toSignificant(G,K,ne){void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=mV.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>0||invariant(),_V.set({precision:G+1,rounding:AV[ne]});var ue=new _V(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(G);return ue.toFormat(ue.decimalPlaces(),K)},G.toFixed=function toFixed(G,K,ne){return void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=mV.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>=0||invariant(),TV.DP=G,TV.RM=EV[ne],new TV(this.numerator.toString()).div(this.denominator.toString()).toFormat(G,K)},_createClass$5(Fraction,[{key:"quotient",get:function get(){return oV.divide(this.numerator,this.denominator)}},{key:"remainder",get:function get(){return new Fraction(oV.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function get(){return new Fraction(this.numerator,this.denominator)}}]),Fraction}(),SV=bV(lV),IV=function(G){function CurrencyAmount(K,ne,ue){var pe;return pe=G.call(this,ne,ue)||this,oV.lessThanOrEqual(pe.quotient,wV)||invariant(),pe.currency=K,pe.decimalScale=oV.exponentiate(oV.BigInt(10),oV.BigInt(K.decimals)),pe}_inheritsLoose$4(CurrencyAmount,G),CurrencyAmount.fromRawAmount=function fromRawAmount(G,K){return new CurrencyAmount(G,K)},CurrencyAmount.fromFractionalAmount=function fromFractionalAmount(G,K,ne){return new CurrencyAmount(G,K,ne)};var K=CurrencyAmount.prototype;return K.add=function add(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.add.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.subtract=function subtract(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.subtract.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.multiply=function multiply(K){var ne=G.prototype.multiply.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.divide=function divide(K){var ne=G.prototype.divide.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=6),void 0===ue&&(ue=mV.ROUND_DOWN),G.prototype.divide.call(this,this.decimalScale).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=this.currency.decimals),void 0===ue&&(ue=mV.ROUND_DOWN),K<=this.currency.decimals||invariant(),G.prototype.divide.call(this,this.decimalScale).toFixed(K,ne,ue)},K.toExact=function toExact(G){return void 0===G&&(G={groupSeparator:""}),SV.DP=this.currency.decimals,new SV(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(G)},_createClass$5(CurrencyAmount,[{key:"wrapped",get:function get(){return this.currency.isToken?this:CurrencyAmount.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),CurrencyAmount}(PV),CV=new PV(oV.BigInt(100));function toPercent$3(G){return new RV(G.numerator,G.denominator)}var RV=function(G){function Percent(){var K;return(K=G.apply(this,arguments)||this).isPercent=!0,K}_inheritsLoose$4(Percent,G);var K=Percent.prototype;return K.add=function add(K){return toPercent$3(G.prototype.add.call(this,K))},K.subtract=function subtract(K){return toPercent$3(G.prototype.subtract.call(this,K))},K.multiply=function multiply(K){return toPercent$3(G.prototype.multiply.call(this,K))},K.divide=function divide(K){return toPercent$3(G.prototype.divide.call(this,K))},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=5),G.prototype.multiply.call(this,CV).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=2),G.prototype.multiply.call(this,CV).toFixed(K,ne,ue)},Percent}(PV),kV=function BaseCurrency(G,K,ne,ue){Number.isSafeInteger(G)||invariant(),K>=0&&K<255&&Number.isInteger(K)||invariant(),this.chainId=G,this.decimals=K,this.symbol=ne,this.name=ue};var OV=/^0x[0-9a-fA-F]{40}$/;var xV,NV,MV,BV,FV=function(G){function Token(K,ne,ue,pe,he,ye){var me;return(me=G.call(this,K,ue,pe,he)||this).isNative=!1,me.isToken=!0,me.address=ye?function checkValidAddress$3(G){if(OV.test(G))return G;throw new Error(G+" is not a valid address.")}(ne):function validateAndParseAddress$3(G){try{return getAddress$2(G)}catch(K){throw new Error(G+" is not a valid address.")}}(ne),me}_inheritsLoose$4(Token,G);var K=Token.prototype;return K.equals=function equals(G){return G.isToken&&this.chainId===G.chainId&&this.address.toLowerCase()===G.address.toLowerCase()},K.sortsBefore=function sortsBefore(G){return this.chainId!==G.chainId&&invariant(),this.address.toLowerCase()===G.address.toLowerCase()&&invariant(),this.address.toLowerCase()<G.address.toLowerCase()},_createClass$5(Token,[{key:"wrapped",get:function get(){return this}}]),Token}(kV);function _createClass$4(G,K,ne){return K&&function _defineProperties$4(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _extends$3(){return _extends$3=Object.assign||function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G},_extends$3.apply(this,arguments)}function _inheritsLoose$3(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}(xV={})[1]=new FV(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),xV[3]=new FV(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),xV[4]=new FV(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),xV[5]=new FV(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),xV[42]=new FV(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),xV[10]=new FV(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),xV[69]=new FV(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),xV[42161]=new FV(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),xV[421611]=new FV(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),function(G){G[G.MAINNET=1]="MAINNET",G[G.GOERLI=5]="GOERLI",G[G.SEPOLIA=11155111]="SEPOLIA",G[G.OPTIMISM=10]="OPTIMISM",G[G.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",G[G.ARBITRUM_ONE=42161]="ARBITRUM_ONE",G[G.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",G[G.POLYGON=137]="POLYGON",G[G.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",G[G.CELO=42220]="CELO",G[G.CELO_ALFAJORES=44787]="CELO_ALFAJORES",G[G.GNOSIS=100]="GNOSIS",G[G.MOONBEAM=1284]="MOONBEAM",G[G.BNB=56]="BNB",G[G.AVALANCHE=43114]="AVALANCHE",G[G.BASE_GOERLI=84531]="BASE_GOERLI",G[G.BASE=8453]="BASE"}(NV||(NV={})),NV.MAINNET,NV.OPTIMISM,NV.OPTIMISM_GOERLI,NV.ARBITRUM_ONE,NV.ARBITRUM_GOERLI,NV.POLYGON,NV.POLYGON_MUMBAI,NV.GOERLI,NV.SEPOLIA,NV.CELO_ALFAJORES,NV.CELO,NV.BNB,NV.AVALANCHE,NV.BASE,NV.BASE_GOERLI,function(G){G.ETHER="ETH",G.MATIC="MATIC",G.CELO="CELO",G.GNOSIS="XDAI",G.MOONBEAM="GLMR",G.BNB="BNB",G.AVAX="AVAX"}(MV||(MV={}));NV.MAINNET,NV.GOERLI;NV.OPTIMISM,NV.ARBITRUM_ONE,NV.POLYGON,NV.POLYGON_MUMBAI,NV.SEPOLIA;var DV,LV,UV={v3CoreFactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",multicallAddress:"0x1F98415757620B543A52E61c46B32eB19261F984",quoterAddress:"0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",v3MigratorAddress:"0xA5644E29708357803b5A882D272c41cC0dF92B34",nonfungiblePositionManagerAddress:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88"},$V=_extends$3({},UV,{v1MixedRouteQuoterAddress:"0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E"}),qV=_extends$3({},UV,{v1MixedRouteQuoterAddress:"0xBa60b6e6fF25488308789E6e0A65D838be34194e"}),GV=UV,jV=_extends$3({},UV,{multicallAddress:"0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB",tickLensAddress:"0xbfd8137f7d1516D3ea5cA83523914859ec47F573"}),HV=UV,WV={v3CoreFactoryAddress:"0xAfE208a311B21f13EF87E33A90049fC17A7acDEc",multicallAddress:"0x633987602DE5C4F337e3DbF265303A1080324204",quoterAddress:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",v3MigratorAddress:"0x3cFd4d48EDfDCC53D3f173F596f621064614C582",nonfungiblePositionManagerAddress:"0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A",tickLensAddress:"0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D"};(BV={})[NV.MAINNET]=$V,BV[NV.OPTIMISM]=GV,BV[NV.ARBITRUM_ONE]=jV,BV[NV.POLYGON]=HV,BV[NV.POLYGON_MUMBAI]=HV,BV[NV.GOERLI]=qV,BV[NV.CELO]=WV,BV[NV.CELO_ALFAJORES]=WV,BV[NV.BNB]={v3CoreFactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",multicallAddress:"0x963Df249eD09c358A4819E39d9Cd5736c3087184",quoterAddress:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",v3MigratorAddress:"0x32681814957e0C13117ddc0c2aba232b5c9e760f",nonfungiblePositionManagerAddress:"0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613",tickLensAddress:"0xD9270014D396281579760619CCf4c3af0501A47C",swapRouter02Address:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"},BV[NV.OPTIMISM_GOERLI]={v3CoreFactoryAddress:"0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10",multicallAddress:"0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd",quoterAddress:"0x9569CbA925c8ca2248772A9A4976A516743A246F",v3MigratorAddress:"0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8",nonfungiblePositionManagerAddress:"0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6",tickLensAddress:"0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e"},BV[NV.ARBITRUM_GOERLI]={v3CoreFactoryAddress:"0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6",multicallAddress:"0x8260CB40247290317a4c062F3542622367F206Ee",quoterAddress:"0x1dd92b83591781D0C6d98d07391eea4b9a6008FA",v3MigratorAddress:"0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3",nonfungiblePositionManagerAddress:"0x622e4726a167799826d1E1D150b076A7725f5D81",tickLensAddress:"0xb52429333da969a0C79a60930a4Bf0020E5D1DE8"},BV[NV.SEPOLIA]={v3CoreFactoryAddress:"0x0227628f3F023bb0B980b67D528571c95c6DaC1c",multicallAddress:"0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07",quoterAddress:"0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",v3MigratorAddress:"0x729004182cF005CEC8Bd85df140094b6aCbe8b15",nonfungiblePositionManagerAddress:"0x1238536071E1c677A632429e3655c799b22cDA52",tickLensAddress:"0xd7f33bcdb21b359c8ee6f0251d30e94832baad07"},BV[NV.AVALANCHE]={v3CoreFactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",multicallAddress:"0x0139141Cd4Ee88dF3Cdb65881D411bAE271Ef0C2",quoterAddress:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",v3MigratorAddress:"0x44f5f1f5E452ea8d29C890E8F6e893fC0f1f0f97",nonfungiblePositionManagerAddress:"0x655C406EBFa14EE2006250925e54ec43AD184f8B",tickLensAddress:"0xEB9fFC8bf81b4fFd11fb6A63a6B0f098c6e21950",swapRouter02Address:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE"},BV[NV.BASE]={v3CoreFactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",multicallAddress:"0x091e99cb1C49331a94dD62755D168E941AbD0693",quoterAddress:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",v3MigratorAddress:"0x23cF10b1ee3AdfCA73B0eF17C07F7577e7ACd2d7",nonfungiblePositionManagerAddress:"0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",tickLensAddress:"0x0CdeE061c75D43c82520eD998C23ac2991c9ac6d",swapRouter02Address:"0x2626664c2603336E57B271c5C0b26F421741e481"},BV[NV.BASE_GOERLI]={v3CoreFactoryAddress:"0x9323c1d6D800ed51Bd7C6B216cfBec678B7d0BC2",multicallAddress:"0xB206027a9E0E13F05eBEFa5D2402Bab3eA716439",quoterAddress:"0xedf539058e28E5937dAef3f69cEd0b25fbE66Ae9",v3MigratorAddress:"0x3efe5d02a04b7351D671Db7008ec6eBA9AD9e3aE",nonfungiblePositionManagerAddress:"0x3c61369ef0D1D2AFa70d8feC2F31C5D6Ce134F30",tickLensAddress:"0x1acB873Ee909D0c98adB18e4474943249F931b92",swapRouter02Address:"0x8357227D4eDc78991Db6FDB9bD6ADE250536dE1d"},{}[NV.MAINNET]="0xC4e172459f1E7939D522503B81AFAaC1014CE6F6",{}[NV.MAINNET]="0x408ED6354d4973f66138C91495F2f2FCbd8724C3",{}[NV.MAINNET]="0x090D4613473dEE047c3f2706764f49E0821D256e",{}[NV.MAINNET]="0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8",{}[NV.MAINNET]="0x65770b5283117639760beA3F867b69b3697a91dd",function(G){G[G.EXACT_INPUT=0]="EXACT_INPUT",G[G.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(DV||(DV={})),function(G){G[G.ROUND_DOWN=0]="ROUND_DOWN",G[G.ROUND_HALF_UP=1]="ROUND_HALF_UP",G[G.ROUND_UP=2]="ROUND_UP"}(LV||(LV={}));var zV,VV,KV=oV.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),JV=bV(uV),XV=bV(lV),QV=((zV={})[LV.ROUND_DOWN]=JV.ROUND_DOWN,zV[LV.ROUND_HALF_UP]=JV.ROUND_HALF_UP,zV[LV.ROUND_UP]=JV.ROUND_UP,zV),ZV=((VV={})[LV.ROUND_DOWN]=0,VV[LV.ROUND_HALF_UP]=1,VV[LV.ROUND_UP]=3,VV),YV=function(){function Fraction(G,K){void 0===K&&(K=oV.BigInt(1)),this.numerator=oV.BigInt(G),this.denominator=oV.BigInt(K)}Fraction.tryParseFraction=function tryParseFraction(G){if(G instanceof oV||"number"==typeof G||"string"==typeof G)return new Fraction(G);if("numerator"in G&&"denominator"in G)return G;throw new Error("Could not parse fraction")};var G=Fraction.prototype;return G.invert=function invert(){return new Fraction(this.denominator,this.numerator)},G.add=function add(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.add(this.numerator,K.numerator),this.denominator):new Fraction(oV.add(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.subtract=function subtract(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.subtract(this.numerator,K.numerator),this.denominator):new Fraction(oV.subtract(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.lessThan=function lessThan(G){var K=Fraction.tryParseFraction(G);return oV.lessThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.equalTo=function equalTo(G){var K=Fraction.tryParseFraction(G);return oV.equal(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.greaterThan=function greaterThan(G){var K=Fraction.tryParseFraction(G);return oV.greaterThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.multiply=function multiply(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.numerator),oV.multiply(this.denominator,K.denominator))},G.divide=function divide(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.denominator),oV.multiply(this.denominator,K.numerator))},G.toSignificant=function toSignificant(G,K,ne){void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=LV.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>0||invariant(),JV.set({precision:G+1,rounding:QV[ne]});var ue=new JV(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(G);return ue.toFormat(ue.decimalPlaces(),K)},G.toFixed=function toFixed(G,K,ne){return void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=LV.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>=0||invariant(),XV.DP=G,XV.RM=ZV[ne],new XV(this.numerator.toString()).div(this.denominator.toString()).toFormat(G,K)},_createClass$4(Fraction,[{key:"quotient",get:function get(){return oV.divide(this.numerator,this.denominator)}},{key:"remainder",get:function get(){return new Fraction(oV.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function get(){return new Fraction(this.numerator,this.denominator)}}]),Fraction}(),eK=bV(lV),tK=function(G){function CurrencyAmount(K,ne,ue){var pe;return pe=G.call(this,ne,ue)||this,oV.lessThanOrEqual(pe.quotient,KV)||invariant(),pe.currency=K,pe.decimalScale=oV.exponentiate(oV.BigInt(10),oV.BigInt(K.decimals)),pe}_inheritsLoose$3(CurrencyAmount,G),CurrencyAmount.fromRawAmount=function fromRawAmount(G,K){return new CurrencyAmount(G,K)},CurrencyAmount.fromFractionalAmount=function fromFractionalAmount(G,K,ne){return new CurrencyAmount(G,K,ne)};var K=CurrencyAmount.prototype;return K.add=function add(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.add.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.subtract=function subtract(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.subtract.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.multiply=function multiply(K){var ne=G.prototype.multiply.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.divide=function divide(K){var ne=G.prototype.divide.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=6),void 0===ue&&(ue=LV.ROUND_DOWN),G.prototype.divide.call(this,this.decimalScale).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=this.currency.decimals),void 0===ue&&(ue=LV.ROUND_DOWN),K<=this.currency.decimals||invariant(),G.prototype.divide.call(this,this.decimalScale).toFixed(K,ne,ue)},K.toExact=function toExact(G){return void 0===G&&(G={groupSeparator:""}),eK.DP=this.currency.decimals,new eK(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(G)},_createClass$4(CurrencyAmount,[{key:"wrapped",get:function get(){return this.currency.isToken?this:CurrencyAmount.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),CurrencyAmount}(YV),rK=new YV(oV.BigInt(100));function toPercent$2(G){return new nK(G.numerator,G.denominator)}var nK=function(G){function Percent(){var K;return(K=G.apply(this,arguments)||this).isPercent=!0,K}_inheritsLoose$3(Percent,G);var K=Percent.prototype;return K.add=function add(K){return toPercent$2(G.prototype.add.call(this,K))},K.subtract=function subtract(K){return toPercent$2(G.prototype.subtract.call(this,K))},K.multiply=function multiply(K){return toPercent$2(G.prototype.multiply.call(this,K))},K.divide=function divide(K){return toPercent$2(G.prototype.divide.call(this,K))},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=5),G.prototype.multiply.call(this,rK).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=2),G.prototype.multiply.call(this,rK).toFixed(K,ne,ue)},Percent}(YV),aK=function(G){function Price(){for(var K,ne,ue,pe,he,ye=arguments.length,me=new Array(ye),be=0;be<ye;be++)me[be]=arguments[be];if(4===me.length)ne=me[0],ue=me[1],pe=me[2],he=me[3];else{var ve=me[0].quoteAmount.divide(me[0].baseAmount),_e=[me[0].baseAmount.currency,me[0].quoteAmount.currency,ve.denominator,ve.numerator];ne=_e[0],ue=_e[1],pe=_e[2],he=_e[3]}return(K=G.call(this,he,pe)||this).baseCurrency=ne,K.quoteCurrency=ue,K.scalar=new YV(oV.exponentiate(oV.BigInt(10),oV.BigInt(ne.decimals)),oV.exponentiate(oV.BigInt(10),oV.BigInt(ue.decimals))),K}_inheritsLoose$3(Price,G);var K=Price.prototype;return K.invert=function invert(){return new Price(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},K.multiply=function multiply(K){this.quoteCurrency.equals(K.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return new Price(this.baseCurrency,K.quoteCurrency,ne.denominator,ne.numerator)},K.quote=function quote(K){K.currency.equals(this.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return tK.fromFractionalAmount(this.quoteCurrency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(G,K,ne){return void 0===G&&(G=6),this.adjustedForDecimals.toSignificant(G,K,ne)},K.toFixed=function toFixed(G,K,ne){return void 0===G&&(G=4),this.adjustedForDecimals.toFixed(G,K,ne)},_createClass$4(Price,[{key:"adjustedForDecimals",get:function get(){return G.prototype.multiply.call(this,this.scalar)}}]),Price}(YV),iK=function BaseCurrency(G,K,ne,ue){Number.isSafeInteger(G)||invariant(),K>=0&&K<255&&Number.isInteger(K)||invariant(),this.chainId=G,this.decimals=K,this.symbol=ne,this.name=ue};function validateAndParseAddress$2(G){try{return getAddress$2(G)}catch(K){throw new Error(G+" is not a valid address.")}}var sK=/^0x[0-9a-fA-F]{40}$/;var oK,cK=function(G){function Token(K,ne,ue,pe,he,ye){var me;return(me=G.call(this,K,ue,pe,he)||this).isNative=!1,me.isToken=!0,me.address=ye?function checkValidAddress$2(G){if(sK.test(G))return G;throw new Error(G+" is not a valid address.")}(ne):validateAndParseAddress$2(ne),me}_inheritsLoose$3(Token,G);var K=Token.prototype;return K.equals=function equals(G){return G.isToken&&this.chainId===G.chainId&&this.address.toLowerCase()===G.address.toLowerCase()},K.sortsBefore=function sortsBefore(G){return this.chainId!==G.chainId&&invariant(),this.address.toLowerCase()===G.address.toLowerCase()&&invariant(),this.address.toLowerCase()<G.address.toLowerCase()},_createClass$4(Token,[{key:"wrapped",get:function get(){return this}}]),Token}(iK);function sortedInsert$2(G,K,ne,ue){if(ne>0||invariant(),G.length<=ne||invariant(),0===G.length)return G.push(K),null;var pe=G.length===ne;if(pe&&ue(G[G.length-1],K)<=0)return K;for(var he=0,ye=G.length;he<ye;){var me=he+ye>>>1;ue(G[me],K)<=0?he=me+1:ye=me}return G.splice(he,0,K),pe?G.pop():null}(oK={})[1]=new cK(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),oK[3]=new cK(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),oK[4]=new cK(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),oK[5]=new cK(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),oK[42]=new cK(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),oK[10]=new cK(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),oK[69]=new cK(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),oK[42161]=new cK(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),oK[421611]=new cK(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether");var dK=oV.BigInt(Number.MAX_SAFE_INTEGER),uK=oV.BigInt(0),fK=oV.BigInt(1),lK=oV.BigInt(2);var pK=[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}],hK=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"},{internalType:"address",name:"_tokenDescriptor_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Collect",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"DecreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"IncreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint128",name:"amount0Max",type:"uint128"},{internalType:"uint128",name:"amount1Max",type:"uint128"}],internalType:"struct INonfungiblePositionManager.CollectParams",name:"params",type:"tuple"}],name:"collect",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"}],name:"createAndInitializePoolIfNecessary",outputs:[{internalType:"address",name:"pool",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.DecreaseLiquidityParams",name:"params",type:"tuple"}],name:"decreaseLiquidity",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"positions",outputs:[{internalType:"uint96",name:"nonce",type:"uint96"},{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",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:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Owed",type:"uint256"},{internalType:"uint256",name:"amount1Owed",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"uniswapV3MintCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],yK=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"}],mK=[{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"}],bK=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}],gK=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactInputSingleParams",name:"params",type:"tuple"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactOutputSingleParams",name:"params",type:"tuple"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}],vK=[{inputs:[{internalType:"contract IUniswapV3Factory",name:"_factory",type:"address"},{internalType:"contract INonfungiblePositionManager",name:"_nonfungiblePositionManager",type:"address"},{internalType:"uint256",name:"_maxIncentiveStartLeadTime",type:"uint256"},{internalType:"uint256",name:"_maxIncentiveDuration",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"DepositTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{indexed:!0,internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{indexed:!1,internalType:"uint256",name:"startTime",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endTime",type:"uint256"},{indexed:!1,internalType:"address",name:"refundee",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"IncentiveCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"refund",type:"uint256"}],name:"IncentiveEnded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"}],name:"TokenStaked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"TokenUnstaked",type:"event"},{inputs:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountRequested",type:"uint256"}],name:"claimReward",outputs:[{internalType:"uint256",name:"reward",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"reward",type:"uint256"}],name:"createIncentive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"deposits",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint48",name:"numberOfStakes",type:"uint48"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"}],name:"endIncentive",outputs:[{internalType:"uint256",name:"refund",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"contract IUniswapV3Factory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getRewardInfo",outputs:[{internalType:"uint256",name:"reward",type:"uint256"},{internalType:"uint160",name:"secondsInsideX128",type:"uint160"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"incentives",outputs:[{internalType:"uint256",name:"totalRewardUnclaimed",type:"uint256"},{internalType:"uint160",name:"totalSecondsClaimedX128",type:"uint160"},{internalType:"uint96",name:"numberOfStakes",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveStartLeadTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"nonfungiblePositionManager",outputs:[{internalType:"contract INonfungiblePositionManager",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Minimal",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"stakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"stakes",outputs:[{internalType:"uint160",name:"secondsPerLiquidityInsideInitialX128",type:"uint160"},{internalType:"uint128",name:"liquidity",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"transferDeposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"withdrawToken",outputs:[],stateMutability:"nonpayable",type:"function"}],wK=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct ISwapRouter.ExactInputParams",name:"params",type:"tuple"}],name:"exactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactInputSingleParams",name:"params",type:"tuple"}],name:"exactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct ISwapRouter.ExactOutputParams",name:"params",type:"tuple"}],name:"exactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactOutputSingleParams",name:"params",type:"tuple"}],name:"exactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}];function asyncGeneratorStep(G,K,ne,ue,pe,he,ye){try{var me=G[he](ye),be=me.value}catch(G){return void ne(G)}me.done?K(be):Promise.resolve(be).then(ue,pe)}function _asyncToGenerator(G){return function(){var K=this,ne=arguments;return new Promise((function(ue,pe){var he=G.apply(K,ne);function _next(G){asyncGeneratorStep(he,ue,pe,_next,_throw,"next",G)}function _throw(G){asyncGeneratorStep(he,ue,pe,_next,_throw,"throw",G)}_next(void 0)}))}}function _createClass$3(G,K,ne){return K&&function _defineProperties$3(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _extends$2(){return _extends$2=Object.assign||function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G},_extends$2.apply(this,arguments)}function _arrayLikeToArray$1(G,K){(null==K||K>G.length)&&(K=G.length);for(var ne=0,ue=new Array(K);ne<K;ne++)ue[ne]=G[ne];return ue}function _createForOfIteratorHelperLoose$1(G,K){var ne;if("undefined"==typeof Symbol||null==G[Symbol.iterator]){if(Array.isArray(G)||(ne=function _unsupportedIterableToArray$1(G,K){if(G){if("string"==typeof G)return _arrayLikeToArray$1(G,K);var ne=Object.prototype.toString.call(G).slice(8,-1);return"Object"===ne&&G.constructor&&(ne=G.constructor.name),"Map"===ne||"Set"===ne?Array.from(G):"Arguments"===ne||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?_arrayLikeToArray$1(G,K):void 0}}(G))||K){ne&&(G=ne);var ue=0;return function(){return ue>=G.length?{done:!0}:{done:!1,value:G[ue++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(ne=G[Symbol.iterator]()).next.bind(ne)}var _K,TK,AK=function createCommonjsModule(G,K){return G(K={exports:{}},K.exports),K.exports}((function(G){var K=function(G){var K,ne=Object.prototype,ue=ne.hasOwnProperty,pe="function"==typeof Symbol?Symbol:{},he=pe.iterator||"@@iterator",ye=pe.asyncIterator||"@@asyncIterator",me=pe.toStringTag||"@@toStringTag";function define(G,K,ne){return Object.defineProperty(G,K,{value:ne,enumerable:!0,configurable:!0,writable:!0}),G[K]}try{define({},"")}catch(G){define=function(G,K,ne){return G[K]=ne}}function wrap(G,K,ne,ue){var pe=K&&K.prototype instanceof Generator?K:Generator,he=Object.create(pe.prototype),ye=new Context(ue||[]);return he._invoke=function makeInvokeMethod(G,K,ne){var ue=be;return function invoke(pe,he){if(ue===_e)throw new Error("Generator is already running");if(ue===Te){if("throw"===pe)throw he;return doneResult()}for(ne.method=pe,ne.arg=he;;){var ye=ne.delegate;if(ye){var me=maybeInvokeDelegate(ye,ne);if(me){if(me===Ee)continue;return me}}if("next"===ne.method)ne.sent=ne._sent=ne.arg;else if("throw"===ne.method){if(ue===be)throw ue=Te,ne.arg;ne.dispatchException(ne.arg)}else"return"===ne.method&&ne.abrupt("return",ne.arg);ue=_e;var Pe=tryCatch(G,K,ne);if("normal"===Pe.type){if(ue=ne.done?Te:ve,Pe.arg===Ee)continue;return{value:Pe.arg,done:ne.done}}"throw"===Pe.type&&(ue=Te,ne.method="throw",ne.arg=Pe.arg)}}}(G,ne,ye),he}function tryCatch(G,K,ne){try{return{type:"normal",arg:G.call(K,ne)}}catch(G){return{type:"throw",arg:G}}}G.wrap=wrap;var be="suspendedStart",ve="suspendedYield",_e="executing",Te="completed",Ee={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Pe={};Pe[he]=function(){return this};var Se=Object.getPrototypeOf,Ce=Se&&Se(Se(values([])));Ce&&Ce!==ne&&ue.call(Ce,he)&&(Pe=Ce);var ke=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Pe);function defineIteratorMethods(G){["next","throw","return"].forEach((function(K){define(G,K,(function(G){return this._invoke(K,G)}))}))}function AsyncIterator(G,K){function invoke(ne,pe,he,ye){var me=tryCatch(G[ne],G,pe);if("throw"!==me.type){var be=me.arg,ve=be.value;return ve&&"object"==typeof ve&&ue.call(ve,"__await")?K.resolve(ve.__await).then((function(G){invoke("next",G,he,ye)}),(function(G){invoke("throw",G,he,ye)})):K.resolve(ve).then((function(G){be.value=G,he(be)}),(function(G){return invoke("throw",G,he,ye)}))}ye(me.arg)}var ne;this._invoke=function enqueue(G,ue){function callInvokeWithMethodAndArg(){return new K((function(K,ne){invoke(G,ue,K,ne)}))}return ne=ne?ne.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(G,ne){var ue=G.iterator[ne.method];if(ue===K){if(ne.delegate=null,"throw"===ne.method){if(G.iterator.return&&(ne.method="return",ne.arg=K,maybeInvokeDelegate(G,ne),"throw"===ne.method))return Ee;ne.method="throw",ne.arg=new TypeError("The iterator does not provide a 'throw' method")}return Ee}var pe=tryCatch(ue,G.iterator,ne.arg);if("throw"===pe.type)return ne.method="throw",ne.arg=pe.arg,ne.delegate=null,Ee;var he=pe.arg;return he?he.done?(ne[G.resultName]=he.value,ne.next=G.nextLoc,"return"!==ne.method&&(ne.method="next",ne.arg=K),ne.delegate=null,Ee):he:(ne.method="throw",ne.arg=new TypeError("iterator result is not an object"),ne.delegate=null,Ee)}function pushTryEntry(G){var K={tryLoc:G[0]};1 in G&&(K.catchLoc=G[1]),2 in G&&(K.finallyLoc=G[2],K.afterLoc=G[3]),this.tryEntries.push(K)}function resetTryEntry(G){var K=G.completion||{};K.type="normal",delete K.arg,G.completion=K}function Context(G){this.tryEntries=[{tryLoc:"root"}],G.forEach(pushTryEntry,this),this.reset(!0)}function values(G){if(G){var ne=G[he];if(ne)return ne.call(G);if("function"==typeof G.next)return G;if(!isNaN(G.length)){var pe=-1,ye=function next(){for(;++pe<G.length;)if(ue.call(G,pe))return next.value=G[pe],next.done=!1,next;return next.value=K,next.done=!0,next};return ye.next=ye}}return{next:doneResult}}function doneResult(){return{value:K,done:!0}}return GeneratorFunction.prototype=ke.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,me,"GeneratorFunction"),G.isGeneratorFunction=function(G){var K="function"==typeof G&&G.constructor;return!!K&&(K===GeneratorFunction||"GeneratorFunction"===(K.displayName||K.name))},G.mark=function(G){return Object.setPrototypeOf?Object.setPrototypeOf(G,GeneratorFunctionPrototype):(G.__proto__=GeneratorFunctionPrototype,define(G,me,"GeneratorFunction")),G.prototype=Object.create(ke),G},G.awrap=function(G){return{__await:G}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[ye]=function(){return this},G.AsyncIterator=AsyncIterator,G.async=function(K,ne,ue,pe,he){void 0===he&&(he=Promise);var ye=new AsyncIterator(wrap(K,ne,ue,pe),he);return G.isGeneratorFunction(ne)?ye:ye.next().then((function(G){return G.done?G.value:ye.next()}))},defineIteratorMethods(ke),define(ke,me,"Generator"),ke[he]=function(){return this},ke.toString=function(){return"[object Generator]"},G.keys=function(G){var K=[];for(var ne in G)K.push(ne);return K.reverse(),function next(){for(;K.length;){var ne=K.pop();if(ne in G)return next.value=ne,next.done=!1,next}return next.done=!0,next}},G.values=values,Context.prototype={constructor:Context,reset:function(G){if(this.prev=0,this.next=0,this.sent=this._sent=K,this.done=!1,this.delegate=null,this.method="next",this.arg=K,this.tryEntries.forEach(resetTryEntry),!G)for(var ne in this)"t"===ne.charAt(0)&&ue.call(this,ne)&&!isNaN(+ne.slice(1))&&(this[ne]=K)},stop:function(){this.done=!0;var G=this.tryEntries[0].completion;if("throw"===G.type)throw G.arg;return this.rval},dispatchException:function(G){if(this.done)throw G;var ne=this;function handle(ue,pe){return ye.type="throw",ye.arg=G,ne.next=ue,pe&&(ne.method="next",ne.arg=K),!!pe}for(var pe=this.tryEntries.length-1;pe>=0;--pe){var he=this.tryEntries[pe],ye=he.completion;if("root"===he.tryLoc)return handle("end");if(he.tryLoc<=this.prev){var me=ue.call(he,"catchLoc"),be=ue.call(he,"finallyLoc");if(me&&be){if(this.prev<he.catchLoc)return handle(he.catchLoc,!0);if(this.prev<he.finallyLoc)return handle(he.finallyLoc)}else if(me){if(this.prev<he.catchLoc)return handle(he.catchLoc,!0)}else{if(!be)throw new Error("try statement without catch or finally");if(this.prev<he.finallyLoc)return handle(he.finallyLoc)}}}},abrupt:function(G,K){for(var ne=this.tryEntries.length-1;ne>=0;--ne){var pe=this.tryEntries[ne];if(pe.tryLoc<=this.prev&&ue.call(pe,"finallyLoc")&&this.prev<pe.finallyLoc){var he=pe;break}}he&&("break"===G||"continue"===G)&&he.tryLoc<=K&&K<=he.finallyLoc&&(he=null);var ye=he?he.completion:{};return ye.type=G,ye.arg=K,he?(this.method="next",this.next=he.finallyLoc,Ee):this.complete(ye)},complete:function(G,K){if("throw"===G.type)throw G.arg;return"break"===G.type||"continue"===G.type?this.next=G.arg:"return"===G.type?(this.rval=this.arg=G.arg,this.method="return",this.next="end"):"normal"===G.type&&K&&(this.next=K),Ee},finish:function(G){for(var K=this.tryEntries.length-1;K>=0;--K){var ne=this.tryEntries[K];if(ne.finallyLoc===G)return this.complete(ne.completion,ne.afterLoc),resetTryEntry(ne),Ee}},catch:function(G){for(var K=this.tryEntries.length-1;K>=0;--K){var ne=this.tryEntries[K];if(ne.tryLoc===G){var ue=ne.completion;if("throw"===ue.type){var pe=ue.arg;resetTryEntry(ne)}return pe}}throw new Error("illegal catch attempt")},delegateYield:function(G,ne,ue){return this.delegate={iterator:values(G),resultName:ne,nextLoc:ue},"next"===this.method&&(this.arg=K),Ee}},G}(G.exports);try{regeneratorRuntime=K}catch(G){Function("r","regeneratorRuntime = r")(K)}})),EK="0x1F98431c8aD98523631AE4a59f267346ea31F984",PK="0x0000000000000000000000000000000000000000",SK="0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";!function(G){G[G.LOWEST=100]="LOWEST",G[G.LOW=500]="LOW",G[G.MEDIUM=3e3]="MEDIUM",G[G.HIGH=1e4]="HIGH"}(TK||(TK={}));var IK=((_K={})[TK.LOWEST]=1,_K[TK.LOW]=10,_K[TK.MEDIUM]=60,_K[TK.HIGH]=200,_K),CK=oV.BigInt(-1),RK=oV.BigInt(0),kK=oV.BigInt(1),OK=oV.exponentiate(oV.BigInt(2),oV.BigInt(96)),xK=oV.exponentiate(OK,oV.BigInt(2));function computePoolAddress$1(G){var K=G.factoryAddress,ne=G.tokenA,ue=G.tokenB,pe=G.fee,he=G.initCodeHashManualOverride,ye=ne.sortsBefore(ue)?[ne,ue]:[ue,ne],me=ye[0],be=ye[1];return getCreate2Address(K,keccak256$2(["bytes"],[po.encode(["address","address","uint24"],[me.address,be.address,pe])]),null!=he?he:SK)}var NK=function(){function LiquidityMath(){}return LiquidityMath.addDelta=function addDelta(G,K){return oV.lessThan(K,RK)?oV.subtract(G,oV.multiply(K,CK)):oV.add(G,K)},LiquidityMath}(),MK=function(){function FullMath(){}return FullMath.mulDivRoundingUp=function mulDivRoundingUp(G,K,ne){var ue=oV.multiply(G,K),pe=oV.divide(ue,ne);return oV.notEqual(oV.remainder(ue,ne),RK)&&(pe=oV.add(pe,kK)),pe},FullMath}(),BK=oV.subtract(oV.exponentiate(oV.BigInt(2),oV.BigInt(160)),kK);function multiplyIn256(G,K){var ne=oV.multiply(G,K);return oV.bitwiseAnd(ne,KV)}var FK=function(){function SqrtPriceMath(){}return SqrtPriceMath.getAmount0Delta=function getAmount0Delta(G,K,ne,ue){if(oV.greaterThan(G,K)){var pe=[K,G];G=pe[0],K=pe[1]}var he=oV.leftShift(ne,oV.BigInt(96)),ye=oV.subtract(K,G);return ue?MK.mulDivRoundingUp(MK.mulDivRoundingUp(he,ye,K),kK,G):oV.divide(oV.divide(oV.multiply(he,ye),K),G)},SqrtPriceMath.getAmount1Delta=function getAmount1Delta(G,K,ne,ue){if(oV.greaterThan(G,K)){var pe=[K,G];G=pe[0],K=pe[1]}return ue?MK.mulDivRoundingUp(ne,oV.subtract(K,G),OK):oV.divide(oV.multiply(ne,oV.subtract(K,G)),OK)},SqrtPriceMath.getNextSqrtPriceFromInput=function getNextSqrtPriceFromInput(G,K,ne,ue){return oV.greaterThan(G,RK)||invariant(),oV.greaterThan(K,RK)||invariant(),ue?this.getNextSqrtPriceFromAmount0RoundingUp(G,K,ne,!0):this.getNextSqrtPriceFromAmount1RoundingDown(G,K,ne,!0)},SqrtPriceMath.getNextSqrtPriceFromOutput=function getNextSqrtPriceFromOutput(G,K,ne,ue){return oV.greaterThan(G,RK)||invariant(),oV.greaterThan(K,RK)||invariant(),ue?this.getNextSqrtPriceFromAmount1RoundingDown(G,K,ne,!1):this.getNextSqrtPriceFromAmount0RoundingUp(G,K,ne,!1)},SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp=function getNextSqrtPriceFromAmount0RoundingUp(G,K,ne,ue){if(oV.equal(ne,RK))return G;var pe=oV.leftShift(K,oV.BigInt(96));if(ue){var he=multiplyIn256(ne,G);if(oV.equal(oV.divide(he,ne),G)){var ye=function addIn256(G,K){var ne=oV.add(G,K);return oV.bitwiseAnd(ne,KV)}(pe,he);if(oV.greaterThanOrEqual(ye,pe))return MK.mulDivRoundingUp(pe,G,ye)}return MK.mulDivRoundingUp(pe,kK,oV.add(oV.divide(pe,G),ne))}var me=multiplyIn256(ne,G);oV.equal(oV.divide(me,ne),G)||invariant(),oV.greaterThan(pe,me)||invariant();var be=oV.subtract(pe,me);return MK.mulDivRoundingUp(pe,G,be)},SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown=function getNextSqrtPriceFromAmount1RoundingDown(G,K,ne,ue){if(ue){var pe=oV.lessThanOrEqual(ne,BK)?oV.divide(oV.leftShift(ne,oV.BigInt(96)),K):oV.divide(oV.multiply(ne,OK),K);return oV.add(G,pe)}var he=MK.mulDivRoundingUp(ne,OK,K);return oV.greaterThan(G,he)||invariant(),oV.subtract(G,he)},SqrtPriceMath}(),DK=oV.exponentiate(oV.BigInt(10),oV.BigInt(6)),LK=function(){function SwapMath(){}return SwapMath.computeSwapStep=function computeSwapStep(G,K,ne,ue,pe){var he={},ye=oV.greaterThanOrEqual(G,K),me=oV.greaterThanOrEqual(ue,RK);if(me){var be=oV.divide(oV.multiply(ue,oV.subtract(DK,oV.BigInt(pe))),DK);he.amountIn=ye?FK.getAmount0Delta(K,G,ne,!0):FK.getAmount1Delta(G,K,ne,!0),oV.greaterThanOrEqual(be,he.amountIn)?he.sqrtRatioNextX96=K:he.sqrtRatioNextX96=FK.getNextSqrtPriceFromInput(G,ne,be,ye)}else he.amountOut=ye?FK.getAmount1Delta(K,G,ne,!1):FK.getAmount0Delta(G,K,ne,!1),oV.greaterThanOrEqual(oV.multiply(ue,CK),he.amountOut)?he.sqrtRatioNextX96=K:he.sqrtRatioNextX96=FK.getNextSqrtPriceFromOutput(G,ne,oV.multiply(ue,CK),ye);var ve=oV.equal(K,he.sqrtRatioNextX96);return ye?(he.amountIn=ve&&me?he.amountIn:FK.getAmount0Delta(he.sqrtRatioNextX96,G,ne,!0),he.amountOut=ve&&!me?he.amountOut:FK.getAmount1Delta(he.sqrtRatioNextX96,G,ne,!1)):(he.amountIn=ve&&me?he.amountIn:FK.getAmount1Delta(G,he.sqrtRatioNextX96,ne,!0),he.amountOut=ve&&!me?he.amountOut:FK.getAmount0Delta(G,he.sqrtRatioNextX96,ne,!1)),!me&&oV.greaterThan(he.amountOut,oV.multiply(ue,CK))&&(he.amountOut=oV.multiply(ue,CK)),me&&oV.notEqual(he.sqrtRatioNextX96,K)?he.feeAmount=oV.subtract(ue,he.amountIn):he.feeAmount=MK.mulDivRoundingUp(he.amountIn,oV.BigInt(pe),oV.subtract(DK,oV.BigInt(pe))),[he.sqrtRatioNextX96,he.amountIn,he.amountOut,he.feeAmount]},SwapMath}(),UK=oV.BigInt(2),$K=[128,64,32,16,8,4,2,1].map((function(G){return[G,oV.exponentiate(UK,oV.BigInt(G))]}));function mostSignificantBit(G){oV.greaterThan(G,RK)||invariant(),oV.lessThanOrEqual(G,KV)||invariant();for(var K,ne=0,ue=_createForOfIteratorHelperLoose$1($K);!(K=ue()).done;){var pe=K.value,he=pe[0],ye=pe[1];oV.greaterThanOrEqual(G,ye)&&(G=oV.signedRightShift(G,oV.BigInt(he)),ne+=he)}return ne}function mulShift(G,K){return oV.signedRightShift(oV.multiply(G,oV.BigInt(K)),oV.BigInt(128))}var qK=oV.exponentiate(oV.BigInt(2),oV.BigInt(32)),GK=function(){function TickMath(){}return TickMath.getSqrtRatioAtTick=function getSqrtRatioAtTick(G){G>=TickMath.MIN_TICK&&G<=TickMath.MAX_TICK&&Number.isInteger(G)||invariant();var K=G<0?-1*G:G,ne=0!=(1&K)?oV.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):oV.BigInt("0x100000000000000000000000000000000");return 0!=(2&K)&&(ne=mulShift(ne,"0xfff97272373d413259a46990580e213a")),0!=(4&K)&&(ne=mulShift(ne,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&K)&&(ne=mulShift(ne,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&K)&&(ne=mulShift(ne,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&K)&&(ne=mulShift(ne,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&K)&&(ne=mulShift(ne,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&K)&&(ne=mulShift(ne,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&K)&&(ne=mulShift(ne,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&K)&&(ne=mulShift(ne,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&K)&&(ne=mulShift(ne,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&K)&&(ne=mulShift(ne,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&K)&&(ne=mulShift(ne,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&K)&&(ne=mulShift(ne,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&K)&&(ne=mulShift(ne,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&K)&&(ne=mulShift(ne,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&K)&&(ne=mulShift(ne,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&K)&&(ne=mulShift(ne,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&K)&&(ne=mulShift(ne,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&K)&&(ne=mulShift(ne,"0x48a170391f7dc42444e8fa2")),G>0&&(ne=oV.divide(KV,ne)),oV.greaterThan(oV.remainder(ne,qK),RK)?oV.add(oV.divide(ne,qK),kK):oV.divide(ne,qK)},TickMath.getTickAtSqrtRatio=function getTickAtSqrtRatio(G){oV.greaterThanOrEqual(G,TickMath.MIN_SQRT_RATIO)&&oV.lessThan(G,TickMath.MAX_SQRT_RATIO)||invariant();var K,ne=oV.leftShift(G,oV.BigInt(32)),ue=mostSignificantBit(ne);K=oV.greaterThanOrEqual(oV.BigInt(ue),oV.BigInt(128))?oV.signedRightShift(ne,oV.BigInt(ue-127)):oV.leftShift(ne,oV.BigInt(127-ue));for(var pe=oV.leftShift(oV.subtract(oV.BigInt(ue),oV.BigInt(128)),oV.BigInt(64)),he=0;he<14;he++){K=oV.signedRightShift(oV.multiply(K,K),oV.BigInt(127));var ye=oV.signedRightShift(K,oV.BigInt(128));pe=oV.bitwiseOr(pe,oV.leftShift(ye,oV.BigInt(63-he))),K=oV.signedRightShift(K,ye)}var me=oV.multiply(pe,oV.BigInt("255738958999603826347141")),be=oV.toNumber(oV.signedRightShift(oV.subtract(me,oV.BigInt("3402992956809132418596140100660247210")),oV.BigInt(128))),ve=oV.toNumber(oV.signedRightShift(oV.add(me,oV.BigInt("291339464771989622907027621153398088495")),oV.BigInt(128)));return be===ve?be:oV.lessThanOrEqual(TickMath.getSqrtRatioAtTick(ve),G)?ve:be},TickMath}();GK.MIN_TICK=-887272,GK.MAX_TICK=-GK.MIN_TICK,GK.MIN_SQRT_RATIO=oV.BigInt("4295128739"),GK.MAX_SQRT_RATIO=oV.BigInt("1461446703485210103287273052203988822378723970342");var jK=function(){function NoTickDataProvider(){}var G=NoTickDataProvider.prototype;return G.getTick=function(){var G=_asyncToGenerator(AK.mark((function _callee(G){return AK.wrap((function _callee$(G){for(;;)switch(G.prev=G.next){case 0:throw new Error(NoTickDataProvider.ERROR_MESSAGE);case 1:case"end":return G.stop()}}),_callee)})));return function getTick(K){return G.apply(this,arguments)}}(),G.nextInitializedTickWithinOneWord=function(){var G=_asyncToGenerator(AK.mark((function _callee2(G,K,ne){return AK.wrap((function _callee2$(G){for(;;)switch(G.prev=G.next){case 0:throw new Error(NoTickDataProvider.ERROR_MESSAGE);case 1:case"end":return G.stop()}}),_callee2)})));return function nextInitializedTickWithinOneWord(K,ne,ue){return G.apply(this,arguments)}}(),NoTickDataProvider}();function isSorted(G,K){for(var ne=0;ne<G.length-1;ne++)if(K(G[ne],G[ne+1])>0)return!1;return!0}function tickComparator(G,K){return G.index-K.index}jK.ERROR_MESSAGE="No tick data provider was given";var HK=function(){function TickList(){}return TickList.validateList=function validateList(G,K){K>0||invariant(),G.every((function(G){return G.index%K==0}))||invariant(),oV.equal(G.reduce((function(G,K){var ne=K.liquidityNet;return oV.add(G,ne)}),RK),RK)||invariant(),isSorted(G,tickComparator)||invariant()},TickList.isBelowSmallest=function isBelowSmallest(G,K){return G.length>0||invariant(),K<G[0].index},TickList.isAtOrAboveLargest=function isAtOrAboveLargest(G,K){return G.length>0||invariant(),K>=G[G.length-1].index},TickList.getTick=function getTick(G,K){var ne=G[this.binarySearch(G,K)];return ne.index!==K&&invariant(),ne},TickList.binarySearch=function binarySearch(G,K){this.isBelowSmallest(G,K)&&invariant();for(var ne,ue=0,pe=G.length-1;;){if(G[ne=Math.floor((ue+pe)/2)].index<=K&&(ne===G.length-1||G[ne+1].index>K))return ne;G[ne].index<K?ue=ne+1:pe=ne-1}},TickList.nextInitializedTick=function nextInitializedTick(G,K,ne){return ne?(TickList.isBelowSmallest(G,K)&&invariant(),TickList.isAtOrAboveLargest(G,K)?G[G.length-1]:G[this.binarySearch(G,K)]):(this.isAtOrAboveLargest(G,K)&&invariant(),this.isBelowSmallest(G,K)?G[0]:G[this.binarySearch(G,K)+1])},TickList.nextInitializedTickWithinOneWord=function nextInitializedTickWithinOneWord(G,K,ne,ue){var pe=Math.floor(K/ue);if(ne){var he=(pe>>8<<8)*ue;if(TickList.isBelowSmallest(G,K))return[he,!1];var ye=TickList.nextInitializedTick(G,K,ne).index,me=Math.max(he,ye);return[me,me===ye]}var be=(((pe+1>>8)+1<<8)-1)*ue;if(this.isAtOrAboveLargest(G,K))return[be,!1];var ve=this.nextInitializedTick(G,K,ne).index,_e=Math.min(be,ve);return[_e,_e===ve]},TickList}();function toHex$1(G){var K=oV.BigInt(G).toString(16);return K.length%2!=0&&(K="0"+K),"0x"+K}function encodeRouteToPath(G,K){var ne=G.input.wrapped,ue=G.pools.reduce((function(G,K,ne){var ue=G.inputToken,pe=G.path,he=G.types,ye=K.token0.equals(ue)?K.token1:K.token0;return 0===ne?{inputToken:ye,types:["address","uint24","address"],path:[ue.address,K.fee,ye.address]}:{inputToken:ye,types:[].concat(he,["uint24","address"]),path:[].concat(pe,[K.fee,ye.address])}}),{inputToken:ne,path:[],types:[]}),pe=ue.path,he=ue.types;return K?pack$2(he.reverse(),pe.reverse()):pack$2(he,pe)}function encodeSqrtRatioX96(G,K){var ne=oV.leftShift(oV.BigInt(G),oV.BigInt(192)),ue=oV.BigInt(K);return function sqrt$2(G){if(oV.greaterThanOrEqual(G,uK)||invariant(),oV.lessThan(G,dK))return oV.BigInt(Math.floor(Math.sqrt(oV.toNumber(G))));var K,ne;for(K=G,ne=oV.add(oV.divide(G,lK),fK);oV.lessThan(ne,K);)K=ne,ne=oV.divide(oV.add(oV.divide(G,ne),ne),lK);return K}(oV.divide(ne,ue))}function maxLiquidityForAmount0Imprecise(G,K,ne){if(oV.greaterThan(G,K)){var ue=[K,G];G=ue[0],K=ue[1]}var pe=oV.divide(oV.multiply(G,K),OK);return oV.divide(oV.multiply(oV.BigInt(ne),pe),oV.subtract(K,G))}function maxLiquidityForAmount0Precise(G,K,ne){if(oV.greaterThan(G,K)){var ue=[K,G];G=ue[0],K=ue[1]}var pe=oV.multiply(oV.multiply(oV.BigInt(ne),G),K),he=oV.multiply(OK,oV.subtract(K,G));return oV.divide(pe,he)}function maxLiquidityForAmount1(G,K,ne){if(oV.greaterThan(G,K)){var ue=[K,G];G=ue[0],K=ue[1]}return oV.divide(oV.multiply(oV.BigInt(ne),OK),oV.subtract(K,G))}function maxLiquidityForAmounts(G,K,ne,ue,pe,he){if(oV.greaterThan(K,ne)){var ye=[ne,K];K=ye[0],ne=ye[1]}var me=he?maxLiquidityForAmount0Precise:maxLiquidityForAmount0Imprecise;if(oV.lessThanOrEqual(G,K))return me(K,ne,ue);if(oV.lessThan(G,ne)){var be=me(G,ne,ue),ve=maxLiquidityForAmount1(K,G,pe);return oV.lessThan(be,ve)?be:ve}return maxLiquidityForAmount1(K,ne,pe)}var WK=oV.exponentiate(oV.BigInt(2),oV.BigInt(128)),zK=function(){function PositionLibrary(){}return PositionLibrary.getTokensOwed=function getTokensOwed(G,K,ne,ue,pe){return[oV.divide(oV.multiply(subIn256(ue,G),ne),WK),oV.divide(oV.multiply(subIn256(pe,K),ne),WK)]},PositionLibrary}();function tickToPrice(G,K,ne){var ue=GK.getSqrtRatioAtTick(ne),pe=oV.multiply(ue,ue);return G.sortsBefore(K)?new aK(G,K,xK,pe):new aK(G,K,pe,xK)}var VK=oV.exponentiate(oV.BigInt(2),oV.BigInt(256));function subIn256(G,K){var ne=oV.subtract(G,K);return oV.lessThan(ne,RK)?oV.add(VK,ne):ne}var KK=function(){function TickLibrary(){}return TickLibrary.getFeeGrowthInside=function getFeeGrowthInside(G,K,ne,ue,pe,he,ye){var me,be,ve,_e;return pe>=ne?(me=G.feeGrowthOutside0X128,be=G.feeGrowthOutside1X128):(me=subIn256(he,G.feeGrowthOutside0X128),be=subIn256(ye,G.feeGrowthOutside1X128)),pe<ue?(ve=K.feeGrowthOutside0X128,_e=K.feeGrowthOutside1X128):(ve=subIn256(he,K.feeGrowthOutside0X128),_e=subIn256(ye,K.feeGrowthOutside1X128)),[subIn256(subIn256(he,me),ve),subIn256(subIn256(ye,be),_e)]},TickLibrary}(),JK=function Tick(G){var K=G.index,ne=G.liquidityGross,ue=G.liquidityNet;K>=GK.MIN_TICK&&K<=GK.MAX_TICK||invariant(),this.index=K,this.liquidityGross=oV.BigInt(ne),this.liquidityNet=oV.BigInt(ue)},XK=function(){function TickListDataProvider(G,K){var ne=G.map((function(G){return G instanceof JK?G:new JK(G)}));HK.validateList(ne,K),this.ticks=ne}var G=TickListDataProvider.prototype;return G.getTick=function(){var G=_asyncToGenerator(AK.mark((function _callee(G){return AK.wrap((function _callee$(K){for(;;)switch(K.prev=K.next){case 0:return K.abrupt("return",HK.getTick(this.ticks,G));case 1:case"end":return K.stop()}}),_callee,this)})));return function getTick(K){return G.apply(this,arguments)}}(),G.nextInitializedTickWithinOneWord=function(){var G=_asyncToGenerator(AK.mark((function _callee2(G,K,ne){return AK.wrap((function _callee2$(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.abrupt("return",HK.nextInitializedTickWithinOneWord(this.ticks,G,K,ne));case 1:case"end":return ue.stop()}}),_callee2,this)})));return function nextInitializedTickWithinOneWord(K,ne,ue){return G.apply(this,arguments)}}(),TickListDataProvider}(),QK=new jK,ZK=function(){function Pool(G,K,ne,ue,pe,he,ye){void 0===ye&&(ye=QK),Number.isInteger(ne)&&ne<1e6||invariant();var me=GK.getSqrtRatioAtTick(he),be=GK.getSqrtRatioAtTick(he+1);oV.greaterThanOrEqual(oV.BigInt(ue),me)&&oV.lessThanOrEqual(oV.BigInt(ue),be)||invariant();var ve=G.sortsBefore(K)?[G,K]:[K,G];this.token0=ve[0],this.token1=ve[1],this.fee=ne,this.sqrtRatioX96=oV.BigInt(ue),this.liquidity=oV.BigInt(pe),this.tickCurrent=he,this.tickDataProvider=Array.isArray(ye)?new XK(ye,IK[ne]):ye}Pool.getAddress=function getAddress(G,K,ne,ue,pe){return computePoolAddress$1({factoryAddress:null!=pe?pe:EK,fee:ne,tokenA:G,tokenB:K,initCodeHashManualOverride:ue})};var G=Pool.prototype;return G.involvesToken=function involvesToken(G){return G.equals(this.token0)||G.equals(this.token1)},G.priceOf=function priceOf(G){return this.involvesToken(G)||invariant(),G.equals(this.token0)?this.token0Price:this.token1Price},G.getOutputAmount=function(){var G=_asyncToGenerator(AK.mark((function _callee(G,K){var ne,ue,pe,he,ye,me,be;return AK.wrap((function _callee$(ve){for(;;)switch(ve.prev=ve.next){case 0:return this.involvesToken(G.currency)||invariant(),ne=G.currency.equals(this.token0),ve.next=4,this.swap(ne,G.quotient,K);case 4:return ue=ve.sent,pe=ue.amountCalculated,he=ue.sqrtRatioX96,ye=ue.liquidity,me=ue.tickCurrent,be=ne?this.token1:this.token0,ve.abrupt("return",[tK.fromRawAmount(be,oV.multiply(pe,CK)),new Pool(this.token0,this.token1,this.fee,he,ye,me,this.tickDataProvider)]);case 11:case"end":return ve.stop()}}),_callee,this)})));return function getOutputAmount(K,ne){return G.apply(this,arguments)}}(),G.getInputAmount=function(){var G=_asyncToGenerator(AK.mark((function _callee2(G,K){var ne,ue,pe,he,ye,me,be;return AK.wrap((function _callee2$(ve){for(;;)switch(ve.prev=ve.next){case 0:return G.currency.isToken&&this.involvesToken(G.currency)||invariant(),ne=G.currency.equals(this.token1),ve.next=4,this.swap(ne,oV.multiply(G.quotient,CK),K);case 4:return ue=ve.sent,pe=ue.amountCalculated,he=ue.sqrtRatioX96,ye=ue.liquidity,me=ue.tickCurrent,be=ne?this.token0:this.token1,ve.abrupt("return",[tK.fromRawAmount(be,pe),new Pool(this.token0,this.token1,this.fee,he,ye,me,this.tickDataProvider)]);case 11:case"end":return ve.stop()}}),_callee2,this)})));return function getInputAmount(K,ne){return G.apply(this,arguments)}}(),G.swap=function(){var G=_asyncToGenerator(AK.mark((function _callee3(G,K,ne){var ue,pe,he,ye,me,be;return AK.wrap((function _callee3$(ve){for(;;)switch(ve.prev=ve.next){case 0:ne||(ne=G?oV.add(GK.MIN_SQRT_RATIO,kK):oV.subtract(GK.MAX_SQRT_RATIO,kK)),G?(oV.greaterThan(ne,GK.MIN_SQRT_RATIO)||invariant(),oV.lessThan(ne,this.sqrtRatioX96)||invariant()):(oV.lessThan(ne,GK.MAX_SQRT_RATIO)||invariant(),oV.greaterThan(ne,this.sqrtRatioX96)||invariant()),ue=oV.greaterThanOrEqual(K,RK),pe={amountSpecifiedRemaining:K,amountCalculated:RK,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};case 4:if(!oV.notEqual(pe.amountSpecifiedRemaining,RK)||pe.sqrtPriceX96==ne){ve.next=35;break}return(he={}).sqrtPriceStartX96=pe.sqrtPriceX96,ve.next=9,this.tickDataProvider.nextInitializedTickWithinOneWord(pe.tick,G,this.tickSpacing);case 9:if(ye=ve.sent,he.tickNext=ye[0],he.initialized=ye[1],he.tickNext<GK.MIN_TICK?he.tickNext=GK.MIN_TICK:he.tickNext>GK.MAX_TICK&&(he.tickNext=GK.MAX_TICK),he.sqrtPriceNextX96=GK.getSqrtRatioAtTick(he.tickNext),me=LK.computeSwapStep(pe.sqrtPriceX96,(G?oV.lessThan(he.sqrtPriceNextX96,ne):oV.greaterThan(he.sqrtPriceNextX96,ne))?ne:he.sqrtPriceNextX96,pe.liquidity,pe.amountSpecifiedRemaining,this.fee),pe.sqrtPriceX96=me[0],he.amountIn=me[1],he.amountOut=me[2],he.feeAmount=me[3],ue?(pe.amountSpecifiedRemaining=oV.subtract(pe.amountSpecifiedRemaining,oV.add(he.amountIn,he.feeAmount)),pe.amountCalculated=oV.subtract(pe.amountCalculated,he.amountOut)):(pe.amountSpecifiedRemaining=oV.add(pe.amountSpecifiedRemaining,he.amountOut),pe.amountCalculated=oV.add(pe.amountCalculated,oV.add(he.amountIn,he.feeAmount))),!oV.equal(pe.sqrtPriceX96,he.sqrtPriceNextX96)){ve.next=32;break}if(!he.initialized){ve.next=29;break}return ve.t0=oV,ve.next=25,this.tickDataProvider.getTick(he.tickNext);case 25:ve.t1=ve.sent.liquidityNet,be=ve.t0.BigInt.call(ve.t0,ve.t1),G&&(be=oV.multiply(be,CK)),pe.liquidity=NK.addDelta(pe.liquidity,be);case 29:pe.tick=G?he.tickNext-1:he.tickNext,ve.next=33;break;case 32:oV.notEqual(pe.sqrtPriceX96,he.sqrtPriceStartX96)&&(pe.tick=GK.getTickAtSqrtRatio(pe.sqrtPriceX96));case 33:ve.next=4;break;case 35:return ve.abrupt("return",{amountCalculated:pe.amountCalculated,sqrtRatioX96:pe.sqrtPriceX96,liquidity:pe.liquidity,tickCurrent:pe.tick});case 36:case"end":return ve.stop()}}),_callee3,this)})));return function swap(K,ne,ue){return G.apply(this,arguments)}}(),_createClass$3(Pool,[{key:"token0Price",get:function get(){var G;return null!=(G=this._token0Price)?G:this._token0Price=new aK(this.token0,this.token1,xK,oV.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function get(){var G;return null!=(G=this._token1Price)?G:this._token1Price=new aK(this.token1,this.token0,oV.multiply(this.sqrtRatioX96,this.sqrtRatioX96),xK)}},{key:"chainId",get:function get(){return this.token0.chainId}},{key:"tickSpacing",get:function get(){return IK[this.fee]}}]),Pool}(),YK=function(){function Position(G){var K=G.pool,ne=G.liquidity,ue=G.tickLower,pe=G.tickUpper;this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,ue<pe||invariant(),ue>=GK.MIN_TICK&&ue%K.tickSpacing==0||invariant(),pe<=GK.MAX_TICK&&pe%K.tickSpacing==0||invariant(),this.pool=K,this.tickLower=ue,this.tickUpper=pe,this.liquidity=oV.BigInt(ne)}var G=Position.prototype;return G.ratiosAfterSlippage=function ratiosAfterSlippage(G){var K=this.pool.token0Price.asFraction.multiply(new nK(1).subtract(G)),ne=this.pool.token0Price.asFraction.multiply(G.add(1)),ue=encodeSqrtRatioX96(K.numerator,K.denominator);oV.lessThanOrEqual(ue,GK.MIN_SQRT_RATIO)&&(ue=oV.add(GK.MIN_SQRT_RATIO,oV.BigInt(1)));var pe=encodeSqrtRatioX96(ne.numerator,ne.denominator);return oV.greaterThanOrEqual(pe,GK.MAX_SQRT_RATIO)&&(pe=oV.subtract(GK.MAX_SQRT_RATIO,oV.BigInt(1))),{sqrtRatioX96Lower:ue,sqrtRatioX96Upper:pe}},G.mintAmountsWithSlippage=function mintAmountsWithSlippage(G){var K=this.ratiosAfterSlippage(G),ne=K.sqrtRatioX96Upper,ue=K.sqrtRatioX96Lower,pe=new ZK(this.pool.token0,this.pool.token1,this.pool.fee,ue,0,GK.getTickAtSqrtRatio(ue)),he=new ZK(this.pool.token0,this.pool.token1,this.pool.fee,ne,0,GK.getTickAtSqrtRatio(ne)),ye=Position.fromAmounts(_extends$2({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts,{useFullPrecision:!1}));return{amount0:new Position({pool:he,liquidity:ye.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount0,amount1:new Position({pool:pe,liquidity:ye.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount1}},G.burnAmountsWithSlippage=function burnAmountsWithSlippage(G){var K=this.ratiosAfterSlippage(G),ne=K.sqrtRatioX96Upper,ue=K.sqrtRatioX96Lower,pe=new ZK(this.pool.token0,this.pool.token1,this.pool.fee,ue,0,GK.getTickAtSqrtRatio(ue)),he=new Position({pool:new ZK(this.pool.token0,this.pool.token1,this.pool.fee,ne,0,GK.getTickAtSqrtRatio(ne)),liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,ye=new Position({pool:pe,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:he.quotient,amount1:ye.quotient}},Position.fromAmounts=function fromAmounts(G){var K=G.pool,ne=G.tickLower,ue=G.tickUpper,pe=G.amount0,he=G.amount1,ye=G.useFullPrecision,me=GK.getSqrtRatioAtTick(ne),be=GK.getSqrtRatioAtTick(ue);return new Position({pool:K,tickLower:ne,tickUpper:ue,liquidity:maxLiquidityForAmounts(K.sqrtRatioX96,me,be,pe,he,ye)})},Position.fromAmount0=function fromAmount0(G){var K=G.pool,ne=G.tickLower,ue=G.tickUpper,pe=G.amount0,he=G.useFullPrecision;return Position.fromAmounts({pool:K,tickLower:ne,tickUpper:ue,amount0:pe,amount1:KV,useFullPrecision:he})},Position.fromAmount1=function fromAmount1(G){var K=G.pool,ne=G.tickLower,ue=G.tickUpper,pe=G.amount1;return Position.fromAmounts({pool:K,tickLower:ne,tickUpper:ue,amount0:KV,amount1:pe,useFullPrecision:!0})},_createClass$3(Position,[{key:"token0PriceLower",get:function get(){return tickToPrice(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function get(){return tickToPrice(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function get(){return null===this._token0Amount&&(this.pool.tickCurrent<this.tickLower?this._token0Amount=tK.fromRawAmount(this.pool.token0,FK.getAmount0Delta(GK.getSqrtRatioAtTick(this.tickLower),GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this.pool.tickCurrent<this.tickUpper?this._token0Amount=tK.fromRawAmount(this.pool.token0,FK.getAmount0Delta(this.pool.sqrtRatioX96,GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this._token0Amount=tK.fromRawAmount(this.pool.token0,RK)),this._token0Amount}},{key:"amount1",get:function get(){return null===this._token1Amount&&(this.pool.tickCurrent<this.tickLower?this._token1Amount=tK.fromRawAmount(this.pool.token1,RK):this.pool.tickCurrent<this.tickUpper?this._token1Amount=tK.fromRawAmount(this.pool.token1,FK.getAmount1Delta(GK.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!1)):this._token1Amount=tK.fromRawAmount(this.pool.token1,FK.getAmount1Delta(GK.getSqrtRatioAtTick(this.tickLower),GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}},{key:"mintAmounts",get:function get(){return null===this._mintAmounts?this.pool.tickCurrent<this.tickLower?{amount0:FK.getAmount0Delta(GK.getSqrtRatioAtTick(this.tickLower),GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:RK}:this.pool.tickCurrent<this.tickUpper?{amount0:FK.getAmount0Delta(this.pool.sqrtRatioX96,GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:FK.getAmount1Delta(GK.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!0)}:{amount0:RK,amount1:FK.getAmount1Delta(GK.getSqrtRatioAtTick(this.tickLower),GK.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0)}:this._mintAmounts}}]),Position}(),eJ=function(){function Route(G,K,ne){this._midPrice=null,G.length>0||invariant();var ue=G[0].chainId,pe=G.every((function(G){return G.chainId===ue}));pe||invariant();var he=K.wrapped;G[0].involvesToken(he)||invariant(),G[G.length-1].involvesToken(ne.wrapped)||invariant();for(var ye,me=[he],be=_createForOfIteratorHelperLoose$1(G.entries());!(ye=be()).done;){var ve=ye.value,_e=ve[0],Te=ve[1],Ee=me[_e];Ee.equals(Te.token0)||Ee.equals(Te.token1)||invariant();var Pe=Ee.equals(Te.token0)?Te.token1:Te.token0;me.push(Pe)}this.pools=G,this.tokenPath=me,this.input=K,this.output=null!=ne?ne:me[me.length-1]}return _createClass$3(Route,[{key:"chainId",get:function get(){return this.pools[0].chainId}},{key:"midPrice",get:function get(){if(null!==this._midPrice)return this._midPrice;var G=this.pools.slice(1).reduce((function(G,K){var ne=G.nextInput,ue=G.price;return ne.equals(K.token0)?{nextInput:K.token1,price:ue.multiply(K.token0Price)}:{nextInput:K.token0,price:ue.multiply(K.token1Price)}}),this.pools[0].token0.equals(this.input.wrapped)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new aK(this.input,this.output,G.denominator,G.numerator)}}]),Route}();function tradeComparator$1(G,K){return G.inputAmount.currency.equals(K.inputAmount.currency)||invariant(),G.outputAmount.currency.equals(K.outputAmount.currency)||invariant(),G.outputAmount.equalTo(K.outputAmount)?G.inputAmount.equalTo(K.inputAmount)?G.swaps.reduce((function(G,K){return G+K.route.tokenPath.length}),0)-K.swaps.reduce((function(G,K){return G+K.route.tokenPath.length}),0):G.inputAmount.lessThan(K.inputAmount)?-1:1:G.outputAmount.lessThan(K.outputAmount)?1:-1}var tJ=function(){function Trade(G){var K=G.routes,ne=G.tradeType,ue=K[0].inputAmount.currency,pe=K[0].outputAmount.currency;K.every((function(G){var K=G.route;return ue.wrapped.equals(K.input.wrapped)}))||invariant(),K.every((function(G){var K=G.route;return pe.wrapped.equals(K.output.wrapped)}))||invariant();for(var he,ye=K.map((function(G){return G.route.pools.length})).reduce((function(G,K){return G+K}),0),me=new Set,be=_createForOfIteratorHelperLoose$1(K);!(he=be()).done;)for(var ve,_e=_createForOfIteratorHelperLoose$1(he.value.route.pools);!(ve=_e()).done;){var Te=ve.value;me.add(ZK.getAddress(Te.token0,Te.token1,Te.fee))}ye!=me.size&&invariant(),this.swaps=K,this.tradeType=ne}Trade.exactIn=function(){var G=_asyncToGenerator(AK.mark((function _callee(G,K){return AK.wrap((function _callee$(ne){for(;;)switch(ne.prev=ne.next){case 0:return ne.abrupt("return",Trade.fromRoute(G,K,DV.EXACT_INPUT));case 1:case"end":return ne.stop()}}),_callee)})));return function exactIn(K,ne){return G.apply(this,arguments)}}(),Trade.exactOut=function(){var G=_asyncToGenerator(AK.mark((function _callee2(G,K){return AK.wrap((function _callee2$(ne){for(;;)switch(ne.prev=ne.next){case 0:return ne.abrupt("return",Trade.fromRoute(G,K,DV.EXACT_OUTPUT));case 1:case"end":return ne.stop()}}),_callee2)})));return function exactOut(K,ne){return G.apply(this,arguments)}}(),Trade.fromRoute=function(){var G=_asyncToGenerator(AK.mark((function _callee3(G,K,ne){var ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe;return AK.wrap((function _callee3$(Se){for(;;)switch(Se.prev=Se.next){case 0:if(ue=new Array(G.tokenPath.length),ne!==DV.EXACT_INPUT){Se.next=19;break}K.currency.equals(G.input)||invariant(),ue[0]=K.wrapped,ye=0;case 5:if(!(ye<G.tokenPath.length-1)){Se.next=15;break}return me=G.pools[ye],Se.next=9,me.getOutputAmount(ue[ye]);case 9:be=Se.sent,ve=be[0],ue[ye+1]=ve;case 12:ye++,Se.next=5;break;case 15:pe=tK.fromFractionalAmount(G.input,K.numerator,K.denominator),he=tK.fromFractionalAmount(G.output,ue[ue.length-1].numerator,ue[ue.length-1].denominator),Se.next=34;break;case 19:K.currency.equals(G.output)||invariant(),ue[ue.length-1]=K.wrapped,_e=G.tokenPath.length-1;case 22:if(!(_e>0)){Se.next=32;break}return Te=G.pools[_e-1],Se.next=26,Te.getInputAmount(ue[_e]);case 26:Ee=Se.sent,Pe=Ee[0],ue[_e-1]=Pe;case 29:_e--,Se.next=22;break;case 32:pe=tK.fromFractionalAmount(G.input,ue[0].numerator,ue[0].denominator),he=tK.fromFractionalAmount(G.output,K.numerator,K.denominator);case 34:return Se.abrupt("return",new Trade({routes:[{inputAmount:pe,outputAmount:he,route:G}],tradeType:ne}));case 35:case"end":return Se.stop()}}),_callee3)})));return function fromRoute(K,ne,ue){return G.apply(this,arguments)}}(),Trade.fromRoutes=function(){var G=_asyncToGenerator(AK.mark((function _callee4(G,K){var ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe;return AK.wrap((function _callee4$(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:ne=[],ue=_createForOfIteratorHelperLoose$1(G);case 2:if((pe=ue()).done){Ne.next=43;break}if(he=pe.value,ye=he.route,me=he.amount,be=new Array(ye.tokenPath.length),ve=void 0,_e=void 0,K!==DV.EXACT_INPUT){Ne.next=25;break}me.currency.equals(ye.input)||invariant(),ve=tK.fromFractionalAmount(ye.input,me.numerator,me.denominator),be[0]=tK.fromFractionalAmount(ye.input.wrapped,me.numerator,me.denominator),Te=0;case 12:if(!(Te<ye.tokenPath.length-1)){Ne.next=22;break}return Ee=ye.pools[Te],Ne.next=16,Ee.getOutputAmount(be[Te]);case 16:Pe=Ne.sent,Se=Pe[0],be[Te+1]=Se;case 19:Te++,Ne.next=12;break;case 22:_e=tK.fromFractionalAmount(ye.output,be[be.length-1].numerator,be[be.length-1].denominator),Ne.next=40;break;case 25:me.currency.equals(ye.output)||invariant(),_e=tK.fromFractionalAmount(ye.output,me.numerator,me.denominator),be[be.length-1]=tK.fromFractionalAmount(ye.output.wrapped,me.numerator,me.denominator),Ce=ye.tokenPath.length-1;case 29:if(!(Ce>0)){Ne.next=39;break}return ke=ye.pools[Ce-1],Ne.next=33,ke.getInputAmount(be[Ce]);case 33:Oe=Ne.sent,xe=Oe[0],be[Ce-1]=xe;case 36:Ce--,Ne.next=29;break;case 39:ve=tK.fromFractionalAmount(ye.input,be[0].numerator,be[0].denominator);case 40:ne.push({route:ye,inputAmount:ve,outputAmount:_e});case 41:Ne.next=2;break;case 43:return Ne.abrupt("return",new Trade({routes:ne,tradeType:K}));case 44:case"end":return Ne.stop()}}),_callee4)})));return function fromRoutes(K,ne){return G.apply(this,arguments)}}(),Trade.createUncheckedTrade=function createUncheckedTrade(G){return new Trade(_extends$2({},G,{routes:[{inputAmount:G.inputAmount,outputAmount:G.outputAmount,route:G.route}]}))},Trade.createUncheckedTradeWithMultipleRoutes=function createUncheckedTradeWithMultipleRoutes(G){return new Trade(G)};var G=Trade.prototype;return G.minimumAmountOut=function minimumAmountOut(G,K){if(void 0===K&&(K=this.outputAmount),G.lessThan(RK)&&invariant(),this.tradeType===DV.EXACT_OUTPUT)return K;var ne=new YV(kK).add(G).invert().multiply(K.quotient).quotient;return tK.fromRawAmount(K.currency,ne)},G.maximumAmountIn=function maximumAmountIn(G,K){if(void 0===K&&(K=this.inputAmount),G.lessThan(RK)&&invariant(),this.tradeType===DV.EXACT_INPUT)return K;var ne=new YV(kK).add(G).multiply(K.quotient).quotient;return tK.fromRawAmount(K.currency,ne)},G.worstExecutionPrice=function worstExecutionPrice(G){return new aK(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(G).quotient,this.minimumAmountOut(G).quotient)},Trade.bestTradeExactIn=function(){var G=_asyncToGenerator(AK.mark((function _callee5(G,K,ne,ue,pe,he,ye){var me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe;return AK.wrap((function _callee5$(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:be=(me=void 0===ue?{}:ue).maxNumResults,ve=void 0===be?3:be,_e=me.maxHops,Te=void 0===_e?3:_e,void 0===pe&&(pe=[]),void 0===he&&(he=K),void 0===ye&&(ye=[]),G.length>0||invariant(),Te>0||invariant(),K===he||pe.length>0||invariant(),Ee=he.wrapped,Pe=ne.wrapped,Se=0;case 10:if(!(Se<G.length)){Ne.next=46;break}if((Ce=G[Se]).token0.equals(Ee.currency)||Ce.token1.equals(Ee.currency)){Ne.next=14;break}return Ne.abrupt("continue",43);case 14:return ke=void 0,Ne.prev=15,Ne.next=19,Ce.getOutputAmount(Ee);case 19:Oe=Ne.sent,ke=Oe[0],Ne.next=28;break;case 23:if(Ne.prev=23,Ne.t0=Ne.catch(15),!Ne.t0.isInsufficientInputAmountError){Ne.next=27;break}return Ne.abrupt("continue",43);case 27:throw Ne.t0;case 28:if(!ke.currency.isToken||!ke.currency.equals(Pe)){Ne.next=39;break}return Ne.t1=sortedInsert$2,Ne.t2=ye,Ne.next=33,Trade.fromRoute(new eJ([].concat(pe,[Ce]),K.currency,ne),K,DV.EXACT_INPUT);case 33:Ne.t3=Ne.sent,Ne.t4=ve,Ne.t5=tradeComparator$1,(0,Ne.t1)(Ne.t2,Ne.t3,Ne.t4,Ne.t5),Ne.next=43;break;case 39:if(!(Te>1&&G.length>1)){Ne.next=43;break}return xe=G.slice(0,Se).concat(G.slice(Se+1,G.length)),Ne.next=43,Trade.bestTradeExactIn(xe,K,ne,{maxNumResults:ve,maxHops:Te-1},[].concat(pe,[Ce]),ke,ye);case 43:Se++,Ne.next=10;break;case 46:return Ne.abrupt("return",ye);case 47:case"end":return Ne.stop()}}),_callee5,null,[[15,23]])})));return function bestTradeExactIn(K,ne,ue,pe,he,ye,me){return G.apply(this,arguments)}}(),Trade.bestTradeExactOut=function(){var G=_asyncToGenerator(AK.mark((function _callee6(G,K,ne,ue,pe,he,ye){var me,be,ve,_e,Te,Ee,Pe,Se,Ce,ke,Oe,xe;return AK.wrap((function _callee6$(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:be=(me=void 0===ue?{}:ue).maxNumResults,ve=void 0===be?3:be,_e=me.maxHops,Te=void 0===_e?3:_e,void 0===pe&&(pe=[]),void 0===he&&(he=ne),void 0===ye&&(ye=[]),G.length>0||invariant(),Te>0||invariant(),ne===he||pe.length>0||invariant(),Ee=he.wrapped,Pe=K.wrapped,Se=0;case 10:if(!(Se<G.length)){Ne.next=46;break}if((Ce=G[Se]).token0.equals(Ee.currency)||Ce.token1.equals(Ee.currency)){Ne.next=14;break}return Ne.abrupt("continue",43);case 14:return ke=void 0,Ne.prev=15,Ne.next=19,Ce.getInputAmount(Ee);case 19:Oe=Ne.sent,ke=Oe[0],Ne.next=28;break;case 23:if(Ne.prev=23,Ne.t0=Ne.catch(15),!Ne.t0.isInsufficientReservesError){Ne.next=27;break}return Ne.abrupt("continue",43);case 27:throw Ne.t0;case 28:if(!ke.currency.equals(Pe)){Ne.next=39;break}return Ne.t1=sortedInsert$2,Ne.t2=ye,Ne.next=33,Trade.fromRoute(new eJ([Ce].concat(pe),K,ne.currency),ne,DV.EXACT_OUTPUT);case 33:Ne.t3=Ne.sent,Ne.t4=ve,Ne.t5=tradeComparator$1,(0,Ne.t1)(Ne.t2,Ne.t3,Ne.t4,Ne.t5),Ne.next=43;break;case 39:if(!(Te>1&&G.length>1)){Ne.next=43;break}return xe=G.slice(0,Se).concat(G.slice(Se+1,G.length)),Ne.next=43,Trade.bestTradeExactOut(xe,K,ne,{maxNumResults:ve,maxHops:Te-1},[Ce].concat(pe),ke,ye);case 43:Se++,Ne.next=10;break;case 46:return Ne.abrupt("return",ye);case 47:case"end":return Ne.stop()}}),_callee6,null,[[15,23]])})));return function bestTradeExactOut(K,ne,ue,pe,he,ye,me){return G.apply(this,arguments)}}(),_createClass$3(Trade,[{key:"route",get:function get(){return 1!=this.swaps.length&&invariant(),this.swaps[0].route}},{key:"inputAmount",get:function get(){if(this._inputAmount)return this._inputAmount;var G=this.swaps[0].inputAmount.currency,K=this.swaps.map((function(G){return G.inputAmount})).reduce((function(G,K){return G.add(K)}),tK.fromRawAmount(G,0));return this._inputAmount=K,this._inputAmount}},{key:"outputAmount",get:function get(){if(this._outputAmount)return this._outputAmount;var G=this.swaps[0].outputAmount.currency,K=this.swaps.map((function(G){return G.outputAmount})).reduce((function(G,K){return G.add(K)}),tK.fromRawAmount(G,0));return this._outputAmount=K,this._outputAmount}},{key:"executionPrice",get:function get(){var G;return null!=(G=this._executionPrice)?G:this._executionPrice=new aK(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function get(){if(this._priceImpact)return this._priceImpact;for(var G,K=tK.fromRawAmount(this.outputAmount.currency,0),ne=_createForOfIteratorHelperLoose$1(this.swaps);!(G=ne()).done;){var ue=G.value,pe=ue.route,he=ue.inputAmount,ye=pe.midPrice;K=K.add(ye.quote(he))}var me=K.subtract(this.outputAmount).divide(K);return this._priceImpact=new nK(me.numerator,me.denominator),this._priceImpact}}]),Trade}(),rJ=function(){function Multicall(){}return Multicall.encodeMulticall=function encodeMulticall(G){return Array.isArray(G)||(G=[G]),1===G.length?G[0]:Multicall.INTERFACE.encodeFunctionData("multicall",[G])},Multicall}();rJ.INTERFACE=new Ho(pK);var nJ=function(){function SelfPermit(){}return SelfPermit.encodePermit=function encodePermit(G,K){return function isAllowedPermit(G){return"nonce"in G}(K)?SelfPermit.INTERFACE.encodeFunctionData("selfPermitAllowed",[G.address,toHex$1(K.nonce),toHex$1(K.expiry),K.v,K.r,K.s]):SelfPermit.INTERFACE.encodeFunctionData("selfPermit",[G.address,toHex$1(K.amount),toHex$1(K.deadline),K.v,K.r,K.s])},SelfPermit}();nJ.INTERFACE=new Ho(yK);var aJ=function(){function Payments(){}return Payments.encodeFeeBips=function encodeFeeBips(G){return toHex$1(G.multiply(1e4).quotient)},Payments.encodeUnwrapWETH9=function encodeUnwrapWETH9(G,K,ne){if(K=validateAndParseAddress$2(K),ne){var ue=this.encodeFeeBips(ne.fee),pe=validateAndParseAddress$2(ne.recipient);return Payments.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[toHex$1(G),K,ue,pe])}return Payments.INTERFACE.encodeFunctionData("unwrapWETH9",[toHex$1(G),K])},Payments.encodeSweepToken=function encodeSweepToken(G,K,ne,ue){if(ne=validateAndParseAddress$2(ne),ue){var pe=this.encodeFeeBips(ue.fee),he=validateAndParseAddress$2(ue.recipient);return Payments.INTERFACE.encodeFunctionData("sweepTokenWithFee",[G.address,toHex$1(K),ne,pe,he])}return Payments.INTERFACE.encodeFunctionData("sweepToken",[G.address,toHex$1(K),ne])},Payments.encodeRefundETH=function encodeRefundETH(){return Payments.INTERFACE.encodeFunctionData("refundETH")},Payments}();aJ.INTERFACE=new Ho(mK);var iJ=toHex$1(oV.subtract(oV.exponentiate(oV.BigInt(2),oV.BigInt(128)),oV.BigInt(1)));function isMint(G){return Object.keys(G).some((function(G){return"recipient"===G}))}var sJ=function(){function NonfungiblePositionManager(){}return NonfungiblePositionManager.encodeCreate=function encodeCreate(G){return NonfungiblePositionManager.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[G.token0.address,G.token1.address,G.fee,toHex$1(G.sqrtRatioX96)])},NonfungiblePositionManager.createCallParameters=function createCallParameters(G){return{calldata:this.encodeCreate(G),value:toHex$1(0)}},NonfungiblePositionManager.addCallParameters=function addCallParameters(G,K){oV.greaterThan(G.liquidity,RK)||invariant();var ne=[],ue=G.mintAmounts,pe=ue.amount0,he=ue.amount1,ye=G.mintAmountsWithSlippage(K.slippageTolerance),me=toHex$1(ye.amount0),be=toHex$1(ye.amount1),ve=toHex$1(K.deadline);if(isMint(K)&&K.createPool&&ne.push(this.encodeCreate(G.pool)),K.token0Permit&&ne.push(nJ.encodePermit(G.pool.token0,K.token0Permit)),K.token1Permit&&ne.push(nJ.encodePermit(G.pool.token1,K.token1Permit)),isMint(K)){var _e=validateAndParseAddress$2(K.recipient);ne.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("mint",[{token0:G.pool.token0.address,token1:G.pool.token1.address,fee:G.pool.fee,tickLower:G.tickLower,tickUpper:G.tickUpper,amount0Desired:toHex$1(pe),amount1Desired:toHex$1(he),amount0Min:me,amount1Min:be,recipient:_e,deadline:ve}]))}else ne.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:toHex$1(K.tokenId),amount0Desired:toHex$1(pe),amount1Desired:toHex$1(he),amount0Min:me,amount1Min:be,deadline:ve}]));var Te=toHex$1(0);if(K.useNative){var Ee=K.useNative.wrapped;G.pool.token0.equals(Ee)||G.pool.token1.equals(Ee)||invariant();var Pe=G.pool.token0.equals(Ee)?pe:he;oV.greaterThan(Pe,RK)&&ne.push(aJ.encodeRefundETH()),Te=toHex$1(Pe)}return{calldata:rJ.encodeMulticall(ne),value:Te}},NonfungiblePositionManager.encodeCollect=function encodeCollect(G){var K=[],ne=toHex$1(G.tokenId),ue=G.expectedCurrencyOwed0.currency.isNative||G.expectedCurrencyOwed1.currency.isNative,pe=validateAndParseAddress$2(G.recipient);if(K.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("collect",[{tokenId:ne,recipient:ue?PK:pe,amount0Max:iJ,amount1Max:iJ}])),ue){var he=G.expectedCurrencyOwed0.currency.isNative?G.expectedCurrencyOwed0.quotient:G.expectedCurrencyOwed1.quotient,ye=G.expectedCurrencyOwed0.currency.isNative?G.expectedCurrencyOwed1.currency:G.expectedCurrencyOwed0.currency,me=G.expectedCurrencyOwed0.currency.isNative?G.expectedCurrencyOwed1.quotient:G.expectedCurrencyOwed0.quotient;K.push(aJ.encodeUnwrapWETH9(he,pe)),K.push(aJ.encodeSweepToken(ye,me,pe))}return K},NonfungiblePositionManager.collectCallParameters=function collectCallParameters(G){var K=NonfungiblePositionManager.encodeCollect(G);return{calldata:rJ.encodeMulticall(K),value:toHex$1(0)}},NonfungiblePositionManager.removeCallParameters=function removeCallParameters(G,K){var ne=[],ue=toHex$1(K.deadline),pe=toHex$1(K.tokenId),he=new YK({pool:G.pool,liquidity:K.liquidityPercentage.multiply(G.liquidity).quotient,tickLower:G.tickLower,tickUpper:G.tickUpper});oV.greaterThan(he.liquidity,RK)||invariant();var ye=he.burnAmountsWithSlippage(K.slippageTolerance),me=ye.amount0,be=ye.amount1;K.permit&&ne.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("permit",[validateAndParseAddress$2(K.permit.spender),pe,toHex$1(K.permit.deadline),K.permit.v,K.permit.r,K.permit.s])),ne.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:pe,liquidity:toHex$1(he.liquidity),amount0Min:toHex$1(me),amount1Min:toHex$1(be),deadline:ue}]));var ve=K.collectOptions,_e=ve.expectedCurrencyOwed0,Te=ve.expectedCurrencyOwed1,Ee=function _objectWithoutPropertiesLoose(G,K){if(null==G)return{};var ne,ue,pe={},he=Object.keys(G);for(ue=0;ue<he.length;ue++)ne=he[ue],K.indexOf(ne)>=0||(pe[ne]=G[ne]);return pe}(ve,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return ne.push.apply(ne,NonfungiblePositionManager.encodeCollect(_extends$2({tokenId:toHex$1(K.tokenId),expectedCurrencyOwed0:_e.add(tK.fromRawAmount(_e.currency,me)),expectedCurrencyOwed1:Te.add(tK.fromRawAmount(Te.currency,be))},Ee))),K.liquidityPercentage.equalTo(kK)?K.burnToken&&ne.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData("burn",[pe])):!0===K.burnToken&&invariant(),{calldata:rJ.encodeMulticall(ne),value:toHex$1(0)}},NonfungiblePositionManager.safeTransferFromParameters=function safeTransferFromParameters(G){var K=validateAndParseAddress$2(G.recipient),ne=validateAndParseAddress$2(G.sender);return{calldata:G.data?NonfungiblePositionManager.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[ne,K,toHex$1(G.tokenId),G.data]):NonfungiblePositionManager.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[ne,K,toHex$1(G.tokenId)]),value:toHex$1(0)}},NonfungiblePositionManager}();sJ.INTERFACE=new Ho(hK);var oJ=function(){function SwapQuoter(){}return SwapQuoter.quoteCallParameters=function quoteCallParameters(G,K,ne,ue){void 0===ue&&(ue={});var pe,he=1===G.pools.length,ye=toHex$1(K.quotient),me=ue.useQuoterV2?this.V2INTERFACE:this.V1INTERFACE;if(he){var be,ve,_e={tokenIn:G.tokenPath[0].address,tokenOut:G.tokenPath[1].address,fee:G.pools[0].fee,sqrtPriceLimitX96:toHex$1(null!=(be=null==(ve=ue)?void 0:ve.sqrtPriceLimitX96)?be:0)},Te=_extends$2({},_e,ne==DV.EXACT_INPUT?{amountIn:ye}:{amount:ye}),Ee=[_e.tokenIn,_e.tokenOut,_e.fee,ye,_e.sqrtPriceLimitX96],Pe=ne===DV.EXACT_INPUT?"quoteExactInputSingle":"quoteExactOutputSingle";pe=me.encodeFunctionData(Pe,ue.useQuoterV2?[Te]:Ee)}else{var Se;void 0!==(null==(Se=ue)?void 0:Se.sqrtPriceLimitX96)&&invariant();var Ce=encodeRouteToPath(G,ne===DV.EXACT_OUTPUT),ke=ne===DV.EXACT_INPUT?"quoteExactInput":"quoteExactOutput";pe=me.encodeFunctionData(ke,[Ce,ye])}return{calldata:pe,value:toHex$1(0)}},SwapQuoter}();oJ.V1INTERFACE=new Ho(bK),oJ.V2INTERFACE=new Ho(gK);var cJ=function(){function Staker(){}return Staker.encodeClaim=function encodeClaim(G,K){var ne,ue=[];ue.push(Staker.INTERFACE.encodeFunctionData("unstakeToken",[this._encodeIncentiveKey(G),toHex$1(K.tokenId)]));var pe=validateAndParseAddress$2(K.recipient),he=null!=(ne=K.amount)?ne:0;return ue.push(Staker.INTERFACE.encodeFunctionData("claimReward",[G.rewardToken.address,pe,toHex$1(he)])),ue},Staker.collectRewards=function collectRewards(G,K){G=Array.isArray(G)?G:[G];for(var ne=[],ue=0;ue<G.length;ue++){var pe=G[ue];(ne=ne.concat(this.encodeClaim(pe,K))).push(Staker.INTERFACE.encodeFunctionData("stakeToken",[this._encodeIncentiveKey(pe),toHex$1(K.tokenId)]))}return{calldata:rJ.encodeMulticall(ne),value:toHex$1(0)}},Staker.withdrawToken=function withdrawToken(G,K){var ne=[];G=Array.isArray(G)?G:[G];for(var ue={tokenId:K.tokenId,recipient:K.recipient,amount:K.amount},pe=0;pe<G.length;pe++){var he=G[pe];ne=ne.concat(this.encodeClaim(he,ue))}var ye=validateAndParseAddress$2(K.owner);return ne.push(Staker.INTERFACE.encodeFunctionData("withdrawToken",[toHex$1(K.tokenId),ye,K.data?K.data:toHex$1(0)])),{calldata:rJ.encodeMulticall(ne),value:toHex$1(0)}},Staker.encodeDeposit=function encodeDeposit(G){var K;if((G=Array.isArray(G)?G:[G]).length>1){for(var ne=[],ue=0;ue<G.length;ue++){var pe=G[ue];ne.push(this._encodeIncentiveKey(pe))}K=po.encode([Staker.INCENTIVE_KEY_ABI+"[]"],[ne])}else K=po.encode([Staker.INCENTIVE_KEY_ABI],[this._encodeIncentiveKey(G[0])]);return K},Staker._encodeIncentiveKey=function _encodeIncentiveKey(G){var K=G.pool,ne=K.token0,ue=K.token1,pe=K.fee,he=validateAndParseAddress$2(G.refundee);return{rewardToken:G.rewardToken.address,pool:ZK.getAddress(ne,ue,pe),startTime:toHex$1(G.startTime),endTime:toHex$1(G.endTime),refundee:he}},Staker}();cJ.INTERFACE=new Ho(vK),cJ.INCENTIVE_KEY_ABI="tuple(address rewardToken, address pool, uint256 startTime, uint256 endTime, address refundee)";var dJ=function(){function SwapRouter(){}return SwapRouter.swapCallParameters=function swapCallParameters(G,K){Array.isArray(G)||(G=[G]);var ne=G[0],ue=ne.inputAmount.currency.wrapped,pe=ne.outputAmount.currency.wrapped;G.every((function(G){return G.inputAmount.currency.wrapped.equals(ue)}))||invariant(),G.every((function(G){return G.outputAmount.currency.wrapped.equals(pe)}))||invariant();var he=[],ye=tK.fromRawAmount(G[0].inputAmount.currency,0),me=tK.fromRawAmount(G[0].outputAmount.currency,0),be=G.reduce((function(G,ne){return G.add(ne.minimumAmountOut(K.slippageTolerance))}),me),ve=ne.inputAmount.currency.isNative&&ne.tradeType===DV.EXACT_OUTPUT,_e=ne.inputAmount.currency.isNative,Te=ne.outputAmount.currency.isNative,Ee=Te||!!K.fee,Pe=_e?G.reduce((function(G,ne){return G.add(ne.maximumAmountIn(K.slippageTolerance))}),ye):ye;K.inputTokenPermit&&(ne.inputAmount.currency.isToken||invariant(),he.push(nJ.encodePermit(ne.inputAmount.currency,K.inputTokenPermit)));for(var Se,Ce=validateAndParseAddress$2(K.recipient),ke=toHex$1(K.deadline),Oe=_createForOfIteratorHelperLoose$1(G);!(Se=Oe()).done;)for(var xe,Ne=Se.value,Me=_createForOfIteratorHelperLoose$1(Ne.swaps);!(xe=Me()).done;){var Be=xe.value,Fe=Be.route,De=Be.inputAmount,Le=Be.outputAmount,Ue=toHex$1(Ne.maximumAmountIn(K.slippageTolerance,De).quotient),je=toHex$1(Ne.minimumAmountOut(K.slippageTolerance,Le).quotient);if(1===Fe.pools.length)if(Ne.tradeType===DV.EXACT_INPUT){var ze,Je={tokenIn:Fe.tokenPath[0].address,tokenOut:Fe.tokenPath[1].address,fee:Fe.pools[0].fee,recipient:Ee?PK:Ce,deadline:ke,amountIn:Ue,amountOutMinimum:je,sqrtPriceLimitX96:toHex$1(null!=(ze=K.sqrtPriceLimitX96)?ze:0)};he.push(SwapRouter.INTERFACE.encodeFunctionData("exactInputSingle",[Je]))}else{var Xe,Qe={tokenIn:Fe.tokenPath[0].address,tokenOut:Fe.tokenPath[1].address,fee:Fe.pools[0].fee,recipient:Ee?PK:Ce,deadline:ke,amountOut:je,amountInMaximum:Ue,sqrtPriceLimitX96:toHex$1(null!=(Xe=K.sqrtPriceLimitX96)?Xe:0)};he.push(SwapRouter.INTERFACE.encodeFunctionData("exactOutputSingle",[Qe]))}else{void 0!==K.sqrtPriceLimitX96&&invariant();var Ye=encodeRouteToPath(Fe,Ne.tradeType===DV.EXACT_OUTPUT);if(Ne.tradeType===DV.EXACT_INPUT){var et={path:Ye,recipient:Ee?PK:Ce,deadline:ke,amountIn:Ue,amountOutMinimum:je};he.push(SwapRouter.INTERFACE.encodeFunctionData("exactInput",[et]))}else{var tt={path:Ye,recipient:Ee?PK:Ce,deadline:ke,amountOut:je,amountInMaximum:Ue};he.push(SwapRouter.INTERFACE.encodeFunctionData("exactOutput",[tt]))}}}return Ee&&(K.fee?Te?he.push(aJ.encodeUnwrapWETH9(be.quotient,Ce,K.fee)):he.push(aJ.encodeSweepToken(ne.outputAmount.currency.wrapped,be.quotient,Ce,K.fee)):he.push(aJ.encodeUnwrapWETH9(be.quotient,Ce))),ve&&he.push(aJ.encodeRefundETH()),{calldata:rJ.encodeMulticall(he),value:toHex$1(Pe.quotient)}},SwapRouter}();dJ.INTERFACE=new Ho(wK);var uJ,fJ,lJ=Object.freeze({__proto__:null,ADDRESS_ZERO:PK,FACTORY_ADDRESS:EK,get FeeAmount(){return TK},FullMath:MK,LiquidityMath:NK,Multicall:rJ,NoTickDataProvider:jK,NonfungiblePositionManager:sJ,POOL_INIT_CODE_HASH:SK,Payments:aJ,Pool:ZK,Position:YK,PositionLibrary:zK,Route:eJ,SelfPermit:nJ,SqrtPriceMath:FK,Staker:cJ,SwapMath:LK,SwapQuoter:oJ,SwapRouter:dJ,TICK_SPACINGS:IK,Tick:JK,TickLibrary:KK,TickList:HK,TickListDataProvider:XK,TickMath:GK,Trade:tJ,computePoolAddress:computePoolAddress$1,encodeRouteToPath:encodeRouteToPath,encodeSqrtRatioX96:encodeSqrtRatioX96,isSorted:isSorted,maxLiquidityForAmounts:maxLiquidityForAmounts,mostSignificantBit:mostSignificantBit,nearestUsableTick:function nearestUsableTick(G,K){Number.isInteger(G)&&Number.isInteger(K)||invariant(),K>0||invariant(),G>=GK.MIN_TICK&&G<=GK.MAX_TICK||invariant();var ne=Math.round(G/K)*K;return ne<GK.MIN_TICK?ne+K:ne>GK.MAX_TICK?ne-K:ne},priceToClosestTick:function priceToClosestTick(G){var K=G.baseCurrency.sortsBefore(G.quoteCurrency),ne=K?encodeSqrtRatioX96(G.numerator,G.denominator):encodeSqrtRatioX96(G.denominator,G.numerator),ue=GK.getTickAtSqrtRatio(ne),pe=tickToPrice(G.baseCurrency,G.quoteCurrency,ue+1);return K?G.lessThan(pe)||ue++:G.greaterThan(pe)||ue++,ue},subIn256:subIn256,tickToPrice:tickToPrice,toHex:toHex$1,tradeComparator:tradeComparator$1}),pJ={exports:{}},hJ={},yJ=getAugmentedNamespace$1(Wo);var mJ,bJ={_format:"hh-sol-artifact-1",contractName:"IApproveAndCall",sourceName:"contracts/interfaces/IApproveAndCall.sol",abi:[{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveMax",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveMaxMinusOne",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveZeroThenMax",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveZeroThenMaxMinusOne",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"callPositionManager",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"getApprovalType",outputs:[{internalType:"enum IApproveAndCall.ApprovalType",name:"",type:"uint8"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"}],internalType:"struct IApproveAndCall.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],internalType:"struct IApproveAndCall.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"}],bytecode:"0x",deployedBytecode:"0x",linkReferences:{},deployedLinkReferences:{}},gJ=getAugmentedNamespace$1(lJ),vJ={_format:"hh-sol-artifact-1",contractName:"IMulticallExtended",sourceName:"contracts/interfaces/IMulticallExtended.sol",abi:[{inputs:[{internalType:"bytes32",name:"previousBlockhash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}],bytecode:"0x",deployedBytecode:"0x",linkReferences:{},deployedLinkReferences:{}};function _createClass$2(G,K,ne){return K&&function _defineProperties$2(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _extends$1(){return _extends$1=Object.assign||function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G},_extends$1.apply(this,arguments)}function _inheritsLoose$2(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}!function(G){G[G.MAINNET=1]="MAINNET",G[G.GOERLI=5]="GOERLI",G[G.SEPOLIA=11155111]="SEPOLIA",G[G.OPTIMISM=10]="OPTIMISM",G[G.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",G[G.ARBITRUM_ONE=42161]="ARBITRUM_ONE",G[G.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",G[G.POLYGON=137]="POLYGON",G[G.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",G[G.CELO=42220]="CELO",G[G.CELO_ALFAJORES=44787]="CELO_ALFAJORES",G[G.GNOSIS=100]="GNOSIS",G[G.MOONBEAM=1284]="MOONBEAM",G[G.BNB=56]="BNB",G[G.AVALANCHE=43114]="AVALANCHE",G[G.BASE_GOERLI=84531]="BASE_GOERLI",G[G.BASE=8453]="BASE"}(mJ||(mJ={}));var wJ,_J,TJ,AJ,EJ,PJ,SJ,IJ=[mJ.MAINNET,mJ.OPTIMISM,mJ.OPTIMISM_GOERLI,mJ.ARBITRUM_ONE,mJ.ARBITRUM_GOERLI,mJ.POLYGON,mJ.POLYGON_MUMBAI,mJ.GOERLI,mJ.SEPOLIA,mJ.CELO_ALFAJORES,mJ.CELO,mJ.BNB,mJ.AVALANCHE,mJ.BASE,mJ.BASE_GOERLI];!function(G){G.ETHER="ETH",G.MATIC="MATIC",G.CELO="CELO",G.GNOSIS="XDAI",G.MOONBEAM="GLMR",G.BNB="BNB",G.AVAX="AVAX"}(wJ||(wJ={}));var CJ=[mJ.MAINNET,mJ.GOERLI];function constructSameAddressMap$1(G,K){return void 0===K&&(K=[]),CJ.concat(K).reduce((function(K,ne){return K[ne]=G,K}),{})}var RJ,kJ,OJ=constructSameAddressMap$1("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",[mJ.OPTIMISM,mJ.ARBITRUM_ONE,mJ.POLYGON,mJ.POLYGON_MUMBAI,mJ.SEPOLIA]),xJ="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",NJ=constructSameAddressMap$1(xJ),MJ="0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",BJ=constructSameAddressMap$1(MJ),FJ={v3CoreFactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",multicallAddress:"0x1F98415757620B543A52E61c46B32eB19261F984",quoterAddress:"0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",v3MigratorAddress:"0xA5644E29708357803b5A882D272c41cC0dF92B34",nonfungiblePositionManagerAddress:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88"},DJ=_extends$1({},FJ,{v1MixedRouteQuoterAddress:"0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E"}),LJ=_extends$1({},FJ,{v1MixedRouteQuoterAddress:"0xBa60b6e6fF25488308789E6e0A65D838be34194e"}),UJ=FJ,$J=_extends$1({},FJ,{multicallAddress:"0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB",tickLensAddress:"0xbfd8137f7d1516D3ea5cA83523914859ec47F573"}),qJ=FJ,GJ={v3CoreFactoryAddress:"0xAfE208a311B21f13EF87E33A90049fC17A7acDEc",multicallAddress:"0x633987602DE5C4F337e3DbF265303A1080324204",quoterAddress:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",v3MigratorAddress:"0x3cFd4d48EDfDCC53D3f173F596f621064614C582",nonfungiblePositionManagerAddress:"0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A",tickLensAddress:"0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D"},jJ=((_J={})[mJ.MAINNET]=DJ,_J[mJ.OPTIMISM]=UJ,_J[mJ.ARBITRUM_ONE]=$J,_J[mJ.POLYGON]=qJ,_J[mJ.POLYGON_MUMBAI]=qJ,_J[mJ.GOERLI]=LJ,_J[mJ.CELO]=GJ,_J[mJ.CELO_ALFAJORES]=GJ,_J[mJ.BNB]={v3CoreFactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",multicallAddress:"0x963Df249eD09c358A4819E39d9Cd5736c3087184",quoterAddress:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",v3MigratorAddress:"0x32681814957e0C13117ddc0c2aba232b5c9e760f",nonfungiblePositionManagerAddress:"0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613",tickLensAddress:"0xD9270014D396281579760619CCf4c3af0501A47C",swapRouter02Address:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"},_J[mJ.OPTIMISM_GOERLI]={v3CoreFactoryAddress:"0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10",multicallAddress:"0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd",quoterAddress:"0x9569CbA925c8ca2248772A9A4976A516743A246F",v3MigratorAddress:"0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8",nonfungiblePositionManagerAddress:"0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6",tickLensAddress:"0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e"},_J[mJ.ARBITRUM_GOERLI]={v3CoreFactoryAddress:"0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6",multicallAddress:"0x8260CB40247290317a4c062F3542622367F206Ee",quoterAddress:"0x1dd92b83591781D0C6d98d07391eea4b9a6008FA",v3MigratorAddress:"0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3",nonfungiblePositionManagerAddress:"0x622e4726a167799826d1E1D150b076A7725f5D81",tickLensAddress:"0xb52429333da969a0C79a60930a4Bf0020E5D1DE8"},_J[mJ.SEPOLIA]={v3CoreFactoryAddress:"0x0227628f3F023bb0B980b67D528571c95c6DaC1c",multicallAddress:"0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07",quoterAddress:"0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",v3MigratorAddress:"0x729004182cF005CEC8Bd85df140094b6aCbe8b15",nonfungiblePositionManagerAddress:"0x1238536071E1c677A632429e3655c799b22cDA52",tickLensAddress:"0xd7f33bcdb21b359c8ee6f0251d30e94832baad07"},_J[mJ.AVALANCHE]={v3CoreFactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",multicallAddress:"0x0139141Cd4Ee88dF3Cdb65881D411bAE271Ef0C2",quoterAddress:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",v3MigratorAddress:"0x44f5f1f5E452ea8d29C890E8F6e893fC0f1f0f97",nonfungiblePositionManagerAddress:"0x655C406EBFa14EE2006250925e54ec43AD184f8B",tickLensAddress:"0xEB9fFC8bf81b4fFd11fb6A63a6B0f098c6e21950",swapRouter02Address:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE"},_J[mJ.BASE]={v3CoreFactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",multicallAddress:"0x091e99cb1C49331a94dD62755D168E941AbD0693",quoterAddress:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",v3MigratorAddress:"0x23cF10b1ee3AdfCA73B0eF17C07F7577e7ACd2d7",nonfungiblePositionManagerAddress:"0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",tickLensAddress:"0x0CdeE061c75D43c82520eD998C23ac2991c9ac6d",swapRouter02Address:"0x2626664c2603336E57B271c5C0b26F421741e481"},_J[mJ.BASE_GOERLI]={v3CoreFactoryAddress:"0x9323c1d6D800ed51Bd7C6B216cfBec678B7d0BC2",multicallAddress:"0xB206027a9E0E13F05eBEFa5D2402Bab3eA716439",quoterAddress:"0xedf539058e28E5937dAef3f69cEd0b25fbE66Ae9",v3MigratorAddress:"0x3efe5d02a04b7351D671Db7008ec6eBA9AD9e3aE",nonfungiblePositionManagerAddress:"0x3c61369ef0D1D2AFa70d8feC2F31C5D6Ce134F30",tickLensAddress:"0x1acB873Ee909D0c98adB18e4474943249F931b92",swapRouter02Address:"0x8357227D4eDc78991Db6FDB9bD6ADE250536dE1d"},_J),HJ=_extends$1({},IJ.reduce((function(G,K){return G[K]=jJ[K].v3CoreFactoryAddress,G}),{})),WJ=_extends$1({},IJ.reduce((function(G,K){var ne=jJ[K].v3MigratorAddress;return ne&&(G[K]=ne),G}),{})),zJ=_extends$1({},IJ.reduce((function(G,K){return G[K]=jJ[K].multicallAddress,G}),{})),VJ=constructSameAddressMap$1("0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F"),KJ=((TJ={})[mJ.MAINNET]="0xC4e172459f1E7939D522503B81AFAaC1014CE6F6",TJ),JJ=((AJ={})[mJ.MAINNET]="0x408ED6354d4973f66138C91495F2f2FCbd8724C3",AJ),XJ=constructSameAddressMap$1("0x1a9C8182C09F50C8318d769245beA52c32BE35BC"),QJ=((EJ={})[mJ.MAINNET]="0x090D4613473dEE047c3f2706764f49E0821D256e",EJ),ZJ=((PJ={})[mJ.MAINNET]="0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8",PJ),YJ=_extends$1({},IJ.reduce((function(G,K){return G[K]=jJ[K].quoterAddress,G}),{})),eX=_extends$1({},IJ.reduce((function(G,K){var ne=jJ[K].nonfungiblePositionManagerAddress;return ne&&(G[K]=ne),G}),{})),tX=_extends$1({},constructSameAddressMap$1("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")),rX=((SJ={})[mJ.MAINNET]="0x65770b5283117639760beA3F867b69b3697a91dd",SJ),nX=_extends$1({},IJ.reduce((function(G,K){var ne=jJ[K].tickLensAddress;return ne&&(G[K]=ne),G}),{})),aX=IJ.reduce((function(G,K){var ne=jJ[K].v1MixedRouteQuoterAddress;return ne&&(G[K]=ne),G}),{});!function(G){G[G.EXACT_INPUT=0]="EXACT_INPUT",G[G.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(RJ||(RJ={})),function(G){G[G.ROUND_DOWN=0]="ROUND_DOWN",G[G.ROUND_HALF_UP=1]="ROUND_HALF_UP",G[G.ROUND_UP=2]="ROUND_UP"}(kJ||(kJ={}));var iX,sX,oX=oV.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),cX=bV(uV),dX=bV(lV),uX=((iX={})[kJ.ROUND_DOWN]=cX.ROUND_DOWN,iX[kJ.ROUND_HALF_UP]=cX.ROUND_HALF_UP,iX[kJ.ROUND_UP]=cX.ROUND_UP,iX),fX=((sX={})[kJ.ROUND_DOWN]=0,sX[kJ.ROUND_HALF_UP]=1,sX[kJ.ROUND_UP]=3,sX),lX=function(){function Fraction(G,K){void 0===K&&(K=oV.BigInt(1)),this.numerator=oV.BigInt(G),this.denominator=oV.BigInt(K)}Fraction.tryParseFraction=function tryParseFraction(G){if(G instanceof oV||"number"==typeof G||"string"==typeof G)return new Fraction(G);if("numerator"in G&&"denominator"in G)return G;throw new Error("Could not parse fraction")};var G=Fraction.prototype;return G.invert=function invert(){return new Fraction(this.denominator,this.numerator)},G.add=function add(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.add(this.numerator,K.numerator),this.denominator):new Fraction(oV.add(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.subtract=function subtract(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.subtract(this.numerator,K.numerator),this.denominator):new Fraction(oV.subtract(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.lessThan=function lessThan(G){var K=Fraction.tryParseFraction(G);return oV.lessThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.equalTo=function equalTo(G){var K=Fraction.tryParseFraction(G);return oV.equal(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.greaterThan=function greaterThan(G){var K=Fraction.tryParseFraction(G);return oV.greaterThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.multiply=function multiply(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.numerator),oV.multiply(this.denominator,K.denominator))},G.divide=function divide(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.denominator),oV.multiply(this.denominator,K.numerator))},G.toSignificant=function toSignificant(G,K,ne){void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=kJ.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>0||invariant(),cX.set({precision:G+1,rounding:uX[ne]});var ue=new cX(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(G);return ue.toFormat(ue.decimalPlaces(),K)},G.toFixed=function toFixed(G,K,ne){return void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=kJ.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>=0||invariant(),dX.DP=G,dX.RM=fX[ne],new dX(this.numerator.toString()).div(this.denominator.toString()).toFormat(G,K)},_createClass$2(Fraction,[{key:"quotient",get:function get(){return oV.divide(this.numerator,this.denominator)}},{key:"remainder",get:function get(){return new Fraction(oV.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function get(){return new Fraction(this.numerator,this.denominator)}}]),Fraction}(),pX=bV(lV),hX=function(G){function CurrencyAmount(K,ne,ue){var pe;return pe=G.call(this,ne,ue)||this,oV.lessThanOrEqual(pe.quotient,oX)||invariant(),pe.currency=K,pe.decimalScale=oV.exponentiate(oV.BigInt(10),oV.BigInt(K.decimals)),pe}_inheritsLoose$2(CurrencyAmount,G),CurrencyAmount.fromRawAmount=function fromRawAmount(G,K){return new CurrencyAmount(G,K)},CurrencyAmount.fromFractionalAmount=function fromFractionalAmount(G,K,ne){return new CurrencyAmount(G,K,ne)};var K=CurrencyAmount.prototype;return K.add=function add(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.add.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.subtract=function subtract(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.subtract.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.multiply=function multiply(K){var ne=G.prototype.multiply.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.divide=function divide(K){var ne=G.prototype.divide.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=6),void 0===ue&&(ue=kJ.ROUND_DOWN),G.prototype.divide.call(this,this.decimalScale).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=this.currency.decimals),void 0===ue&&(ue=kJ.ROUND_DOWN),K<=this.currency.decimals||invariant(),G.prototype.divide.call(this,this.decimalScale).toFixed(K,ne,ue)},K.toExact=function toExact(G){return void 0===G&&(G={groupSeparator:""}),pX.DP=this.currency.decimals,new pX(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(G)},_createClass$2(CurrencyAmount,[{key:"wrapped",get:function get(){return this.currency.isToken?this:CurrencyAmount.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),CurrencyAmount}(lX),yX=new lX(oV.BigInt(100));function toPercent$1(G){return new mX(G.numerator,G.denominator)}var mX=function(G){function Percent(){var K;return(K=G.apply(this,arguments)||this).isPercent=!0,K}_inheritsLoose$2(Percent,G);var K=Percent.prototype;return K.add=function add(K){return toPercent$1(G.prototype.add.call(this,K))},K.subtract=function subtract(K){return toPercent$1(G.prototype.subtract.call(this,K))},K.multiply=function multiply(K){return toPercent$1(G.prototype.multiply.call(this,K))},K.divide=function divide(K){return toPercent$1(G.prototype.divide.call(this,K))},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=5),G.prototype.multiply.call(this,yX).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=2),G.prototype.multiply.call(this,yX).toFixed(K,ne,ue)},Percent}(lX),bX=function(G){function Price(){for(var K,ne,ue,pe,he,ye=arguments.length,me=new Array(ye),be=0;be<ye;be++)me[be]=arguments[be];if(4===me.length)ne=me[0],ue=me[1],pe=me[2],he=me[3];else{var ve=me[0].quoteAmount.divide(me[0].baseAmount),_e=[me[0].baseAmount.currency,me[0].quoteAmount.currency,ve.denominator,ve.numerator];ne=_e[0],ue=_e[1],pe=_e[2],he=_e[3]}return(K=G.call(this,he,pe)||this).baseCurrency=ne,K.quoteCurrency=ue,K.scalar=new lX(oV.exponentiate(oV.BigInt(10),oV.BigInt(ne.decimals)),oV.exponentiate(oV.BigInt(10),oV.BigInt(ue.decimals))),K}_inheritsLoose$2(Price,G);var K=Price.prototype;return K.invert=function invert(){return new Price(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},K.multiply=function multiply(K){this.quoteCurrency.equals(K.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return new Price(this.baseCurrency,K.quoteCurrency,ne.denominator,ne.numerator)},K.quote=function quote(K){K.currency.equals(this.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return hX.fromFractionalAmount(this.quoteCurrency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(G,K,ne){return void 0===G&&(G=6),this.adjustedForDecimals.toSignificant(G,K,ne)},K.toFixed=function toFixed(G,K,ne){return void 0===G&&(G=4),this.adjustedForDecimals.toFixed(G,K,ne)},_createClass$2(Price,[{key:"adjustedForDecimals",get:function get(){return G.prototype.multiply.call(this,this.scalar)}}]),Price}(lX),gX=function BaseCurrency(G,K,ne,ue){Number.isSafeInteger(G)||invariant(),K>=0&&K<255&&Number.isInteger(K)||invariant(),this.chainId=G,this.decimals=K,this.symbol=ne,this.name=ue},vX=function(G){function NativeCurrency(){var K;return(K=G.apply(this,arguments)||this).isNative=!0,K.isToken=!1,K}return _inheritsLoose$2(NativeCurrency,G),NativeCurrency}(gX);function validateAndParseAddress$1(G){try{return getAddress$2(G)}catch(K){throw new Error(G+" is not a valid address.")}}var wX=/^0x[0-9a-fA-F]{40}$/;var _X,TX=function(G){function Token(K,ne,ue,pe,he,ye){var me;return(me=G.call(this,K,ue,pe,he)||this).isNative=!1,me.isToken=!0,me.address=ye?function checkValidAddress$1(G){if(wX.test(G))return G;throw new Error(G+" is not a valid address.")}(ne):validateAndParseAddress$1(ne),me}_inheritsLoose$2(Token,G);var K=Token.prototype;return K.equals=function equals(G){return G.isToken&&this.chainId===G.chainId&&this.address.toLowerCase()===G.address.toLowerCase()},K.sortsBefore=function sortsBefore(G){return this.chainId!==G.chainId&&invariant(),this.address.toLowerCase()===G.address.toLowerCase()&&invariant(),this.address.toLowerCase()<G.address.toLowerCase()},_createClass$2(Token,[{key:"wrapped",get:function get(){return this}}]),Token}(gX),AX=((_X={})[1]=new TX(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),_X[3]=new TX(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),_X[4]=new TX(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),_X[5]=new TX(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),_X[42]=new TX(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),_X[10]=new TX(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),_X[69]=new TX(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),_X[42161]=new TX(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),_X[421611]=new TX(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),_X),EX=function(G){function Ether(K){return G.call(this,K,18,"ETH","Ether")||this}return _inheritsLoose$2(Ether,G),Ether.onChain=function onChain(G){var K;return null!=(K=this._etherCache[G])?K:this._etherCache[G]=new Ether(G)},Ether.prototype.equals=function equals(G){return G.isNative&&G.chainId===this.chainId},_createClass$2(Ether,[{key:"wrapped",get:function get(){var G=AX[this.chainId];return G||invariant(),G}}]),Ether}(vX);EX._etherCache={};var PX=oV.BigInt(Number.MAX_SAFE_INTEGER),SX=oV.BigInt(0),IX=oV.BigInt(1),CX=oV.BigInt(2);var RX,kX,OX,xX=Object.freeze({__proto__:null,ARGENT_WALLET_DETECTOR_ADDRESS:ZJ,CHAIN_TO_ADDRESSES_MAP:jJ,get ChainId(){return mJ},CurrencyAmount:hX,ENS_REGISTRAR_ADDRESSES:tX,Ether:EX,Fraction:lX,GOVERNANCE_ALPHA_V0_ADDRESSES:VJ,GOVERNANCE_ALPHA_V1_ADDRESSES:KJ,GOVERNANCE_BRAVO_ADDRESSES:JJ,MERKLE_DISTRIBUTOR_ADDRESS:QJ,MIXED_ROUTE_QUOTER_V1_ADDRESSES:aX,MULTICALL_ADDRESSES:zJ,MaxUint256:oX,NONFUNGIBLE_POSITION_MANAGER_ADDRESSES:eX,NativeCurrency:vX,get NativeCurrencyName(){return wJ},Percent:mX,Price:bX,QUOTER_ADDRESSES:YJ,get Rounding(){return kJ},SOCKS_CONTROLLER_ADDRESSES:rX,SUPPORTED_CHAINS:IJ,SWAP_ROUTER_02_ADDRESSES:function SWAP_ROUTER_02_ADDRESSES(G){return G==mJ.BNB?jJ[G].swapRouter02Address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"},TICK_LENS_ADDRESSES:nX,TIMELOCK_ADDRESSES:XJ,Token:TX,get TradeType(){return RJ},UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS:"0x8B799381ac40b838BBA4131ffB26197C432AFe78",UNI_ADDRESSES:OJ,V2_FACTORY_ADDRESS:xJ,V2_FACTORY_ADDRESSES:NJ,V2_ROUTER_ADDRESS:MJ,V2_ROUTER_ADDRESSES:BJ,V3_CORE_FACTORY_ADDRESSES:HJ,V3_MIGRATOR_ADDRESSES:WJ,WETH9:AX,computePriceImpact:function computePriceImpact$1(G,K,ne){var ue=G.quote(K),pe=ue.subtract(ne).divide(ue);return new mX(pe.numerator,pe.denominator)},sortedInsert:function sortedInsert$1(G,K,ne,ue){if(ne>0||invariant(),G.length<=ne||invariant(),0===G.length)return G.push(K),null;var pe=G.length===ne;if(pe&&ue(G[G.length-1],K)<=0)return K;for(var he=0,ye=G.length;he<ye;){var me=he+ye>>>1;ue(G[me],K)<=0?he=me+1:ye=me}return G.splice(he,0,K),pe?G.pop():null},sqrt:function sqrt$1(G){if(oV.greaterThanOrEqual(G,SX)||invariant(),oV.lessThan(G,PX))return oV.BigInt(Math.floor(Math.sqrt(oV.toNumber(G))));var K,ne;for(K=G,ne=oV.add(oV.divide(G,CX),IX);oV.lessThan(ne,K);)K=ne,ne=oV.divide(oV.add(oV.divide(G,ne),ne),CX);return K},validateAndParseAddress:validateAndParseAddress$1}),NX=getAugmentedNamespace$1(xX),MX={_format:"hh-sol-artifact-1",contractName:"IPeripheryPaymentsWithFeeExtended",sourceName:"contracts/interfaces/IPeripheryPaymentsWithFeeExtended.sol",abi:[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"pull",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"wrapETH",outputs:[],stateMutability:"payable",type:"function"}],bytecode:"0x",deployedBytecode:"0x",linkReferences:{},deployedLinkReferences:{}},BX={_format:"hh-sol-artifact-1",contractName:"ISwapRouter02",sourceName:"contracts/interfaces/ISwapRouter02.sol",abi:[{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveMax",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveMaxMinusOne",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveZeroThenMax",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"approveZeroThenMaxMinusOne",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"callPositionManager",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct IV3SwapRouter.ExactInputParams",name:"params",type:"tuple"}],name:"exactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IV3SwapRouter.ExactInputSingleParams",name:"params",type:"tuple"}],name:"exactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct IV3SwapRouter.ExactOutputParams",name:"params",type:"tuple"}],name:"exactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IV3SwapRouter.ExactOutputSingleParams",name:"params",type:"tuple"}],name:"exactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"getApprovalType",outputs:[{internalType:"enum IApproveAndCall.ApprovalType",name:"",type:"uint8"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"}],internalType:"struct IApproveAndCall.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],internalType:"struct IApproveAndCall.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"bytes",name:"result",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"previousBlockhash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"nonpayable",type:"function"}],bytecode:"0x",deployedBytecode:"0x",linkReferences:{},deployedLinkReferences:{}};function _createClass$1(G,K,ne){return K&&function _defineProperties$1(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _extends(){return _extends=Object.assign||function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G},_extends.apply(this,arguments)}function _inheritsLoose$1(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}!function(G){G[G.MAINNET=1]="MAINNET",G[G.GOERLI=5]="GOERLI",G[G.SEPOLIA=11155111]="SEPOLIA",G[G.OPTIMISM=10]="OPTIMISM",G[G.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",G[G.ARBITRUM_ONE=42161]="ARBITRUM_ONE",G[G.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",G[G.POLYGON=137]="POLYGON",G[G.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",G[G.CELO=42220]="CELO",G[G.CELO_ALFAJORES=44787]="CELO_ALFAJORES",G[G.GNOSIS=100]="GNOSIS",G[G.MOONBEAM=1284]="MOONBEAM",G[G.BNB=56]="BNB",G[G.AVALANCHE=43114]="AVALANCHE",G[G.BASE_GOERLI=84531]="BASE_GOERLI",G[G.BASE=8453]="BASE"}(RX||(RX={})),RX.MAINNET,RX.OPTIMISM,RX.OPTIMISM_GOERLI,RX.ARBITRUM_ONE,RX.ARBITRUM_GOERLI,RX.POLYGON,RX.POLYGON_MUMBAI,RX.GOERLI,RX.SEPOLIA,RX.CELO_ALFAJORES,RX.CELO,RX.BNB,RX.AVALANCHE,RX.BASE,RX.BASE_GOERLI,function(G){G.ETHER="ETH",G.MATIC="MATIC",G.CELO="CELO",G.GNOSIS="XDAI",G.MOONBEAM="GLMR",G.BNB="BNB",G.AVAX="AVAX"}(kX||(kX={}));RX.MAINNET,RX.GOERLI;RX.OPTIMISM,RX.ARBITRUM_ONE,RX.POLYGON,RX.POLYGON_MUMBAI,RX.SEPOLIA;var FX,DX,LX={v3CoreFactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",multicallAddress:"0x1F98415757620B543A52E61c46B32eB19261F984",quoterAddress:"0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",v3MigratorAddress:"0xA5644E29708357803b5A882D272c41cC0dF92B34",nonfungiblePositionManagerAddress:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88"},UX=_extends({},LX,{v1MixedRouteQuoterAddress:"0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E"}),$X=_extends({},LX,{v1MixedRouteQuoterAddress:"0xBa60b6e6fF25488308789E6e0A65D838be34194e"}),qX=LX,GX=_extends({},LX,{multicallAddress:"0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB",tickLensAddress:"0xbfd8137f7d1516D3ea5cA83523914859ec47F573"}),jX=LX,HX={v3CoreFactoryAddress:"0xAfE208a311B21f13EF87E33A90049fC17A7acDEc",multicallAddress:"0x633987602DE5C4F337e3DbF265303A1080324204",quoterAddress:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",v3MigratorAddress:"0x3cFd4d48EDfDCC53D3f173F596f621064614C582",nonfungiblePositionManagerAddress:"0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A",tickLensAddress:"0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D"};(OX={})[RX.MAINNET]=UX,OX[RX.OPTIMISM]=qX,OX[RX.ARBITRUM_ONE]=GX,OX[RX.POLYGON]=jX,OX[RX.POLYGON_MUMBAI]=jX,OX[RX.GOERLI]=$X,OX[RX.CELO]=HX,OX[RX.CELO_ALFAJORES]=HX,OX[RX.BNB]={v3CoreFactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",multicallAddress:"0x963Df249eD09c358A4819E39d9Cd5736c3087184",quoterAddress:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",v3MigratorAddress:"0x32681814957e0C13117ddc0c2aba232b5c9e760f",nonfungiblePositionManagerAddress:"0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613",tickLensAddress:"0xD9270014D396281579760619CCf4c3af0501A47C",swapRouter02Address:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"},OX[RX.OPTIMISM_GOERLI]={v3CoreFactoryAddress:"0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10",multicallAddress:"0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd",quoterAddress:"0x9569CbA925c8ca2248772A9A4976A516743A246F",v3MigratorAddress:"0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8",nonfungiblePositionManagerAddress:"0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6",tickLensAddress:"0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e"},OX[RX.ARBITRUM_GOERLI]={v3CoreFactoryAddress:"0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6",multicallAddress:"0x8260CB40247290317a4c062F3542622367F206Ee",quoterAddress:"0x1dd92b83591781D0C6d98d07391eea4b9a6008FA",v3MigratorAddress:"0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3",nonfungiblePositionManagerAddress:"0x622e4726a167799826d1E1D150b076A7725f5D81",tickLensAddress:"0xb52429333da969a0C79a60930a4Bf0020E5D1DE8"},OX[RX.SEPOLIA]={v3CoreFactoryAddress:"0x0227628f3F023bb0B980b67D528571c95c6DaC1c",multicallAddress:"0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07",quoterAddress:"0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",v3MigratorAddress:"0x729004182cF005CEC8Bd85df140094b6aCbe8b15",nonfungiblePositionManagerAddress:"0x1238536071E1c677A632429e3655c799b22cDA52",tickLensAddress:"0xd7f33bcdb21b359c8ee6f0251d30e94832baad07"},OX[RX.AVALANCHE]={v3CoreFactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",multicallAddress:"0x0139141Cd4Ee88dF3Cdb65881D411bAE271Ef0C2",quoterAddress:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",v3MigratorAddress:"0x44f5f1f5E452ea8d29C890E8F6e893fC0f1f0f97",nonfungiblePositionManagerAddress:"0x655C406EBFa14EE2006250925e54ec43AD184f8B",tickLensAddress:"0xEB9fFC8bf81b4fFd11fb6A63a6B0f098c6e21950",swapRouter02Address:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE"},OX[RX.BASE]={v3CoreFactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",multicallAddress:"0x091e99cb1C49331a94dD62755D168E941AbD0693",quoterAddress:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",v3MigratorAddress:"0x23cF10b1ee3AdfCA73B0eF17C07F7577e7ACd2d7",nonfungiblePositionManagerAddress:"0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",tickLensAddress:"0x0CdeE061c75D43c82520eD998C23ac2991c9ac6d",swapRouter02Address:"0x2626664c2603336E57B271c5C0b26F421741e481"},OX[RX.BASE_GOERLI]={v3CoreFactoryAddress:"0x9323c1d6D800ed51Bd7C6B216cfBec678B7d0BC2",multicallAddress:"0xB206027a9E0E13F05eBEFa5D2402Bab3eA716439",quoterAddress:"0xedf539058e28E5937dAef3f69cEd0b25fbE66Ae9",v3MigratorAddress:"0x3efe5d02a04b7351D671Db7008ec6eBA9AD9e3aE",nonfungiblePositionManagerAddress:"0x3c61369ef0D1D2AFa70d8feC2F31C5D6Ce134F30",tickLensAddress:"0x1acB873Ee909D0c98adB18e4474943249F931b92",swapRouter02Address:"0x8357227D4eDc78991Db6FDB9bD6ADE250536dE1d"},{}[RX.MAINNET]="0xC4e172459f1E7939D522503B81AFAaC1014CE6F6",{}[RX.MAINNET]="0x408ED6354d4973f66138C91495F2f2FCbd8724C3",{}[RX.MAINNET]="0x090D4613473dEE047c3f2706764f49E0821D256e",{}[RX.MAINNET]="0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8",{}[RX.MAINNET]="0x65770b5283117639760beA3F867b69b3697a91dd",function(G){G[G.EXACT_INPUT=0]="EXACT_INPUT",G[G.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(FX||(FX={})),function(G){G[G.ROUND_DOWN=0]="ROUND_DOWN",G[G.ROUND_HALF_UP=1]="ROUND_HALF_UP",G[G.ROUND_UP=2]="ROUND_UP"}(DX||(DX={}));var WX,zX,VX=oV.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),KX=bV(uV),JX=bV(lV),XX=((WX={})[DX.ROUND_DOWN]=KX.ROUND_DOWN,WX[DX.ROUND_HALF_UP]=KX.ROUND_HALF_UP,WX[DX.ROUND_UP]=KX.ROUND_UP,WX),QX=((zX={})[DX.ROUND_DOWN]=0,zX[DX.ROUND_HALF_UP]=1,zX[DX.ROUND_UP]=3,zX),ZX=function(){function Fraction(G,K){void 0===K&&(K=oV.BigInt(1)),this.numerator=oV.BigInt(G),this.denominator=oV.BigInt(K)}Fraction.tryParseFraction=function tryParseFraction(G){if(G instanceof oV||"number"==typeof G||"string"==typeof G)return new Fraction(G);if("numerator"in G&&"denominator"in G)return G;throw new Error("Could not parse fraction")};var G=Fraction.prototype;return G.invert=function invert(){return new Fraction(this.denominator,this.numerator)},G.add=function add(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.add(this.numerator,K.numerator),this.denominator):new Fraction(oV.add(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.subtract=function subtract(G){var K=Fraction.tryParseFraction(G);return oV.equal(this.denominator,K.denominator)?new Fraction(oV.subtract(this.numerator,K.numerator),this.denominator):new Fraction(oV.subtract(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator)),oV.multiply(this.denominator,K.denominator))},G.lessThan=function lessThan(G){var K=Fraction.tryParseFraction(G);return oV.lessThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.equalTo=function equalTo(G){var K=Fraction.tryParseFraction(G);return oV.equal(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.greaterThan=function greaterThan(G){var K=Fraction.tryParseFraction(G);return oV.greaterThan(oV.multiply(this.numerator,K.denominator),oV.multiply(K.numerator,this.denominator))},G.multiply=function multiply(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.numerator),oV.multiply(this.denominator,K.denominator))},G.divide=function divide(G){var K=Fraction.tryParseFraction(G);return new Fraction(oV.multiply(this.numerator,K.denominator),oV.multiply(this.denominator,K.numerator))},G.toSignificant=function toSignificant(G,K,ne){void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=DX.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>0||invariant(),KX.set({precision:G+1,rounding:XX[ne]});var ue=new KX(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(G);return ue.toFormat(ue.decimalPlaces(),K)},G.toFixed=function toFixed(G,K,ne){return void 0===K&&(K={groupSeparator:""}),void 0===ne&&(ne=DX.ROUND_HALF_UP),Number.isInteger(G)||invariant(),G>=0||invariant(),JX.DP=G,JX.RM=QX[ne],new JX(this.numerator.toString()).div(this.denominator.toString()).toFormat(G,K)},_createClass$1(Fraction,[{key:"quotient",get:function get(){return oV.divide(this.numerator,this.denominator)}},{key:"remainder",get:function get(){return new Fraction(oV.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function get(){return new Fraction(this.numerator,this.denominator)}}]),Fraction}(),YX=bV(lV),eQ=function(G){function CurrencyAmount(K,ne,ue){var pe;return pe=G.call(this,ne,ue)||this,oV.lessThanOrEqual(pe.quotient,VX)||invariant(),pe.currency=K,pe.decimalScale=oV.exponentiate(oV.BigInt(10),oV.BigInt(K.decimals)),pe}_inheritsLoose$1(CurrencyAmount,G),CurrencyAmount.fromRawAmount=function fromRawAmount(G,K){return new CurrencyAmount(G,K)},CurrencyAmount.fromFractionalAmount=function fromFractionalAmount(G,K,ne){return new CurrencyAmount(G,K,ne)};var K=CurrencyAmount.prototype;return K.add=function add(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.add.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.subtract=function subtract(K){this.currency.equals(K.currency)||invariant();var ne=G.prototype.subtract.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.multiply=function multiply(K){var ne=G.prototype.multiply.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.divide=function divide(K){var ne=G.prototype.divide.call(this,K);return CurrencyAmount.fromFractionalAmount(this.currency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=6),void 0===ue&&(ue=DX.ROUND_DOWN),G.prototype.divide.call(this,this.decimalScale).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=this.currency.decimals),void 0===ue&&(ue=DX.ROUND_DOWN),K<=this.currency.decimals||invariant(),G.prototype.divide.call(this,this.decimalScale).toFixed(K,ne,ue)},K.toExact=function toExact(G){return void 0===G&&(G={groupSeparator:""}),YX.DP=this.currency.decimals,new YX(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(G)},_createClass$1(CurrencyAmount,[{key:"wrapped",get:function get(){return this.currency.isToken?this:CurrencyAmount.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),CurrencyAmount}(ZX),tQ=new ZX(oV.BigInt(100));function toPercent(G){return new rQ(G.numerator,G.denominator)}var rQ=function(G){function Percent(){var K;return(K=G.apply(this,arguments)||this).isPercent=!0,K}_inheritsLoose$1(Percent,G);var K=Percent.prototype;return K.add=function add(K){return toPercent(G.prototype.add.call(this,K))},K.subtract=function subtract(K){return toPercent(G.prototype.subtract.call(this,K))},K.multiply=function multiply(K){return toPercent(G.prototype.multiply.call(this,K))},K.divide=function divide(K){return toPercent(G.prototype.divide.call(this,K))},K.toSignificant=function toSignificant(K,ne,ue){return void 0===K&&(K=5),G.prototype.multiply.call(this,tQ).toSignificant(K,ne,ue)},K.toFixed=function toFixed(K,ne,ue){return void 0===K&&(K=2),G.prototype.multiply.call(this,tQ).toFixed(K,ne,ue)},Percent}(ZX),nQ=function(G){function Price(){for(var K,ne,ue,pe,he,ye=arguments.length,me=new Array(ye),be=0;be<ye;be++)me[be]=arguments[be];if(4===me.length)ne=me[0],ue=me[1],pe=me[2],he=me[3];else{var ve=me[0].quoteAmount.divide(me[0].baseAmount),_e=[me[0].baseAmount.currency,me[0].quoteAmount.currency,ve.denominator,ve.numerator];ne=_e[0],ue=_e[1],pe=_e[2],he=_e[3]}return(K=G.call(this,he,pe)||this).baseCurrency=ne,K.quoteCurrency=ue,K.scalar=new ZX(oV.exponentiate(oV.BigInt(10),oV.BigInt(ne.decimals)),oV.exponentiate(oV.BigInt(10),oV.BigInt(ue.decimals))),K}_inheritsLoose$1(Price,G);var K=Price.prototype;return K.invert=function invert(){return new Price(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},K.multiply=function multiply(K){this.quoteCurrency.equals(K.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return new Price(this.baseCurrency,K.quoteCurrency,ne.denominator,ne.numerator)},K.quote=function quote(K){K.currency.equals(this.baseCurrency)||invariant();var ne=G.prototype.multiply.call(this,K);return eQ.fromFractionalAmount(this.quoteCurrency,ne.numerator,ne.denominator)},K.toSignificant=function toSignificant(G,K,ne){return void 0===G&&(G=6),this.adjustedForDecimals.toSignificant(G,K,ne)},K.toFixed=function toFixed(G,K,ne){return void 0===G&&(G=4),this.adjustedForDecimals.toFixed(G,K,ne)},_createClass$1(Price,[{key:"adjustedForDecimals",get:function get(){return G.prototype.multiply.call(this,this.scalar)}}]),Price}(ZX),aQ=function BaseCurrency(G,K,ne,ue){Number.isSafeInteger(G)||invariant(),K>=0&&K<255&&Number.isInteger(K)||invariant(),this.chainId=G,this.decimals=K,this.symbol=ne,this.name=ue};function validateAndParseAddress(G){try{return getAddress$2(G)}catch(K){throw new Error(G+" is not a valid address.")}}var iQ=/^0x[0-9a-fA-F]{40}$/;var sQ,oQ=function(G){function Token(K,ne,ue,pe,he,ye){var me;return(me=G.call(this,K,ue,pe,he)||this).isNative=!1,me.isToken=!0,me.address=ye?function checkValidAddress(G){if(iQ.test(G))return G;throw new Error(G+" is not a valid address.")}(ne):validateAndParseAddress(ne),me}_inheritsLoose$1(Token,G);var K=Token.prototype;return K.equals=function equals(G){return G.isToken&&this.chainId===G.chainId&&this.address.toLowerCase()===G.address.toLowerCase()},K.sortsBefore=function sortsBefore(G){return this.chainId!==G.chainId&&invariant(),this.address.toLowerCase()===G.address.toLowerCase()&&invariant(),this.address.toLowerCase()<G.address.toLowerCase()},_createClass$1(Token,[{key:"wrapped",get:function get(){return this}}]),Token}(aQ);function sortedInsert(G,K,ne,ue){if(ne>0||invariant(),G.length<=ne||invariant(),0===G.length)return G.push(K),null;var pe=G.length===ne;if(pe&&ue(G[G.length-1],K)<=0)return K;for(var he=0,ye=G.length;he<ye;){var me=he+ye>>>1;ue(G[me],K)<=0?he=me+1:ye=me}return G.splice(he,0,K),pe?G.pop():null}(sQ={})[1]=new oQ(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),sQ[3]=new oQ(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),sQ[4]=new oQ(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),sQ[5]=new oQ(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),sQ[42]=new oQ(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),sQ[10]=new oQ(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),sQ[69]=new oQ(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),sQ[42161]=new oQ(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),sQ[421611]=new oQ(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether");var cQ=oV.BigInt(Number.MAX_SAFE_INTEGER),dQ=oV.BigInt(0),uQ=oV.BigInt(1),fQ=oV.BigInt(2);function sqrt(G){if(oV.greaterThanOrEqual(G,dQ)||invariant(),oV.lessThan(G,cQ))return oV.BigInt(Math.floor(Math.sqrt(oV.toNumber(G))));var K,ne;for(K=G,ne=oV.add(oV.divide(G,fQ),uQ);oV.lessThan(ne,K);)K=ne,ne=oV.divide(oV.add(oV.divide(G,ne),ne),fQ);return K}var lQ="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",pQ="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",hQ=oV.BigInt(1e3),yQ=oV.BigInt(0),mQ=oV.BigInt(1),bQ=oV.BigInt(5),gQ=oV.BigInt(997),vQ=oV.BigInt(1e3);function _createClass(G,K,ne){return K&&function _defineProperties(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function _inheritsLoose(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,G.__proto__=K}function _getPrototypeOf(G){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(G){return G.__proto__||Object.getPrototypeOf(G)},_getPrototypeOf(G)}function _setPrototypeOf(G,K){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(G,K){return G.__proto__=K,G},_setPrototypeOf(G,K)}function _construct(G,K,ne){return _construct=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(G){return!1}}()?Reflect.construct:function _construct(G,K,ne){var ue=[null];ue.push.apply(ue,K);var pe=new(Function.bind.apply(G,ue));return ne&&_setPrototypeOf(pe,ne.prototype),pe},_construct.apply(null,arguments)}function _wrapNativeSuper(G){var K="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(G){if(null===G||!function _isNativeFunction(G){return-1!==Function.toString.call(G).indexOf("[native code]")}(G))return G;if("function"!=typeof G)throw new TypeError("Super expression must either be null or a function");if(void 0!==K){if(K.has(G))return K.get(G);K.set(G,Wrapper)}function Wrapper(){return _construct(G,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(G.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,G)},_wrapNativeSuper(G)}function _assertThisInitialized(G){if(void 0===G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return G}function _arrayLikeToArray(G,K){(null==K||K>G.length)&&(K=G.length);for(var ne=0,ue=new Array(K);ne<K;ne++)ue[ne]=G[ne];return ue}function _createForOfIteratorHelperLoose(G,K){var ne;if("undefined"==typeof Symbol||null==G[Symbol.iterator]){if(Array.isArray(G)||(ne=function _unsupportedIterableToArray(G,K){if(G){if("string"==typeof G)return _arrayLikeToArray(G,K);var ne=Object.prototype.toString.call(G).slice(8,-1);return"Object"===ne&&G.constructor&&(ne=G.constructor.name),"Map"===ne||"Set"===ne?Array.from(G):"Arguments"===ne||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?_arrayLikeToArray(G,K):void 0}}(G))||K){ne&&(G=ne);var ue=0;return function(){return ue>=G.length?{done:!0}:{done:!1,value:G[ue++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(ne=G[Symbol.iterator]()).next.bind(ne)}var wQ="setPrototypeOf"in Object,_Q=function(G){function InsufficientReservesError(){var K;return(K=G.call(this)||this).isInsufficientReservesError=!0,K.name=K.constructor.name,wQ&&Object.setPrototypeOf(_assertThisInitialized(K),(this instanceof InsufficientReservesError?this.constructor:void 0).prototype),K}return _inheritsLoose(InsufficientReservesError,G),InsufficientReservesError}(_wrapNativeSuper(Error)),TQ=function(G){function InsufficientInputAmountError(){var K;return(K=G.call(this)||this).isInsufficientInputAmountError=!0,K.name=K.constructor.name,wQ&&Object.setPrototypeOf(_assertThisInitialized(K),(this instanceof InsufficientInputAmountError?this.constructor:void 0).prototype),K}return _inheritsLoose(InsufficientInputAmountError,G),InsufficientInputAmountError}(_wrapNativeSuper(Error)),AQ=function computePairAddress(G){var K=G.factoryAddress,ne=G.tokenA,ue=G.tokenB,pe=ne.sortsBefore(ue)?[ne,ue]:[ue,ne],he=pe[1];return getCreate2Address(K,keccak256$2(["bytes"],[pack$2(["address","address"],[pe[0].address,he.address])]),pQ)},EQ=function(){function Pair(G,K){var ne=G.currency.sortsBefore(K.currency)?[G,K]:[K,G];this.liquidityToken=new oQ(ne[0].currency.chainId,Pair.getAddress(ne[0].currency,ne[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=ne}Pair.getAddress=function getAddress(G,K){return AQ({factoryAddress:lQ,tokenA:G,tokenB:K})};var G=Pair.prototype;return G.involvesToken=function involvesToken(G){return G.equals(this.token0)||G.equals(this.token1)},G.priceOf=function priceOf(G){return this.involvesToken(G)||invariant(),G.equals(this.token0)?this.token0Price:this.token1Price},G.reserveOf=function reserveOf(G){return this.involvesToken(G)||invariant(),G.equals(this.token0)?this.reserve0:this.reserve1},G.getOutputAmount=function getOutputAmount(G){if(this.involvesToken(G.currency)||invariant(),oV.equal(this.reserve0.quotient,yQ)||oV.equal(this.reserve1.quotient,yQ))throw new _Q;var K=this.reserveOf(G.currency),ne=this.reserveOf(G.currency.equals(this.token0)?this.token1:this.token0),ue=oV.multiply(G.quotient,gQ),pe=oV.multiply(ue,ne.quotient),he=oV.add(oV.multiply(K.quotient,vQ),ue),ye=eQ.fromRawAmount(G.currency.equals(this.token0)?this.token1:this.token0,oV.divide(pe,he));if(oV.equal(ye.quotient,yQ))throw new TQ;return[ye,new Pair(K.add(G),ne.subtract(ye))]},G.getInputAmount=function getInputAmount(G){if(this.involvesToken(G.currency)||invariant(),oV.equal(this.reserve0.quotient,yQ)||oV.equal(this.reserve1.quotient,yQ)||oV.greaterThanOrEqual(G.quotient,this.reserveOf(G.currency).quotient))throw new _Q;var K=this.reserveOf(G.currency),ne=this.reserveOf(G.currency.equals(this.token0)?this.token1:this.token0),ue=oV.multiply(oV.multiply(ne.quotient,G.quotient),vQ),pe=oV.multiply(oV.subtract(K.quotient,G.quotient),gQ),he=eQ.fromRawAmount(G.currency.equals(this.token0)?this.token1:this.token0,oV.add(oV.divide(ue,pe),mQ));return[he,new Pair(ne.add(he),K.subtract(G))]},G.getLiquidityMinted=function getLiquidityMinted(G,K,ne){G.currency.equals(this.liquidityToken)||invariant();var ue,pe=K.currency.sortsBefore(ne.currency)?[K,ne]:[ne,K];if(pe[0].currency.equals(this.token0)&&pe[1].currency.equals(this.token1)||invariant(),oV.equal(G.quotient,yQ))ue=oV.subtract(sqrt(oV.multiply(pe[0].quotient,pe[1].quotient)),hQ);else{var he=oV.divide(oV.multiply(pe[0].quotient,G.quotient),this.reserve0.quotient),ye=oV.divide(oV.multiply(pe[1].quotient,G.quotient),this.reserve1.quotient);ue=oV.lessThanOrEqual(he,ye)?he:ye}if(!oV.greaterThan(ue,yQ))throw new TQ;return eQ.fromRawAmount(this.liquidityToken,ue)},G.getLiquidityValue=function getLiquidityValue(G,K,ne,ue,pe){var he;if(void 0===ue&&(ue=!1),this.involvesToken(G)||invariant(),K.currency.equals(this.liquidityToken)||invariant(),ne.currency.equals(this.liquidityToken)||invariant(),oV.lessThanOrEqual(ne.quotient,K.quotient)||invariant(),ue){pe||invariant();var ye=oV.BigInt(pe);if(oV.equal(ye,yQ))he=K;else{var me=sqrt(oV.multiply(this.reserve0.quotient,this.reserve1.quotient)),be=sqrt(ye);if(oV.greaterThan(me,be)){var ve=oV.multiply(K.quotient,oV.subtract(me,be)),_e=oV.add(oV.multiply(me,bQ),be),Te=oV.divide(ve,_e);he=K.add(eQ.fromRawAmount(this.liquidityToken,Te))}else he=K}}else he=K;return eQ.fromRawAmount(G,oV.divide(oV.multiply(ne.quotient,this.reserveOf(G).quotient),he.quotient))},_createClass(Pair,[{key:"token0Price",get:function get(){var G=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new nQ(this.token0,this.token1,G.denominator,G.numerator)}},{key:"token1Price",get:function get(){var G=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new nQ(this.token1,this.token0,G.denominator,G.numerator)}},{key:"chainId",get:function get(){return this.token0.chainId}},{key:"token0",get:function get(){return this.tokenAmounts[0].currency}},{key:"token1",get:function get(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function get(){return this.tokenAmounts[0]}},{key:"reserve1",get:function get(){return this.tokenAmounts[1]}}]),Pair}(),PQ=function(){function Route(G,K,ne){this._midPrice=null,G.length>0||invariant();var ue=G[0].chainId;G.every((function(G){return G.chainId===ue}))||invariant();var pe=K.wrapped;G[0].involvesToken(pe)||invariant(),void 0===ne||G[G.length-1].involvesToken(ne.wrapped)||invariant();for(var he,ye=[pe],me=_createForOfIteratorHelperLoose(G.entries());!(he=me()).done;){var be=he.value,ve=be[0],_e=be[1],Te=ye[ve];Te.equals(_e.token0)||Te.equals(_e.token1)||invariant();var Ee=Te.equals(_e.token0)?_e.token1:_e.token0;ye.push(Ee)}this.pairs=G,this.path=ye,this.input=K,this.output=ne}return _createClass(Route,[{key:"midPrice",get:function get(){if(null!==this._midPrice)return this._midPrice;for(var G,K=[],ne=_createForOfIteratorHelperLoose(this.pairs.entries());!(G=ne()).done;){var ue=G.value,pe=ue[0],he=ue[1];K.push(this.path[pe].equals(he.token0)?new nQ(he.reserve0.currency,he.reserve1.currency,he.reserve0.quotient,he.reserve1.quotient):new nQ(he.reserve1.currency,he.reserve0.currency,he.reserve1.quotient,he.reserve0.quotient))}var ye=K.slice(1).reduce((function(G,K){return G.multiply(K)}),K[0]);return this._midPrice=new nQ(this.input,this.output,ye.denominator,ye.numerator)}},{key:"chainId",get:function get(){return this.pairs[0].chainId}}]),Route}();function inputOutputComparator(G,K){return G.inputAmount.currency.equals(K.inputAmount.currency)||invariant(),G.outputAmount.currency.equals(K.outputAmount.currency)||invariant(),G.outputAmount.equalTo(K.outputAmount)?G.inputAmount.equalTo(K.inputAmount)?0:G.inputAmount.lessThan(K.inputAmount)?-1:1:G.outputAmount.lessThan(K.outputAmount)?1:-1}function tradeComparator(G,K){var ne=inputOutputComparator(G,K);return 0!==ne?ne:G.priceImpact.lessThan(K.priceImpact)?-1:G.priceImpact.greaterThan(K.priceImpact)?1:G.route.path.length-K.route.path.length}var SQ=function(){function Trade(G,K,ne){this.route=G,this.tradeType=ne;var ue=new Array(G.path.length);if(ne===FX.EXACT_INPUT){K.currency.equals(G.input)||invariant(),ue[0]=K.wrapped;for(var pe=0;pe<G.path.length-1;pe++){var he=G.pairs[pe].getOutputAmount(ue[pe])[0];ue[pe+1]=he}this.inputAmount=eQ.fromFractionalAmount(G.input,K.numerator,K.denominator),this.outputAmount=eQ.fromFractionalAmount(G.output,ue[ue.length-1].numerator,ue[ue.length-1].denominator)}else{K.currency.equals(G.output)||invariant(),ue[ue.length-1]=K.wrapped;for(var ye=G.path.length-1;ye>0;ye--){var me=G.pairs[ye-1].getInputAmount(ue[ye])[0];ue[ye-1]=me}this.inputAmount=eQ.fromFractionalAmount(G.input,ue[0].numerator,ue[0].denominator),this.outputAmount=eQ.fromFractionalAmount(G.output,K.numerator,K.denominator)}this.executionPrice=new nQ(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=function computePriceImpact(G,K,ne){var ue=G.quote(K),pe=ue.subtract(ne).divide(ue);return new rQ(pe.numerator,pe.denominator)}(G.midPrice,this.inputAmount,this.outputAmount)}Trade.exactIn=function exactIn(G,K){return new Trade(G,K,FX.EXACT_INPUT)},Trade.exactOut=function exactOut(G,K){return new Trade(G,K,FX.EXACT_OUTPUT)};var G=Trade.prototype;return G.minimumAmountOut=function minimumAmountOut(G){if(G.lessThan(yQ)&&invariant(),this.tradeType===FX.EXACT_OUTPUT)return this.outputAmount;var K=new ZX(mQ).add(G).invert().multiply(this.outputAmount.quotient).quotient;return eQ.fromRawAmount(this.outputAmount.currency,K)},G.maximumAmountIn=function maximumAmountIn(G){if(G.lessThan(yQ)&&invariant(),this.tradeType===FX.EXACT_INPUT)return this.inputAmount;var K=new ZX(mQ).add(G).multiply(this.inputAmount.quotient).quotient;return eQ.fromRawAmount(this.inputAmount.currency,K)},Trade.bestTradeExactIn=function bestTradeExactIn(G,K,ne,ue,pe,he,ye){var me=void 0===ue?{}:ue,be=me.maxNumResults,ve=void 0===be?3:be,_e=me.maxHops,Te=void 0===_e?3:_e;void 0===pe&&(pe=[]),void 0===he&&(he=K),void 0===ye&&(ye=[]),G.length>0||invariant(),Te>0||invariant(),K===he||pe.length>0||invariant();for(var Ee=he.wrapped,Pe=ne.wrapped,Se=0;Se<G.length;Se++){var Ce=G[Se];if((Ce.token0.equals(Ee.currency)||Ce.token1.equals(Ee.currency))&&(!Ce.reserve0.equalTo(yQ)&&!Ce.reserve1.equalTo(yQ))){var ke=void 0;try{ke=Ce.getOutputAmount(Ee)[0]}catch(G){if(G.isInsufficientInputAmountError)continue;throw G}if(ke.currency.equals(Pe))sortedInsert(ye,new Trade(new PQ([].concat(pe,[Ce]),K.currency,ne),K,FX.EXACT_INPUT),ve,tradeComparator);else if(Te>1&&G.length>1){var Oe=G.slice(0,Se).concat(G.slice(Se+1,G.length));Trade.bestTradeExactIn(Oe,K,ne,{maxNumResults:ve,maxHops:Te-1},[].concat(pe,[Ce]),ke,ye)}}}return ye},G.worstExecutionPrice=function worstExecutionPrice(G){return new nQ(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(G).quotient,this.minimumAmountOut(G).quotient)},Trade.bestTradeExactOut=function bestTradeExactOut(G,K,ne,ue,pe,he,ye){var me=void 0===ue?{}:ue,be=me.maxNumResults,ve=void 0===be?3:be,_e=me.maxHops,Te=void 0===_e?3:_e;void 0===pe&&(pe=[]),void 0===he&&(he=ne),void 0===ye&&(ye=[]),G.length>0||invariant(),Te>0||invariant(),ne===he||pe.length>0||invariant();for(var Ee=he.wrapped,Pe=K.wrapped,Se=0;Se<G.length;Se++){var Ce=G[Se];if((Ce.token0.equals(Ee.currency)||Ce.token1.equals(Ee.currency))&&(!Ce.reserve0.equalTo(yQ)&&!Ce.reserve1.equalTo(yQ))){var ke=void 0;try{ke=Ce.getInputAmount(Ee)[0]}catch(G){if(G.isInsufficientReservesError)continue;throw G}if(ke.currency.equals(Pe))sortedInsert(ye,new Trade(new PQ([Ce].concat(pe),K,ne.currency),ne,FX.EXACT_OUTPUT),ve,tradeComparator);else if(Te>1&&G.length>1){var Oe=G.slice(0,Se).concat(G.slice(Se+1,G.length));Trade.bestTradeExactOut(Oe,K,ne,{maxNumResults:ve,maxHops:Te-1},[Ce].concat(pe),ke,ye)}}}return ye},Trade}();function toHex(G){return"0x"+G.quotient.toString(16)}var IQ,CQ="0x0",RQ=function(){function Router(){}return Router.swapCallParameters=function swapCallParameters(G,K){var ne=G.inputAmount.currency.isNative,ue=G.outputAmount.currency.isNative;ne&&ue&&invariant(),!("ttl"in K)||K.ttl>0||invariant();var pe,he,ye,me=validateAndParseAddress(K.recipient),be=toHex(G.maximumAmountIn(K.allowedSlippage)),ve=toHex(G.minimumAmountOut(K.allowedSlippage)),_e=G.route.path.map((function(G){return G.address})),Te="ttl"in K?"0x"+(Math.floor((new Date).getTime()/1e3)+K.ttl).toString(16):"0x"+K.deadline.toString(16),Ee=Boolean(K.feeOnTransfer);switch(G.tradeType){case FX.EXACT_INPUT:ne?(pe=Ee?"swapExactETHForTokensSupportingFeeOnTransferTokens":"swapExactETHForTokens",he=[ve,_e,me,Te],ye=be):ue?(pe=Ee?"swapExactTokensForETHSupportingFeeOnTransferTokens":"swapExactTokensForETH",he=[be,ve,_e,me,Te],ye=CQ):(pe=Ee?"swapExactTokensForTokensSupportingFeeOnTransferTokens":"swapExactTokensForTokens",he=[be,ve,_e,me,Te],ye=CQ);break;case FX.EXACT_OUTPUT:Ee&&invariant(),ne?(pe="swapETHForExactTokens",he=[ve,_e,me,Te],ye=be):ue?(pe="swapTokensForExactETH",he=[ve,be,_e,me,Te],ye=CQ):(pe="swapTokensForExactTokens",he=[ve,be,_e,me,Te],ye=CQ)}return{methodName:pe,args:he,value:ye}},Router}(),kQ=getAugmentedNamespace$1(Object.freeze({__proto__:null,FACTORY_ADDRESS:lQ,INIT_CODE_HASH:pQ,InsufficientInputAmountError:TQ,InsufficientReservesError:_Q,MINIMUM_LIQUIDITY:hQ,Pair:EQ,Route:PQ,Router:RQ,Trade:SQ,computePairAddress:AQ,inputOutputComparator:inputOutputComparator,tradeComparator:tradeComparator})),OQ=getAugmentedNamespace$1(af);pJ.exports=function requireRouterSdk_cjs_production_min(){return IQ||(IQ=1,function(G){function t(G){return G&&"object"==typeof G&&"default"in G?G.default:G}Object.defineProperty(G,"__esModule",{value:!0});var K,ne=t(sV),ue=yJ,pe=t(function requireTinyInvariant_cjs(){return fJ?uJ:(fJ=1,uJ=function invariant(G,K){if(!G)throw new Error("Invariant failed")})}()),he=bJ,ye=gJ,me=vJ,be=NX,ve=MX,_e=BX,Te=kQ,Ee=OQ,Pe="0x0000000000000000000000000000000000000001",Se="0x0000000000000000000000000000000000000002",Ce=ne.BigInt(0),ke=ne.BigInt(1);function A(G){return Object.keys(G).some((function(G){return"recipient"===G}))}(K=G.ApprovalTypes||(G.ApprovalTypes={}))[K.NOT_REQUIRED=0]="NOT_REQUIRED",K[K.MAX=1]="MAX",K[K.MAX_MINUS_ONE=2]="MAX_MINUS_ONE",K[K.ZERO_THEN_MAX=3]="ZERO_THEN_MAX",K[K.ZERO_THEN_MAX_MINUS_ONE=4]="ZERO_THEN_MAX_MINUS_ONE";var Oe=function(){function t(){}return t.encodeApproveMax=function(G){return t.INTERFACE.encodeFunctionData("approveMax",[G.address])},t.encodeApproveMaxMinusOne=function(G){return t.INTERFACE.encodeFunctionData("approveMaxMinusOne",[G.address])},t.encodeApproveZeroThenMax=function(G){return t.INTERFACE.encodeFunctionData("approveZeroThenMax",[G.address])},t.encodeApproveZeroThenMaxMinusOne=function(G){return t.INTERFACE.encodeFunctionData("approveZeroThenMaxMinusOne",[G.address])},t.encodeCallPositionManager=function(G){if(G.length>0||pe(!1),1==G.length)return t.INTERFACE.encodeFunctionData("callPositionManager",G);var K=ye.NonfungiblePositionManager.INTERFACE.encodeFunctionData("multicall",[G]);return t.INTERFACE.encodeFunctionData("callPositionManager",[K])},t.encodeAddLiquidity=function(G,K,ue,pe){var he=G.mintAmountsWithSlippage(pe),me=he.amount0,be=he.amount1;return ne.lessThan(K.amount0.quotient,me)&&(me=K.amount0.quotient),ne.lessThan(K.amount1.quotient,be)&&(be=K.amount1.quotient),A(ue)?t.INTERFACE.encodeFunctionData("mint",[{token0:G.pool.token0.address,token1:G.pool.token1.address,fee:G.pool.fee,tickLower:G.tickLower,tickUpper:G.tickUpper,amount0Min:ye.toHex(me),amount1Min:ye.toHex(be),recipient:ue.recipient}]):t.INTERFACE.encodeFunctionData("increaseLiquidity",[{token0:G.pool.token0.address,token1:G.pool.token1.address,amount0Min:ye.toHex(me),amount1Min:ye.toHex(be),tokenId:ye.toHex(ue.tokenId)}])},t.encodeApprove=function(K,ne){switch(ne){case G.ApprovalTypes.MAX:return t.encodeApproveMax(K.wrapped);case G.ApprovalTypes.MAX_MINUS_ONE:return t.encodeApproveMaxMinusOne(K.wrapped);case G.ApprovalTypes.ZERO_THEN_MAX:return t.encodeApproveZeroThenMax(K.wrapped);case G.ApprovalTypes.ZERO_THEN_MAX_MINUS_ONE:return t.encodeApproveZeroThenMaxMinusOne(K.wrapped);default:throw"Error: invalid ApprovalType"}},t}();Oe.INTERFACE=new ue.Interface(he.abi);var xe=function(){function t(){}return t.encodeMulticall=function(G,K){if(void 0===K)return ye.Multicall.encodeMulticall(G);if(Array.isArray(G)||(G=[G]),"string"==typeof K&&K.startsWith("0x")){var ne=function(G){if(!G.match(/^0x[0-9a-fA-F]{64}$/))throw new Error(G+" is not valid bytes32.");return G.toLowerCase()}(K);return t.INTERFACE.encodeFunctionData("multicall(bytes32,bytes[])",[ne,G])}var ue=ye.toHex(K);return t.INTERFACE.encodeFunctionData("multicall(uint256,bytes[])",[ue,G])},t}();function w(G){return ye.toHex(G.multiply(1e4).quotient)}xe.INTERFACE=new ue.Interface(me.abi);var Ne=function(){function t(){}return t.encodeUnwrapWETH9=function(G,K,ne){if("string"==typeof K)return ye.Payments.encodeUnwrapWETH9(G,K,ne);if(ne){var ue=w(ne.fee),pe=be.validateAndParseAddress(ne.recipient);return t.INTERFACE.encodeFunctionData("unwrapWETH9WithFee(uint256,uint256,address)",[ye.toHex(G),ue,pe])}return t.INTERFACE.encodeFunctionData("unwrapWETH9(uint256)",[ye.toHex(G)])},t.encodeSweepToken=function(G,K,ne,ue){if("string"==typeof ne)return ye.Payments.encodeSweepToken(G,K,ne,ue);if(ue){var pe=w(ue.fee),he=be.validateAndParseAddress(ue.recipient);return t.INTERFACE.encodeFunctionData("sweepTokenWithFee(address,uint256,uint256,address)",[G.address,ye.toHex(K),pe,he])}return t.INTERFACE.encodeFunctionData("sweepToken(address,uint256)",[G.address,ye.toHex(K)])},t.encodePull=function(G,K){return t.INTERFACE.encodeFunctionData("pull",[G.address,ye.toHex(K)])},t.encodeWrapETH=function(G){return t.INTERFACE.encodeFunctionData("wrapETH",[ye.toHex(G)])},t}();function E(G,K,ne,ue,pe,he,ye){try{var me=G[he](ye),be=me.value}catch(G){return void ne(G)}me.done?K(be):Promise.resolve(be).then(ue,pe)}function k(G){return function(){var K=this,ne=arguments;return new Promise((function(ue,pe){var he=G.apply(K,ne);function i(G){E(he,ue,pe,i,a,"next",G)}function a(G){E(he,ue,pe,i,a,"throw",G)}i(void 0)}))}}function I(G,K,ne){return K&&function g(G,K){for(var ne=0;ne<K.length;ne++){var ue=K[ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(G,ue.key,ue)}}(G.prototype,K),G}function P(){return(P=Object.assign||function(G){for(var K=1;K<arguments.length;K++){var ne=arguments[K];for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(G[ue]=ne[ue])}return G}).apply(this,arguments)}function R(G,K){G.prototype=Object.create(K.prototype),G.prototype.constructor=G,(Object.setPrototypeOf||function(G,K){return G.__proto__=K,G})(G,K)}function _(G,K){(null==K||K>G.length)&&(K=G.length);for(var ne=0,ue=new Array(K);ne<K;ne++)ue[ne]=G[ne];return ue}function b(G,K){var ne="undefined"!=typeof Symbol&&G[Symbol.iterator]||G["@@iterator"];if(ne)return(ne=ne.call(G)).next.bind(ne);if(Array.isArray(G)||(ne=function(G,K){if(G){if("string"==typeof G)return _(G,void 0);var ne=Object.prototype.toString.call(G).slice(8,-1);return"Object"===ne&&G.constructor&&(ne=G.constructor.name),"Map"===ne||"Set"===ne?Array.from(G):"Arguments"===ne||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?_(G,void 0):void 0}}(G))||K){ne&&(G=ne);var ue=0;return function(){return ue>=G.length?{done:!0}:{done:!1,value:G[ue++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Ne.INTERFACE=new ue.Interface(ve.abi);var Me,Be=(function(G){var K=function(G){var K=Object.prototype,ne=K.hasOwnProperty,ue="function"==typeof Symbol?Symbol:{},pe=ue.iterator||"@@iterator",he=ue.asyncIterator||"@@asyncIterator",ye=ue.toStringTag||"@@toStringTag";function a(G,K,ne){return Object.defineProperty(G,K,{value:ne,enumerable:!0,configurable:!0,writable:!0}),G[K]}try{a({},"")}catch(G){a=function(G,K,ne){return G[K]=ne}}function c(G,K,ne,ue){var pe=Object.create((K&&K.prototype instanceof d?K:d).prototype),he=new k(ue||[]);return pe._invoke=function(G,K,ne){var ue="suspendedStart";return function(pe,he){if("executing"===ue)throw new Error("Generator is already running");if("completed"===ue){if("throw"===pe)throw he;return{value:void 0,done:!0}}for(ne.method=pe,ne.arg=he;;){var ye=ne.delegate;if(ye){var be=w(ye,ne);if(be){if(be===me)continue;return be}}if("next"===ne.method)ne.sent=ne._sent=ne.arg;else if("throw"===ne.method){if("suspendedStart"===ue)throw ue="completed",ne.arg;ne.dispatchException(ne.arg)}else"return"===ne.method&&ne.abrupt("return",ne.arg);ue="executing";var ve=s(G,K,ne);if("normal"===ve.type){if(ue=ne.done?"completed":"suspendedYield",ve.arg===me)continue;return{value:ve.arg,done:ne.done}}"throw"===ve.type&&(ue="completed",ne.method="throw",ne.arg=ve.arg)}}}(G,ne,he),pe}function s(G,K,ne){try{return{type:"normal",arg:G.call(K,ne)}}catch(G){return{type:"throw",arg:G}}}G.wrap=c;var me={};function d(){}function l(){}function m(){}var be={};a(be,pe,(function(){return this}));var ve=Object.getPrototypeOf,_e=ve&&ve(ve(g([])));_e&&_e!==K&&ne.call(_e,pe)&&(be=_e);var Te=m.prototype=d.prototype=Object.create(be);function y(G){["next","throw","return"].forEach((function(K){a(G,K,(function(G){return this._invoke(K,G)}))}))}function T(G,K){var ue;this._invoke=function(pe,he){function i(){return new K((function(ue,ye){!function r(ue,pe,he,ye){var me=s(G[ue],G,pe);if("throw"!==me.type){var be=me.arg,ve=be.value;return ve&&"object"==typeof ve&&ne.call(ve,"__await")?K.resolve(ve.__await).then((function(G){r("next",G,he,ye)}),(function(G){r("throw",G,he,ye)})):K.resolve(ve).then((function(G){be.value=G,he(be)}),(function(G){return r("throw",G,he,ye)}))}ye(me.arg)}(pe,he,ue,ye)}))}return ue=ue?ue.then(i,i):i()}}function w(G,K){var ne=G.iterator[K.method];if(void 0===ne){if(K.delegate=null,"throw"===K.method){if(G.iterator.return&&(K.method="return",K.arg=void 0,w(G,K),"throw"===K.method))return me;K.method="throw",K.arg=new TypeError("The iterator does not provide a 'throw' method")}return me}var ue=s(ne,G.iterator,K.arg);if("throw"===ue.type)return K.method="throw",K.arg=ue.arg,K.delegate=null,me;var pe=ue.arg;return pe?pe.done?(K[G.resultName]=pe.value,K.next=G.nextLoc,"return"!==K.method&&(K.method="next",K.arg=void 0),K.delegate=null,me):pe:(K.method="throw",K.arg=new TypeError("iterator result is not an object"),K.delegate=null,me)}function x(G){var K={tryLoc:G[0]};1 in G&&(K.catchLoc=G[1]),2 in G&&(K.finallyLoc=G[2],K.afterLoc=G[3]),this.tryEntries.push(K)}function E(G){var K=G.completion||{};K.type="normal",delete K.arg,G.completion=K}function k(G){this.tryEntries=[{tryLoc:"root"}],G.forEach(x,this),this.reset(!0)}function g(G){if(G){var K=G[pe];if(K)return K.call(G);if("function"==typeof G.next)return G;if(!isNaN(G.length)){var ue=-1,he=function e(){for(;++ue<G.length;)if(ne.call(G,ue))return e.value=G[ue],e.done=!1,e;return e.value=void 0,e.done=!0,e};return he.next=he}}return{next:I}}function I(){return{value:void 0,done:!0}}return l.prototype=m,a(Te,"constructor",m),a(m,"constructor",l),l.displayName=a(m,ye,"GeneratorFunction"),G.isGeneratorFunction=function(G){var K="function"==typeof G&&G.constructor;return!!K&&(K===l||"GeneratorFunction"===(K.displayName||K.name))},G.mark=function(G){return Object.setPrototypeOf?Object.setPrototypeOf(G,m):(G.__proto__=m,a(G,ye,"GeneratorFunction")),G.prototype=Object.create(Te),G},G.awrap=function(G){return{__await:G}},y(T.prototype),a(T.prototype,he,(function(){return this})),G.AsyncIterator=T,G.async=function(K,ne,ue,pe,he){void 0===he&&(he=Promise);var ye=new T(c(K,ne,ue,pe),he);return G.isGeneratorFunction(ne)?ye:ye.next().then((function(G){return G.done?G.value:ye.next()}))},y(Te),a(Te,ye,"Generator"),a(Te,pe,(function(){return this})),a(Te,"toString",(function(){return"[object Generator]"})),G.keys=function(G){var K=[];for(var ne in G)K.push(ne);return K.reverse(),function n(){for(;K.length;){var ne=K.pop();if(ne in G)return n.value=ne,n.done=!1,n}return n.done=!0,n}},G.values=g,k.prototype={constructor:k,reset:function(G){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!G)for(var K in this)"t"===K.charAt(0)&&ne.call(this,K)&&!isNaN(+K.slice(1))&&(this[K]=void 0)},stop:function(){this.done=!0;var G=this.tryEntries[0].completion;if("throw"===G.type)throw G.arg;return this.rval},dispatchException:function(G){if(this.done)throw G;var K=this;function r(ne,ue){return he.type="throw",he.arg=G,K.next=ne,ue&&(K.method="next",K.arg=void 0),!!ue}for(var ue=this.tryEntries.length-1;ue>=0;--ue){var pe=this.tryEntries[ue],he=pe.completion;if("root"===pe.tryLoc)return r("end");if(pe.tryLoc<=this.prev){var ye=ne.call(pe,"catchLoc"),me=ne.call(pe,"finallyLoc");if(ye&&me){if(this.prev<pe.catchLoc)return r(pe.catchLoc,!0);if(this.prev<pe.finallyLoc)return r(pe.finallyLoc)}else if(ye){if(this.prev<pe.catchLoc)return r(pe.catchLoc,!0)}else{if(!me)throw new Error("try statement without catch or finally");if(this.prev<pe.finallyLoc)return r(pe.finallyLoc)}}}},abrupt:function(G,K){for(var ue=this.tryEntries.length-1;ue>=0;--ue){var pe=this.tryEntries[ue];if(pe.tryLoc<=this.prev&&ne.call(pe,"finallyLoc")&&this.prev<pe.finallyLoc){var he=pe;break}}he&&("break"===G||"continue"===G)&&he.tryLoc<=K&&K<=he.finallyLoc&&(he=null);var ye=he?he.completion:{};return ye.type=G,ye.arg=K,he?(this.method="next",this.next=he.finallyLoc,me):this.complete(ye)},complete:function(G,K){if("throw"===G.type)throw G.arg;return"break"===G.type||"continue"===G.type?this.next=G.arg:"return"===G.type?(this.rval=this.arg=G.arg,this.method="return",this.next="end"):"normal"===G.type&&K&&(this.next=K),me},finish:function(G){for(var K=this.tryEntries.length-1;K>=0;--K){var ne=this.tryEntries[K];if(ne.finallyLoc===G)return this.complete(ne.completion,ne.afterLoc),E(ne),me}},catch:function(G){for(var K=this.tryEntries.length-1;K>=0;--K){var ne=this.tryEntries[K];if(ne.tryLoc===G){var ue=ne.completion;if("throw"===ue.type){var pe=ue.arg;E(ne)}return pe}}throw new Error("illegal catch attempt")},delegateYield:function(G,K,ne){return this.delegate={iterator:g(G),resultName:K,nextLoc:ne},"next"===this.method&&(this.arg=void 0),me}},G}(G.exports);try{regeneratorRuntime=K}catch(G){"object"==typeof globalThis?globalThis.regeneratorRuntime=K:Function("r","regeneratorRuntime = r")(K)}}(Me={exports:{}}),Me.exports),Fe=function(){function t(G,K,ne){this._midPrice=null,G.length>0||pe(!1);var ue=G[0].chainId;G.every((function(G){return G.chainId===ue}))||pe(!1);var he=K.wrapped;G[0].involvesToken(he)||pe(!1),G[G.length-1].involvesToken(ne.wrapped)||pe(!1);for(var ye,me=[he],be=b(G.entries());!(ye=be()).done;){var ve=ye.value,_e=ve[1],Te=me[ve[0]];Te.equals(_e.token0)||Te.equals(_e.token1)||pe(!1);var Ee=Te.equals(_e.token0)?_e.token1:_e.token0;me.push(Ee)}this.pools=G,this.path=me,this.input=K,this.output=null!=ne?ne:me[me.length-1]}return I(t,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var G=this.pools.slice(1).reduce((function(G,K){var ne=G.price;return G.nextInput.equals(K.token0)?{nextInput:K.token1,price:ne.multiply(K.token0Price)}:{nextInput:K.token0,price:ne.multiply(K.token1Price)}}),this.pools[0].token0.equals(this.input.wrapped)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new be.Price(this.input,this.output,G.denominator,G.numerator)}}]),t}();function q(G,K){return G.inputAmount.currency.equals(K.inputAmount.currency)||pe(!1),G.outputAmount.currency.equals(K.outputAmount.currency)||pe(!1),G.outputAmount.equalTo(K.outputAmount)?G.inputAmount.equalTo(K.inputAmount)?G.swaps.reduce((function(G,K){return G+K.route.path.length}),0)-K.swaps.reduce((function(G,K){return G+K.route.path.length}),0):G.inputAmount.lessThan(K.inputAmount)?-1:1:G.outputAmount.lessThan(K.outputAmount)?1:-1}var De,Le=function(){function t(G){var K=G.routes,ne=G.tradeType,ue=K[0].inputAmount.currency,he=K[0].outputAmount.currency;K.every((function(G){return ue.wrapped.equals(G.route.input.wrapped)}))||pe(!1),K.every((function(G){return he.wrapped.equals(G.route.output.wrapped)}))||pe(!1);for(var me,ve=K.map((function(G){return G.route.pools.length})).reduce((function(G,K){return G+K}),0),_e=new Set,Ee=b(K);!(me=Ee()).done;)for(var Pe,Se=b(me.value.route.pools);!(Pe=Se()).done;){var Ce=Pe.value;_e.add(Ce instanceof ye.Pool?ye.Pool.getAddress(Ce.token0,Ce.token1,Ce.fee):Te.Pair.getAddress(Ce.token0,Ce.token1))}ve!=_e.size&&pe(!1),ne!==be.TradeType.EXACT_INPUT&&pe(!1),this.swaps=K,this.tradeType=ne}t.fromRoute=function(){var G=k(Be.mark((function e(G,K,ne){var ue,he,ye,me,ve;return Be.wrap((function(_e){for(;;)switch(_e.prev=_e.next){case 0:ue=new Array(G.path.length),ne!==be.TradeType.EXACT_INPUT&&pe(!1),K.currency.equals(G.input)||pe(!1),ue[0]=K.wrapped,me=0;case 5:if(!(me<G.path.length-1)){_e.next=15;break}return ve=G.pools[me],_e.next=9,ve.getOutputAmount(ue[me]);case 9:ue[me+1]=_e.sent[0];case 12:me++,_e.next=5;break;case 15:return he=be.CurrencyAmount.fromFractionalAmount(G.input,K.numerator,K.denominator),ye=be.CurrencyAmount.fromFractionalAmount(G.output,ue[ue.length-1].numerator,ue[ue.length-1].denominator),_e.abrupt("return",new t({routes:[{inputAmount:he,outputAmount:ye,route:G}],tradeType:ne}));case 18:case"end":return _e.stop()}}),e)})));return function(K,ne,ue){return G.apply(this,arguments)}}(),t.fromRoutes=function(){var G=k(Be.mark((function e(G,K){var ne,ue,he,ye,me,ve,_e,Te,Ee,Pe,Se;return Be.wrap((function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:ne=[],K!==be.TradeType.EXACT_INPUT&&pe(!1),ue=b(G);case 3:if((he=ue()).done){Ce.next=26;break}me=(ye=he.value).route,ve=ye.amount,_e=new Array(me.path.length),Te=void 0,Ee=void 0,ve.currency.equals(me.input)||pe(!1),Te=be.CurrencyAmount.fromFractionalAmount(me.input,ve.numerator,ve.denominator),_e[0]=be.CurrencyAmount.fromFractionalAmount(me.input.wrapped,ve.numerator,ve.denominator),Pe=0;case 12:if(!(Pe<me.path.length-1)){Ce.next=22;break}return Se=me.pools[Pe],Ce.next=16,Se.getOutputAmount(_e[Pe]);case 16:_e[Pe+1]=Ce.sent[0];case 19:Pe++,Ce.next=12;break;case 22:Ee=be.CurrencyAmount.fromFractionalAmount(me.output,_e[_e.length-1].numerator,_e[_e.length-1].denominator),ne.push({route:me,inputAmount:Te,outputAmount:Ee});case 24:Ce.next=3;break;case 26:return Ce.abrupt("return",new t({routes:ne,tradeType:K}));case 27:case"end":return Ce.stop()}}),e)})));return function(K,ne){return G.apply(this,arguments)}}(),t.createUncheckedTrade=function(G){return new t(P({},G,{routes:[{inputAmount:G.inputAmount,outputAmount:G.outputAmount,route:G.route}]}))},t.createUncheckedTradeWithMultipleRoutes=function(G){return new t(G)};var G=t.prototype;return G.minimumAmountOut=function(G,K){void 0===K&&(K=this.outputAmount),G.lessThan(Ce)&&pe(!1);var ne=new be.Fraction(ke).add(G).invert().multiply(K.quotient).quotient;return be.CurrencyAmount.fromRawAmount(K.currency,ne)},G.maximumAmountIn=function(G,K){return void 0===K&&(K=this.inputAmount),G.lessThan(Ce)&&pe(!1),K},G.worstExecutionPrice=function(G){return new be.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(G).quotient,this.minimumAmountOut(G).quotient)},t.bestTradeExactIn=function(){var G=k(Be.mark((function e(G,K,ne,ue,he,ye,me){var ve,_e,Ee,Pe,Se,ke,Oe,xe,Ne,Me,De;return Be.wrap((function(Be){for(;;)switch(Be.prev=Be.next){case 0:Ee=void 0===(_e=(ve=void 0===ue?{}:ue).maxNumResults)?3:_e,Se=void 0===(Pe=ve.maxHops)?3:Pe,void 0===he&&(he=[]),void 0===ye&&(ye=K),void 0===me&&(me=[]),G.length>0||pe(!1),Se>0||pe(!1),K===ye||he.length>0||pe(!1),ke=ye.wrapped,Oe=ne.wrapped,xe=0;case 10:if(!(xe<G.length)){Be.next=49;break}if((Ne=G[xe]).token0.equals(ke.currency)||Ne.token1.equals(ke.currency)){Be.next=14;break}return Be.abrupt("continue",46);case 14:if(!(Ne instanceof Te.Pair)){Be.next=17;break}if(!Ne.reserve0.equalTo(Ce)&&!Ne.reserve1.equalTo(Ce)){Be.next=17;break}return Be.abrupt("continue",46);case 17:return Me=void 0,Be.prev=18,Be.next=22,Ne.getOutputAmount(ke);case 22:Me=Be.sent[0],Be.next=31;break;case 26:if(Be.prev=26,Be.t0=Be.catch(18),!Be.t0.isInsufficientInputAmountError){Be.next=30;break}return Be.abrupt("continue",46);case 30:throw Be.t0;case 31:if(!Me.currency.isToken||!Me.currency.equals(Oe)){Be.next=42;break}return Be.t1=be.sortedInsert,Be.t2=me,Be.next=36,t.fromRoute(new Fe([].concat(he,[Ne]),K.currency,ne),K,be.TradeType.EXACT_INPUT);case 36:Be.t3=Be.sent,Be.t4=Ee,Be.t5=q,(0,Be.t1)(Be.t2,Be.t3,Be.t4,Be.t5),Be.next=46;break;case 42:if(!(Se>1&&G.length>1)){Be.next=46;break}return De=G.slice(0,xe).concat(G.slice(xe+1,G.length)),Be.next=46,t.bestTradeExactIn(De,K,ne,{maxNumResults:Ee,maxHops:Se-1},[].concat(he,[Ne]),Me,me);case 46:xe++,Be.next=10;break;case 49:return Be.abrupt("return",me);case 50:case"end":return Be.stop()}}),e,null,[[18,26]])})));return function(K,ne,ue,pe,he,ye,me){return G.apply(this,arguments)}}(),I(t,[{key:"route",get:function(){return 1!=this.swaps.length&&pe(!1),this.swaps[0].route}},{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var G=this.swaps[0].inputAmount.currency,K=this.swaps.map((function(G){return G.inputAmount})).reduce((function(G,K){return G.add(K)}),be.CurrencyAmount.fromRawAmount(G,0));return this._inputAmount=K,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var G=this.swaps[0].outputAmount.currency,K=this.swaps.map((function(G){return G.outputAmount})).reduce((function(G,K){return G.add(K)}),be.CurrencyAmount.fromRawAmount(G,0));return this._outputAmount=K,this._outputAmount}},{key:"executionPrice",get:function(){var G;return null!=(G=this._executionPrice)?G:this._executionPrice=new be.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var G,K=be.CurrencyAmount.fromRawAmount(this.outputAmount.currency,0),ne=b(this.swaps);!(G=ne()).done;){var ue=G.value;K=K.add(ue.route.midPrice.quote(ue.inputAmount))}var pe=K.subtract(this.outputAmount).divide(K);return this._priceImpact=new be.Percent(pe.numerator,pe.denominator),this._priceImpact}}]),t}();(De=G.Protocol||(G.Protocol={})).V2="V2",De.V3="V3",De.MIXED="MIXED";var Ue=function(K){function e(ne){var ue;return(ue=K.call(this,ne.pairs,ne.input,ne.output)||this).protocol=G.Protocol.V2,ue.pools=ue.pairs,ue}return R(e,K),e}(Te.Route),je=function(K){function e(ne){var ue;return(ue=K.call(this,ne.pools,ne.input,ne.output)||this).protocol=G.Protocol.V3,ue.path=ne.tokenPath,ue}return R(e,K),e}(ye.Route),ze=function(K){function e(ne){var ue;return(ue=K.call(this,ne.pools,ne.input,ne.output)||this).protocol=G.Protocol.MIXED,ue}return R(e,K),e}(Fe),Je=function(){function t(G){var K=G.v2Routes,ne=G.v3Routes,ue=G.tradeType,he=G.mixedRoutes;this.swaps=[],this.routes=[];for(var me,be=b(K);!(me=be()).done;){var ve=me.value,_e=ve.inputAmount,Ee=ve.outputAmount,Pe=new Ue(ve.routev2);this.routes.push(Pe),this.swaps.push({route:Pe,inputAmount:_e,outputAmount:Ee})}for(var Se,Ce=b(ne);!(Se=Ce()).done;){var ke=Se.value,Oe=ke.inputAmount,xe=ke.outputAmount,Ne=new je(ke.routev3);this.routes.push(Ne),this.swaps.push({route:Ne,inputAmount:Oe,outputAmount:xe})}if(he)for(var Me,Be=b(he);!(Me=Be()).done;){var Fe=Me.value,De=Fe.inputAmount,Le=Fe.outputAmount,Je=new ze(Fe.mixedRoute);this.routes.push(Je),this.swaps.push({route:Je,inputAmount:De,outputAmount:Le})}this.tradeType=ue;var Xe=this.swaps[0].inputAmount.currency,Qe=this.swaps[0].outputAmount.currency;this.swaps.every((function(G){return Xe.wrapped.equals(G.route.input.wrapped)}))||pe(!1),this.swaps.every((function(G){return Qe.wrapped.equals(G.route.output.wrapped)}))||pe(!1);for(var Ye,et=this.swaps.map((function(G){return G.route.pools.length})).reduce((function(G,K){return G+K}),0),tt=new Set,rt=b(this.swaps);!(Ye=rt()).done;)for(var nt,at=b(Ye.value.route.pools);!(nt=at()).done;){var it=nt.value;if(it instanceof ye.Pool)tt.add(ye.Pool.getAddress(it.token0,it.token1,it.fee));else{if(!(it instanceof Te.Pair))throw new Error("Unexpected pool type in route when constructing trade object");tt.add(Te.Pair.getAddress(it.token0,it.token1))}}et!=tt.size&&pe(!1)}var G=t.prototype;return G.minimumAmountOut=function(G,K){if(void 0===K&&(K=this.outputAmount),G.lessThan(Ce)&&pe(!1),this.tradeType===be.TradeType.EXACT_OUTPUT)return K;var ne=new be.Fraction(ke).add(G).invert().multiply(K.quotient).quotient;return be.CurrencyAmount.fromRawAmount(K.currency,ne)},G.maximumAmountIn=function(G,K){if(void 0===K&&(K=this.inputAmount),G.lessThan(Ce)&&pe(!1),this.tradeType===be.TradeType.EXACT_INPUT)return K;var ne=new be.Fraction(ke).add(G).multiply(K.quotient).quotient;return be.CurrencyAmount.fromRawAmount(K.currency,ne)},G.worstExecutionPrice=function(G){return new be.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(G).quotient,this.minimumAmountOut(G).quotient)},t.fromRoutes=function(){var G=k(Be.mark((function e(G,K,ne,ue){var pe,he,me,be,ve,_e,Ee,Pe,Se,Ce,ke,Oe,xe,Ne,Me,Fe,De,Ue,je,ze;return Be.wrap((function(Be){for(;;)switch(Be.prev=Be.next){case 0:for(pe=[],he=[],me=[],be=b(G);!(ve=be()).done;)Pe=new Te.Trade(Ee=(_e=ve.value).routev2,_e.amount,ne),pe.push({routev2:Ee,inputAmount:Pe.inputAmount,outputAmount:Pe.outputAmount});Se=b(K);case 5:if((Ce=Se()).done){Be.next=14;break}return Oe=(ke=Ce.value).routev3,xe=ke.amount,Be.next=9,ye.Trade.fromRoute(Oe,xe,ne);case 9:he.push({routev3:Oe,inputAmount:(Ne=Be.sent).inputAmount,outputAmount:Ne.outputAmount});case 12:Be.next=5;break;case 14:if(!ue){Be.next=25;break}Me=b(ue);case 16:if((Fe=Me()).done){Be.next=25;break}return Ue=(De=Fe.value).mixedRoute,je=De.amount,Be.next=20,Le.fromRoute(Ue,je,ne);case 20:me.push({mixedRoute:Ue,inputAmount:(ze=Be.sent).inputAmount,outputAmount:ze.outputAmount});case 23:Be.next=16;break;case 25:return Be.abrupt("return",new t({v2Routes:pe,v3Routes:he,mixedRoutes:me,tradeType:ne}));case 26:case"end":return Be.stop()}}),e)})));return function(K,ne,ue,pe){return G.apply(this,arguments)}}(),t.fromRoute=function(){var G=k(Be.mark((function e(G,K,ne){var ue,pe,he,me,be,ve;return Be.wrap((function(_e){for(;;)switch(_e.prev=_e.next){case 0:if(ue=[],pe=[],he=[],!(G instanceof Te.Route)){_e.next=9;break}me=new Te.Trade(G,K,ne),ue=[{routev2:G,inputAmount:me.inputAmount,outputAmount:me.outputAmount}],_e.next=26;break;case 9:if(!(G instanceof ye.Route)){_e.next=17;break}return _e.next=12,ye.Trade.fromRoute(G,K,ne);case 12:pe=[{routev3:G,inputAmount:(be=_e.sent).inputAmount,outputAmount:be.outputAmount}],_e.next=26;break;case 17:if(!(G instanceof Fe)){_e.next=25;break}return _e.next=20,Le.fromRoute(G,K,ne);case 20:he=[{mixedRoute:G,inputAmount:(ve=_e.sent).inputAmount,outputAmount:ve.outputAmount}],_e.next=26;break;case 25:throw new Error("Invalid route type");case 26:return _e.abrupt("return",new t({v2Routes:ue,v3Routes:pe,mixedRoutes:he,tradeType:ne}));case 27:case"end":return _e.stop()}}),e)})));return function(K,ne,ue){return G.apply(this,arguments)}}(),I(t,[{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var G=this.swaps[0].inputAmount.currency,K=this.swaps.map((function(G){return G.inputAmount})).reduce((function(G,K){return G.add(K)}),be.CurrencyAmount.fromRawAmount(G,0));return this._inputAmount=K,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var G=this.swaps[0].outputAmount.currency,K=this.swaps.map((function(G){return G.outputAmount})).reduce((function(G,K){return G.add(K)}),be.CurrencyAmount.fromRawAmount(G,0));return this._outputAmount=K,this._outputAmount}},{key:"executionPrice",get:function(){var G;return null!=(G=this._executionPrice)?G:this._executionPrice=new be.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var G,K=be.CurrencyAmount.fromRawAmount(this.outputAmount.currency,0),ne=b(this.swaps);!(G=ne()).done;){var ue=G.value;K=K.add(ue.route.midPrice.quote(ue.inputAmount))}var pe=K.subtract(this.outputAmount).divide(K);return this._priceImpact=new be.Percent(pe.numerator,pe.denominator),this._priceImpact}}]),t}();function L(G){var K=G.pools.reduce((function(G,K,ne){var ue=G.inputToken,pe=G.path,he=G.types,me=K.token0.equals(ue)?K.token1:K.token0;return 0===ne?{inputToken:me,types:["address","uint24","address"],path:[ue.address,K instanceof ye.Pool?K.fee:8388608,me.address]}:{inputToken:me,types:[].concat(he,["uint24","address"]),path:[].concat(pe,[K instanceof ye.Pool?K.fee:8388608,me.address])}}),{inputToken:G.input.wrapped,path:[],types:[]});return Ee.pack(K.types,K.path)}var X=function(G){for(var K=[],ne=0,ue=0;ue<G.pools.length;)(G.pools[ne]instanceof ye.Pool&&G.pools[ue]instanceof Te.Pair||G.pools[ne]instanceof Te.Pair&&G.pools[ue]instanceof ye.Pool)&&(K.push(G.pools.slice(ne,ue)),ne=ue),++ue===G.pools.length&&K.push(G.pools.slice(ne,ue));return K},j=function(G,K){return G.reduce((function(G,K){var ne=G.inputToken;if(!K.involvesToken(ne))throw new Error("PATH");return{inputToken:K.token0.equals(ne)?K.token1:K.token0}}),{inputToken:K}).inputToken},Xe=ne.BigInt(0),Qe=new be.Percent(ne.BigInt(50),ne.BigInt(100)),Ye=function(){function t(){}return t.encodeV2Swap=function(G,K,ne,ue){var pe=ye.toHex(G.maximumAmountIn(K.slippageTolerance).quotient),he=ye.toHex(G.minimumAmountOut(K.slippageTolerance).quotient),me=G.route.path.map((function(G){return G.address})),ve=ne?Se:void 0===K.recipient?Pe:be.validateAndParseAddress(K.recipient);return G.tradeType===be.TradeType.EXACT_INPUT?t.INTERFACE.encodeFunctionData("swapExactTokensForTokens",[pe,ue?0:he,me,ve]):t.INTERFACE.encodeFunctionData("swapTokensForExactTokens",[he,pe,me,ve])},t.encodeV3Swap=function(G,K,ne,ue){for(var pe,he=[],me=b(G.swaps);!(pe=me()).done;){var ve=pe.value,_e=ve.route,Te=ve.outputAmount,Ee=ye.toHex(G.maximumAmountIn(K.slippageTolerance,ve.inputAmount).quotient),Ce=ye.toHex(G.minimumAmountOut(K.slippageTolerance,Te).quotient),ke=1===_e.pools.length,Oe=ne?Se:void 0===K.recipient?Pe:be.validateAndParseAddress(K.recipient);if(ke)he.push(G.tradeType===be.TradeType.EXACT_INPUT?t.INTERFACE.encodeFunctionData("exactInputSingle",[{tokenIn:_e.tokenPath[0].address,tokenOut:_e.tokenPath[1].address,fee:_e.pools[0].fee,recipient:Oe,amountIn:Ee,amountOutMinimum:ue?0:Ce,sqrtPriceLimitX96:0}]):t.INTERFACE.encodeFunctionData("exactOutputSingle",[{tokenIn:_e.tokenPath[0].address,tokenOut:_e.tokenPath[1].address,fee:_e.pools[0].fee,recipient:Oe,amountOut:Ce,amountInMaximum:Ee,sqrtPriceLimitX96:0}]));else{var xe=ye.encodeRouteToPath(_e,G.tradeType===be.TradeType.EXACT_OUTPUT);he.push(G.tradeType===be.TradeType.EXACT_INPUT?t.INTERFACE.encodeFunctionData("exactInput",[{path:xe,recipient:Oe,amountIn:Ee,amountOutMinimum:ue?0:Ce}]):t.INTERFACE.encodeFunctionData("exactOutput",[{path:xe,recipient:Oe,amountOut:Ce,amountInMaximum:Ee}]))}}return he},t.encodeMixedRouteSwap=function(G,K,ne,ue){var he=[];G.tradeType!==be.TradeType.EXACT_INPUT&&pe(!1);for(var me,ve=b(G.swaps);!(me=ve()).done;){var _e=me.value,Te=_e.route,Ee=_e.outputAmount,Ce=ye.toHex(G.maximumAmountIn(K.slippageTolerance,_e.inputAmount).quotient),ke=ye.toHex(G.minimumAmountOut(K.slippageTolerance,Ee).quotient),Oe=1===Te.pools.length,xe=ne?Se:void 0===K.recipient?Pe:be.validateAndParseAddress(K.recipient),w=function(G){return G.pools.every((function(G){return G instanceof ye.Pool}))};if(Oe)if(w(Te))he.push(t.INTERFACE.encodeFunctionData("exactInputSingle",[{tokenIn:Te.path[0].address,tokenOut:Te.path[1].address,fee:Te.pools[0].fee,recipient:xe,amountIn:Ce,amountOutMinimum:ue?0:ke,sqrtPriceLimitX96:0}]));else{var Ne=Te.path.map((function(G){return G.address}));he.push(t.INTERFACE.encodeFunctionData("swapExactTokensForTokens",[Ce,ue?0:ke,Ne,xe]))}else!function(){for(var G=X(Te),n=function(K){return K===G.length-1},K=void 0,ne=Te.input.wrapped,ue=0;ue<G.length;ue++){var pe=G[ue];K=j(pe,ne);var ye=new Fe([].concat(pe),pe[0].token0.equals(ne)?pe[0].token0:pe[0].token1,K),me=new ze(ye);if(ne=K,w(me)){var be={path:L(me),recipient:n(ue)?xe:Se,amountIn:0==ue?Ce:0,amountOutMinimum:n(ue)?ke:0};he.push(t.INTERFACE.encodeFunctionData("exactInput",[be]))}else{var ve=[0==ue?Ce:0,n(ue)?ke:0,me.path.map((function(G){return G.address})),n(ue)?xe:Se];he.push(t.INTERFACE.encodeFunctionData("swapExactTokensForTokens",ve))}}}()}return he},t.encodeSwaps=function(K,ne,ue){if(K instanceof Je){K.swaps.every((function(K){return K.route.protocol==G.Protocol.V3||K.route.protocol==G.Protocol.V2||K.route.protocol==G.Protocol.MIXED}))||pe(!1);for(var he,me=[],ve=b(K.swaps);!(he=ve()).done;){var _e=he.value,Ee=_e.route,Pe=_e.inputAmount,Se=_e.outputAmount;if(Ee.protocol==G.Protocol.V2)me.push(new Te.Trade(Ee,K.tradeType==be.TradeType.EXACT_INPUT?Pe:Se,K.tradeType));else if(Ee.protocol==G.Protocol.V3)me.push(ye.Trade.createUncheckedTrade({route:Ee,inputAmount:Pe,outputAmount:Se,tradeType:K.tradeType}));else{if(Ee.protocol!=G.Protocol.MIXED)throw new Error("UNSUPPORTED_TRADE_PROTOCOL");me.push(Le.createUncheckedTrade({route:Ee,inputAmount:Pe,outputAmount:Se,tradeType:K.tradeType}))}}K=me}Array.isArray(K)||(K=[K]);var Ce=K.reduce((function(G,K){return G+(K instanceof ye.Trade||K instanceof Le?K.swaps.length:1)}),0),ke=K[0];K.every((function(G){return G.inputAmount.currency.equals(ke.inputAmount.currency)}))||pe(!1),K.every((function(G){return G.outputAmount.currency.equals(ke.outputAmount.currency)}))||pe(!1),K.every((function(G){return G.tradeType===ke.tradeType}))||pe(!1);var Oe=[],xe=ke.inputAmount.currency.isNative,Ne=ke.outputAmount.currency.isNative,Me=ke.tradeType===be.TradeType.EXACT_INPUT&&Ce>2,Be=Ne||!!ne.fee||!!ue||Me;ne.inputTokenPermit&&(ke.inputAmount.currency.isToken||pe(!1),Oe.push(ye.SelfPermit.encodePermit(ke.inputAmount.currency,ne.inputTokenPermit)));for(var Fe,De=b(K);!(Fe=De()).done;){var Ue=Fe.value;if(Ue instanceof Te.Trade)Oe.push(t.encodeV2Swap(Ue,ne,Be,Me));else if(Ue instanceof ye.Trade)for(var je,ze=b(t.encodeV3Swap(Ue,ne,Be,Me));!(je=ze()).done;)Oe.push(je.value);else{if(!(Ue instanceof Le))throw new Error("Unsupported trade object");for(var Xe,Qe=b(t.encodeMixedRouteSwap(Ue,ne,Be,Me));!(Xe=Qe()).done;)Oe.push(Xe.value)}}var Ye=be.CurrencyAmount.fromRawAmount(ke.inputAmount.currency,0),et=be.CurrencyAmount.fromRawAmount(ke.outputAmount.currency,0),tt=K.reduce((function(G,K){return G.add(K.minimumAmountOut(ne.slippageTolerance))}),et),rt=K.reduce((function(G,K){return G.add(K.outputAmount)}),et),nt=K.reduce((function(G,K){return G.add(K.maximumAmountIn(ne.slippageTolerance))}),Ye);return{calldatas:Oe,sampleTrade:ke,routerMustCustody:Be,inputIsNative:xe,outputIsNative:Ne,totalAmountIn:nt,minimumAmountOut:tt,quoteAmountOut:rt}},t.swapCallParameters=function(G,K){var ne=t.encodeSwaps(G,K),ue=ne.calldatas,pe=ne.sampleTrade,he=ne.inputIsNative,me=ne.totalAmountIn,ve=ne.minimumAmountOut;return ne.routerMustCustody&&ue.push(ne.outputIsNative?Ne.encodeUnwrapWETH9(ve.quotient,K.recipient,K.fee):Ne.encodeSweepToken(pe.outputAmount.currency.wrapped,ve.quotient,K.recipient,K.fee)),he&&(pe.tradeType===be.TradeType.EXACT_OUTPUT||t.riskOfPartialFill(G))&&ue.push(ye.Payments.encodeRefundETH()),{calldata:xe.encodeMulticall(ue,K.deadlineOrPreviousBlockhash),value:ye.toHex(he?me.quotient:Xe)}},t.swapAndAddCallParameters=function(K,ne,ue,he,me,ve){var _e=t.encodeSwaps(K,ne,!0),Te=_e.calldatas,Ee=_e.inputIsNative,Pe=_e.outputIsNative,Se=_e.sampleTrade,Ce=_e.totalAmountIn,ke=_e.quoteAmountOut,Me=_e.minimumAmountOut;ne.outputTokenPermit&&(ke.currency.isToken||pe(!1),Te.push(ye.SelfPermit.encodePermit(ke.currency,ne.outputTokenPermit)));var Be=Se.route.chainId,Fe=ue.pool.token0.wrapped.address===Ce.currency.wrapped.address,De=t.getPositionAmounts(ue,Fe),Le=De.positionAmountIn,Ue=De.positionAmountOut,je=Ee?be.WETH9[Be]:Le.currency.wrapped,ze=Pe?be.WETH9[Be]:Ue.currency.wrapped,Je=Ue.subtract(ke.wrapped);Je.greaterThan(be.CurrencyAmount.fromRawAmount(Ue.currency,0))&&Te.push(Pe?Ne.encodeWrapETH(Je.quotient):Ne.encodePull(ze,Je.quotient)),Te.push(Ee?Ne.encodeWrapETH(Le.quotient):Ne.encodePull(je,Le.quotient)),me!==G.ApprovalTypes.NOT_REQUIRED&&Te.push(Oe.encodeApprove(je,me)),ve!==G.ApprovalTypes.NOT_REQUIRED&&Te.push(Oe.encodeApprove(ze,ve));var Qe,Ye=ye.Position.fromAmounts({pool:ue.pool,tickLower:ue.tickLower,tickUpper:ue.tickUpper,amount0:Fe?ue.amount0.quotient.toString():Me.quotient.toString(),amount1:Fe?Me.quotient.toString():ue.amount1.quotient.toString(),useFullPrecision:!1});return Te.push(Oe.encodeAddLiquidity(ue,Ye,he,ne.slippageTolerance)),Te.push(Ee?Ne.encodeUnwrapWETH9(Xe):Ne.encodeSweepToken(je,Xe)),Te.push(Pe?Ne.encodeUnwrapWETH9(Xe):Ne.encodeSweepToken(ze,Xe)),Qe=Ee?Ce.wrapped.add(Le.wrapped).quotient:Pe?Je.quotient:Xe,{calldata:xe.encodeMulticall(Te,ne.deadlineOrPreviousBlockhash),value:Qe.toString()}},t.riskOfPartialFill=function(G){return Array.isArray(G)?G.some((function(G){return t.v3TradeWithHighPriceImpact(G)})):t.v3TradeWithHighPriceImpact(G)},t.v3TradeWithHighPriceImpact=function(G){return!(G instanceof Te.Trade)&&G.priceImpact.greaterThan(Qe)},t.getPositionAmounts=function(G,K){var ne=G.mintAmounts,ue=ne.amount1,pe=be.CurrencyAmount.fromRawAmount(G.pool.token0,ne.amount0),he=be.CurrencyAmount.fromRawAmount(G.pool.token1,ue),ye=K?[pe,he]:[he,pe];return{positionAmountIn:ye[0],positionAmountOut:ye[1]}},t}();Ye.INTERFACE=new ue.Interface(_e.abi),G.ADDRESS_THIS=Se,G.ApproveAndCall=Oe,G.MSG_SENDER=Pe,G.MixedRoute=ze,G.MixedRouteSDK=Fe,G.MixedRouteTrade=Le,G.MulticallExtended=xe,G.ONE=ke,G.PaymentsExtended=Ne,G.RouteV2=Ue,G.RouteV3=je,G.SwapRouter=Ye,G.Trade=Je,G.V2_FEE_PATH_PLACEHOLDER=8388608,G.ZERO=Ce,G.encodeMixedRouteToPath=L,G.getOutputOfPools=j,G.isMint=A,G.partitionMixedRouteByProtocol=X,G.tradeComparator=q}(hJ)),hJ}();var xQ,NQ=pJ.exports;!function(G){G.INVALID_CONFIGURATION="INVALID_CONFIGURATION",G.INVALID_SLIPPAGE="INVALID_SLIPPAGE",G.INVALID_MAX_HOPS="INVALID_MAX_HOPS",G.INVALID_ADDRESS="INVALID_ADDRESS",G.DUPLICATE_ADDRESSES="DUPLICATE_ADDRESSES",G.CHAIN_NOT_SUPPORTED="CHAIN_NOT_SUPPORTED",G.NO_ROUTES_AVAILABLE="NO_ROUTES_AVAILABLE",G.PROVIDER_CALL_ERROR="PROVIDER_CALL_ERROR",G.APPROVE_ERROR="APPROVE_ERROR",G.ALREADY_APPROVED_ERROR="ALREADY_APPROVED_ERROR"}(xQ||(xQ={}));class ExchangeError extends Error{message;code;constructor(G,K){super(G),this.message=G,this.code=K}}class InvalidConfigurationError extends ExchangeError{constructor(G){super(G||"Invalid configuration",xQ.INVALID_CONFIGURATION)}}class ChainNotSupportedError extends ExchangeError{constructor(G,K){super(`Chain with ID ${G} is not a supported chain in environment ${K}`,xQ.CHAIN_NOT_SUPPORTED)}}class InvalidSlippageError extends ExchangeError{constructor(G){super(G,xQ.INVALID_SLIPPAGE)}}class InvalidMaxHopsError extends ExchangeError{constructor(G){super(G,xQ.INVALID_MAX_HOPS)}}class InvalidAddressError extends ExchangeError{constructor(G){super(G,xQ.INVALID_ADDRESS)}}class DuplicateAddressesError extends ExchangeError{constructor(){super("token in and token out addresses must be different",xQ.DUPLICATE_ADDRESSES)}}class NoRoutesAvailableError extends ExchangeError{constructor(){super("no routes available",xQ.NO_ROUTES_AVAILABLE)}}class ProviderCallError extends ExchangeError{constructor(G){super(G,xQ.PROVIDER_CALL_ERROR)}}class ApproveError extends ExchangeError{constructor(G){super(G,xQ.APPROVE_ERROR)}}const MQ={"0xcdca1753":["uint256","uint160[]","uint32[]","uint256"],"0xc6a5026a":["uint256","uint160","uint32","uint256"],"0x2f80bb1d":["uint256","uint160[]","uint32[]","uint256"],"0xbd21704a":["uint256","uint160","uint32","uint256"]};const BQ=id$3("decimals()").substring(0,10);async function getTokenDecimals(G,K,ne){if("native"===G)return ne.decimals;try{const ne=await K.call({to:G,data:BQ});return parseInt(ne,16)}catch(G){const K=G instanceof Error?G.message:"Unknown Error";throw new ProviderCallError(`failed to get ERC20 decimals: ${K}`)}}function isValidNonZeroAddress(G){if(G===ui)return!1;try{return getAddress$2(G),!0}catch(G){return!1}}const isValidTokenLiteral=G=>"native"===G||isValidNonZeroAddress(G),erc20ToUniswapToken=G=>new FV(G.chainId,G.address,G.decimals,G.symbol,G.name),uniswapTokenToERC20=G=>({chainId:G.chainId,address:G.address,decimals:G.decimals,symbol:G.symbol,name:G.name,type:"erc20"}),toCurrencyAmount=G=>{const K=erc20ToUniswapToken(G.token);return IV.fromRawAmount(K,G.value.toString())},newAmount=(G,K)=>({value:G,token:K}),isERC20Amount=G=>"erc20"===G.token.type,isNativeAmount=G=>"native"===G.token.type,isNative=G=>"native"===G.type,addAmount=(G,K)=>{if(isERC20Amount(G)&&isERC20Amount(K))return((G,K)=>{if(G.token.address!==K.token.address)throw new Error("Token mismatch: token addresses must be the same");return{value:G.value.add(K.value),token:G.token}})(G,K);if(isNativeAmount(G)&&isNativeAmount(K))return((G,K)=>({value:G.value.add(K.value),token:G.token}))(G,K);throw new Error("Token mismatch: token types must be the same")},subtractAmount=(G,K)=>{if(isERC20Amount(G)&&isERC20Amount(K))return((G,K)=>{if(G.token.address!==K.token.address)throw new Error("Token mismatch: token addresses must be the same");return{value:G.value.sub(K.value),token:G.token}})(G,K);if(isNativeAmount(G)&&isNativeAmount(K))return((G,K)=>({value:G.value.sub(K.value),token:G.token}))(G,K);throw new Error("Token mismatch: token types must be the same")},toPublicAmount=G=>{return{token:(K=G.token,"native"===K.type?{address:"native",chainId:K.chainId,decimals:K.decimals,symbol:K.symbol,name:K.name}:K),value:G.value};var K},getDefaultDeadlineSeconds=()=>Math.floor(Date.now()/1e3)+900,FQ=13473,DQ=13371,LQ={chainId:FQ,decimals:18,symbol:"tIMX",name:"Immutable Testnet Token",type:"native"},UQ={chainId:FQ,address:"0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439",decimals:18,symbol:"WIMX",name:"Wrapped Immutable Testnet Token",type:"erc20"},$Q=[UQ],qQ={chainId:DQ,decimals:18,symbol:"IMX",name:"Immutable Token",type:"native"},GQ={chainId:DQ,address:"0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d",decimals:18,symbol:"WIMX",name:"Wrapped Immutable Token",type:"erc20"},jQ=[GQ,{chainId:DQ,address:"0x52a6c53869ce09a731cd772f245b97a4401d3348",decimals:18,symbol:"ETH",name:"Ethereum",type:"erc20"},{chainId:DQ,address:"0x6de8aCC0D406837030CE4dd28e7c08C5a96a30d2",decimals:6,symbol:"USDC",name:"USDC",type:"erc20"},{chainId:DQ,address:"0x68bcc7F1190AF20e7b572BCfb431c3Ac10A936Ab",decimals:6,symbol:"USDT",name:"USDT",type:"erc20"}],fetchGasPrice=async(G,K)=>{const ne=await(async G=>{const[K,ne]=await Promise.all([G.getBlock("latest"),G.send("eth_maxPriorityFeePerGas",[])]);if(!K.baseFeePerGas)throw new Error("Base fee per gas not found in block");return{maxFeePerGas:K.baseFeePerGas.mul(2).add(ne),maxPriorityFeePerGas:ne,lastBaseFeePerGas:K.baseFeePerGas}})(G).catch((()=>null));return ne?newAmount(ne.maxFeePerGas,K):null},calculateGasFee=(G,K,ne)=>{const ue=newAmount(ne.mul(K.value),K.token);return G?newAmount(ue.value.add(K.value.mul(50876)),K.token):ue},HQ=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}];class ERC20__factory{static abi=HQ;static createInterface(){return new Ho(HQ)}static connect(G,K){return new iu(G,HQ,K)}}const getApproveTransaction$1=async(G,K,ne,ue)=>{const pe=await(async(G,K,ne,ue)=>{const pe=ERC20__factory.connect(ne.token.address,G);let he;try{he=await pe.allowance(K,ue)}catch(G){const K=G instanceof Error?G.message:"Unknown Error";throw new ApproveError(`failed to get allowance: ${K}`)}const ye=ne.value.sub(he);return!ye.isNegative()&&!ye.isZero()})(G,K,ne,ue);return pe?((G,K,ne)=>{if(G===ne)throw new ApproveError("owner and spender addresses are the same");return{data:ERC20__factory.createInterface().encodeFunctionData("approve",[ne,K.value]),to:K.token.address,value:0,from:G}})(K,ne,ue):null};const getApproval=async(G,K,ne,ue)=>{const pe=await getApproveTransaction$1(G,K,ne.amount,ne.spender);if(!pe)return null;const he=await async function getApproveGasEstimate(G,K,ne,ue){const pe=ERC20__factory.connect(ue,G);return await pe.estimateGas.approve(ne,ji,{from:K})}(G,K,ne.spender,ne.amount.token.address),ye=ue?calculateGasFee(!1,ue,he):null;return{transaction:pe,gasFeeEstimate:ye?toPublicAmount(ye):null}},canUnwrapToken=G=>"native"===G.type;class NativeTokenService{nativeToken;wrappedToken;constructor(G,K){this.nativeToken=G,this.wrappedToken=K}wrapAmount(G){return newAmount(G.value,this.wrappedToken)}unwrapAmount(G){if(G.token.address.toLowerCase()!==this.wrappedToken.address.toLowerCase())throw new Error(`cannot unwrap non-wrapped token ${G.token.address}`);return newAmount(G.value,this.nativeToken)}maybeWrapToken(G){return canUnwrapToken(G)?this.wrappedToken:G}maybeWrapAmount(G){return newAmount(G.value,this.maybeWrapToken(G.token))}isWrappedNative(G){return"erc20"===G.type&&G.address.toLowerCase()===this.wrappedToken.address.toLowerCase()}isWrapOrUnwrap(G,K){return G===this.nativeToken&&this.isWrappedNative(K)||this.isWrappedNative(G)&&K===this.nativeToken}}const slippageToFraction=G=>{if(1===G.toString().split(".").length)return new RV(G,100);const K=(G/100).toString().split("."),ne=K[0]+K[1],ue=10**K[1].length;return new RV(ne,ue)};const prepareUserQuote=(G,K,ne,ue)=>{const pe=function getQuoteAmountFromTradeType(G){return G.tradeType===yV.EXACT_INPUT?G.amountOut:G.amountIn}(K),he=canUnwrapToken(ue)?G.unwrapAmount(pe):pe,ye=newAmount(function applySlippage(G,K,ne){const ue=slippageToFraction(ne).add(1),pe=(G===yV.EXACT_INPUT?ue.invert():ue).multiply(K.toString()).quotient;return Oi.from(pe.toString())}(K.tradeType,he.value,ne),ue);return{quotedAmount:he,quotedAmountWithMaxSlippage:ye}};class Fees{secondaryFees;amount;constructor(G,K){this.secondaryFees=G,this.amount=newAmount(Oi.from(0),K)}get token(){return this.amount.token}addAmount(G){this.amount=addAmount(this.amount,G)}amountWithFeesApplied(){return addAmount(this.amount,this.total())}amountLessFees(){return subtractAmount(this.amount,this.total())}withAmounts(){return this.secondaryFees.map((G=>{const K=this.amount.value.mul(G.basisPoints).div(1e4);return{...G,amount:newAmount(K,this.amount.token)}}))}total(){let G=newAmount(Oi.from(0),this.amount.token);for(const K of this.secondaryFees){const ne=this.amount.value.mul(K.basisPoints).div(1e4);G=addAmount(G,newAmount(ne,this.amount.token))}return G}}const WQ=[{inputs:[{internalType:"address",name:"_admin",type:"address"},{internalType:"address",name:"_uniRouter",type:"address"},{internalType:"address",name:"_wimx",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ContractPaused",type:"error"},{inputs:[],name:"DeadlinePassed",type:"error"},{inputs:[],name:"FailedToRefundNativeTokens",type:"error"},{inputs:[{internalType:"address payable",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"FailedToSendFees",type:"error"},{inputs:[{internalType:"uint256",name:"required",type:"uint256"},{internalType:"uint256",name:"actual",type:"uint256"}],name:"FailedToUnwrapNativeTokens",type:"error"},{inputs:[],name:"FailedToWithdrawNativeTokens",type:"error"},{inputs:[],name:"FeeTooHigh",type:"error"},{inputs:[],name:"IncorrectRecipient",type:"error"},{inputs:[],name:"InputTokenNotWrapped",type:"error"},{inputs:[],name:"NativeTokenAmountMismatch",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"feeToken",type:"address"},{indexed:!0,internalType:"address",name:"feePayer",type:"address"},{indexed:!0,internalType:"address",name:"feeRecipient",type:"address"},{indexed:!1,internalType:"uint256",name:"feeAmount",type:"uint256"}],name:"FeeTaken",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"feePayer",type:"address"},{indexed:!0,internalType:"address",name:"feeRecipient",type:"address"},{indexed:!1,internalType:"uint256",name:"feeAmount",type:"uint256"}],name:"FeeTaken",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address payable",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBasisPoints",type:"uint256"}],internalType:"struct IImmutableSwapProxy.SecondaryFeeParams[]",name:"secondaryFees",type:"tuple[]"},{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IV3SwapRouter.ExactInputSingleParams",name:"swapParams",type:"tuple"}],name:"exactInputSingleWithSecondaryFee",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address payable",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBasisPoints",type:"uint256"}],internalType:"struct IImmutableSwapProxy.SecondaryFeeParams[]",name:"secondaryFees",type:"tuple[]"},{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct IV3SwapRouter.ExactInputParams",name:"swapParams",type:"tuple"}],name:"exactInputWithSecondaryFee",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address payable",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBasisPoints",type:"uint256"}],internalType:"struct IImmutableSwapProxy.SecondaryFeeParams[]",name:"secondaryFees",type:"tuple[]"},{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IV3SwapRouter.ExactOutputSingleParams",name:"swapParams",type:"tuple"}],name:"exactOutputSingleWithSecondaryFee",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address payable",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBasisPoints",type:"uint256"}],internalType:"struct IImmutableSwapProxy.SecondaryFeeParams[]",name:"secondaryFees",type:"tuple[]"},{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct IV3SwapRouter.ExactOutputParams",name:"swapParams",type:"tuple"}],name:"exactOutputWithSecondaryFee",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"}],name:"unwrapNativeToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"erc20",type:"address"}],name:"withdrawFunds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"withdrawFunds",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],zQ="0x60806040523480156200001157600080fd5b50604051620034dd380380620034dd83398101604081905262000034916200015c565b6001805460ff191690556200004b6000846200009e565b600180546001600160a01b039384166101008102610100600160a81b03199092169190911790915560038054929093166001600160a01b03199283161790925560028054909116909117905550620001a6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200013b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b03811681146200015757600080fd5b919050565b6000806000606084860312156200017257600080fd5b6200017d846200013f565b92506200018d602085016200013f565b91506200019d604085016200013f565b90509250925092565b61332780620001b66000396000f3fe6080604052600436106101175760003560e01c806358e81a50116100a05780638456cb59116100645780638456cb59146102c457806391d14854146102d9578063a217fddf146102f9578063ac9650d81461030e578063d547741f1461032e57600080fd5b806358e81a50146102465780635ae401dc146102595780635c975abb146102795780635ebca7991461029157806368742da6146102a457600080fd5b80632f2ff15d116100e75780632f2ff15d146101cb57806336568abe146101eb578063383ebb0b1461020b5780633f4ba83a1461021e5780635640f6591461023357600080fd5b80620fa9fb1461012357806301ffc9a714610145578063116944b21461017a578063248a9ca31461019b57600080fd5b3661011e57005b600080fd5b34801561012f57600080fd5b5061014361013e366004612ab8565b61034e565b005b34801561015157600080fd5b50610165610160366004612af1565b61041a565b60405190151581526020015b60405180910390f35b61018d610188366004612c89565b610451565b604051908152602001610171565b3480156101a757600080fd5b5061018d6101b6366004612cde565b60009081526020819052604090206001015490565b3480156101d757600080fd5b506101436101e6366004612cf7565b610771565b3480156101f757600080fd5b50610143610206366004612cf7565b610796565b61018d610219366004612ddf565b610819565b34801561022a57600080fd5b50610143610b86565b61018d610241366004612ddf565b610bd6565b61018d610254366004612c89565b610ee4565b61026c610267366004612e8b565b61121e565b6040516101719190612f26565b34801561028557600080fd5b5060015460ff16610165565b61014361029f366004612cde565b611255565b3480156102b057600080fd5b506101436102bf366004612f88565b6113ad565b3480156102d057600080fd5b50610143611428565b3480156102e557600080fd5b506101656102f4366004612cf7565b611476565b34801561030557600080fd5b5061018d600081565b34801561031a57600080fd5b5061026c610329366004612fa5565b61149f565b34801561033a57600080fd5b50610143610349366004612cf7565b611593565b6103787f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b610394576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190612fe6565b90506104156001600160a01b03831684836115b8565b505050565b60006001600160e01b03198216637965db0b60e01b148061044b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061045f60015460ff1690565b1561047d5760405163ab35696f60e01b815260040160405180910390fd5b61048a826060015161161b565b6104a75760405163519bdea760e01b815260040160405180910390fd5b608082015134801561065a57836080015181146104d7576040516342f7487960e11b815260040160405180910390fd5b60035484516001600160a01b03908116911614610507576040516324d0121760e01b815260040160405180910390fd5b60008061056f866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b828210156105655761055660408302860136819003810190612fff565b81526020019060010190610539565b5050505050611641565b608088018290526001546040516304e45aaf60e01b815292945090925061010090046001600160a01b0316906304e45aaf9084906105b1908a90600401613056565b60206040518083038185885af11580156105cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105f49190612fe6565b945061065384828a8a808060200260200160405190810160405280939291908181526020016000905b828210156106495761063a60408302860136819003810190612fff565b8152602001906001019061061d565b5050505050611679565b5050610768565b6000806106b8866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610565576106a960408302860136819003810190612fff565b8152602001906001019061068c565b60808801829052875191935091506106db906001600160a01b031633308561170c565b6001546040516304e45aaf60e01b81526101009091046001600160a01b0316906304e45aaf9061070f908990600401613056565b6020604051808303816000875af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107529190612fe6565b9450610765866000015185838b8b61174a565b50505b50509392505050565b60008281526020819052604090206001015461078c8161184b565b6104158383611855565b6001600160a01b038116331461080b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61081582826118d9565b5050565b600061082760015460ff1690565b156108455760405163ab35696f60e01b815260040160405180910390fd5b610852826020015161161b565b61086f5760405163519bdea760e01b815260040160405180910390fd5b600061087e836000015161193e565b606084015190915034908115610a30576003546001600160a01b038481169116146108bc576040516324d0121760e01b815260040160405180910390fd5b846060015182146108e0576040516342f7487960e11b815260040160405180910390fd5b600061094286606001518989808060200260200160405190810160405280939291908181526020016000905b828210156109385761092960408302860136819003810190612fff565b8152602001906001019061090c565b5050505050611974565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b81346908490610985908b906004016130fc565b60206040518083038185885af11580156109a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109c89190612fe6565b9050610a2781848b8b808060200260200160405190810160405280939291908181526020016000905b82821015610a1d57610a0e60408302860136819003810190612fff565b815260200190600101906109f1565b50505050506119c3565b95505050610b7c565b6000610a938487606001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a8957610a7a60408302860136819003810190612fff565b81526020019060010190610a5d565b5050505050611aab565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b8134690610ad4908a906004016130fc565b6020604051808303816000875af1158015610af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b179190612fe6565b9050610b778582858c8c808060200260200160405190810160405280939291908181526020016000905b82821015610b6d57610b5e60408302860136819003810190612fff565b81526020019060010190610b41565b5050505050611b03565b955050505b5050509392505050565b610bb07fe7276a2a84d8de556657ec9cf93a55a7d66f096e529d0582ed08e9e2208b92b533611476565b610bcc576040516282b42960e81b815260040160405180910390fd5b610bd4611b57565b565b6000610be460015460ff1690565b15610c025760405163ab35696f60e01b815260040160405180910390fd5b610c0f826020015161161b565b610c2c5760405163519bdea760e01b815260040160405180910390fd5b6000610c3b8360000151611ba9565b6040840151909150348015610dd75784604001518114610c6e576040516342f7487960e11b815260040160405180910390fd5b6003546001600160a01b03848116911614610c9c576040516324d0121760e01b815260040160405180910390fd5b600080610cf68588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610ce760408302860136819003810190612fff565b81526020019060010190610cca565b6040898101839052600154905163b858183f60e01b815292945090925061010090046001600160a01b03169063b858183f908490610d38908b906004016130fc565b60206040518083038185885af1158015610d56573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d7b9190612fe6565b9550610dd084828b8b808060200260200160405190810160405280939291908181526020016000905b8282101561064957610dc160408302860136819003810190612fff565b81526020019060010190610da4565b5050610b7c565b600080610e318588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610e2260408302860136819003810190612fff565b81526020019060010190610e05565b604089018290529092509050610e526001600160a01b03861633308561170c565b60015460405163b858183f60e01b81526101009091046001600160a01b03169063b858183f90610e86908a906004016130fc565b6020604051808303816000875af1158015610ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec99190612fe6565b9550610ed88585838c8c61174a565b50505050509392505050565b6000610ef260015460ff1690565b15610f105760405163ab35696f60e01b815260040160405180910390fd5b610f1d826060015161161b565b610f3a5760405163519bdea760e01b815260040160405180910390fd5b60a0820151349081156110d75760035484516001600160a01b03908116911614610f77576040516324d0121760e01b815260040160405180910390fd5b8360a001518214610f9b576040516342f7487960e11b815260040160405180910390fd5b6000610ff38560a001518888808060200260200160405190810160405280939291908181526020016000905b8282101561093857610fe460408302860136819003810190612fff565b81526020019060010190610fc7565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df908490611036908a90600401613056565b60206040518083038185885af1158015611054573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110799190612fe6565b90506110ce81848a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a1d576110bf60408302860136819003810190612fff565b815260200190600101906110a2565b94505050610768565b600061113485600001518660a001518989808060200260200160405190810160405280939291908181526020016000905b82821015610a895761112560408302860136819003810190612fff565b81526020019060010190611108565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df90611175908990600401613056565b6020604051808303816000875af1158015611194573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b89190612fe6565b9050611212866000015182858b8b808060200260200160405190810160405280939291908181526020016000905b82821015610b6d5761120360408302860136819003810190612fff565b815260200190600101906111e6565b98975050505050505050565b6060834211156112415760405163387b2e5560e11b815260040160405180910390fd5b61124b838361149f565b90505b9392505050565b60015460ff16156112795760405163ab35696f60e01b815260040160405180910390fd5b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156112c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e69190612fe6565b905081811015611313576040516342fb4ceb60e11b81526004810183905260248101829052604401610802565b801561081557600354604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b5050505060006113833383611bb5565b905080610415576040516342fb4ceb60e11b81526004810184905260248101839052604401610802565b6113d77f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b6113f3576040516282b42960e81b815260040160405180910390fd5b47156114255760006114058247611bb5565b90508061081557604051633398652560e11b815260040160405180910390fd5b50565b6114527ffcb9fcbfa83b897fb2d5cf4b58962164105c1e71489a37ef3ae0db3fdce576f633611476565b61146e576040516282b42960e81b815260040160405180910390fd5b610bd4611c5f565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060816001600160401b038111156114b9576114b9612b66565b6040519080825280602002602001820160405280156114ec57816020015b60608152602001906001900390816114d75790505b50905060005b8281101561158c5761155c308585848181106115105761151061310f565b90506020028101906115229190613125565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c9a92505050565b82828151811061156e5761156e61310f565b6020026020010181905250808061158490613181565b9150506114f2565b5092915050565b6000828152602081905260409020600101546115ae8161184b565b61041583836118d9565b6040516001600160a01b03831660248201526044810182905261041590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cbf565b60006001600160a01b03821633148061044b57506001600160a01b038216301492915050565b60008061164d83611d94565b506116588484611e07565b509050611665818561319a565b91506116718583611f30565b935093915050565b600061168361202d565b905060006116928583866120a4565b90506000806116a18386611e07565b915091506116ae816120d0565b8315611703576000826116c1858a61319a565b6116cb919061319a565b905080156117015760006116df3383611bb5565b9050806116ff576040516382e4f46960e01b815260040160405180910390fd5b505b505b50505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526117449085906323b872dd60e01b906084016115e4565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015611791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b59190612fe6565b905060006117c48683876120a4565b90506000611824828686808060200260200160405190810160405280939291908181526020016000905b8282101561181a5761180b60408302860136819003810190612fff565b815260200190600101906117ee565b5050505050611e07565b91505061183188826121af565b8215611701576117016001600160a01b03891633856115b8565b61142581336122b8565b61185f8282611476565b610815576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556118953390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6118e38282611476565b15610815576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806014835161194f919061319a565b9050600061195f84836014612311565b905061196c81600061241e565b949350505050565b60008061198083611d94565b90506000611990826127106131ad565b905060006119a18661271084612483565b6003549091506119ba906001600160a01b031682611f30565b95945050505050565b60008060006119d28685611e07565b915091506119df816120d0565b600260009054906101000a90046001600160a01b03166001600160a01b03166312210e8a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611a2f57600080fd5b505af1158015611a43573d6000803e3d6000fd5b505050506000828787611a56919061319a565b611a60919061319a565b90508015611a96576000611a743383611bb5565b905080611a94576040516382e4f46960e01b815260040160405180910390fd5b505b611aa083886131ad565b979650505050505050565b600080611ab783611d94565b90506000611ac7826127106131ad565b90506000611ad88661271084612483565b9050611ae48782611f30565b611af96001600160a01b03881633308961170c565b9695505050505050565b6000806000611b128685611e07565b91509150611b2087826124c3565b600082611b2d888861319a565b611b37919061319a565b9050611b4d6001600160a01b03891633836115b8565b61121283886131ad565b611b5f6125ca565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061044b828261241e565b600081471015611c075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610802565b6040516001600160a01b038416908390600081818185875af1925050503d8060008114611c50576040519150601f19603f3d011682016040523d82523d6000602084013e611c55565b606091505b5090949350505050565b611c67612613565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611b8c565b606061124e83836040518060600160405280602781526020016132cb60279139612659565b6000611d14826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126c79092919063ffffffff16565b9050805160001480611d35575080806020019051810190611d3591906131c0565b6104155760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610802565b6000805b8251811015611dde57828181518110611db357611db361310f565b60200260200101516020015182611dca91906131ad565b915080611dd681613181565b915050611d98565b506103e8811115611e025760405163cd4e616760e01b815260040160405180910390fd5b919050565b6000606082516001600160401b03811115611e2457611e24612b66565b604051908082528060200260200182016040528015611e6957816020015b6040805180820190915260008082526020820152815260200190600190039081611e425790505b50905060005b8351811015611f28576000611eae858381518110611e8f57611e8f61310f565b602002602001015160200151612710886126d69092919063ffffffff16565b90506040518060400160405280868481518110611ecd57611ecd61310f565b6020026020010151600001516001600160a01b0316815260200182815250838381518110611efd57611efd61310f565b6020908102919091010152611f1281856131ad565b9350508080611f2090613181565b915050611e6f565b509250929050565b600154604051636eb1769f60e11b81523060048201526001600160a01b0361010090920482166024820152829184169063dd62ed3e90604401602060405180830381865afa158015611f86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611faa9190612fe6565b10156108155760015460405163095ea7b360e01b81526101009091046001600160a01b039081166004830152600019602483015283169063095ea7b3906044016020604051808303816000875af1158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041591906131c0565b60025460408051630910874560e11b8152905160009247926001600160a01b03909116916312210e8a91600480820192879290919082900301818387803b15801561207757600080fd5b505af115801561208b573d6000803e3d6000fd5b5047925061209d91508390508261319a565b9250505090565b600082156120c857816120b7848661319a565b6120c1919061319a565b905061124e565b509192915050565b60005b81518110156108155760008282815181106120f0576120f061310f565b60200260200101519050600061210e82600001518360200151611bb5565b90508061214557815160208301516040516208c3b360e61b81526001600160a01b0390921660048301526024820152604401610802565b81600001516001600160a01b0316336001600160a01b03167fe0e765ab26c1caf691c510426951246128b96830e49cc81d8c093fd551abac35846020015160405161219291815260200190565b60405180910390a3505080806121a790613181565b9150506120d3565b60005b815181101561041557612215338383815181106121d1576121d161310f565b6020026020010151600001518484815181106121ef576121ef61310f565b602002602001015160200151866001600160a01b031661170c909392919063ffffffff16565b8181815181106122275761222761310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106122835761228361310f565b60200260200101516020015160405161229e91815260200190565b60405180910390a4806122b081613181565b9150506121b2565b6122c28282611476565b610815576122cf81612778565b6122da83602061278a565b6040516020016122eb9291906131e2565b60408051601f198184030181529082905262461bcd60e51b825261080291600401613257565b60608161231f81601f6131ad565b101561235e5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610802565b61236882846131ad565b845110156123ac5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610802565b6060821580156123cb5760405191506000825260208201604052612415565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156124045780518352602092830192016123ec565b5050858452601f01601f1916604052505b50949350505050565b600061242b8260146131ad565b835110156124735760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610802565b500160200151600160601b900490565b60006124908484846126d6565b9050600082806124a2576124a261326a565b848609111561124e5760001981106124b957600080fd5b6001019392505050565b60005b8151811015610415576125278282815181106124e4576124e461310f565b6020026020010151600001518383815181106125025761250261310f565b602002602001015160200151856001600160a01b03166115b89092919063ffffffff16565b8181815181106125395761253961310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106125955761259561310f565b6020026020010151602001516040516125b091815260200190565b60405180910390a4806125c281613181565b9150506124c6565b60015460ff16610bd45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610802565b60015460ff1615610bd45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610802565b6060600080856001600160a01b0316856040516126769190613280565b600060405180830381855af49150503d80600081146126b1576040519150601f19603f3d011682016040523d82523d6000602084013e6126b6565b606091505b5091509150611af986838387612925565b606061124b848460008561299e565b600083830281600019858709828110838203039150508084116126f857600080fd5b8060000361270b5750829004905061124e565b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b606061044b6001600160a01b03831660145b6060600061279983600261329c565b6127a49060026131ad565b6001600160401b038111156127bb576127bb612b66565b6040519080825280601f01601f1916602001820160405280156127e5576020820181803683370190505b509050600360fc1b816000815181106128005761280061310f565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061282f5761282f61310f565b60200101906001600160f81b031916908160001a905350600061285384600261329c565b61285e9060016131ad565b90505b60018111156128d6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128925761289261310f565b1a60f81b8282815181106128a8576128a861310f565b60200101906001600160f81b031916908160001a90535060049490941c936128cf816132b3565b9050612861565b50831561124e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610802565b6060831561299457825160000361298d576001600160a01b0385163b61298d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610802565b508161196c565b61196c8383612a6e565b6060824710156129ff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610802565b600080866001600160a01b03168587604051612a1b9190613280565b60006040518083038185875af1925050503d8060008114612a58576040519150601f19603f3d011682016040523d82523d6000602084013e612a5d565b606091505b5091509150611aa087838387612925565b815115612a7e5781518083602001fd5b8060405162461bcd60e51b81526004016108029190613257565b6001600160a01b038116811461142557600080fd5b8035611e0281612a98565b60008060408385031215612acb57600080fd5b8235612ad681612a98565b91506020830135612ae681612a98565b809150509250929050565b600060208284031215612b0357600080fd5b81356001600160e01b03198116811461124e57600080fd5b60008083601f840112612b2d57600080fd5b5081356001600160401b03811115612b4457600080fd5b6020830191508360208260061b8501011115612b5f57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715612b9e57612b9e612b66565b60405290565b604051608081016001600160401b0381118282101715612b9e57612b9e612b66565b604051601f8201601f191681016001600160401b0381118282101715612bee57612bee612b66565b604052919050565b600060e08284031215612c0857600080fd5b612c10612b7c565b90508135612c1d81612a98565b81526020820135612c2d81612a98565b6020820152604082013562ffffff81168114612c4857600080fd5b6040820152612c5960608301612aad565b60608201526080820135608082015260a082013560a0820152612c7e60c08301612aad565b60c082015292915050565b60008060006101008486031215612c9f57600080fd5b83356001600160401b03811115612cb557600080fd5b612cc186828701612b1b565b9094509250612cd590508560208601612bf6565b90509250925092565b600060208284031215612cf057600080fd5b5035919050565b60008060408385031215612d0a57600080fd5b823591506020830135612ae681612a98565b600060808284031215612d2e57600080fd5b612d36612ba4565b905081356001600160401b0380821115612d4f57600080fd5b818401915084601f830112612d6357600080fd5b8135602082821115612d7757612d77612b66565b612d89601f8301601f19168201612bc6565b92508183528681838601011115612d9f57600080fd5b81818501828501376000818385010152828552612dbd818701612aad565b8186015250505050604082013560408201526060820135606082015292915050565b600080600060408486031215612df457600080fd5b83356001600160401b0380821115612e0b57600080fd5b612e1787838801612b1b565b90955093506020860135915080821115612e3057600080fd5b50612e3d86828701612d1c565b9150509250925092565b60008083601f840112612e5957600080fd5b5081356001600160401b03811115612e7057600080fd5b6020830191508360208260051b8501011115612b5f57600080fd5b600080600060408486031215612ea057600080fd5b8335925060208401356001600160401b03811115612ebd57600080fd5b612ec986828701612e47565b9497909650939450505050565b60005b83811015612ef1578181015183820152602001612ed9565b50506000910152565b60008151808452612f12816020860160208601612ed6565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612f7b57603f19888603018452612f69858351612efa565b94509285019290850190600101612f4d565b5092979650505050505050565b600060208284031215612f9a57600080fd5b813561124e81612a98565b60008060208385031215612fb857600080fd5b82356001600160401b03811115612fce57600080fd5b612fda85828601612e47565b90969095509350505050565b600060208284031215612ff857600080fd5b5051919050565b60006040828403121561301157600080fd5b604051604081018181106001600160401b038211171561303357613033612b66565b604052823561304181612a98565b81526020928301359281019290925250919050565b60e0810161044b828480516001600160a01b03908116835260208083015182169084015260408083015162ffffff16908401526060808301518216908401526080808301519084015260a0828101519084015260c09182015116910152565b60008151608084526130ca6080850182612efa565b6020848101516001600160a01b0316908601526040808501519086015260609384015193909401929092525090919050565b60208152600061124e60208301846130b5565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261313c57600080fd5b8301803591506001600160401b0382111561315657600080fd5b602001915036819003821315612b5f57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131935761319361316b565b5060010190565b8181038181111561044b5761044b61316b565b8082018082111561044b5761044b61316b565b6000602082840312156131d257600080fd5b8151801515811461124e57600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161321a816017850160208801612ed6565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161324b816028840160208801612ed6565b01602801949350505050565b60208152600061124e6020830184612efa565b634e487b7160e01b600052601260045260246000fd5b60008251613292818460208701612ed6565b9190910192915050565b808202811582820484141761044b5761044b61316b565b6000816132c2576132c261316b565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220162c0f9d1b47c666f486fc65c7c7502bb0e7378e3166be6f93d98943154831c364736f6c63430008130033";class ImmutableSwapProxy__factory extends ContractFactory{constructor(...G){G.length>1?super(...G):super(WQ,zQ,G[0])}deploy(G,K,ne,ue){return super.deploy(G,K,ne,ue||{})}getDeployTransaction(G,K,ne,ue){return super.getDeployTransaction(G,K,ne,ue||{})}attach(G){return super.attach(G)}connect(G){return super.connect(G)}static bytecode=zQ;static abi=WQ;static createInterface(){return new Ho(WQ)}static connect(G,K){return new iu(G,WQ,K)}}const VQ=[{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct UniswapInterfaceMulticall.Call[]",name:"calls",type:"tuple[]"}],name:"multicall",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"uint256",name:"gasUsed",type:"uint256"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct UniswapInterfaceMulticall.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"}],KQ="0x608060405234801561001057600080fd5b50610567806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630f28c97d146100465780631749e1e3146100645780634d2301cc14610085575b600080fd5b61004e610098565b60405161005b919061041f565b60405180910390f35b6100776100723660046102a7565b61009c565b60405161005b929190610428565b61004e610093366004610286565b610220565b4290565b8051439060609067ffffffffffffffff811180156100b957600080fd5b506040519080825280602002602001820160405280156100f357816020015b6100e061023a565b8152602001906001900390816100d85790505b50905060005b835181101561021a57600080600086848151811061011357fe5b60200260200101516000015187858151811061012b57fe5b60200260200101516020015188868151811061014357fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101839190610403565b60006040518083038160008787f1925050503d80600081146101c1576040519150601f19603f3d011682016040523d82523d6000602084013e6101c6565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508989815181106101fb57fe5b60200260200101819052505050505050505080806001019150506100f9565b50915091565b73ffffffffffffffffffffffffffffffffffffffff163190565b604051806060016040528060001515815260200160008152602001606081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461028157600080fd5b919050565b600060208284031215610297578081fd5b6102a08261025d565b9392505050565b600060208083850312156102b9578182fd5b823567ffffffffffffffff808211156102d0578384fd5b818501915085601f8301126102e3578384fd5b8135818111156102ef57fe5b6102fc8485830201610506565b81815284810190848601875b848110156103f457813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0606081838f03011215610346578a8bfd5b60408051606081018181108b8211171561035c57fe5b8252610369848d0161025d565b8152818401358c82015260608401358a811115610384578d8efd5b8085019450508e603f850112610398578c8dfd5b8b8401358a8111156103a657fe5b6103b68d85601f84011601610506565b93508084528f838287010111156103cb578d8efd5b808386018e86013783018c018d9052908101919091528552509287019290870190600101610308565b50909998505050505050505050565b6000825161041581846020870161052a565b9190910192915050565b90815260200190565b600060408083018584526020828186015281865180845260609350838701915083838202880101838901875b838110156104f6578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001855281518051151584528681015187850152880151888401889052805188850181905260806104b582828801858c0161052a565b96880196601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01694909401909301925090850190600101610454565b50909a9950505050505050505050565b60405181810167ffffffffffffffff8111828210171561052257fe5b604052919050565b60005b8381101561054557818101518382015260200161052d565b83811115610554576000848401525b5050505056fea164736f6c6343000706000a";class Multicall__factory extends ContractFactory{constructor(...G){G.length>1?super(...G):super(VQ,KQ,G[0])}deploy(G){return super.deploy(G||{})}getDeployTransaction(G){return super.getDeployTransaction(G||{})}attach(G){return super.attach(G)}connect(G){return super.connect(G)}static bytecode=KQ;static abi=VQ;static createInterface(){return new Ho(VQ)}static connect(G,K){return new iu(G,VQ,K)}}const JQ=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"int24",name:"tickLower",type:"int24"},{indexed:!0,internalType:"int24",name:"tickUpper",type:"int24"},{indexed:!1,internalType:"uint128",name:"amount",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{indexed:!0,internalType:"int24",name:"tickLower",type:"int24"},{indexed:!0,internalType:"int24",name:"tickUpper",type:"int24"},{indexed:!1,internalType:"uint128",name:"amount0",type:"uint128"},{indexed:!1,internalType:"uint128",name:"amount1",type:"uint128"}],name:"Collect",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint128",name:"amount0",type:"uint128"},{indexed:!1,internalType:"uint128",name:"amount1",type:"uint128"}],name:"CollectProtocol",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!1,internalType:"uint256",name:"paid0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"paid1",type:"uint256"}],name:"Flash",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint16",name:"observationCardinalityNextOld",type:"uint16"},{indexed:!1,internalType:"uint16",name:"observationCardinalityNextNew",type:"uint16"}],name:"IncreaseObservationCardinalityNext",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint160",name:"sqrtPriceX96",type:"uint160"},{indexed:!1,internalType:"int24",name:"tick",type:"int24"}],name:"Initialize",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"int24",name:"tickLower",type:"int24"},{indexed:!0,internalType:"int24",name:"tickUpper",type:"int24"},{indexed:!1,internalType:"uint128",name:"amount",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"feeProtocol0Old",type:"uint8"},{indexed:!1,internalType:"uint8",name:"feeProtocol1Old",type:"uint8"},{indexed:!1,internalType:"uint8",name:"feeProtocol0New",type:"uint8"},{indexed:!1,internalType:"uint8",name:"feeProtocol1New",type:"uint8"}],name:"SetFeeProtocol",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"int256",name:"amount0",type:"int256"},{indexed:!1,internalType:"int256",name:"amount1",type:"int256"},{indexed:!1,internalType:"uint160",name:"sqrtPriceX96",type:"uint160"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"int24",name:"tick",type:"int24"}],name:"Swap",type:"event"},{inputs:[{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"amount",type:"uint128"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"amount0Requested",type:"uint128"},{internalType:"uint128",name:"amount1Requested",type:"uint128"}],name:"collect",outputs:[{internalType:"uint128",name:"amount0",type:"uint128"},{internalType:"uint128",name:"amount1",type:"uint128"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint128",name:"amount0Requested",type:"uint128"},{internalType:"uint128",name:"amount1Requested",type:"uint128"}],name:"collectProtocol",outputs:[{internalType:"uint128",name:"amount0",type:"uint128"},{internalType:"uint128",name:"amount1",type:"uint128"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"fee",outputs:[{internalType:"uint24",name:"",type:"uint24"}],stateMutability:"view",type:"function"},{inputs:[],name:"feeGrowthGlobal0X128",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"feeGrowthGlobal1X128",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"flash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint16",name:"observationCardinalityNext",type:"uint16"}],name:"increaseObservationCardinalityNext",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"liquidity",outputs:[{internalType:"uint128",name:"",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxLiquidityPerTick",outputs:[{internalType:"uint128",name:"",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"amount",type:"uint128"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"observations",outputs:[{internalType:"uint32",name:"blockTimestamp",type:"uint32"},{internalType:"int56",name:"tickCumulative",type:"int56"},{internalType:"uint160",name:"secondsPerLiquidityCumulativeX128",type:"uint160"},{internalType:"bool",name:"initialized",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32[]",name:"secondsAgos",type:"uint32[]"}],name:"observe",outputs:[{internalType:"int56[]",name:"tickCumulatives",type:"int56[]"},{internalType:"uint160[]",name:"secondsPerLiquidityCumulativeX128s",type:"uint160[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"positions",outputs:[{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"protocolFees",outputs:[{internalType:"uint128",name:"token0",type:"uint128"},{internalType:"uint128",name:"token1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint8",name:"feeProtocol0",type:"uint8"},{internalType:"uint8",name:"feeProtocol1",type:"uint8"}],name:"setFeeProtocol",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"slot0",outputs:[{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"},{internalType:"int24",name:"tick",type:"int24"},{internalType:"uint16",name:"observationIndex",type:"uint16"},{internalType:"uint16",name:"observationCardinality",type:"uint16"},{internalType:"uint16",name:"observationCardinalityNext",type:"uint16"},{internalType:"uint8",name:"feeProtocol",type:"uint8"},{internalType:"bool",name:"unlocked",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"}],name:"snapshotCumulativesInside",outputs:[{internalType:"int56",name:"tickCumulativeInside",type:"int56"},{internalType:"uint160",name:"secondsPerLiquidityInsideX128",type:"uint160"},{internalType:"uint32",name:"secondsInside",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"bool",name:"zeroForOne",type:"bool"},{internalType:"int256",name:"amountSpecified",type:"int256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[{internalType:"int256",name:"amount0",type:"int256"},{internalType:"int256",name:"amount1",type:"int256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int16",name:"",type:"int16"}],name:"tickBitmap",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"tickSpacing",outputs:[{internalType:"int24",name:"",type:"int24"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int24",name:"",type:"int24"}],name:"ticks",outputs:[{internalType:"uint128",name:"liquidityGross",type:"uint128"},{internalType:"int128",name:"liquidityNet",type:"int128"},{internalType:"uint256",name:"feeGrowthOutside0X128",type:"uint256"},{internalType:"uint256",name:"feeGrowthOutside1X128",type:"uint256"},{internalType:"int56",name:"tickCumulativeOutside",type:"int56"},{internalType:"uint160",name:"secondsPerLiquidityOutsideX128",type:"uint160"},{internalType:"uint32",name:"secondsOutside",type:"uint32"},{internalType:"bool",name:"initialized",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}],XQ="0x6101606040523480156200001257600080fd5b503060601b60805260408051630890357360e41b81529051600091339163890357309160048082019260a092909190829003018186803b1580156200005657600080fd5b505afa1580156200006b573d6000803e3d6000fd5b505050506040513d60a08110156200008257600080fd5b508051602080830151604084015160608086015160809096015160e896871b6001600160e81b0319166101005291811b6001600160601b031990811660e05292811b831660c0529390931b1660a052600282810b900b90921b610120529150620000f79082906200010f811b62002b8417901c565b60801b6001600160801b03191661014052506200017d565b60008082600281900b620d89e719816200012557fe5b05029050600083600281900b620d89e8816200013d57fe5b0502905060008460020b83830360020b816200015557fe5b0560010190508062ffffff166001600160801b038016816200017357fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160e81c6101205160e81c6101405160801c61567e6200024a60003980611fee5280614b5f5280614b96525080610c0052806128fd5280614bca5280614bfc525080610cef52806119cb5280611a0252806129455250806111c75280611a855280611ef4528061244452806129215280613e6b5250806108d252806112f55280611a545280611e8e52806123be5280613d2252508061207b528061227d52806128d9525080612bfb525061567e6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f4314610800578063f305839914610820578063f30dba9314610828578063f637731d146108aa576101ae565b8063c45a0155146107d1578063d0c93a7c146107d9578063d21220a7146107f8576101ae565b8063883bdbfd116100c8578063883bdbfd14610633578063a34123a71461073c578063a38807f214610776576101ae565b806370cf754a146105c65780638206a4d1146105ce57806385b66729146105f6576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc146104705780634f1eb3d8146104fc578063514ea4bf1461054d5780635339c296146105a6576101ae565b80633850c7bd1461035b5780633c8a7d8d146103b45780634614131914610456576101ae565b80631ad8b03b1161018c5780631ad8b03b146102aa578063252c09d7146102e157806332148f6714610338576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610286575b600080fd5b6101bb6108d0565b604080516001600160a01b039092168252519081900360200190f35b61026d600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a08101608082013564010000000081111561022e57600080fd5b82018360208201111561024057600080fd5b8035906020019184600183028401116401000000008311171561026257600080fd5b5090925090506108f4565b6040805192835260208301919091528051918290030190f35b61028e6114ad565b604080516001600160801b039092168252519081900360200190f35b6102b26114bc565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fe600480360360208110156102f757600080fd5b50356114d6565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103596004803603602081101561034e57600080fd5b503561ffff1661151c565b005b610363611616565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b61026d600480360360a08110156103ca57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a08101608082013564010000000081111561041757600080fd5b82018360208201111561042957600080fd5b8035906020019184600183028401116401000000008311171561044b57600080fd5b509092509050611666565b61045e611922565b60408051918252519081900360200190f35b6103596004803603608081101561048657600080fd5b6001600160a01b0382351691602081013591604082013591908101906080810160608201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050611928565b6102b2600480360360a081101561051257600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611d83565b61056a6004803603602081101561056357600080fd5b5035611f9d565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045e600480360360208110156105bc57600080fd5b503560010b611fda565b61028e611fec565b610359600480360360408110156105e457600080fd5b5060ff81358116916020013516612010565b6102b26004803603606081101561060c57600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661220f565b6106a36004803603602081101561064957600080fd5b81019060208101813564010000000081111561066457600080fd5b82018360208201111561067657600080fd5b8035906020019184602083028401116401000000008311171561069857600080fd5b5090925090506124dc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106e75781810151838201526020016106cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561072657818101518382015260200161070e565b5050505090500194505050505060405180910390f35b61026d6004803603606081101561075257600080fd5b508035600290810b91602081013590910b90604001356001600160801b0316612569565b6107a06004803603604081101561078c57600080fd5b508035600290810b9160200135900b6126e0565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b6101bb6128d7565b6107e16128fb565b6040805160029290920b8252519081900360200190f35b6101bb61291f565b610808612943565b6040805162ffffff9092168252519081900360200190f35b61045e612967565b6108486004803603602081101561083e57600080fd5b503560020b61296d565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610359600480360360208110156108c057600080fd5b50356001600160a01b03166129db565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806108ff612bf0565b85610936576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b8104909216608082015260ff600160e81b8304811660a0830152600160f01b909204909116151560c082018190526109ef576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a3a5780600001516001600160a01b0316866001600160a01b0316118015610a35575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a6c565b80600001516001600160a01b0316866001600160a01b0316108015610a6c57506401000276a36001600160a01b038716115b610aa3576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6000805460ff60f01b191681556040805160c08101909152808a610ad25760048460a0015160ff16901c610ae5565b60108460a0015160ff1681610ae357fe5b065b60ff1681526004546001600160801b03166020820152604001610b06612c27565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b8257600254610b86565b6001545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bd55750886001600160a01b031681604001516001600160a01b031614155b15610f9f57610be261560e565b60408201516001600160a01b031681526060820151610c25906006907f00000000000000000000000000000000000000000000000000000000000000008f612c2b565b15156040830152600290810b810b60208301819052620d89e719910b1215610c5657620d89e7196020820152610c75565b6020810151620d89e860029190910b1315610c7557620d89e860208201525b610c828160200151612d6d565b6001600160a01b031660608201526040820151610d13908d610cbc578b6001600160a01b031683606001516001600160a01b031611610cd6565b8b6001600160a01b031683606001516001600160a01b0316105b610ce4578260600151610ce6565b8b5b60c085015185517f000000000000000000000000000000000000000000000000000000000000000061309f565b60c085015260a084015260808301526001600160a01b031660408301528215610d7557610d498160c00151826080015101613291565b825103825260a0810151610d6b90610d6090613291565b6020840151906132a7565b6020830152610db0565b610d828160a00151613291565b825101825260c08101516080820151610daa91610d9f9101613291565b6020840151906132c3565b60208301525b835160ff1615610df6576000846000015160ff168260c0015181610dd057fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e3557610e298160c00151600160801b8460c001516001600160801b03166132d9565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f5e57806040015115610f35578360a00151610ebf57610e9d846040015160008760200151886040015188602001518a606001516008613389909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f0b82602001518e610ed657600154610edc565b84608001515b8f610eeb578560800151610eef565b6002545b608089015160608a015160408b0151600595949392919061351c565b90508c15610f17576000035b610f258360c00151826135ef565b6001600160801b031660c0840152505b8b610f44578060200151610f4d565b60018160200151035b600290810b900b6060830152610f99565b80600001516001600160a01b031682604001516001600160a01b031614610f9957610f8c82604001516136a5565b600290810b900b60608301525b50610baf565b836020015160020b816060015160020b1461107a57600080610fed86604001518660400151886020015188602001518a606001518b6080015160086139d1909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b93909316929092029190911773ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116179055506110ac9050565b60408101516000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110f25760c0810151600480546001600160801b0319166001600160801b039092169190911790555b8a1561114257608081015160015560a08101516001600160801b03161561113d5760a0810151600380546001600160801b031981166001600160801b03918216909301169190911790555b611188565b608081015160025560a08101516001600160801b0316156111885760a0810151600380546001600160801b03808216600160801b92839004821690940116029190911790555b8115158b1515146111a157602081015181518b036111ae565b80600001518a0381602001515b90965094508a156112e75760008512156111f0576111f07f00000000000000000000000000000000000000000000000000000000000000008d87600003613b86565b60006111fa613cd4565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e613cd4565b6112a88289613e0d565b11156112e1576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611411565b600086121561131e5761131e7f00000000000000000000000000000000000000000000000000000000000000008d88600003613b86565b6000611328613e1d565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506113cc613e1d565b6113d68288613e0d565b111561140f576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b60408082015160c083015160608085015184518b8152602081018b90526001600160a01b03948516818701526001600160801b039093169183019190915260020b60808201529151908e169133917fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679181900360a00190a350506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b6004546001600160801b031681565b6003546001600160801b0380821691600160801b90041682565b60088161ffff81106114e757600080fd5b015463ffffffff81169150640100000000810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600054600160f01b900460ff16611560576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611575612bf0565b60008054600160d81b900461ffff169061159160088385613eb5565b6000805461ffff808416600160d81b810261ffff60d81b19909316929092179092559192508316146115fe576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506000805460ff60f01b1916600160f01b17905550565b6000546001600160a01b03811690600160a01b810460020b9061ffff600160b81b8204811691600160c81b8104821691600160d81b8204169060ff600160e81b8204811691600160f01b90041687565b600080548190600160f01b900460ff166116ad576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b191690556001600160801b0385166116cd57600080fd5b60008061171b60405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b81526020016117118a6001600160801b0316613f58565b600f0b9052613f69565b9250925050819350809250600080600086111561173d5761173a613cd4565b91505b841561174e5761174b613e1d565b90505b336001600160a01b031663d348799787878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050600086111561183b576117f9613cd4565b6118038388613e0d565b111561183b576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b841561188b57611849613e1d565b6118538287613e0d565b111561188b576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b60025481565b600054600160f01b900460ff1661196c576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611981612bf0565b6004546001600160801b0316806119c3576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b60006119f8867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a2f867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a3b613cd4565b90506000611a47613e1d565b90508815611a7a57611a7a7f00000000000000000000000000000000000000000000000000000000000000008b8b613b86565b8715611aab57611aab7f00000000000000000000000000000000000000000000000000000000000000008b8a613b86565b336001600160a01b031663e9cbafb085858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506000611b4f613cd4565b90506000611b5b613e1d565b905081611b688588613e0d565b1115611ba0576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611bab8487613e0d565b1115611be3576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611c725760008054600160e81b9004600f16908115611c16578160ff168481611c1057fe5b04611c19565b60005b90506001600160801b03811615611c4c57600380546001600160801b038082168401166001600160801b03199091161790555b611c66818503600160801b8d6001600160801b03166132d9565b60018054909101905550505b8015611cfd5760008054600160e81b900460041c600f16908115611ca2578160ff168381611c9c57fe5b04611ca5565b60005b90506001600160801b03811615611cd757600380546001600160801b03600160801b8083048216850182160291161790555b611cf1818403600160801b8d6001600160801b03166132d9565b60028054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506000805460ff60f01b1916600160f01b179055505050505050505050505050565b600080548190600160f01b900460ff16611dca576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19168155611de460073389896141e3565b60038101549091506001600160801b0390811690861611611e055784611e14565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e3c5783611e52565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611eb7576003810180546001600160801b031981166001600160801b03918216869003821617909155611eb7907f0000000000000000000000000000000000000000000000000000000000000000908a908616613b86565b6001600160801b03821615611f1d576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f1d907f0000000000000000000000000000000000000000000000000000000000000000908a908516613b86565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506000805460ff60f01b1916600160f01b17905590969095509350505050565b60076020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600054600160f01b900460ff16612054576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156120c157600080fd5b505afa1580156120d5573d6000803e3d6000fd5b505050506040513d60208110156120eb57600080fd5b50516001600160a01b0316331461210157600080fd5b60ff82161580612124575060048260ff16101580156121245750600a8260ff1611155b801561214e575060ff8116158061214e575060048160ff161015801561214e5750600a8160ff1611155b61215757600080fd5b60008054610ff0600484901b16840160ff908116600160e81b9081027fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826040805160ff9390920683168252600f600486901c16602083015286831682820152918516606082015290519081900360800190a150506000805460ff60f01b1916600160f01b17905550565b600080548190600160f01b900460ff16612256576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156122c357600080fd5b505afa1580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50516001600160a01b0316331461230357600080fd5b6003546001600160801b039081169085161161231f578361232c565b6003546001600160801b03165b6003549092506001600160801b03600160801b9091048116908416116123525782612366565b600354600160801b90046001600160801b03165b90506001600160801b038216156123e7576003546001600160801b038381169116141561239557600019909101905b600380546001600160801b031981166001600160801b039182168590038216179091556123e7907f00000000000000000000000000000000000000000000000000000000000000009087908516613b86565b6001600160801b0381161561246d576003546001600160801b03828116600160801b90920416141561241857600019015b600380546001600160801b03600160801b80830482168590038216029181169190911790915561246d907f00000000000000000000000000000000000000000000000000000000000000009087908416613b86565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36000805460ff60f01b1916600160f01b1790559094909350915050565b6060806124e7612bf0565b61255e6124f2612c27565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600454600896959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614247565b915091509250929050565b600080548190600160f01b900460ff166125b0576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916815560408051608081018252338152600288810b602083015287900b918101919091528190819061260990606081016125fc6001600160801b038a16613f58565b600003600f0b9052613f69565b925092509250816000039450806000039350600085118061262a5750600084115b15612669576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506000805460ff60f01b1916600160f01b179055509094909350915050565b60008060006126ed612bf0565b6126f785856143a1565b600285810b810b60009081526005602052604080822087840b90930b825281206003830154600681900b9367010000000000000082046001600160a01b0316928492600160d81b810463ffffffff169284929091600160f81b900460ff168061275f57600080fd5b6003820154600681900b985067010000000000000081046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806127a457600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b8304909416608084015260ff600160e81b8304811660a0850152600160f01b909204909116151560c08301529093508e810b91900b1215905061284d575093909403965090039350900390506128d0565b8a60020b816020015160020b12156128c1576000612869612c27565b602083015160408401516004546060860151939450600093849361289f936008938893879392916001600160801b031690613389565b9a9003989098039b5050949096039290920396509091030392506128d0915050565b50949093039650039350900390505b9250925092565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60056020526000908152604090208054600182015460028301546003909301546001600160801b03831693600160801b909304600f0b9290600681900b9067010000000000000081046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a1e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a29826136a5565b9050600080612a41612a39612c27565b60089061446a565b6040805160e0810182526001600160a01b038816808252600288810b6020808501829052600085870181905261ffff898116606088018190529089166080880181905260a08801839052600160c0909801979097528154600160f01b73ffffffffffffffffffffffffffffffffffffffff19909116871762ffffff60a01b1916600160a01b62ffffff9787900b9790971696909602959095177fffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffff16600160c81b9091021761ffff60d81b1916600160d81b909602959095177fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692909217909355835191825281019190915281519395509193507f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c9592918290030190a150505050565b60008082600281900b620d89e71981612b9957fe5b05029050600083600281900b620d89e881612bb057fe5b0502905060008460020b83830360020b81612bc757fe5b0560010190508062ffffff166001600160801b03801681612be457fe5b0493505050505b919050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612c2557600080fd5b565b4290565b60008060008460020b8660020b81612c3f57fe5b05905060008660020b128015612c6657508460020b8660020b81612c5f57fe5b0760020b15155b15612c7057600019015b8315612ce557600080612c82836144b6565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612cc757888360ff16860302612cda565b88612cd1826144c8565b840360ff168603025b965050505050612d63565b600080612cf4836001016144b6565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612d4657888360ff0360ff16866001010102612d5c565b8883612d5183614568565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612d84578260020b612d8c565b8260020b6000035b9050620d89e8811115612dca576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612dde57600160801b612df0565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612e24576ffff97272373d413259a46990580e213a0260801c5b6004821615612e43576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612e62576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612e81576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612ea0576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612ebf576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615612ede576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615612efe576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615612f1e576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615612f3e576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615612f5e576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615612f7e576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615612f9e576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615612fbe576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615612fde576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615612fff576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561301f576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161561303e576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161561305b576b048a170391f7dc42444e8fa20260801c5b60008460020b131561307657806000198161307257fe5b0490505b64010000000081061561308a57600161308d565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a1610158187128015906131245760006130d88989620f42400362ffffff16620f42406132d9565b9050826130f1576130ec8c8c8c6001614652565b6130fe565b6130fe8b8d8c60016146cd565b955085811061310f578a965061311e565b61311b8c8b838661478a565b96505b5061316e565b8161313b576131368b8b8b60006146cd565b613148565b6131488a8c8b6000614652565b935083886000031061315c5789955061316e565b61316b8b8a8a600003856147d6565b95505b6001600160a01b038a81169087161482156131d15780801561318d5750815b6131a35761319e878d8c60016146cd565b6131a5565b855b95508080156131b2575081155b6131c8576131c3878d8c6000614652565b6131ca565b845b945061321b565b8080156131db5750815b6131f1576131ec8c888c6001614652565b6131f3565b855b9550808015613200575081155b613216576132118c888c60006146cd565b613218565b845b94505b8115801561322b57508860000385115b15613237578860000394505b81801561325657508a6001600160a01b0316876001600160a01b031614155b15613265578589039350613282565b61327f868962ffffff168a620f42400362ffffff166141a9565b93505b50505095509550955095915050565b6000600160ff1b82106132a357600080fd5b5090565b808203828113156000831215146132bd57600080fd5b92915050565b818101828112156000831215146132bd57600080fd5b600080806000198587098686029250828110908390030390508061330f576000841161330457600080fd5b508290049050613382565b80841161331b57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff8716613430576000898661ffff1661ffff81106133aa57fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461341c57613419818a8988614822565b90505b806020015181604001519250925050613510565b8688036000806134458c8c858c8c8c8c6148d2565b91509150816000015163ffffffff168363ffffffff161415613477578160200151826040015194509450505050613510565b805163ffffffff8481169116141561349f578060200151816040015194509450505050613510565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b816134cd57fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b031602816134ff57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b036701000000000000008085048216909603169094027fffffffffff0000000000000000000000000000000000000000ffffffffffffff90921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561365457826001600160801b03168260000384039150816001600160801b03161061364f576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6132bd565b826001600160801b03168284019150816001600160801b031610156132bd576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b038316108015906136e1575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b613716576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106137b757607f810383901c91506137c1565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146139c257886001600160a01b03166139a682612d6d565b6001600160a01b031611156139bb57816139bd565b805b6139c4565b815b9998505050505050505050565b6000806000898961ffff1661ffff81106139e757fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613a575788859250925050613510565b8461ffff168461ffff16118015613a7857506001850361ffff168961ffff16145b15613a8557839150613a89565b8491505b8161ffff168960010161ffff1681613a9d57fe5b069250613aac81898989614822565b8a8461ffff1661ffff8110613abd57fe5b825191018054602084015160408501516060909501511515600160f81b027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16640100000000026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613c025780518252601f199092019160209182019101613be3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c64576040519150601f19603f3d011682016040523d82523d6000602084013e613c69565b606091505b5091509150818015613c97575080511580613c975750808060200190516020811015613c9457600080fd5b50515b613ccd576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613d6d5780518252601f199092019160209182019101613d4e565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613dcd576040519150601f19603f3d011682016040523d82523d6000602084013e613dd2565b606091505b5091509150818015613de657506020815110155b613def57600080fd5b808060200190516020811015613e0457600080fd5b50519250505090565b808201828110156132bd57600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613d6d5780518252601f199092019160209182019101613d4e565b6000808361ffff1611613ef3576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff1611613f09575081613382565b825b8261ffff168161ffff161015613f4f576001858261ffff1661ffff8110613f2e57fe5b01805463ffffffff191663ffffffff92909216919091179055600101613f0b565b50909392505050565b80600f81900b8114612beb57600080fd5b6000806000613f76612bf0565b613f88846020015185604001516143a1565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b8504909116608086015260ff600160e81b8504811660a0870152600160f01b909404909316151560c08501528851908901519489015192890151939461402c9491939092909190614acf565b93508460600151600f0b6000146141a157846020015160020b816020015160020b12156140815761407a6140638660200151612d6d565b6140708760400151612d6d565b8760600151614c84565b92506141a1565b846040015160020b816020015160020b12156141775760045460408201516001600160801b03909116906140d3906140b7612c27565b60208501516060860151608087015160089493929187916139d1565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614123919061411990612d6d565b8860600151614c84565b93506141416141358760200151612d6d565b83516060890151614cc8565b92506141518187606001516135ef565b600480546001600160801b0319166001600160801b0392909216919091179055506141a1565b61419e6141878660200151612d6d565b6141948760400151612d6d565b8760600151614cc8565b91505b509193909250565b60006141b68484846132d9565b9050600082806141c257fe5b84860911156133825760001981106141d957600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614287576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff8111801561429f57600080fd5b506040519080825280602002602001820160405280156142c9578160200160208202803683370190505b509150865167ffffffffffffffff811180156142e457600080fd5b5060405190808252806020026020018201604052801561430e578160200160208202803683370190505b50905060005b87518110156143945761433f8a8a8a848151811061432e57fe5b60200260200101518a8a8a8a613389565b84838151811061434b57fe5b6020026020010184848151811061435e57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614314565b5097509795505050505050565b8060020b8260020b126143e1576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614424576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614466576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116144d657600080fd5b600160801b82106144e957608091821c91015b68010000000000000000821061450157604091821c91015b640100000000821061451557602091821c91015b62010000821061452757601091821c91015b610100821061453857600891821c91015b6010821061454857600491821c91015b6004821061455857600291821c91015b60028210612beb57600101919050565b600080821161457657600080fd5b5060ff6001600160801b0382161561459157607f1901614599565b608082901c91505b67ffffffffffffffff8216156145b257603f19016145ba565b604082901c91505b63ffffffff8216156145cf57601f19016145d7565b602082901c91505b61ffff8216156145ea57600f19016145f2565b601082901c91505b60ff821615614604576007190161460c565b600882901c91505b600f82161561461e5760031901614626565b600482901c91505b60038216156146385760011901614640565b600282901c91505b6001821615612beb5760001901919050565b6000836001600160a01b0316856001600160a01b03161115614672579293925b8161469f5761469a836001600160801b03168686036001600160a01b0316600160601b6132d9565b6146c2565b6146c2836001600160801b03168686036001600160a01b0316600160601b6141a9565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156146ed579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b03868603811690871661472957600080fd5b8361475957866001600160a01b031661474c8383896001600160a01b03166132d9565b8161475357fe5b0461477f565b61477f6147708383896001600160a01b03166141a9565b886001600160a01b0316614cf7565b979650505050505050565b600080856001600160a01b0316116147a157600080fd5b6000846001600160801b0316116147b757600080fd5b816147c95761469a8585856001614d02565b6146c28585856001614de3565b600080856001600160a01b0316116147ed57600080fd5b6000846001600160801b03161161480357600080fd5b816148155761469a8585856000614de3565b6146c28585856000614d02565b61482a61564a565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b03161161487e576001614880565b845b6001600160801b031673ffffffff00000000000000000000000000000000608085901b16816148ab57fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6148da61564a565b6148e261564a565b888561ffff1661ffff81106148f357fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff1615156060820152925061495890899089614ed8565b15614990578663ffffffff16826000015163ffffffff16141561497a57613510565b8161498783898988614822565b91509150613510565b888361ffff168660010161ffff16816149a557fe5b0661ffff1661ffff81106149b557fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614a6c57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614a7b88836000015189614ed8565b614ab2576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614abf8989898887614f9b565b9150915097509795505050505050565b6000614ade60078787876141e3565b60015460025491925090600080600f87900b15614c24576000614aff612c27565b6000805460045492935090918291614b499160089186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b900416613389565b9092509050614b8360058d8b8d8b8b87898b60007f000000000000000000000000000000000000000000000000000000000000000061513b565b9450614bba60058c8b8d8b8b87898b60017f000000000000000000000000000000000000000000000000000000000000000061513b565b93508415614bee57614bee60068d7f0000000000000000000000000000000000000000000000000000000000000000615325565b8315614c2057614c2060068c7f0000000000000000000000000000000000000000000000000000000000000000615325565b5050505b600080614c3660058c8c8b8a8a61538b565b9092509050614c47878a8484615437565b600089600f0b1215614c75578315614c6457614c6460058c6155cc565b8215614c7557614c7560058b6155cc565b50505050505095945050505050565b60008082600f0b12614caa57614ca5614ca085858560016146cd565b613291565b6146c5565b614cbd614ca085858560000360006146cd565b600003949350505050565b60008082600f0b12614ce457614ca5614ca08585856001614652565b614cbd614ca08585856000036000614652565b808204910615150190565b60008115614d755760006001600160a01b03841115614d3857614d3384600160601b876001600160801b03166132d9565b614d50565b6001600160801b038516606085901b81614d4e57fe5b045b9050614d6d614d686001600160a01b03881683613e0d565b6155f8565b9150506146c5565b60006001600160a01b03841115614da357614d9e84600160601b876001600160801b03166141a9565b614dba565b614dba606085901b6001600160801b038716614cf7565b905080866001600160a01b031611614dd157600080fd5b6001600160a01b0386160390506146c5565b600082614df15750836146c5565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215614e91576001600160a01b03861684810290858281614e3157fe5b041415614e6257818101828110614e6057614e5683896001600160a01b0316836141a9565b93505050506146c5565b505b614e8882614e83878a6001600160a01b03168681614e7c57fe5b0490613e0d565b614cf7565b925050506146c5565b6001600160a01b03861684810290858281614ea857fe5b04148015614eb557508082115b614ebe57600080fd5b808203614e56614d68846001600160a01b038b16846141a9565b60008363ffffffff168363ffffffff1611158015614f0257508363ffffffff168263ffffffff1611155b15614f1e578163ffffffff168363ffffffff1611159050613382565b60008463ffffffff168463ffffffff1611614f46578363ffffffff1664010000000001614f4e565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611614f7f578363ffffffff1664010000000001614f87565b8363ffffffff165b64ffffffffff169091111595945050505050565b614fa361564a565b614fab61564a565b60008361ffff168560010161ffff1681614fc157fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281614fee57fe5b0661ffff8110614ffa57fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061506557806001019250614fd9565b898661ffff16826001018161507657fe5b0661ffff811061508257fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906150ed908b908b614ed8565b905080801561510657506151068a8a8760000151614ed8565b15615111575061512e565b8061512157600182039250615128565b8160010193505b50614fd9565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b031682615166828d6135ef565b9050846001600160801b0316816001600160801b031611156151b4576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b03828116159082161581141594501561528a578c60020b8e60020b1361525a57600183018b9055600283018a90556003830180547fffffffffff0000000000000000000000000000000000000000ffffffffffffff166701000000000000006001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16600160f81b1790555b82546001600160801b0319166001600160801b038216178355856152d35782546152ce906152c990600160801b9004600f90810b810b908f900b6132c3565b613f58565b6152f4565b82546152f4906152c990600160801b9004600f90810b810b908f900b6132a7565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b8161533457fe5b0760020b1561534257600080fd5b60008061535d8360020b8560020b8161535757fe5b056144b6565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b126153d1575050600182015460028301546153e4565b8360010154880391508360020154870390505b6000808b60020b8b60020b121561540657505060018301546002840154615419565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6154d65781516001600160801b03166154ce576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b5080516154e5565b81516154e290866135ef565b90505b60006155098360200151860384600001516001600160801b0316600160801b6132d9565b9050600061552f8460400151860385600001516001600160801b0316600160801b6132d9565b905086600f0b6000146155565787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061558457506000816001600160801b0316115b156155c2576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612beb57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000a";class UniswapV3Pool__factory extends ContractFactory{constructor(...G){G.length>1?super(...G):super(JQ,XQ,G[0])}deploy(G){return super.deploy(G||{})}getDeployTransaction(G){return super.getDeployTransaction(G||{})}attach(G){return super.attach(G)}connect(G){return super.connect(G)}static bytecode=XQ;static abi=JQ;static createInterface(){return new Ho(JQ)}static connect(G,K){return new iu(G,JQ,K)}}const QQ=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"src",type:"address"},{name:"dst",type:"address"},{name:"wad",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"wad",type:"uint256"}],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"dst",type:"address"},{name:"wad",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[],name:"deposit",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!0,name:"guy",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"}];class WIMX__factory{static abi=QQ;static createInterface(){return new Ho(QQ)}static connect(G,K){return new iu(G,QQ,K)}}async function multicallSingleCallDataMultipleContracts(G,K,ne){const ue=UniswapV3Pool__factory.createInterface(),pe=getCallData(K,ue),he=[];return pe&&ne.forEach((G=>{G&&he.push({target:G,callData:pe,gasLimit:Oi.from("1000000")})})),G.callStatic.multicall(he)}const getCallData=(G,K)=>{const ne=K?.getFunction(G);return ne?K?.encodeFunctionData(ne):void 0};function computePoolAddress({factoryAddress:G,erc20Pair:K,fee:ne,initCodeHashManualOverride:ue}){return K=ensureCorrectERC20AddressOrder(K),getCreate2Address(G,keccak256$2(["bytes"],[po.encode(["address","address","uint24"],[K[0].address,K[1].address,ne])]),ue??"0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54")}const ensureCorrectERC20AddressOrder=G=>{if(G[0].address.toLowerCase()>G[1].address.toLowerCase()){const K=G[0];G[0]=G[1],G[1]=K}return G},ZQ=[TK.LOWEST,TK.LOW,TK.MEDIUM,TK.HIGH],generatePossiblePoolsFromERC20Pair=(G,K,ne)=>{const ue=((G,K)=>{const ne=new Map,ue=[];[...G,...K].forEach((G=>{ne.set(G.address,G),ue.push(G.address)}));const pe=[...new Set([...ue])],he=[];for(let G=0;G<pe.length;G++)for(let K=G+1;K<pe.length;K++){const ue=ne.get(pe[G]),ye=ne.get(pe[K]);ue&&ye&&he.push([ue,ye])}return he})(G,K),pe=[];for(let G=0;G<ue.length;G++)for(let K=0;K<ZQ.length;K++){const he=computePoolAddress({factoryAddress:ne,erc20Pair:ue[G],fee:ZQ[K]});pe.push({erc20Pair:ue[G],fee:ZQ[K],poolAddress:he})}return pe},YQ="liquidity",eZ="slot0";class Router{provider;multicallContract;routingTokens;routingContracts;constructor(G,K,ne,ue){this.provider=G,this.multicallContract=K,this.routingTokens=ne,this.routingContracts=ue,this.provider=G,this.multicallContract=K,this.routingTokens=ne,this.routingContracts=ue}async findOptimalRoute(G,K,ne,ue=3){const[pe,he]=this.determineERC20InAndERC20Out(ne,G,K),ye=[pe,he],me=await(async(G,K,ne,ue)=>{const pe=generatePossiblePoolsFromERC20Pair(K,ne,ue),he=pe.map((G=>G.poolAddress));let ye,me;try{[ye,me]=await Promise.all([multicallSingleCallDataMultipleContracts(G,eZ,he),multicallSingleCallDataMultipleContracts(G,YQ,he)])}catch(G){const K=G instanceof Error?G.message:"Unknown Error";throw new ProviderCallError(`failed multicall: ${K}`)}const be=ye.returnData,ve=me.returnData,_e=UniswapV3Pool__factory.createInterface(),Te=[];return pe.forEach(((G,K)=>{const ne="0x"===ye.returnData[K].returnData,ue="0x"===me.returnData[K].returnData;if(ne||ue)return;const pe=_e.decodeFunctionResult(eZ,be[K].returnData),he=_e.decodeFunctionResult(YQ,ve[K].returnData),Ee=pe.sqrtPriceX96.isZero(),Pe=he[0].isZero();if(Ee||Pe)return;const Se=new ZK(erc20ToUniswapToken(G.erc20Pair[0]),erc20ToUniswapToken(G.erc20Pair[1]),G.fee,pe.sqrtPriceX96.toString(),he.toString(),pe.tick);Te.push(Se)})),Te})(this.multicallContract,ye,this.routingTokens,this.routingContracts.coreFactory);if(0===me.length)throw new NoRoutesAvailableError;const be=generateAllAcyclicPaths(pe,he,me,ue,[],[],pe);if(0===be.length)throw new NoRoutesAvailableError;return await this.getBestQuoteFromRoutes(be,G,ne)}async getBestQuoteFromRoutes(G,K,ne){const ue=await async function getQuotesForRoutes(G,K,ne,ue,pe){const he=ne.map((G=>oJ.quoteCallParameters(G,toCurrencyAmount(ue),pe,{useQuoterV2:!0}).calldata)),ye=await Promise.allSettled(he.map((ne=>G.send("eth_call",[{to:K,data:ne},"latest"])))),me=ye.reduce(((G,K,ye)=>{if("rejected"===K.status)return G;const me=he[ye].substring(0,10),be=MQ[me];if(!be)throw new Error("No quoting function signature found");if("0x"===K.value)return G;try{const he=po.decode(be,K.value);if(he){const K=he[0];if(!(K instanceof Oi))throw new Error("Expected BigNumber");const me=uniswapTokenToERC20(ne[ye].input),be=uniswapTokenToERC20(ne[ye].output);G.push({route:ne[ye],amountIn:pe===yV.EXACT_INPUT?ue:newAmount(K,me),amountOut:pe===yV.EXACT_INPUT?newAmount(K,be):ue,gasEstimate:Oi.from(he[3]),tradeType:pe})}}catch{}return G}),new Array);return me}(this.provider,this.routingContracts.quoter,G,K,ne);if(0===ue.length)throw new NoRoutesAvailableError;if(ne===yV.EXACT_INPUT)return this.bestQuoteForAmountIn(ue);if(ne===yV.EXACT_OUTPUT)return this.bestQuoteForAmountOut(ue);throw new Error("Invalid trade type")}bestQuoteForAmountIn(G){let K=G[0];for(let ne=1;ne<G.length;ne++)G[ne].amountOut.value.gt(K.amountOut.value)&&(K=G[ne]);return K}bestQuoteForAmountOut(G){let K=G[0];for(let ne=1;ne<G.length;ne++)G[ne].amountIn.value.lt(K.amountIn.value)&&(K=G[ne]);return K}determineERC20InAndERC20Out(G,K,ne){return G===yV.EXACT_INPUT?[K.token,ne]:[ne,K.token]}}const generateAllAcyclicPaths=(G,K,ne,ue,pe=[],he=[],ye=G)=>{const me=erc20ToUniswapToken(G),be=erc20ToUniswapToken(K),ve=erc20ToUniswapToken(ye);for(const G of ne){const _e=G.involvesToken(me),Te=pe.find((K=>{return(ne=G)===(ue=K)||ne.token0.equals(ue.token0)&&ne.token1.equals(ue.token1)&&ne.fee===ue.fee;var ne,ue}));if(!_e||Te)continue;const Ee=G.token0.equals(me)?G.token1:G.token0;Ee.equals(be)?he.push(new eJ([...pe,G],ve,be)):ue>1&&generateAllAcyclicPaths(uniswapTokenToERC20(Ee),K,ne,ue-1,[...pe,G],he,ye)}return he},tZ="multicall(uint256,bytes[])";function buildSwapParameters(G,K,ne,ue,pe,he,ye,me,be,ve){const{route:_e}=ue.swaps[0],Te=1===_e.pools.length,Ee=pe.length>0;return Te?Ee?function buildSinglePoolSwapWithFees(G,K,ne,ue,pe,he,ye,me){const be=he.map((G=>({feeBasisPoints:G.basisPoints,recipient:G.recipient}))),ve=[];return K.tradeType===yV.EXACT_INPUT&&ve.push(ye.encodeFunctionData("exactInputSingleWithSecondaryFee",[be,{tokenIn:ne.tokenPath[0].address,tokenOut:ne.tokenPath[1].address,fee:ne.pools[0].fee,recipient:G,amountIn:ue,amountOutMinimum:pe,sqrtPriceLimitX96:0}])),K.tradeType===yV.EXACT_OUTPUT&&ve.push(ye.encodeFunctionData("exactOutputSingleWithSecondaryFee",[be,{tokenIn:ne.tokenPath[0].address,tokenOut:ne.tokenPath[1].address,fee:ne.pools[0].fee,recipient:G,amountInMaximum:ue,amountOut:pe,sqrtPriceLimitX96:0}])),isNative(me)&&ve.push(ye.encodeFunctionData("unwrapNativeToken",[pe])),ve}(ne,ue,_e,be,ve,pe,he,K):function buildSinglePoolSwap(G,K,ne,ue,pe,he,ye,me,be){const ve=[];return ue.tradeType===yV.EXACT_INPUT&&ve.push(me.encodeFunctionData("exactInputSingle",[{tokenIn:pe.tokenPath[0].address,tokenOut:pe.tokenPath[1].address,fee:pe.pools[0].fee,recipient:ne,amountIn:he,amountOutMinimum:ye,sqrtPriceLimitX96:0}])),ue.tradeType===yV.EXACT_OUTPUT&&ve.push(me.encodeFunctionData("exactOutputSingle",[{tokenIn:pe.tokenPath[0].address,tokenOut:pe.tokenPath[1].address,fee:pe.pools[0].fee,recipient:ne,amountInMaximum:he,amountOut:ye,sqrtPriceLimitX96:0}])),isNative(G)&&ve.push(be.encodeFunctionData("refundETH")),isNative(K)&&ve.push(be.encodeFunctionData("unwrapWETH9(uint256)",[ye])),ve}(G,K,ne,ue,_e,be,ve,ye,me):Ee?function buildMultiPoolSwapWithFees(G,K,ne,ue,pe,he,ye,me){const be=encodeRouteToPath(ne,K.tradeType===yV.EXACT_OUTPUT),ve=he.map((G=>({feeBasisPoints:G.basisPoints,recipient:G.recipient}))),_e=[];return K.tradeType===yV.EXACT_INPUT&&_e.push(ye.encodeFunctionData("exactInputWithSecondaryFee",[ve,{path:be,recipient:G,amountIn:ue,amountOutMinimum:pe}])),K.tradeType===yV.EXACT_OUTPUT&&_e.push(ye.encodeFunctionData("exactOutputWithSecondaryFee",[ve,{path:be,recipient:G,amountInMaximum:ue,amountOut:pe}])),isNative(me)&&_e.push(ye.encodeFunctionData("unwrapNativeToken",[pe])),_e}(ne,ue,_e,be,ve,pe,he,K):function buildMultiPoolSwap(G,K,ne,ue,pe,he,ye,me,be){const ve=encodeRouteToPath(pe,ue.tradeType===yV.EXACT_OUTPUT),_e=[];return ue.tradeType===yV.EXACT_INPUT&&_e.push(me.encodeFunctionData("exactInput",[{path:ve,recipient:ne,amountIn:he,amountOutMinimum:ye}])),ue.tradeType===yV.EXACT_OUTPUT&&_e.push(me.encodeFunctionData("exactOutput",[{path:ve,recipient:ne,amountInMaximum:he,amountOut:ye}])),isNative(G)&&_e.push(be.encodeFunctionData("refundETH")),isNative(K)&&_e.push(be.encodeFunctionData("unwrapWETH9(uint256)",[ye])),_e}(G,K,ne,ue,_e,be,ve,ye,me)}function createSwapCallParameters(G,K,ne,ue,pe,he,ye,me){const be=ImmutableSwapProxy__factory.createInterface(),ve=buildSwapParameters(G,K,ue,ne,he,be,NQ.SwapRouter.INTERFACE,NQ.PaymentsExtended.INTERFACE,ye,me);return be.encodeFunctionData(tZ,[pe.deadlineOrPreviousBlockhash,ve])}function getSwap(G,K,ne,ue,pe,he,ye,me,be,ve){const _e=((G,K,ne,ue,pe)=>isNative(G)?0===pe.length?ne:ue:K)(K,ue,ye,me,ve),{calldata:Te,maximumAmountIn:Ee}=function createSwapParameters(G,K,ne,ue,pe,he,ye){const me=tJ.createUncheckedTrade({route:ne.route,inputAmount:toCurrencyAmount(ne.amountIn),outputAmount:toCurrencyAmount(ne.amountOut),tradeType:ne.tradeType}),be={slippageTolerance:slippageToFraction(pe),recipient:ue,deadlineOrPreviousBlockhash:he},ve=toHex$1(me.maximumAmountIn(be.slippageTolerance).quotient),_e=toHex$1(me.minimumAmountOut(be.slippageTolerance).quotient);return{calldata:createSwapCallParameters(G,K,me,ue,be,ye,ve,_e),maximumAmountIn:ve}}(G,K,ne,_e,pe,he,ve),Pe=ve.length>0,Se=be?calculateGasFee(Pe,be,ne.gasEstimate):null,Ce=((G,K)=>"native"===G.type?K:"0x00")(G,Ee);return{transaction:{data:Te,to:ve.length>0?me:ye,value:Ce,from:ue},gasFeeEstimate:Se?toPublicAmount(Se):null}}function adjustQuoteWithFees(G,K,ne,ue){const pe=((G,K,ne,ue)=>{if(G.tradeType===yV.EXACT_OUTPUT){const K=canUnwrapToken(ne.token)?ue.unwrapAmount(G.amountIn):G.amountIn;return ne.addAmount(K),ue.maybeWrapAmount(ne.amountWithFeesApplied())}return ue.maybeWrapAmount(K)})(G,K,ne,ue);return{gasEstimate:G.gasEstimate,route:G.route,amountIn:pe,amountOut:G.amountOut,tradeType:G.tradeType}}const rZ={[FQ]:{multicall:"0x4857Dfd11c712e862eC362cEee29F7974B70EfcD",coreFactory:"0x56c2162254b0E4417288786eE402c2B41d4e181e",quoter:"0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd",swapRouter:"0x0b012055F770AE7BB7a8303968A7Fb6088A2296e",immutableSwapProxy:"0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98"},[DQ]:{multicall:"0xc7efb32470dEE601959B15f1f923e017C6A918cA",coreFactory:"0x56c2162254b0E4417288786eE402c2B41d4e181e",quoter:"0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd",swapRouter:"0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B",immutableSwapProxy:"0xD67cc11151dBccCC424A16F8963ece3D0539BD61"}},nZ={[FQ]:{chainId:FQ,rpcUrl:"https://rpc.testnet.immutable.com",contracts:rZ[13473],commonRoutingTokens:$Q,nativeToken:LQ,wrappedNativeToken:UQ}},aZ={[DQ]:{chainId:DQ,rpcUrl:"https://rpc.immutable.com",contracts:rZ[13371],commonRoutingTokens:jQ,nativeToken:qQ,wrappedNativeToken:GQ}},iZ={[Jn.SANDBOX]:nZ,[Jn.PRODUCTION]:aZ};class ExchangeConfiguration{baseConfig;chain;secondaryFees=[];constructor({chainId:G,baseConfig:K,secondaryFees:ne,overrides:ue}){if(this.baseConfig=K,this.secondaryFees=ne||[],function validateSecondaryFees(G){let K=0;for(const ne of G){if(!isValidNonZeroAddress(ne.recipient))throw new InvalidConfigurationError(`Invalid secondary fee recipient address: ${ne.recipient}`);if(ne.basisPoints<=0||ne.basisPoints>1e3)throw new InvalidConfigurationError(`Invalid secondary fee basis points: ${ne.basisPoints}`);K+=ne.basisPoints}if(K>1e3)throw new InvalidConfigurationError(`Invalid total secondary fee basis points: ${K}`)}(this.secondaryFees),ue)return function validateOverrides(G){const K=["rpcURL","exchangeContracts","commonRoutingTokens","nativeToken"];for(const ne of K)if(!G[ne])throw new InvalidConfigurationError(`Missing override: ${ne}`);Object.entries(G.exchangeContracts).forEach((([G,K])=>{if(!isValidNonZeroAddress(K))throw new InvalidConfigurationError(`Invalid exchange contract address for ${G}`)}))}(ue),this.chain={chainId:G,rpcUrl:ue.rpcURL,contracts:ue.exchangeContracts,commonRoutingTokens:ue.commonRoutingTokens,nativeToken:ue.nativeToken,wrappedNativeToken:ue.wrappedNativeToken},void(this.secondaryFees=ne||[]);const pe=iZ[K.environment][G];if(!pe)throw new ChainNotSupportedError(G,K.environment);this.chain=pe}}class Exchange{provider;batchProvider;router;chainId;nativeToken;wrappedNativeToken;secondaryFees;nativeTokenService;swapProxyContractAddress;routerContractAddress;constructor(G){const K=new ExchangeConfiguration(G);this.chainId=K.chain.chainId,this.nativeToken=K.chain.nativeToken,this.wrappedNativeToken=K.chain.wrappedNativeToken,this.nativeTokenService=new NativeTokenService(this.nativeToken,this.wrappedNativeToken),this.secondaryFees=K.secondaryFees,this.routerContractAddress=K.chain.contracts.swapRouter,this.swapProxyContractAddress=K.chain.contracts.immutableSwapProxy,this.provider=new StaticJsonRpcProvider({url:K.chain.rpcUrl,skipFetchSetup:!0},K.chain.chainId),this.batchProvider=new JsonRpcBatchProvider({url:K.chain.rpcUrl,skipFetchSetup:!0},K.chain.chainId);const ne=Multicall__factory.connect(K.chain.contracts.multicall,this.provider);this.router=new Router(this.batchProvider,ne,K.chain.commonRoutingTokens,K.chain.contracts)}static validate(G,K,ne,ue,pe){assert$c(isValidNonZeroAddress(pe),new InvalidAddressError("invalid from address")),assert$c(isValidTokenLiteral(G),new InvalidAddressError("invalid token in address")),assert$c(isValidTokenLiteral(K),new InvalidAddressError("invalid token out address")),assert$c(G.toLocaleLowerCase()!==K.toLocaleLowerCase(),new DuplicateAddressesError),assert$c(ne<=10,new InvalidMaxHopsError("max hops must be less than or equal to 10")),assert$c(ne>=1,new InvalidMaxHopsError("max hops must be greater than or equal to 1")),assert$c(ue<=50,new InvalidSlippageError("slippage percent must be less than or equal to 50")),assert$c(ue>=0,new InvalidSlippageError("slippage percent must be greater than or equal to 0"))}async getSecondaryFees(G){if(0===this.secondaryFees.length)return[];const K=ImmutableSwapProxy__factory.connect(this.swapProxyContractAddress,G);return await K.paused()?[]:this.secondaryFees}parseTokenLiteral(G,K){return"native"===G?this.nativeToken:{type:"erc20",address:G,chainId:this.chainId,decimals:K}}async getUnwrapTransaction(G,K,ne,ue){const pe=ne.encodeFunctionData("withdraw",[K]),he=Oi.from(35216),ye=ue?toPublicAmount(calculateGasFee(!1,ue,he)):null;return{transaction:{transaction:{data:pe,to:this.wrappedNativeToken.address,from:G},gasFeeEstimate:ye},approval:null}}getWrapTransaction(G,K,ne,ue){const pe=ne.encodeFunctionData("deposit"),he=Oi.from(45038),ye=ue?toPublicAmount(calculateGasFee(!1,ue,he)):null;return{transaction:{transaction:{data:pe,to:this.wrappedNativeToken.address,value:K,from:G},gasFeeEstimate:ye},approval:null}}async getUnsignedWrapUnwrapTx(G,K,ne,ue){const pe="native"===K.token.type,he={token:"native"===G.type?this.wrappedNativeToken:this.nativeToken,value:K.value},ye={amount:toPublicAmount(he),amountWithMaxSlippage:toPublicAmount(he),slippage:0,fees:[]},me=WIMX__factory.createInterface();let be;return be=pe?this.getWrapTransaction(ne,he.value,me,ue):await this.getUnwrapTransaction(ne,he.value,me,ue),{quote:ye,approval:be.approval,swap:be.transaction}}async getUnsignedSwapTx(G,K,ne,ue,pe,he,ye,me){Exchange.validate(K,ne,he,pe,G);const be=[getTokenDecimals(K,this.batchProvider,this.nativeToken),getTokenDecimals(ne,this.batchProvider,this.nativeToken),this.getSecondaryFees(this.batchProvider),fetchGasPrice(this.batchProvider,this.nativeToken)],[ve,_e,Te,Ee]=await Promise.all(be),Pe=this.parseTokenLiteral(K,ve),Se=this.parseTokenLiteral(ne,_e),[Ce,ke]=me===yV.EXACT_INPUT?[Pe,Se]:[Se,Pe],Oe=newAmount(ue,Ce);if(this.nativeTokenService.isWrapOrUnwrap(Pe,Se))return this.getUnsignedWrapUnwrapTx(Ce,newAmount(ue,Pe),G,Ee);const xe=new Fees(Te,Pe),Ne=function getOurQuoteReqAmount(G,K,ne,ue){return ne===yV.EXACT_OUTPUT?ue.maybeWrapAmount(G):(K.addAmount(G),ue.maybeWrapAmount(K.amountLessFees()))}(Oe,xe,me,this.nativeTokenService),Me=adjustQuoteWithFees(await this.router.findOptimalRoute(Ne,this.nativeTokenService.maybeWrapToken(ke),me,he),Oe,xe,this.nativeTokenService),Be=getSwap(Pe,Se,Me,G,pe,ye,this.routerContractAddress,this.swapProxyContractAddress,Ee,Te),{quotedAmount:Fe,quotedAmountWithMaxSlippage:De}=prepareUserQuote(this.nativeTokenService,Me,pe,ke),Le=((G,K,ne,ue,pe)=>{const he=G===yV.EXACT_INPUT?K:ne;return isERC20Amount(he)?{spender:0===pe.length?ue.routerAddress:ue.secondaryFeeAddress,amount:he}:null})(me,Oe,De,{routerAddress:this.routerContractAddress,secondaryFeeAddress:this.swapProxyContractAddress},Te),Ue=Le?await getApproval(this.provider,G,Le,Ee):null,je=((G,K,ne,ue)=>({amount:toPublicAmount(G),amountWithMaxSlippage:toPublicAmount(K),slippage:ne,fees:ue.withAmounts().map((G=>({...G,amount:toPublicAmount(G.amount)})))}))(Fe,De,pe,xe);return{quote:je,approval:Ue,swap:Be}}async getUnsignedSwapTxFromAmountIn(G,K,ne,ue,pe=.1,he=3,ye=getDefaultDeadlineSeconds()){return await this.getUnsignedSwapTx(G,K,ne,Oi.from(ue),pe,he,ye,yV.EXACT_INPUT)}async getUnsignedSwapTxFromAmountOut(G,K,ne,ue,pe=.1,he=3,ye=getDefaultDeadlineSeconds()){return await this.getUnsignedSwapTx(G,K,ne,Oi.from(ue),pe,he,ye,yV.EXACT_OUTPUT)}}var sZ=function detectEthereumProvider({mustBeMetaMask:G=!1,silent:K=!1,timeout:ne=3e3}={}){!function _validateInputs(){if("boolean"!=typeof G)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!=typeof K)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!=typeof ne)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();let ue=!1;return new Promise((pe=>{function handleEthereum(){if(ue)return;ue=!0,window.removeEventListener("ethereum#initialized",handleEthereum);const{ethereum:ne}=window;if(!ne||G&&!ne.isMetaMask){const ue=G&&ne?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!K&&console.error("@metamask/detect-provider:",ue),pe(null)}else pe(ne)}window.ethereum?handleEthereum():(window.addEventListener("ethereum#initialized",handleEthereum,{once:!0}),setTimeout((()=>{handleEthereum()}),ne))}))},oZ=getDefaultExportFromCjs$1(sZ),cZ={exports:{}};!function(G,K){var ne;K=G.exports=SemVer,ne=function(){},K.SEMVER_SPEC_VERSION="2.0.0";var ue=256,pe=Number.MAX_SAFE_INTEGER||9007199254740991,he=ue-6,ye=K.re=[],me=K.safeRe=[],be=K.src=[],ve=K.tokens={},_e=0;function tok(G){ve[G]=_e++}var Te="[a-zA-Z0-9-]",Ee=[["\\s",1],["\\d",ue],[Te,he]];function makeSafeRe(G){for(var K=0;K<Ee.length;K++){var ne=Ee[K][0],ue=Ee[K][1];G=G.split(ne+"*").join(ne+"{0,"+ue+"}").split(ne+"+").join(ne+"{1,"+ue+"}")}return G}tok("NUMERICIDENTIFIER"),be[ve.NUMERICIDENTIFIER]="0|[1-9]\\d*",tok("NUMERICIDENTIFIERLOOSE"),be[ve.NUMERICIDENTIFIERLOOSE]="\\d+",tok("NONNUMERICIDENTIFIER"),be[ve.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+Te+"*",tok("MAINVERSION"),be[ve.MAINVERSION]="("+be[ve.NUMERICIDENTIFIER]+")\\.("+be[ve.NUMERICIDENTIFIER]+")\\.("+be[ve.NUMERICIDENTIFIER]+")",tok("MAINVERSIONLOOSE"),be[ve.MAINVERSIONLOOSE]="("+be[ve.NUMERICIDENTIFIERLOOSE]+")\\.("+be[ve.NUMERICIDENTIFIERLOOSE]+")\\.("+be[ve.NUMERICIDENTIFIERLOOSE]+")",tok("PRERELEASEIDENTIFIER"),be[ve.PRERELEASEIDENTIFIER]="(?:"+be[ve.NUMERICIDENTIFIER]+"|"+be[ve.NONNUMERICIDENTIFIER]+")",tok("PRERELEASEIDENTIFIERLOOSE"),be[ve.PRERELEASEIDENTIFIERLOOSE]="(?:"+be[ve.NUMERICIDENTIFIERLOOSE]+"|"+be[ve.NONNUMERICIDENTIFIER]+")",tok("PRERELEASE"),be[ve.PRERELEASE]="(?:-("+be[ve.PRERELEASEIDENTIFIER]+"(?:\\."+be[ve.PRERELEASEIDENTIFIER]+")*))",tok("PRERELEASELOOSE"),be[ve.PRERELEASELOOSE]="(?:-?("+be[ve.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+be[ve.PRERELEASEIDENTIFIERLOOSE]+")*))",tok("BUILDIDENTIFIER"),be[ve.BUILDIDENTIFIER]=Te+"+",tok("BUILD"),be[ve.BUILD]="(?:\\+("+be[ve.BUILDIDENTIFIER]+"(?:\\."+be[ve.BUILDIDENTIFIER]+")*))",tok("FULL"),tok("FULLPLAIN"),be[ve.FULLPLAIN]="v?"+be[ve.MAINVERSION]+be[ve.PRERELEASE]+"?"+be[ve.BUILD]+"?",be[ve.FULL]="^"+be[ve.FULLPLAIN]+"$",tok("LOOSEPLAIN"),be[ve.LOOSEPLAIN]="[v=\\s]*"+be[ve.MAINVERSIONLOOSE]+be[ve.PRERELEASELOOSE]+"?"+be[ve.BUILD]+"?",tok("LOOSE"),be[ve.LOOSE]="^"+be[ve.LOOSEPLAIN]+"$",tok("GTLT"),be[ve.GTLT]="((?:<|>)?=?)",tok("XRANGEIDENTIFIERLOOSE"),be[ve.XRANGEIDENTIFIERLOOSE]=be[ve.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",tok("XRANGEIDENTIFIER"),be[ve.XRANGEIDENTIFIER]=be[ve.NUMERICIDENTIFIER]+"|x|X|\\*",tok("XRANGEPLAIN"),be[ve.XRANGEPLAIN]="[v=\\s]*("+be[ve.XRANGEIDENTIFIER]+")(?:\\.("+be[ve.XRANGEIDENTIFIER]+")(?:\\.("+be[ve.XRANGEIDENTIFIER]+")(?:"+be[ve.PRERELEASE]+")?"+be[ve.BUILD]+"?)?)?",tok("XRANGEPLAINLOOSE"),be[ve.XRANGEPLAINLOOSE]="[v=\\s]*("+be[ve.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+be[ve.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+be[ve.XRANGEIDENTIFIERLOOSE]+")(?:"+be[ve.PRERELEASELOOSE]+")?"+be[ve.BUILD]+"?)?)?",tok("XRANGE"),be[ve.XRANGE]="^"+be[ve.GTLT]+"\\s*"+be[ve.XRANGEPLAIN]+"$",tok("XRANGELOOSE"),be[ve.XRANGELOOSE]="^"+be[ve.GTLT]+"\\s*"+be[ve.XRANGEPLAINLOOSE]+"$",tok("COERCE"),be[ve.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",tok("COERCERTL"),ye[ve.COERCERTL]=new RegExp(be[ve.COERCE],"g"),me[ve.COERCERTL]=new RegExp(makeSafeRe(be[ve.COERCE]),"g"),tok("LONETILDE"),be[ve.LONETILDE]="(?:~>?)",tok("TILDETRIM"),be[ve.TILDETRIM]="(\\s*)"+be[ve.LONETILDE]+"\\s+",ye[ve.TILDETRIM]=new RegExp(be[ve.TILDETRIM],"g"),me[ve.TILDETRIM]=new RegExp(makeSafeRe(be[ve.TILDETRIM]),"g");tok("TILDE"),be[ve.TILDE]="^"+be[ve.LONETILDE]+be[ve.XRANGEPLAIN]+"$",tok("TILDELOOSE"),be[ve.TILDELOOSE]="^"+be[ve.LONETILDE]+be[ve.XRANGEPLAINLOOSE]+"$",tok("LONECARET"),be[ve.LONECARET]="(?:\\^)",tok("CARETTRIM"),be[ve.CARETTRIM]="(\\s*)"+be[ve.LONECARET]+"\\s+",ye[ve.CARETTRIM]=new RegExp(be[ve.CARETTRIM],"g"),me[ve.CARETTRIM]=new RegExp(makeSafeRe(be[ve.CARETTRIM]),"g");tok("CARET"),be[ve.CARET]="^"+be[ve.LONECARET]+be[ve.XRANGEPLAIN]+"$",tok("CARETLOOSE"),be[ve.CARETLOOSE]="^"+be[ve.LONECARET]+be[ve.XRANGEPLAINLOOSE]+"$",tok("COMPARATORLOOSE"),be[ve.COMPARATORLOOSE]="^"+be[ve.GTLT]+"\\s*("+be[ve.LOOSEPLAIN]+")$|^$",tok("COMPARATOR"),be[ve.COMPARATOR]="^"+be[ve.GTLT]+"\\s*("+be[ve.FULLPLAIN]+")$|^$",tok("COMPARATORTRIM"),be[ve.COMPARATORTRIM]="(\\s*)"+be[ve.GTLT]+"\\s*("+be[ve.LOOSEPLAIN]+"|"+be[ve.XRANGEPLAIN]+")",ye[ve.COMPARATORTRIM]=new RegExp(be[ve.COMPARATORTRIM],"g"),me[ve.COMPARATORTRIM]=new RegExp(makeSafeRe(be[ve.COMPARATORTRIM]),"g");tok("HYPHENRANGE"),be[ve.HYPHENRANGE]="^\\s*("+be[ve.XRANGEPLAIN]+")\\s+-\\s+("+be[ve.XRANGEPLAIN]+")\\s*$",tok("HYPHENRANGELOOSE"),be[ve.HYPHENRANGELOOSE]="^\\s*("+be[ve.XRANGEPLAINLOOSE]+")\\s+-\\s+("+be[ve.XRANGEPLAINLOOSE]+")\\s*$",tok("STAR"),be[ve.STAR]="(<|>)?=?\\s*\\*";for(var Pe=0;Pe<_e;Pe++)ne(Pe,be[Pe]),ye[Pe]||(ye[Pe]=new RegExp(be[Pe]),me[Pe]=new RegExp(makeSafeRe(be[Pe])));function parse(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof SemVer)return G;if("string"!=typeof G)return null;if(G.length>ue)return null;if(!(K.loose?me[ve.LOOSE]:me[ve.FULL]).test(G))return null;try{return new SemVer(G,K)}catch(G){return null}}function SemVer(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof SemVer){if(G.loose===K.loose)return G;G=G.version}else if("string"!=typeof G)throw new TypeError("Invalid Version: "+G);if(G.length>ue)throw new TypeError("version is longer than "+ue+" characters");if(!(this instanceof SemVer))return new SemVer(G,K);ne("SemVer",G,K),this.options=K,this.loose=!!K.loose;var he=G.trim().match(K.loose?me[ve.LOOSE]:me[ve.FULL]);if(!he)throw new TypeError("Invalid Version: "+G);if(this.raw=G,this.major=+he[1],this.minor=+he[2],this.patch=+he[3],this.major>pe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pe||this.patch<0)throw new TypeError("Invalid patch version");he[4]?this.prerelease=he[4].split(".").map((function(G){if(/^[0-9]+$/.test(G)){var K=+G;if(K>=0&&K<pe)return K}return G})):this.prerelease=[],this.build=he[5]?he[5].split("."):[],this.format()}K.parse=parse,K.valid=function valid(G,K){var ne=parse(G,K);return ne?ne.version:null},K.clean=function clean(G,K){var ne=parse(G.trim().replace(/^[=v]+/,""),K);return ne?ne.version:null},K.SemVer=SemVer,SemVer.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},SemVer.prototype.toString=function(){return this.version},SemVer.prototype.compare=function(G){return ne("SemVer.compare",this.version,this.options,G),G instanceof SemVer||(G=new SemVer(G,this.options)),this.compareMain(G)||this.comparePre(G)},SemVer.prototype.compareMain=function(G){return G instanceof SemVer||(G=new SemVer(G,this.options)),compareIdentifiers(this.major,G.major)||compareIdentifiers(this.minor,G.minor)||compareIdentifiers(this.patch,G.patch)},SemVer.prototype.comparePre=function(G){if(G instanceof SemVer||(G=new SemVer(G,this.options)),this.prerelease.length&&!G.prerelease.length)return-1;if(!this.prerelease.length&&G.prerelease.length)return 1;if(!this.prerelease.length&&!G.prerelease.length)return 0;var K=0;do{var ue=this.prerelease[K],pe=G.prerelease[K];if(ne("prerelease compare",K,ue,pe),void 0===ue&&void 0===pe)return 0;if(void 0===pe)return 1;if(void 0===ue)return-1;if(ue!==pe)return compareIdentifiers(ue,pe)}while(++K)},SemVer.prototype.compareBuild=function(G){G instanceof SemVer||(G=new SemVer(G,this.options));var K=0;do{var ue=this.build[K],pe=G.build[K];if(ne("prerelease compare",K,ue,pe),void 0===ue&&void 0===pe)return 0;if(void 0===pe)return 1;if(void 0===ue)return-1;if(ue!==pe)return compareIdentifiers(ue,pe)}while(++K)},SemVer.prototype.inc=function(G,K){switch(G){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",K);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",K);break;case"prepatch":this.prerelease.length=0,this.inc("patch",K),this.inc("pre",K);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",K),this.inc("pre",K);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var ne=this.prerelease.length;--ne>=0;)"number"==typeof this.prerelease[ne]&&(this.prerelease[ne]++,ne=-2);-1===ne&&this.prerelease.push(0)}K&&(this.prerelease[0]===K?isNaN(this.prerelease[1])&&(this.prerelease=[K,0]):this.prerelease=[K,0]);break;default:throw new Error("invalid increment argument: "+G)}return this.format(),this.raw=this.version,this},K.inc=function inc(G,K,ne,ue){"string"==typeof ne&&(ue=ne,ne=void 0);try{return new SemVer(G,ne).inc(K,ue).version}catch(G){return null}},K.diff=function diff(G,K){if(eq(G,K))return null;var ne=parse(G),ue=parse(K),pe="";if(ne.prerelease.length||ue.prerelease.length){pe="pre";var he="prerelease"}for(var ye in ne)if(("major"===ye||"minor"===ye||"patch"===ye)&&ne[ye]!==ue[ye])return pe+ye;return he},K.compareIdentifiers=compareIdentifiers;var Se=/^[0-9]+$/;function compareIdentifiers(G,K){var ne=Se.test(G),ue=Se.test(K);return ne&&ue&&(G=+G,K=+K),G===K?0:ne&&!ue?-1:ue&&!ne?1:G<K?-1:1}function compare(G,K,ne){return new SemVer(G,ne).compare(new SemVer(K,ne))}function gt(G,K,ne){return compare(G,K,ne)>0}function lt(G,K,ne){return compare(G,K,ne)<0}function eq(G,K,ne){return 0===compare(G,K,ne)}function neq(G,K,ne){return 0!==compare(G,K,ne)}function gte(G,K,ne){return compare(G,K,ne)>=0}function lte(G,K,ne){return compare(G,K,ne)<=0}function cmp(G,K,ne,ue){switch(K){case"===":return"object"==typeof G&&(G=G.version),"object"==typeof ne&&(ne=ne.version),G===ne;case"!==":return"object"==typeof G&&(G=G.version),"object"==typeof ne&&(ne=ne.version),G!==ne;case"":case"=":case"==":return eq(G,ne,ue);case"!=":return neq(G,ne,ue);case">":return gt(G,ne,ue);case">=":return gte(G,ne,ue);case"<":return lt(G,ne,ue);case"<=":return lte(G,ne,ue);default:throw new TypeError("Invalid operator: "+K)}}function Comparator(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof Comparator){if(G.loose===!!K.loose)return G;G=G.value}if(!(this instanceof Comparator))return new Comparator(G,K);G=G.trim().split(/\s+/).join(" "),ne("comparator",G,K),this.options=K,this.loose=!!K.loose,this.parse(G),this.semver===Ce?this.value="":this.value=this.operator+this.semver.version,ne("comp",this)}K.rcompareIdentifiers=function rcompareIdentifiers(G,K){return compareIdentifiers(K,G)},K.major=function major(G,K){return new SemVer(G,K).major},K.minor=function minor(G,K){return new SemVer(G,K).minor},K.patch=function patch(G,K){return new SemVer(G,K).patch},K.compare=compare,K.compareLoose=function compareLoose(G,K){return compare(G,K,!0)},K.compareBuild=function compareBuild(G,K,ne){var ue=new SemVer(G,ne),pe=new SemVer(K,ne);return ue.compare(pe)||ue.compareBuild(pe)},K.rcompare=function rcompare(G,K,ne){return compare(K,G,ne)},K.sort=function sort(G,ne){return G.sort((function(G,ue){return K.compareBuild(G,ue,ne)}))},K.rsort=function rsort(G,ne){return G.sort((function(G,ue){return K.compareBuild(ue,G,ne)}))},K.gt=gt,K.lt=lt,K.eq=eq,K.neq=neq,K.gte=gte,K.lte=lte,K.cmp=cmp,K.Comparator=Comparator;var Ce={};function Range(G,K){if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),G instanceof Range)return G.loose===!!K.loose&&G.includePrerelease===!!K.includePrerelease?G:new Range(G.raw,K);if(G instanceof Comparator)return new Range(G.value,K);if(!(this instanceof Range))return new Range(G,K);if(this.options=K,this.loose=!!K.loose,this.includePrerelease=!!K.includePrerelease,this.raw=G.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(G){return this.parseRange(G.trim())}),this).filter((function(G){return G.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function isSatisfiable(G,K){for(var ne=!0,ue=G.slice(),pe=ue.pop();ne&&ue.length;)ne=ue.every((function(G){return pe.intersects(G,K)})),pe=ue.pop();return ne}function isX(G){return!G||"x"===G.toLowerCase()||"*"===G}function hyphenReplace(G,K,ne,ue,pe,he,ye,me,be,ve,_e,Te,Ee){return((K=isX(ne)?"":isX(ue)?">="+ne+".0.0":isX(pe)?">="+ne+"."+ue+".0":">="+K)+" "+(me=isX(be)?"":isX(ve)?"<"+(+be+1)+".0.0":isX(_e)?"<"+be+"."+(+ve+1)+".0":Te?"<="+be+"."+ve+"."+_e+"-"+Te:"<="+me)).trim()}function testSet(G,K,ue){for(var pe=0;pe<G.length;pe++)if(!G[pe].test(K))return!1;if(K.prerelease.length&&!ue.includePrerelease){for(pe=0;pe<G.length;pe++)if(ne(G[pe].semver),G[pe].semver!==Ce&&G[pe].semver.prerelease.length>0){var he=G[pe].semver;if(he.major===K.major&&he.minor===K.minor&&he.patch===K.patch)return!0}return!1}return!0}function satisfies(G,K,ne){try{K=new Range(K,ne)}catch(G){return!1}return K.test(G)}function outside(G,K,ne,ue){var pe,he,ye,me,be;switch(G=new SemVer(G,ue),K=new Range(K,ue),ne){case">":pe=gt,he=lte,ye=lt,me=">",be=">=";break;case"<":pe=lt,he=gte,ye=gt,me="<",be="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(G,K,ue))return!1;for(var ve=0;ve<K.set.length;++ve){var _e=K.set[ve],Te=null,Ee=null;if(_e.forEach((function(G){G.semver===Ce&&(G=new Comparator(">=0.0.0")),Te=Te||G,Ee=Ee||G,pe(G.semver,Te.semver,ue)?Te=G:ye(G.semver,Ee.semver,ue)&&(Ee=G)})),Te.operator===me||Te.operator===be)return!1;if((!Ee.operator||Ee.operator===me)&&he(G,Ee.semver))return!1;if(Ee.operator===be&&ye(G,Ee.semver))return!1}return!0}Comparator.prototype.parse=function(G){var K=this.options.loose?me[ve.COMPARATORLOOSE]:me[ve.COMPARATOR],ne=G.match(K);if(!ne)throw new TypeError("Invalid comparator: "+G);this.operator=void 0!==ne[1]?ne[1]:"","="===this.operator&&(this.operator=""),ne[2]?this.semver=new SemVer(ne[2],this.options.loose):this.semver=Ce},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(G){if(ne("Comparator.test",G,this.options.loose),this.semver===Ce||G===Ce)return!0;if("string"==typeof G)try{G=new SemVer(G,this.options)}catch(G){return!1}return cmp(G,this.operator,this.semver,this.options)},Comparator.prototype.intersects=function(G,K){if(!(G instanceof Comparator))throw new TypeError("a Comparator is required");var ne;if(K&&"object"==typeof K||(K={loose:!!K,includePrerelease:!1}),""===this.operator)return""===this.value||(ne=new Range(G.value,K),satisfies(this.value,ne,K));if(""===G.operator)return""===G.value||(ne=new Range(this.value,K),satisfies(G.semver,ne,K));var ue=!(">="!==this.operator&&">"!==this.operator||">="!==G.operator&&">"!==G.operator),pe=!("<="!==this.operator&&"<"!==this.operator||"<="!==G.operator&&"<"!==G.operator),he=this.semver.version===G.semver.version,ye=!(">="!==this.operator&&"<="!==this.operator||">="!==G.operator&&"<="!==G.operator),me=cmp(this.semver,"<",G.semver,K)&&(">="===this.operator||">"===this.operator)&&("<="===G.operator||"<"===G.operator),be=cmp(this.semver,">",G.semver,K)&&("<="===this.operator||"<"===this.operator)&&(">="===G.operator||">"===G.operator);return ue||pe||he&&ye||me||be},K.Range=Range,Range.prototype.format=function(){return this.range=this.set.map((function(G){return G.join(" ").trim()})).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(G){var K=this.options.loose,ue=K?me[ve.HYPHENRANGELOOSE]:me[ve.HYPHENRANGE];G=G.replace(ue,hyphenReplace),ne("hyphen replace",G),G=G.replace(me[ve.COMPARATORTRIM],"$1$2$3"),ne("comparator trim",G,me[ve.COMPARATORTRIM]),G=(G=(G=G.replace(me[ve.TILDETRIM],"$1~")).replace(me[ve.CARETTRIM],"$1^")).split(/\s+/).join(" ");var pe=K?me[ve.COMPARATORLOOSE]:me[ve.COMPARATOR],he=G.split(" ").map((function(G){return function parseComparator(G,K){return ne("comp",G,K),G=function replaceCarets(G,K){return G.trim().split(/\s+/).map((function(G){return function replaceCaret(G,K){ne("caret",G,K);var ue=K.loose?me[ve.CARETLOOSE]:me[ve.CARET];return G.replace(ue,(function(K,ue,pe,he,ye){var me;return ne("caret",G,K,ue,pe,he,ye),isX(ue)?me="":isX(pe)?me=">="+ue+".0.0 <"+(+ue+1)+".0.0":isX(he)?me="0"===ue?">="+ue+"."+pe+".0 <"+ue+"."+(+pe+1)+".0":">="+ue+"."+pe+".0 <"+(+ue+1)+".0.0":ye?(ne("replaceCaret pr",ye),me="0"===ue?"0"===pe?">="+ue+"."+pe+"."+he+"-"+ye+" <"+ue+"."+pe+"."+(+he+1):">="+ue+"."+pe+"."+he+"-"+ye+" <"+ue+"."+(+pe+1)+".0":">="+ue+"."+pe+"."+he+"-"+ye+" <"+(+ue+1)+".0.0"):(ne("no pr"),me="0"===ue?"0"===pe?">="+ue+"."+pe+"."+he+" <"+ue+"."+pe+"."+(+he+1):">="+ue+"."+pe+"."+he+" <"+ue+"."+(+pe+1)+".0":">="+ue+"."+pe+"."+he+" <"+(+ue+1)+".0.0"),ne("caret return",me),me}))}(G,K)})).join(" ")}(G,K),ne("caret",G),G=function replaceTildes(G,K){return G.trim().split(/\s+/).map((function(G){return function replaceTilde(G,K){var ue=K.loose?me[ve.TILDELOOSE]:me[ve.TILDE];return G.replace(ue,(function(K,ue,pe,he,ye){var me;return ne("tilde",G,K,ue,pe,he,ye),isX(ue)?me="":isX(pe)?me=">="+ue+".0.0 <"+(+ue+1)+".0.0":isX(he)?me=">="+ue+"."+pe+".0 <"+ue+"."+(+pe+1)+".0":ye?(ne("replaceTilde pr",ye),me=">="+ue+"."+pe+"."+he+"-"+ye+" <"+ue+"."+(+pe+1)+".0"):me=">="+ue+"."+pe+"."+he+" <"+ue+"."+(+pe+1)+".0",ne("tilde return",me),me}))}(G,K)})).join(" ")}(G,K),ne("tildes",G),G=function replaceXRanges(G,K){return ne("replaceXRanges",G,K),G.split(/\s+/).map((function(G){return function replaceXRange(G,K){G=G.trim();var ue=K.loose?me[ve.XRANGELOOSE]:me[ve.XRANGE];return G.replace(ue,(function(ue,pe,he,ye,me,be){ne("xRange",G,ue,pe,he,ye,me,be);var ve=isX(he),_e=ve||isX(ye),Te=_e||isX(me),Ee=Te;return"="===pe&&Ee&&(pe=""),be=K.includePrerelease?"-0":"",ve?ue=">"===pe||"<"===pe?"<0.0.0-0":"*":pe&&Ee?(_e&&(ye=0),me=0,">"===pe?(pe=">=",_e?(he=+he+1,ye=0,me=0):(ye=+ye+1,me=0)):"<="===pe&&(pe="<",_e?he=+he+1:ye=+ye+1),ue=pe+he+"."+ye+"."+me+be):_e?ue=">="+he+".0.0"+be+" <"+(+he+1)+".0.0"+be:Te&&(ue=">="+he+"."+ye+".0"+be+" <"+he+"."+(+ye+1)+".0"+be),ne("xRange return",ue),ue}))}(G,K)})).join(" ")}(G,K),ne("xrange",G),G=function replaceStars(G,K){return ne("replaceStars",G,K),G.trim().replace(me[ve.STAR],"")}(G,K),ne("stars",G),G}(G,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(he=he.filter((function(G){return!!G.match(pe)}))),he=he.map((function(G){return new Comparator(G,this.options)}),this)},Range.prototype.intersects=function(G,K){if(!(G instanceof Range))throw new TypeError("a Range is required");return this.set.some((function(ne){return isSatisfiable(ne,K)&&G.set.some((function(G){return isSatisfiable(G,K)&&ne.every((function(ne){return G.every((function(G){return ne.intersects(G,K)}))}))}))}))},K.toComparators=function toComparators(G,K){return new Range(G,K).set.map((function(G){return G.map((function(G){return G.value})).join(" ").trim().split(" ")}))},Range.prototype.test=function(G){if(!G)return!1;if("string"==typeof G)try{G=new SemVer(G,this.options)}catch(G){return!1}for(var K=0;K<this.set.length;K++)if(testSet(this.set[K],G,this.options))return!0;return!1},K.satisfies=satisfies,K.maxSatisfying=function maxSatisfying(G,K,ne){var ue=null,pe=null;try{var he=new Range(K,ne)}catch(G){return null}return G.forEach((function(G){he.test(G)&&(ue&&-1!==pe.compare(G)||(pe=new SemVer(ue=G,ne)))})),ue},K.minSatisfying=function minSatisfying(G,K,ne){var ue=null,pe=null;try{var he=new Range(K,ne)}catch(G){return null}return G.forEach((function(G){he.test(G)&&(ue&&1!==pe.compare(G)||(pe=new SemVer(ue=G,ne)))})),ue},K.minVersion=function minVersion(G,K){G=new Range(G,K);var ne=new SemVer("0.0.0");if(G.test(ne))return ne;if(ne=new SemVer("0.0.0-0"),G.test(ne))return ne;ne=null;for(var ue=0;ue<G.set.length;++ue){G.set[ue].forEach((function(G){var K=new SemVer(G.semver.version);switch(G.operator){case">":0===K.prerelease.length?K.patch++:K.prerelease.push(0),K.raw=K.format();case"":case">=":ne&&!gt(ne,K)||(ne=K);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+G.operator)}}))}if(ne&&G.test(ne))return ne;return null},K.validRange=function validRange(G,K){try{return new Range(G,K).range||"*"}catch(G){return null}},K.ltr=function ltr(G,K,ne){return outside(G,K,"<",ne)},K.gtr=function gtr(G,K,ne){return outside(G,K,">",ne)},K.outside=outside,K.prerelease=function prerelease(G,K){var ne=parse(G,K);return ne&&ne.prerelease.length?ne.prerelease:null},K.intersects=function intersects(G,K,ne){return G=new Range(G,ne),K=new Range(K,ne),G.intersects(K)},K.coerce=function coerce(G,K){if(G instanceof SemVer)return G;"number"==typeof G&&(G=String(G));if("string"!=typeof G)return null;var ne=null;if((K=K||{}).rtl){for(var ue;(ue=me[ve.COERCERTL].exec(G))&&(!ne||ne.index+ne[0].length!==G.length);)ne&&ue.index+ue[0].length===ne.index+ne[0].length||(ne=ue),me[ve.COERCERTL].lastIndex=ue.index+ue[1].length+ue[2].length;me[ve.COERCERTL].lastIndex=-1}else ne=G.match(me[ve.COERCE]);if(null===ne)return null;return parse(ne[2]+"."+(ne[3]||"0")+"."+(ne[4]||"0"),K)}}(cZ,cZ.exports);var dZ,uZ,fZ,lZ,pZ,hZ,yZ,mZ,bZ,gZ,vZ,wZ,_Z,TZ,AZ,EZ,PZ,SZ,IZ,CZ,RZ,kZ=getDefaultExportFromCjs$1(cZ.exports);!function(G){G.IMTBL_WIDGETS_PROVIDER="imtbl-widgets-provider",G.IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",G.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",G.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",G.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget",G.IMTBL_ONRAMP_WIDGET_EVENT="imtbl-onramp-widget",G.IMTBL_SALE_WIDGET_EVENT="imtbl-sale-widget",G.IMTBL_COMMERCE_WIDGET_EVENT="imtbl-commerce-widget",G.IMTBL_ADD_TOKENS_WIDGET_EVENT="imtbl-add-tokens-widget",G.IMTBL_PURCHASE_WIDGET_EVENT="imtbl-purchase-widget"}(dZ||(dZ={})),function(G){G.PROVIDER_UPDATED="PROVIDER_UPDATED"}(uZ||(uZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.SUCCESS="success",G.FAILURE="failure",G.LANGUAGE_CHANGED="language-changed",G.WALLETCONNECT_PROVIDER_UPDATED="walletconnect-provider-updated"}(fZ||(fZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.NETWORK_SWITCH="network-switch",G.DISCONNECT_WALLET="disconnect-wallet",G.LANGUAGE_CHANGED="language-changed"}(lZ||(lZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.SUCCESS="success",G.FAILURE="failure",G.REJECTED="rejected",G.LANGUAGE_CHANGED="language-changed"}(pZ||(pZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.SUCCESS="success",G.FAILURE="failure",G.REJECTED="rejected",G.TRANSACTION_SUCCESS="transaction-success",G.LANGUAGE_CHANGED="language-changed",G.PAYMENT_METHOD="payment-method",G.REQUEST_BRIDGE="request-bridge",G.REQUEST_ONRAMP="request-onramp",G.REQUEST_SWAP="request-swap",G.PAYMENT_TOKEN="payment-token"}(hZ||(hZ={})),function(G){G.CRYPTO="crypto",G.DEBIT="debit",G.CREDIT="credit"}(yZ||(yZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.FAILURE="failure",G.TRANSACTION_SENT="transaction-sent",G.LANGUAGE_CHANGED="language-changed",G.CLAIM_WITHDRAWAL_SUCCESS="claim-withdrawal-success",G.CLAIM_WITHDRAWAL_FAILURE="claim-withdrawal-failure"}(mZ||(mZ={})),function(G){G.REQUEST_CONNECT="request-connect",G.REQUEST_WALLET="request-wallet",G.REQUEST_SWAP="request-swap",G.REQUEST_BRIDGE="request-bridge",G.REQUEST_ONRAMP="request-onramp",G.REQUEST_ADD_TOKENS="request-add-tokens",G.REQUEST_PURCHASE="request-purchase",G.REQUEST_GO_BACK="request-go-back"}(bZ||(bZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.SUCCESS="success",G.FAILURE="failure",G.LANGUAGE_CHANGED="language-changed"}(gZ||(gZ={})),function(G){G.INITIALISED="INITIALISED",G.PROVIDER_UPDATED="PROVIDER_UPDATED",G.CLOSE="CLOSE",G.SUCCESS="SUCCESS",G.FAILURE="FAILURE",G.DISCONNECTED="DISCONNECTED",G.USER_ACTION="USER_ACTION"}(vZ||(vZ={})),function(G){G.SWAP_SUCCESS="SWAP_SUCCESS",G.ONRAMP_SUCCESS="ONRAMP_SUCCESS",G.CONNECT_SUCCESS="CONNECT_SUCCESS",G.SALE_SUCCESS="SALE_SUCCESS",G.SALE_TRANSACTION_SUCCESS="SALE_TRANSACTION_SUCCESS",G.BRIDGE_SUCCESS="BRIDGE_SUCCESS",G.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS="BRIDGE_CLAIM_WITHDRAWAL_SUCCESS",G.ADD_TOKENS_SUCCESS="ADD_TOKENS_SUCCESS",G.ADD_TOKENS_CONNECT_SUCCESS="ADD_TOKENS_CONNECT_SUCCESS"}(wZ||(wZ={})),function(G){G.BRIDGE_FAILED="BRIDGE_FAILED",G.BRIDGE_CLAIM_WITHDRAWAL_FAILED="BRIDGE_CLAIM_WITHDRAWAL_FAILED",G.SWAP_FAILED="SWAP_FAILED",G.SWAP_REJECTED="SWAP_REJECTED",G.CONNECT_FAILED="CONNECT_FAILED",G.SALE_FAILED="SALE_FAILED",G.ONRAMP_FAILED="ONRAMP_FAILED",G.ADD_TOKENS_FAILED="ADD_TOKENS_FAILED"}(_Z||(_Z={})),function(G){G.PAYMENT_METHOD_SELECTED="PAYMENT_METHOD_SELECTED",G.PAYMENT_TOKEN_SELECTED="PAYMENT_TOKEN_SELECTED",G.NETWORK_SWITCH="NETWORK_SWITCH"}(TZ||(TZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.LANGUAGE_CHANGED="language-changed",G.CONNECT_SUCCESS="connect-success",G.SUCCESS="success",G.FAILURE="failure"}(AZ||(AZ={})),function(G){G.CLOSE_WIDGET="close-widget",G.CONNECT_SUCCESS="connect-success",G.SUCCESS="success",G.FAILURE="failure"}(EZ||(EZ={})),function(G){G.CONNECT="connect",G.WALLET="wallet",G.SWAP="swap",G.BRIDGE="bridge",G.ONRAMP="onramp",G.SALE="sale",G.IMMUTABLE_COMMERCE="immutableCommerce",G.ADD_TOKENS="addTokens",G.PURCHASE="purchase"}(PZ||(PZ={})),function(G){G.LAYER1="LAYER1",G.LAYER2="LAYER2"}(SZ||(SZ={})),function(G){G.FROM="FROM",G.TO="TO"}(IZ||(IZ={})),function(G){G.CONNECT="CONNECT",G.WALLET="WALLET",G.SALE="SALE",G.SWAP="SWAP",G.BRIDGE="BRIDGE",G.ONRAMP="ONRAMP",G.ADD_TOKENS="ADD_TOKENS",G.PURCHASE="PURCHASE"}(CZ||(CZ={})),function(G){G.LIGHT="light",G.DARK="dark"}(RZ||(RZ={}));const OZ=["https://checkout-api.dev.immutable.com","https://checkout-api.sandbox.immutable.com","https://checkout-api.immutable.com"];class HttpClient{config;axiosInstance;constructor(G){this.config=G,this.axiosInstance=er.create(),this.setupInterceptors()}shouldAddPublishableKey(G){return OZ.some((K=>G.startsWith(K)))}setupInterceptors(){this.axiosInstance.interceptors.request.use((G=>{const K=this.config?.baseConfig?.publishableKey;if(K&&this.shouldAddPublishableKey(G.url||"")){if(!K.startsWith("pk_imapik-"))throw new Error("Invalid Publishable key. Create your Publishable key in Immutable developer hub. https://hub.immutable.com");G.headers["x-immutable-publishable-key"]=K}return G}),(G=>Promise.reject(G)))}async request(G){return await this.axiosInstance.request(G)}async get(G,K){const ne={...K,url:G};return await this.request(ne)}async post(G,K,ne){const ue={...ne,data:K,url:G};return await this.request(ue)}async put(G,K,ne){const ue={...ne,data:K,url:G};return await this.request(ue)}async delete(G,K,ne){const ue={...ne,data:K,url:G};return await this.request(ue)}}var xZ,NZ;!function(G){G.MISSING_PARAMS="MISSING_PARAMS",G.WEB3_PROVIDER_ERROR="WEB3_PROVIDER_ERROR",G.PROVIDER_ERROR="PROVIDER_ERROR",G.DEFAULT_PROVIDER_ERROR="DEFAULT_PROVIDER_ERROR",G.CONNECT_PROVIDER_ERROR="CONNECT_PROVIDER_ERROR",G.GET_BALANCE_ERROR="GET_BALANCE_ERROR",G.GET_INDEXER_BALANCE_ERROR="GET_INDEXER_BALANCE_ERROR",G.GET_ERC20_INFO_ERROR="GET_ERC20_INFO_ERROR",G.GET_ERC20_BALANCE_ERROR="GET_ERC20_BALANCE_ERROR",G.GET_ERC721_BALANCE_ERROR="GET_ERC721_BALANCE_ERROR",G.GET_NETWORK_INFO_ERROR="GET_NETWORK_INFO_ERROR",G.METAMASK_PROVIDER_ERROR="METAMASK_PROVIDER_ERROR",G.CHAIN_NOT_SUPPORTED_ERROR="CHAIN_NOT_SUPPORTED_ERROR",G.PROVIDER_REQUEST_MISSING_ERROR="PROVIDER_REQUEST_MISSING_ERROR",G.PROVIDER_REQUEST_FAILED_ERROR="PROVIDER_REQUEST_FAILED_ERROR",G.USER_REJECTED_REQUEST_ERROR="USER_REJECTED_REQUEST_ERROR",G.TRANSACTION_FAILED="TRANSACTION_FAILED",G.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",G.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",G.INVALID_GAS_ESTIMATE_TYPE="INVALID_GAS_ESTIMATE_TYPE",G.UNSUPPORTED_TOKEN_TYPE_ERROR="UNSUPPORTED_TOKEN_TYPE_ERROR",G.UNSUPPORTED_BALANCE_REQUIREMENT_ERROR="UNSUPPORTED_BALANCE_REQUIREMENT_ERROR",G.GET_ORDER_LISTING_ERROR="GET_ORDER_LISTING_ERROR",G.CANCEL_ORDER_LISTING_ERROR="CANCEL_ORDER_LISTING_ERROR",G.PREPARE_ORDER_LISTING_ERROR="PREPARE_ORDER_LISTING_ERROR",G.CREATE_ORDER_LISTING_ERROR="CREATE_ORDER_LISTING_ERROR",G.FULFILL_ORDER_LISTING_ERROR="FULFILL_ORDER_LISTING_ERROR",G.SWITCH_NETWORK_UNSUPPORTED="SWITCH_NETWORK_UNSUPPORTED",G.GET_ERC20_ALLOWANCE_ERROR="GET_ERC20_ALLOWANCE_ERROR",G.GET_ERC721_ALLOWANCE_ERROR="GET_ERC721_ALLOWANCE_ERROR",G.GET_ERC1155_ALLOWANCE_ERROR="GET_ERC1155_ALLOWANCE_ERROR",G.EXECUTE_APPROVAL_TRANSACTION_ERROR="EXECUTE_APPROVAL_TRANSACTION_ERROR",G.EXECUTE_FULFILLMENT_TRANSACTION_ERROR="EXECUTE_FULFILLMENT_TRANSACTION_ERROR",G.SIGN_MESSAGE_ERROR="SIGN_MESSAGE_ERROR",G.BRIDGE_GAS_ESTIMATE_ERROR="BRIDGE_GAS_ESTIMATE_ERROR",G.ORDER_FEE_ERROR="ORDER_FEE_ERROR",G.ITEM_REQUIREMENTS_ERROR="ITEM_REQUIREMENTS_ERROR",G.API_ERROR="API_ERROR",G.ORDER_EXPIRED_ERROR="ORDER_EXPIRED_ERROR",G.WIDGETS_SCRIPT_LOAD_ERROR="WIDGETS_SCRIPT_LOAD_ERROR",G.APPROVAL_TRANSACTION_FAILED="APPROVAL_TRANSACTION_FAILED"}(xZ||(xZ={}));class CheckoutError extends Error{message;type;data;constructor(G,K,ne){super(G),this.message=G,this.type=K,this.data=ne}}!function(G){G.REJECTED_SWITCH_AFTER_ADDING_NETWORK="REJECTED_SWITCH_AFTER_ADDING_NETWORK"}(NZ||(NZ={}));const withCheckoutError=async(G,K)=>{try{return await G()}catch(G){const ne=`${G.message}`||"UnknownError",ue=K.message?`[${K.type}]:${K.message}. Cause:${ne}`:`[${K.type}] Cause:${ne}`;if(G instanceof CheckoutError)throw new CheckoutError(ue,K.type,{...K.data,innerErrorType:G.type,...G.data});throw new CheckoutError(ue,K.type,{...K.data})}};var MZ,BZ,FZ;!function(G){G[G.IMTBL_ZKEVM_MAINNET=13371]="IMTBL_ZKEVM_MAINNET",G[G.IMTBL_ZKEVM_TESTNET=13473]="IMTBL_ZKEVM_TESTNET",G[G.IMTBL_ZKEVM_DEVNET=15003]="IMTBL_ZKEVM_DEVNET",G[G.ETHEREUM=1]="ETHEREUM",G[G.SEPOLIA=11155111]="SEPOLIA"}(MZ||(MZ={})),function(G){G.ETHEREUM="Ethereum",G.SEPOLIA="Sepolia",G.IMTBL_ZKEVM_TESTNET="Immutable zkEVM Testnet",G.IMTBL_ZKEVM_DEVNET="Immutable zkEVM Dev",G.IMTBL_ZKEVM_MAINNET="Immutable zkEVM"}(BZ||(BZ={})),function(G){G.ETHEREUM="ethereum",G.SEPOLIA="sepolia",G.IMTBL_ZKEVM_MAINNET="imtbl-zkevm-mainnet",G.IMTBL_ZKEVM_TESTNET="imtbl-zkevm-testnet",G.IMTBL_ZKEVM_DEVNET="imtbl-zkevm-devnet"}(FZ||(FZ={}));const DZ="development",LZ=18,UZ="native",$Z={name:"IMX",symbol:"IMX",decimals:LZ,address:UZ},qZ={name:"tIMX",symbol:"tIMX",decimals:LZ,address:UZ},GZ={[DZ]:"https://api.dev.immutable.com",[Jn.SANDBOX]:"https://api.sandbox.immutable.com",[Jn.PRODUCTION]:"https://api.immutable.com"},jZ={[DZ]:"https://checkout-api.dev.immutable.com",[Jn.SANDBOX]:"https://checkout-api.sandbox.immutable.com",[Jn.PRODUCTION]:"https://checkout-api.immutable.com"},HZ={[Jn.SANDBOX]:"https://global-stg.transak.com",[Jn.PRODUCTION]:"https://global.transak.com/"},WZ=new Map([[MZ.ETHEREUM,{chainIdHex:`0x${MZ.ETHEREUM.toString(16)}`,chainName:BZ.ETHEREUM,rpcUrls:["https://checkout-api.immutable.com/v1/rpc/eth-mainnet"],nativeCurrency:{name:BZ.ETHEREUM,symbol:"ETH",decimals:18},blockExplorerUrls:["https://etherscan.io/"]}],[MZ.IMTBL_ZKEVM_MAINNET,{chainIdHex:`0x${MZ.IMTBL_ZKEVM_MAINNET.toString(16)}`,chainName:BZ.IMTBL_ZKEVM_MAINNET,rpcUrls:["https://rpc.immutable.com"],nativeCurrency:$Z}]]),zZ=new Map([[MZ.SEPOLIA,{chainIdHex:`0x${MZ.SEPOLIA.toString(16)}`,chainName:BZ.SEPOLIA,rpcUrls:["https://checkout-api.sandbox.immutable.com/v1/rpc/eth-sepolia"],nativeCurrency:{name:"Sep Eth",symbol:"ETH",decimals:18},blockExplorerUrls:["https://sepolia.etherscan.io/"]}],[MZ.IMTBL_ZKEVM_TESTNET,{chainIdHex:`0x${MZ.IMTBL_ZKEVM_TESTNET.toString(16)}`,chainName:BZ.IMTBL_ZKEVM_TESTNET,rpcUrls:["https://rpc.testnet.immutable.com"],nativeCurrency:qZ}]]),VZ=new Map([[MZ.SEPOLIA,{chainIdHex:`0x${MZ.SEPOLIA.toString(16)}`,chainName:BZ.SEPOLIA,rpcUrls:["https://checkout-api.dev.immutable.com/v1/rpc/eth-sepolia"],nativeCurrency:{name:"Sep Eth",symbol:"ETH",decimals:18},blockExplorerUrls:["https://sepolia.etherscan.io/"]}],[MZ.IMTBL_ZKEVM_DEVNET,{chainIdHex:`0x${MZ.IMTBL_ZKEVM_DEVNET.toString(16)}`,chainName:BZ.IMTBL_ZKEVM_DEVNET,rpcUrls:["https://rpc.dev.immutable.com"],nativeCurrency:$Z}]]),KZ={[MZ.IMTBL_ZKEVM_TESTNET]:{url:"https://explorer.testnet.immutable.com",nativeToken:zZ.get(MZ.IMTBL_ZKEVM_TESTNET).nativeCurrency},[MZ.IMTBL_ZKEVM_MAINNET]:{url:"https://explorer.immutable.com",nativeToken:WZ.get(MZ.IMTBL_ZKEVM_MAINNET).nativeCurrency},[MZ.SEPOLIA]:{url:"https://eth-sepolia.blockscout.com",nativeToken:zZ.get(MZ.SEPOLIA).nativeCurrency},[MZ.ETHEREUM]:{url:"https://eth.blockscout.com/",nativeToken:WZ.get(MZ.ETHEREUM).nativeCurrency}},JZ=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],XZ=[{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}],QZ=[{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],ZZ={maxFeePerGas:Oi.from(15e9),maxPriorityFeePerGas:Oi.from(1e10)},availabilityService=(G,K)=>({checkDexAvailability:async()=>{let ne;try{ne=await er.post(`${G?GZ[DZ]:K?GZ[Jn.PRODUCTION]:GZ[Jn.SANDBOX]}/v1/availability/checkout/swap`)}catch(G){if(ne=G.response,403===ne.status)return!1;throw new CheckoutError(`Error fetching from api: ${ne.status} ${ne.statusText}`,xZ.API_ERROR,{error:G})}return!0}});var YZ,eY,tY,rY,nY,aY,iY,sY;!function(G){G.TRANSAK="201811419111"}(YZ||(YZ={})),function(G){G.BRIDGE_TO_L2="BRIDGE_TO_L2",G.SWAP="SWAP"}(eY||(eY={})),function(G){G.ALL="all"}(tY||(tY={})),function(G){G.ALL="all",G.SWAP="swap",G.BRIDGE="bridge",G.ONRAMP="onramp"}(rY||(rY={})),function(G){G.CHECK_CONNECTION="eth_accounts",G.CONNECT="eth_requestAccounts",G.ADD_NETWORK="wallet_addEthereumChain",G.SWITCH_NETWORK="wallet_switchEthereumChain",G.GET_CHAINID="eth_chainId",G.REQUEST_PERMISSIONS="wallet_requestPermissions"}(nY||(nY={})),function(G){G.ALL="all"}(aY||(aY={})),function(G){G.PASSPORT="passport",G.METAMASK="metamask",G.WALLETCONNECT="walletconnect"}(iY||(iY={})),function(G){G.PASSPORT="com.immutable.passport",G.METAMASK="io.metamask",G.WALLETCONNECT="walletconnect"}(sY||(sY={}));const oY={allowMistmatchedChainId:!1,allowUnsupportedProvider:!1};var cY,dY,uY,fY,lY,pY,hY,yY;!function(G){G.SUCCESS="SUCCESS",G.FAILED="FAILED",G.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",G.FULFILLMENTS_UNSETTLED="FULFILLMENTS_UNSETTLED"}(cY||(cY={})),function(G){G.NATIVE="NATIVE",G.ERC20="ERC20",G.ERC721="ERC721",G.ERC1155="ERC1155"}(dY||(dY={})),function(G){G.TRANSACTION="TRANSACTION",G.GAS="GAS"}(uY||(uY={})),function(G){G.NATIVE="NATIVE",G.ERC20="ERC20"}(fY||(fY={})),function(G){G.ROUTES_FOUND="ROUTES_FOUND",G.NO_ROUTES_FOUND="NO_ROUTES_FOUND",G.NO_ROUTE_OPTIONS="NO_ROUTE_OPTIONS"}(lY||(lY={})),function(G){G.GAS="GAS",G.BRIDGE_FEE="BRIDGE_FEE",G.SWAP_FEE="SWAP_FEE",G.IMMUTABLE_FEE="IMMUTABLE_FEE"}(pY||(pY={})),function(G){G.BRIDGE="BRIDGE",G.SWAP="SWAP",G.ONRAMP="ONRAMP"}(hY||(hY={})),function(G){G.ONRAMP="onramp"}(yY||(yY={}));const parseChainId=G=>{if("number"==typeof G)return G;if("string"==typeof G&&!Number.isNaN(Number(G)))return G.startsWith("0x")?parseInt(G,16):Number(G);throw new CheckoutError("Invalid chainId",xZ.WEB3_PROVIDER_ERROR)};async function getUnderlyingChainId(G){const K=G.provider?.chainId;return K?parseChainId(K):async function requestChainId(G){if(!G.provider?.request)throw new CheckoutError("Parsed provider is not a valid Web3Provider",xZ.WEB3_PROVIDER_ERROR);const K=await G.provider.request({method:nY.GET_CHAINID,params:[]});return parseChainId(K)}(G)}async function addNetworkToWallet(G,K,ne){if(K.provider?.request){const ue=G.get(ne),pe={chainId:ue?.chainIdHex,chainName:ue?.chainName,rpcUrls:ue?.rpcUrls,nativeCurrency:ue?.nativeCurrency,blockExplorerUrls:ue?.blockExplorerUrls};return await K.provider.request({method:nY.ADD_NETWORK,params:[pe]})}return Promise.reject("Provider does not support request method")}async function getNetworkAllowList(G,{type:K=tY.ALL,exclude:ne}){const{networkMap:ue}=G,pe=await G.remote.getConfig("allowedNetworks");pe||console.warn("No allowed networks configured");const he=(pe||[]).filter((G=>{const ue=K===tY.ALL,pe=!(ne||[]).map((G=>G.chainId)).includes(G.chainId);return ue&&pe})),ye=[];return he.forEach((G=>{const K=ue.get(G.chainId);K&&ye.push({name:K.chainName,chainId:parseInt(K.chainIdHex,16),nativeCurrency:K.nativeCurrency,isSupported:!0})})),{networks:ye}}async function getNetworkInfo(G,K){const{networkMap:ne}=G;return withCheckoutError((async()=>{try{const G=await K.getNetwork();if(Array.from(ne.keys()).includes(G.chainId)){const K=ne.get(G.chainId);return{name:K.chainName,chainId:parseInt(K.chainIdHex,16),nativeCurrency:K.nativeCurrency,isSupported:!0}}return{chainId:G.chainId,name:G.name,isSupported:!1}}catch(G){const ue=await getUnderlyingChainId(K);return{chainId:ue,isSupported:Array.from(ne.keys()).includes(ue)}}}),{type:xZ.GET_NETWORK_INFO_ERROR})}async function switchWalletNetwork(G,K,ne){const{networkMap:ue}=G;if(!(await getNetworkAllowList(G,{type:tY.ALL})).networks.some((G=>G.chainId===ne)))throw new CheckoutError(`Chain:${ne} is not a supported chain`,xZ.CHAIN_NOT_SUPPORTED_ERROR);if(K.provider?.isPassport)throw new CheckoutError("Switching networks with Passport provider is not supported",xZ.SWITCH_NETWORK_UNSUPPORTED);try{await async function switchNetworkInWallet(G,K,ne){if(K.provider?.request)return await K.provider.request({method:nY.SWITCH_NETWORK,params:[{chainId:G.get(ne)?.chainIdHex}]})}(ue,K,ne)}catch(G){if(console.error(G),4902!==G.code)throw new CheckoutError("User cancelled switch network request",xZ.USER_REJECTED_REQUEST_ERROR);try{await addNetworkToWallet(ue,K,ne)}catch(G){throw new CheckoutError("User cancelled add network request",xZ.USER_REJECTED_REQUEST_ERROR,{error:G})}}const pe=new Web3Provider(K.provider);if((await pe.getNetwork()).chainId!==ne)throw new CheckoutError("User cancelled switch network request",xZ.USER_REJECTED_REQUEST_ERROR);return{network:await getNetworkInfo(G,pe),provider:pe}}class RemoteConfigFetcher{httpClient;isDevelopment;isProduction;configCache;version="v1";constructor(G,K){this.isDevelopment=K.isDevelopment,this.isProduction=K.isProduction,this.httpClient=G}getEndpoint=()=>this.isDevelopment?jZ[DZ]:this.isProduction?jZ[Jn.PRODUCTION]:jZ[Jn.SANDBOX];parseResponse(G){let K=G.data;if(G.data&&"object"!=typeof G.data)try{K=JSON.parse(G.data)}catch(G){throw new CheckoutError("Invalid configuration",xZ.API_ERROR,{error:G})}return K}async loadConfig(){if(this.configCache)return this.configCache;let G;try{G=await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`)}catch(G){throw new CheckoutError(`Error: ${G.message}`,xZ.API_ERROR,{error:G})}return this.configCache=this.parseResponse(G),this.configCache}async getConfig(G){const K=await this.loadConfig();if(K)return G?K[G]:K}getHttpClient=()=>this.httpClient}class TokensFetcher{httpClient;remoteConfig;isDevelopment;isProduction;tokensCache;constructor(G,K,ne){this.isDevelopment=ne.isDevelopment,this.isProduction=ne.isProduction,this.httpClient=G,this.remoteConfig=K}getBaseUrl=()=>this.isDevelopment?GZ[DZ]:this.isProduction?GZ[Jn.PRODUCTION]:GZ[Jn.SANDBOX];getChainSlug=()=>this.isDevelopment?FZ.IMTBL_ZKEVM_DEVNET:this.isProduction?FZ.IMTBL_ZKEVM_MAINNET:FZ.IMTBL_ZKEVM_TESTNET;async loadTokens(){if(this.tokensCache)return this.tokensCache;let G;try{G=await this.httpClient.get(`${this.getBaseUrl()}/v1/chains/${this.getChainSlug()}/tokens?verification_status=verified&is_canonical=true`)}catch(G){throw new CheckoutError(`Error: ${G.message}`,xZ.API_ERROR,{error:G})}const K=this.parseResponse(G);return this.tokensCache=await this.getMappingsForTokensResponse(K?.result||[]),this.tokensCache}async getChainTokensConfig(){return await this.loadTokens()??{}}async getTokensConfig(G){const K=await this.loadTokens();return K&&K[G]?K[G]??[]:[]}async getMappingsForTokensResponse(G){const K={},ne=await this.fetchIMXTokenMappings();return Object.keys(ne).forEach((G=>{const ue=parseInt(G,10);K[ue]=[],K[ue]?.push({address:ne[G],decimals:18,name:"IMX",symbol:"IMX",bridge:"native"})})),G.forEach((G=>{const ne=parseInt(G.chain.id.split("eip155:").pop()||"",10);if(!G.symbol||!G.decimals)return;K[ne]||(K[ne]=[]);const ue={address:G.contract_address.toLowerCase(),decimals:G.decimals,name:G.name,symbol:G.symbol,icon:G.image_url??void 0,bridge:G.bridge_used??null};K[ne]?.push(ue);const pe=parseInt(G.root_chain_id?.split("eip155:").pop()||"",10);let he=G.root_contract_address?.toLowerCase();pe&&he&&(K[pe]||(K[pe]=[]),"0x0000000000000000000000000000000000000eee"===he&&(he="native"),K[pe]?.push({...ue,address:he}))})),K}parseResponse(G){let K=G.data;if(G.data&&"object"!=typeof G.data)try{K=JSON.parse(G.data)}catch(G){throw new CheckoutError("Invalid token data",xZ.API_ERROR,{error:G})}return K}async fetchIMXTokenMappings(){return await this.remoteConfig.getConfig("imxAddressMapping")}}class CheckoutConfigurationError extends Error{message;constructor(G){super(G),this.message=G}}const getL1ChainId=G=>G.isProduction?MZ.ETHEREUM:MZ.SEPOLIA,getL2ChainId=G=>G.isDevelopment?MZ.IMTBL_ZKEVM_DEVNET:G.isProduction?MZ.IMTBL_ZKEVM_MAINNET:MZ.IMTBL_ZKEVM_TESTNET;class CheckoutConfiguration{isDevelopment=!1;isProduction;isOnRampEnabled;isSwapEnabled;isBridgeEnabled;remote;tokens;environment;networkMap;publishableKey;overrides;constructor(G,K){if(!Object.values(Jn).includes(G.baseConfig.environment))throw new CheckoutConfigurationError("Invalid checkout configuration of environment");var ne;this.environment=G.baseConfig.environment,this.isProduction=!this.isDevelopment&&this.environment===Jn.PRODUCTION,this.isOnRampEnabled=G.onRamp?.enable??true,this.isSwapEnabled=G.swap?.enable??true,this.isBridgeEnabled=G.bridge?.enable??true,this.publishableKey=G.publishableKey??"<no-publishable-key>",this.networkMap=(ne=this.isProduction,this.isDevelopment?VZ:ne?WZ:zZ),this.remote=new RemoteConfigFetcher(K,{isDevelopment:this.isDevelopment,isProduction:this.isProduction}),this.tokens=new TokensFetcher(K,this.remote,{isDevelopment:this.isDevelopment,isProduction:this.isProduction}),this.overrides=G.overrides??{}}get sdkVersion(){return"1.78.11"}}const isMatchingAddress=(G="",K="")=>G.toLowerCase()===K.toLowerCase(),formatSmartCheckoutAmount=(G,K=6)=>{if(-1===G.indexOf("."))return G;const ne=((G,K)=>{const ne=G.indexOf("."),ue=G.substring(ne+K+1);if(ue&&parseFloat(ue)>=1){const ue=G.substring(0,ne+K+1),pe=1/10**K;return(parseFloat(ue)+pe).toString()}return parseFloat(G.substring(0,ne+K+1)).toString()})(G,K);return ne},getTokenAllowList=async(G,{type:K=rY.ALL,chainId:ne,exclude:ue})=>{let pe,he,ye=[];const me=ne??getL1ChainId(G),be=getL2ChainId(G);switch(K){case rY.SWAP:ye=await G.tokens.getTokensConfig(be),he=((await G.remote.getConfig("dex"))?.blocklist||[]).map((G=>G.address.toLowerCase())),ye=ye.filter((G=>G.address&&!he.includes(G.address)));break;case rY.ONRAMP:pe=await G.remote.getConfig("onramp"),pe||(ye=[]),ye=pe[YZ.TRANSAK]?.tokens||[];break;case rY.BRIDGE:ye=(await G.tokens.getTokensConfig(me)).filter((G=>"native"===G.bridge));break;case rY.ALL:default:ye=await G.tokens.getTokensConfig(me)}return ue&&0!==ue?.length?{tokens:ye.filter((G=>!ue.map((G=>G.address)).includes(G.address||"")))}:{tokens:ye}},isNativeToken=G=>!G||isMatchingAddress(G,UZ);async function getERC20TokenInfo(G,K){return await withCheckoutError((async()=>{const ne=new iu(K,JSON.stringify(JZ),G),[ue,pe,he]=await Promise.all([ne.name(),ne.symbol(),ne.decimals()]);return{name:ue,symbol:pe,decimals:he,address:K}}),{type:xZ.GET_ERC20_INFO_ERROR})}class Blockscout{url;nativeToken;ttl;chainId;cacheMap;httpClient;setCache(G,K){this.cacheMap[G]={data:K,ttl:(new Date).getTime()+1e3*this.ttl}}getCache(G){const K=this.cacheMap[G];return!K||K.ttl<=(new Date).getTime()?null:K.data}constructor(G,K,ne){this.httpClient=G,this.chainId=K,this.url=KZ[this.chainId].url;const ue=KZ[this.chainId].nativeToken;this.nativeToken={address:ue.address??"",decimals:ue.decimals.toString(),name:ue.name,symbol:ue.symbol},this.cacheMap={},this.ttl=void 0!==ne?ne:5}static isChainSupported=G=>Boolean(KZ[G]);static isBlockscoutError=G=>"code"in G;async getTokensByWalletAddress(G){try{let K=`${this.url}/api/v2/addresses/${G.walletAddress}/tokens?type=${G.tokenType}`;G.nextPage&&(K+=`&${new URLSearchParams(G.nextPage)}`);const ne=this.getCache(K);if(ne)return Promise.resolve(ne);const ue=await this.httpClient.get(K),pe=ue.data?.items?.map((G=>{const K={...G.token};return!K.address&&K.address_hash&&(K.address=K.address_hash),{...G,token:K}}))||[],he={items:pe.filter((G=>G.token.address&&G.token.address!==this.nativeToken.address)),next_page_params:ue.data?.next_page_params};return this.setCache(K,he),Promise.resolve(he)}catch(G){let K=tn.InternalServerError,ne="InternalServerError";return er.isAxiosError(G)&&(K=G.response?.status||K,ne=G.message),Promise.reject({code:K,message:ne})}}async getNativeTokenByWalletAddress(G){try{const K=`${this.url}/api/v2/addresses/${G.walletAddress}`,ne=this.getCache(K);if(ne)return Promise.resolve(ne);const ue=await this.httpClient.get(K),pe={token:this.nativeToken,value:ue.data.coin_balance};return this.setCache(K,pe),Promise.resolve(pe)}catch(G){let K=tn.InternalServerError,ne="InternalServerError";return er.isAxiosError(G)&&(K=G.response?.status||K,ne=G.message),Promise.reject({code:K,message:ne})}}}var mY;!function(G){G.ERC20="ERC-20"}(mY||(mY={}));const debugLogger=(G,K,ne)=>{G.isProduction||console.info(K,ne)},measureAsyncExecution=async(G,K,ne)=>{const ue=performance.now(),pe=await ne,he=performance.now();return debugLogger(G,K,(he-ue)/1e3),pe},getBalance=async(G,K,ne)=>await withCheckoutError((async()=>{const ue=await getNetworkInfo(G,K);if(!ue.isSupported)throw new CheckoutError(`Chain:${ue.chainId} is not a supported chain`,xZ.CHAIN_NOT_SUPPORTED_ERROR,{chainName:ue.name});const pe=await K.getBalance(ne);return{balance:pe,formattedBalance:formatUnits(pe,ue.nativeCurrency.decimals),token:ue.nativeCurrency}}),{type:xZ.GET_BALANCE_ERROR});async function getERC20Balance(G,K,ne){return await withCheckoutError((async()=>{const ue=new iu(ne,JSON.stringify(JZ),G);return Promise.all([getERC20TokenInfo(G,ne),ue.balanceOf(K)]).then((([G,K])=>({balance:K,formattedBalance:formatUnits(K,G.decimals),token:{name:G.name,symbol:G.symbol,decimals:G.decimals,address:ne}})))}),{type:xZ.GET_ERC20_BALANCE_ERROR})}const bY=new Map,resetBlockscoutClientMap=()=>bY.clear(),getTokenBalances$1=async(G,K,ne,ue,pe)=>{if(!K)throw new CheckoutError("indexer is disabled for this chain, you must provide a provider.",xZ.MISSING_PARAMS);let he=ne;return he||(he=await(K?.getSigner().getAddress())),await measureAsyncExecution(G,`Time to fetch balances using RPC for ${ue}`,(async(G,K,ne,ue)=>{const pe=[];return ue.forEach((ue=>{!ue.address||isMatchingAddress(ue.address,UZ)?pe.push(getBalance(G,K,ne)):pe.push(getERC20Balance(K,ne,ue.address))})),{balances:(await Promise.allSettled(pe)).filter((G=>"fulfilled"===G.status)).map((G=>{const K=G,{token:ne}=K.value;return ne.address&&!isMatchingAddress(ne.address,UZ)||(K.value.token.address=UZ),K.value}))}})(G,K,he,pe))},getAllBalances=async(G,K,ne,ue,pe=!1)=>{if(!ne&&!K)throw new CheckoutError("both walletAddress and provider are missing. At least one must be provided.",xZ.MISSING_PARAMS);if(!G.networkMap.get(ue))throw new CheckoutError(`chain ID ${ue} not supported by the environment`,xZ.CHAIN_NOT_SUPPORTED_ERROR);const{tokens:he}=await getTokenAllowList(G,{type:rY.ALL,chainId:ue});if(pe&&resetBlockscoutClientMap(),Blockscout.isChainSupported(ue)){const pe=ne??await(K?.getSigner().getAddress());try{return await measureAsyncExecution(G,`Time to fetch balances using blockscout for ${ue}`,(async(G,K,ne,ue)=>{const pe=void 0!==ue,he=Object.assign({},...(ue??[]).map((G=>({[G.address?.toLowerCase()||UZ]:G}))));let ye=bY.get(ne);if(!ye){const K=G.remote.getHttpClient();ye=new Blockscout(K,ne),bY.set(ne,ye)}const me=[],be=mY.ERC20;await Promise.all([(async G=>{let ne;try{do{ne=await G.getTokensByWalletAddress({walletAddress:K,tokenType:be,nextPage:ne?.next_page_params}),me.push(...ne.items)}while(ne.next_page_params)}catch(G){if(G?.code!==tn.NotFound)throw new CheckoutError(G.message||"InternalServerError | getTokensByWalletAddress",xZ.GET_INDEXER_BALANCE_ERROR,{error:G})}})(ye),(async G=>{try{const ne=await G.getNativeTokenByWalletAddress({walletAddress:K});ne.token.address||=UZ,me.push(ne)}catch(G){if(G?.code!==tn.NotFound)throw new CheckoutError(G.message||"InternalServerError | getNativeTokenByWalletAddress",xZ.GET_INDEXER_BALANCE_ERROR,{error:G})}})(ye)]);const ve=[];return me.forEach((G=>{const K=he[G.token.address.toLowerCase()];if(pe&&!K)return;const ne=G.token||{};if(null==G.value)return;const ue=Oi.from(G.value);let ye=parseInt(ne.decimals,10);Number.isNaN(ye)&&(ye=LZ);const me=ne.icon_url??K.icon,be={...ne,decimals:ye,icon:me},_e=formatUnits(G.value,be.decimals);ve.push({balance:ue,formattedBalance:_e,token:be})})),{balances:ve}})(G,pe,ue,he))}catch(pe){if(pe.type===xZ.GET_INDEXER_BALANCE_ERROR&&pe.data?.error?.code===tn.TooManyRequests)return getTokenBalances$1(G,K,ne,ue,he);throw pe}}return getTokenBalances$1(G,K,ne,ue,he)};class FiatRampService{config;constructor(G){this.config=G}async feeEstimate(){const G=await this.config.remote.getConfig("onramp");return G[YZ.TRANSAK]?.fees}async createWidgetUrl(G){return await this.getTransakWidgetUrl(G)}async getTransakWidgetUrl(G){const K=await this.config.remote.getConfig("onramp"),ne=HZ[this.config.environment];let ue={apiKey:K[YZ.TRANSAK].publishableApiKey,network:"immutablezkevm",defaultPaymentMethod:"credit_debit_card",disablePaymentMethods:"",productsAvailed:"buy",exchangeScreenTitle:"Buy",themeColor:"0D0D0D",defaultCryptoCurrency:G.tokenSymbol||"IMX"};return G.isPassport&&G.email&&(ue={...ue,email:encodeURIComponent(G.email),isAutoFillUserData:!0,disableWalletAddressForm:!0}),ue=G.tokenAmount&&G.tokenSymbol?{...ue,defaultCryptoAmount:G.tokenAmount,cryptoCurrencyCode:G.tokenSymbol}:{...ue,defaultFiatAmount:50,defaultFiatCurrency:"usd"},G.walletAddress&&(ue={...ue,walletAddress:G.walletAddress}),G.allowedTokens&&(ue={...ue,cryptoCurrencyList:G.allowedTokens?.join(",").toLowerCase()}),`${ne}?${new URLSearchParams(ue).toString()}`}}function createBridgeInstance(G,K,ne,ue){const pe=ne.get(G),he=ne.get(K);if(!pe)throw new CheckoutError(`Chain:${G} is not a supported chain`,xZ.CHAIN_NOT_SUPPORTED_ERROR);if(!he)throw new CheckoutError(`Chain:${K} is not a supported chain`,xZ.CHAIN_NOT_SUPPORTED_ERROR);let ye=Ez;ue.isDevelopment&&(ye=Az),ue.isProduction&&(ye=Pz);const me=new BridgeConfiguration({baseConfig:new ImmutableConfiguration({environment:ue.environment}),bridgeInstance:ye,rootProvider:pe,childProvider:he});return new TokenBridge(me)}async function createExchangeInstance(G,K){const ne=await K.remote.getConfig("dex");return new Exchange({chainId:G,baseConfig:new ImmutableConfiguration({environment:K.environment}),overrides:ne?.overrides,secondaryFees:ne?.secondaryFees})}function createOrderbookInstance(G){return new Orderbook({baseConfig:{environment:G.environment}})}function createBlockchainDataInstance(G){return new BlockchainData({baseConfig:{environment:G.environment}})}const gY="0x0000000000000000000000000000000000000001",vY=18;async function bridgeToL2GasEstimator(G,K){const ne=getL1ChainId(K),ue=getL2ChainId(K);if(!G.get(ne))throw new Error(`Missing JsonRpcProvider for chain id: ${ne}`);try{const pe=createBridgeInstance(ne,ue,G,K),he=await async function getBridgeFeeEstimate$1(G,K,ne,ue){const pe=K===getL1ChainId(ue)?cz.DEPOSIT:cz.WITHDRAW;return await G.getFee({action:pe,gasMultiplier:"auto",sourceChainId:K.toString(),destinationChainId:ne.toString(),token:UZ.toUpperCase(),amount:Oi.from(0)})}(pe,ne,ue,K);return{gasEstimateType:eY.BRIDGE_TO_L2,fees:he,token:K.networkMap.get(ne)?.nativeCurrency}}catch{return{gasEstimateType:eY.BRIDGE_TO_L2,fees:{sourceChainGas:Oi.from(0),approvalFee:Oi.from(0),bridgeFee:Oi.from(0),imtblFee:Oi.from(0),totalFees:Oi.from(0)},token:K.networkMap.get(ne)?.nativeCurrency}}}async function gasEstimator(G,K,ne){switch(G.gasEstimateType){case eY.BRIDGE_TO_L2:return await bridgeToL2GasEstimator(K,ne);case eY.SWAP:return await async function swapGasEstimator(G){const K=getL2ChainId(G),ne=await G.remote.getConfig("gasEstimateTokens"),{inAddress:ue,outAddress:pe}=ne[K].swapAddresses;try{const ne=await createExchangeInstance(K,G),{swap:he}=await ne.getUnsignedSwapTxFromAmountIn(gY,ue,pe,Oi.from(parseUnits$1("1",vY)));return he.gasFeeEstimate?{gasEstimateType:eY.SWAP,fees:{totalFees:he.gasFeeEstimate.value?Oi.from(he.gasFeeEstimate.value):void 0,token:{address:he.gasFeeEstimate.token.address,symbol:he.gasFeeEstimate.token.symbol??"",name:he.gasFeeEstimate.token.name??"",decimals:he.gasFeeEstimate.token.decimals??vY}}}:{gasEstimateType:eY.SWAP,fees:{}}}catch{return{gasEstimateType:eY.SWAP,fees:{}}}}(ne);default:throw new CheckoutError("Invalid type provided for gasEstimateType",xZ.INVALID_GAS_ESTIMATE_TYPE)}}function createStore(){const G=new Set;let K=[];const request=()=>function requestProviders(G){if("undefined"==typeof window)return;const handler=K=>G(K.detail);return window.addEventListener("eip6963:announceProvider",handler),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",handler)}((ne=>{K.some((({info:G})=>G.uuid===ne.info.uuid))||(K=[...K,ne],G.forEach((G=>G(K,{added:[ne]}))))}));let ne=request();return{_listeners:()=>G,clear(){G.forEach((G=>G([],{removed:[...K]}))),K=[]},destroy(){this.clear(),G.clear(),ne?.()},findProvider:({rdns:G})=>K.find((K=>K.info.rdns===G)),getProviders:()=>K,reset(){this.clear(),ne?.(),ne=request()},subscribe:(ne,{emitImmediately:ue}={})=>(G.add(ne),ue&&ne(K,{added:K}),()=>G.delete(ne))}}class InjectedProvidersManager{static instance;store;resetTimeout;isInit=!1;constructor(){this.store=createStore(),this.store.reset()}static getInstance(){return InjectedProvidersManager.instance||(InjectedProvidersManager.instance=new InjectedProvidersManager),InjectedProvidersManager.instance}findProvider(G){return this.store.findProvider(G)}getProviders(){return this.store.getProviders()}subscribe(G){return this.store.subscribe(G)}clear(){this.store.clear()}reset(){clearTimeout(this.resetTimeout),this.resetTimeout=setTimeout((()=>{this.store.reset()}),200)}initialise(){this.isInit||(this.isInit=!0,this.reset())}requestProviders(){window.dispatchEvent(new CustomEvent("eip6963:requestProvider"))}destroy(){this.store.destroy()}}const wY={name:"MetaMask",rdns:"io.metamask",icon:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMzIiB2aWV3Qm94PSIwIDAgMzUgMzMiIHdpZHRoPSIzNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iLjI1Ij48cGF0aCBkPSJtMzIuOTU4MiAxLTEzLjEzNDEgOS43MTgzIDIuNDQyNC01LjcyNzMxeiIgZmlsbD0iI2UxNzcyNiIgc3Ryb2tlPSIjZTE3NzI2Ii8+PGcgZmlsbD0iI2UyNzYyNSIgc3Ryb2tlPSIjZTI3NjI1Ij48cGF0aCBkPSJtMi42NjI5NiAxIDEzLjAxNzE0IDkuODA5LTIuMzI1NC01LjgxODAyeiIvPjxwYXRoIGQ9Im0yOC4yMjk1IDIzLjUzMzUtMy40OTQ3IDUuMzM4NiA3LjQ4MjkgMi4wNjAzIDIuMTQzNi03LjI4MjN6Ii8+PHBhdGggZD0ibTEuMjcyODEgMjMuNjUwMSAyLjEzMDU1IDcuMjgyMyA3LjQ2OTk0LTIuMDYwMy0zLjQ4MTY2LTUuMzM4NnoiLz48cGF0aCBkPSJtMTAuNDcwNiAxNC41MTQ5LTIuMDc4NiAzLjEzNTggNy40MDUuMzM2OS0uMjQ2OS03Ljk2OXoiLz48cGF0aCBkPSJtMjUuMTUwNSAxNC41MTQ5LTUuMTU3NS00LjU4NzA0LS4xNjg4IDguMDU5NzQgNy40MDQ5LS4zMzY5eiIvPjxwYXRoIGQ9Im0xMC44NzMzIDI4Ljg3MjEgNC40ODE5LTIuMTYzOS0zLjg1ODMtMy4wMDYyeiIvPjxwYXRoIGQ9Im0yMC4yNjU5IDI2LjcwODIgNC40Njg5IDIuMTYzOS0uNjEwNS01LjE3MDF6Ii8+PC9nPjxwYXRoIGQ9Im0yNC43MzQ4IDI4Ljg3MjEtNC40NjktMi4xNjM5LjM2MzggMi45MDI1LS4wMzkgMS4yMzF6IiBmaWxsPSIjZDViZmIyIiBzdHJva2U9IiNkNWJmYjIiLz48cGF0aCBkPSJtMTAuODczMiAyOC44NzIxIDQuMTU3MiAxLjk2OTYtLjAyNi0xLjIzMS4zNTA4LTIuOTAyNXoiIGZpbGw9IiNkNWJmYjIiIHN0cm9rZT0iI2Q1YmZiMiIvPjxwYXRoIGQ9Im0xNS4xMDg0IDIxLjc4NDItMy43MTU1LTEuMDg4NCAyLjYyNDMtMS4yMDUxeiIgZmlsbD0iIzIzMzQ0NyIgc3Ryb2tlPSIjMjMzNDQ3Ii8+PHBhdGggZD0ibTIwLjUxMjYgMjEuNzg0MiAxLjA5MTMtMi4yOTM1IDIuNjM3MiAxLjIwNTF6IiBmaWxsPSIjMjMzNDQ3IiBzdHJva2U9IiMyMzM0NDciLz48cGF0aCBkPSJtMTAuODczMyAyOC44NzIxLjY0OTUtNS4zMzg2LTQuMTMxMTcuMTE2N3oiIGZpbGw9IiNjYzYyMjgiIHN0cm9rZT0iI2NjNjIyOCIvPjxwYXRoIGQ9Im0yNC4wOTgyIDIzLjUzMzUuNjM2NiA1LjMzODYgMy40OTQ2LTUuMjIxOXoiIGZpbGw9IiNjYzYyMjgiIHN0cm9rZT0iI2NjNjIyOCIvPjxwYXRoIGQ9Im0yNy4yMjkxIDE3LjY1MDctNy40MDUuMzM2OS42ODg1IDMuNzk2NiAxLjA5MTMtMi4yOTM1IDIuNjM3MiAxLjIwNTF6IiBmaWxsPSIjY2M2MjI4IiBzdHJva2U9IiNjYzYyMjgiLz48cGF0aCBkPSJtMTEuMzkyOSAyMC42OTU4IDIuNjI0Mi0xLjIwNTEgMS4wOTEzIDIuMjkzNS42ODg1LTMuNzk2Ni03LjQwNDk1LS4zMzY5eiIgZmlsbD0iI2NjNjIyOCIgc3Ryb2tlPSIjY2M2MjI4Ii8+PHBhdGggZD0ibTguMzkyIDE3LjY1MDcgMy4xMDQ5IDYuMDUxMy0uMTAzOS0zLjAwNjJ6IiBmaWxsPSIjZTI3NTI1IiBzdHJva2U9IiNlMjc1MjUiLz48cGF0aCBkPSJtMjQuMjQxMiAyMC42OTU4LS4xMTY5IDMuMDA2MiAzLjEwNDktNi4wNTEzeiIgZmlsbD0iI2UyNzUyNSIgc3Ryb2tlPSIjZTI3NTI1Ii8+PHBhdGggZD0ibTE1Ljc5NyAxNy45ODc2LS42ODg2IDMuNzk2Ny44NzA0IDQuNDgzMy4xOTQ5LTUuOTA4N3oiIGZpbGw9IiNlMjc1MjUiIHN0cm9rZT0iI2UyNzUyNSIvPjxwYXRoIGQ9Im0xOS44MjQyIDE3Ljk4NzYtLjM2MzggMi4zNTg0LjE4MTkgNS45MjE2Ljg3MDQtNC40ODMzeiIgZmlsbD0iI2UyNzUyNSIgc3Ryb2tlPSIjZTI3NTI1Ii8+PHBhdGggZD0ibTIwLjUxMjcgMjEuNzg0Mi0uODcwNCA0LjQ4MzQuNjIzNi40NDA2IDMuODU4NC0zLjAwNjIuMTE2OS0zLjAwNjJ6IiBmaWxsPSIjZjU4NDFmIiBzdHJva2U9IiNmNTg0MWYiLz48cGF0aCBkPSJtMTEuMzkyOSAyMC42OTU4LjEwNCAzLjAwNjIgMy44NTgzIDMuMDA2Mi42MjM2LS40NDA2LS44NzA0LTQuNDgzNHoiIGZpbGw9IiNmNTg0MWYiIHN0cm9rZT0iI2Y1ODQxZiIvPjxwYXRoIGQ9Im0yMC41OTA2IDMwLjg0MTcuMDM5LTEuMjMxLS4zMzc4LS4yODUxaC00Ljk2MjZsLS4zMjQ4LjI4NTEuMDI2IDEuMjMxLTQuMTU3Mi0xLjk2OTYgMS40NTUxIDEuMTkyMSAyLjk0ODkgMi4wMzQ0aDUuMDUzNmwyLjk2Mi0yLjAzNDQgMS40NDItMS4xOTIxeiIgZmlsbD0iI2MwYWM5ZCIgc3Ryb2tlPSIjYzBhYzlkIi8+PHBhdGggZD0ibTIwLjI2NTkgMjYuNzA4Mi0uNjIzNi0uNDQwNmgtMy42NjM1bC0uNjIzNi40NDA2LS4zNTA4IDIuOTAyNS4zMjQ4LS4yODUxaDQuOTYyNmwuMzM3OC4yODUxeiIgZmlsbD0iIzE2MTYxNiIgc3Ryb2tlPSIjMTYxNjE2Ii8+PHBhdGggZD0ibTMzLjUxNjggMTEuMzUzMiAxLjEwNDMtNS4zNjQ0Ny0xLjY2MjktNC45ODg3My0xMi42OTIzIDkuMzk0NCA0Ljg4NDYgNC4xMjA1IDYuODk4MyAyLjAwODUgMS41Mi0xLjc3NTItLjY2MjYtLjQ3OTUgMS4wNTIzLS45NTg4LS44MDU0LS42MjIgMS4wNTIzLS44MDM0eiIgZmlsbD0iIzc2M2UxYSIgc3Ryb2tlPSIjNzYzZTFhIi8+PHBhdGggZD0ibTEgNS45ODg3MyAxLjExNzI0IDUuMzY0NDctLjcxNDUxLjUzMTMgMS4wNjUyNy44MDM0LS44MDU0NS42MjIgMS4wNTIyOC45NTg4LS42NjI1NS40Nzk1IDEuNTE5OTcgMS43NzUyIDYuODk4MzUtMi4wMDg1IDQuODg0Ni00LjEyMDUtMTIuNjkyMzMtOS4zOTQ0eiIgZmlsbD0iIzc2M2UxYSIgc3Ryb2tlPSIjNzYzZTFhIi8+PHBhdGggZD0ibTMyLjA0ODkgMTYuNTIzNC02Ljg5ODMtMi4wMDg1IDIuMDc4NiAzLjEzNTgtMy4xMDQ5IDYuMDUxMyA0LjEwNTItLjA1MTloNi4xMzE4eiIgZmlsbD0iI2Y1ODQxZiIgc3Ryb2tlPSIjZjU4NDFmIi8+PHBhdGggZD0ibTEwLjQ3MDUgMTQuNTE0OS02Ljg5ODI4IDIuMDA4NS0yLjI5OTQ0IDcuMTI2N2g2LjExODgzbDQuMTA1MTkuMDUxOS0zLjEwNDg3LTYuMDUxM3oiIGZpbGw9IiNmNTg0MWYiIHN0cm9rZT0iI2Y1ODQxZiIvPjxwYXRoIGQ9Im0xOS44MjQxIDE3Ljk4NzYuNDQxNy03LjU5MzIgMi4wMDA3LTUuNDAzNGgtOC45MTE5bDIuMDAwNiA1LjQwMzQuNDQxNyA3LjU5MzIuMTY4OSAyLjM4NDIuMDEzIDUuODk1OGgzLjY2MzVsLjAxMy01Ljg5NTh6IiBmaWxsPSIjZjU4NDFmIiBzdHJva2U9IiNmNTg0MWYiLz48L2c+PC9zdmc+",uuid:"fb8e904e-1a71-454a-af65-dc1ee86311c3"},_Y={icon:'data:image/svg+xml,<svg viewBox="0 0 48 48" class="SvgIcon undefined Logo Logo--PassportSymbolOutlined css-1dn9atd" xmlns="http://www.w3.org/2000/svg"><g data-testid="undefined__g"><circle cx="24" cy="24" r="22.5" fill="url(%23paint0_radial_6324_83922)"></circle><circle cx="24" cy="24" r="22.5" fill="url(%23paint1_radial_6324_83922)"></circle><path d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM23.0718 9.16608C23.7383 8.83951 24.4406 8.86188 25.087 9.2287C27.3282 10.5059 29.5627 11.7942 31.786 13.096C32.5018 13.5165 32.8686 14.1897 32.8708 15.0173C32.8843 17.9184 32.8798 20.8171 32.8708 23.7182C32.8708 23.8255 32.8015 23.9821 32.7143 24.0335C31.8531 24.548 30.9808 25.0423 30.0347 25.5881V25.1318C30.0347 22.148 30.0257 19.1664 30.0414 16.1827C30.0436 15.6101 29.8468 15.241 29.339 14.9525C26.7377 13.474 24.1499 11.9687 21.5575 10.4723C21.4457 10.4075 21.3361 10.3381 21.1661 10.2352C21.8326 9.85722 22.4321 9.47698 23.0673 9.16608H23.0718ZM22.5953 38.8451C22.45 38.7713 22.3426 38.7198 22.2375 38.6595C18.8041 36.68 15.3752 34.687 11.9307 32.7232C10.9644 32.173 10.5238 31.3879 10.5349 30.2852C10.5551 27.9411 10.5484 25.597 10.5372 23.2507C10.5327 22.1927 10.9622 21.4255 11.8926 20.8977C14.3105 19.5221 16.715 18.1264 19.1195 16.7284C19.3275 16.6076 19.4796 16.5875 19.6965 16.7172C20.5264 17.216 21.3719 17.6924 22.2554 18.2024C22.0876 18.3031 21.9601 18.3791 21.8304 18.4552C19.2268 19.9582 16.6278 21.4658 14.0175 22.9599C13.5903 23.2037 13.3912 23.5213 13.3957 24.0179C13.4091 25.8654 13.4114 27.713 13.3957 29.5605C13.3912 30.0705 13.5948 30.3948 14.0332 30.6453C16.7866 32.2199 19.5288 33.8125 22.28 35.3916C22.5126 35.5258 22.611 35.6645 22.6065 35.9418C22.5864 36.888 22.5998 37.8363 22.5998 38.8473L22.5953 38.8451ZM22.5953 33.553C22.356 33.4166 22.1838 33.3204 22.0116 33.2198C19.8285 31.9605 17.6477 30.6967 15.4602 29.4464C15.2231 29.3122 15.1359 29.1668 15.1381 28.8917C15.1538 27.4714 15.1471 26.0511 15.1426 24.6308C15.1426 24.4384 15.1717 24.3064 15.3618 24.1991C16.167 23.7495 16.9633 23.2798 17.7618 22.8212C17.8199 22.7877 17.8826 22.7631 17.9877 22.7116V24.3064C17.9877 25.1698 18.0011 26.0354 17.9832 26.8988C17.972 27.3909 18.1622 27.7241 18.5916 27.9657C19.8285 28.6636 21.0498 29.3883 22.2867 30.0839C22.5305 30.2203 22.6043 30.3724 22.5998 30.6408C22.5842 31.5847 22.5931 32.5308 22.5931 33.5508L22.5953 33.553ZM20.0746 14.91C19.6116 14.6371 19.2157 14.6393 18.7527 14.91C16.1581 16.4265 13.5523 17.9228 10.9487 19.4259C10.8391 19.4908 10.7251 19.5489 10.5305 19.6541C10.5998 18.6654 10.3873 17.7327 10.7251 16.8291C10.9085 16.3348 11.2529 15.9635 11.7092 15.6995C13.8811 14.4447 16.0507 13.1877 18.227 11.9396C19.0211 11.4833 19.8308 11.4945 20.6248 11.953C23.0964 13.3756 25.5657 14.8026 28.0306 16.2341C28.1357 16.2945 28.2677 16.4309 28.2677 16.5338C28.2856 17.5493 28.2788 18.567 28.2788 19.6563C27.3819 19.1396 26.5543 18.6609 25.7267 18.1823C23.8412 17.093 21.9512 16.0149 20.0746 14.91ZM37.4427 30.8779C37.3778 31.6764 36.9103 32.2423 36.2192 32.6404C33.5732 34.1614 30.9294 35.6913 28.2856 37.2168C27.4557 37.6954 26.6259 38.1741 25.7938 38.6527C25.6932 38.7109 25.5903 38.7601 25.4539 38.8317C25.4449 38.693 25.4337 38.5924 25.4337 38.4917C25.4337 37.6149 25.4382 36.7404 25.4293 35.8636C25.4293 35.6645 25.4762 35.5437 25.6596 35.4386C29.5157 33.2198 33.3696 30.9942 37.2212 28.7709C37.2794 28.7374 37.3443 28.7105 37.4539 28.6591C37.4539 29.4375 37.4986 30.1622 37.4427 30.8779ZM37.4628 25.3577C37.4561 26.2658 36.9663 26.9033 36.1901 27.3506C33.175 29.0841 30.1622 30.8265 27.1493 32.5666C26.5991 32.8842 26.0466 33.1996 25.4561 33.5396C25.4472 33.3897 25.436 33.2913 25.436 33.1907C25.436 32.3273 25.4449 31.4617 25.4293 30.5983C25.4248 30.3523 25.5075 30.2226 25.72 30.0995C28.46 28.5271 31.1911 26.9368 33.9355 25.3733C34.4231 25.096 34.6378 24.7538 34.6334 24.1812C34.6132 21.1974 34.6244 18.2136 34.6244 15.2298V14.7087C35.3402 15.1404 36.0112 15.496 36.624 15.9299C37.1832 16.3258 37.465 16.9253 37.4673 17.6164C37.4762 20.1976 37.4829 22.7788 37.465 25.3599L37.4628 25.3577Z" fill="%230D0D0D"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint2_radial_6324_83922)"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint3_radial_6324_83922)"></path><defs><radialGradient id="paint0_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(13.4442 13.3899) rotate(44.9817) scale(46.7487 99.1435)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint1_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(25.9515 43.7068) rotate(84.265) scale(24.2138 46.3215)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient><radialGradient id="paint2_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(12.7405 12.6825) rotate(44.9817) scale(49.8653 105.753)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint3_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26.0816 45.0206) rotate(84.265) scale(25.828 49.4096)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient></defs></g></svg>',name:"Immutable Passport",rdns:"com.immutable.passport",uuid:"b90118be-7234-4c89-b89b-d5d267663eb5"};async function createProvider(G,K){let ne,ue=null;switch(G){case iY.PASSPORT:if(ne=InjectedProvidersManager.getInstance().findProvider({rdns:_Y.rdns}),!ne){if(!K)throw console.error("WalletProviderName was PASSPORT but the passport instance was not provided to the Checkout constructor"),new CheckoutError("Passport not provided",xZ.DEFAULT_PROVIDER_ERROR);ue=new Web3Provider(K.connectEvm({announceProvider:!1}))}break;case iY.METAMASK:ne=InjectedProvidersManager.getInstance().findProvider({rdns:wY.rdns}),ne||(ue=await async function getMetaMaskProvider(){const G=await withCheckoutError((async()=>await oZ()),{type:xZ.METAMASK_PROVIDER_ERROR});if(!G||!G.request)throw new CheckoutError("No MetaMask provider installed.",xZ.METAMASK_PROVIDER_ERROR);return new Web3Provider(G)}());break;default:if(ne=InjectedProvidersManager.getInstance().findProvider({rdns:G}),!ne)throw console.error("The WalletProviderName that was provided is not supported"),new CheckoutError("Provider not supported",xZ.DEFAULT_PROVIDER_ERROR)}return!ue&&ne&&(ue=new Web3Provider(ne.provider)),{provider:ue,walletProviderName:G}}function isWeb3Provider(G){return!(!G||!G.provider?.request||"function"!=typeof G.provider.request)}async function validateProvider(G,K,ne){return withCheckoutError((async()=>{if(K.provider?.isPassport)return K;if(!isWeb3Provider(K))throw new CheckoutError("Parsed provider is not a valid Web3Provider",xZ.WEB3_PROVIDER_ERROR);const ue={...oY,...ne},pe=await getUnderlyingChainId(K);let he=K.network?.chainId;try{he=K.network?.chainId,he||(he=(await K.getNetwork()).chainId)}catch(G){throw new CheckoutError("Unable to detect the web3Provider network",xZ.WEB3_PROVIDER_ERROR,{error:G})}if(he!==pe&&!ue.allowMistmatchedChainId)throw console.error("web3ChainId",he,"underlyingChainId",pe,ue),new CheckoutError("Your wallet has changed network, please switch to a supported network",xZ.WEB3_PROVIDER_ERROR);const ye=(await getNetworkAllowList(G,{type:tY.ALL})).networks.some((G=>G.chainId===pe));if(!ye&&!ue.allowUnsupportedProvider)throw new CheckoutError("Your wallet is connected to an unsupported network, please switch to a supported network",xZ.WEB3_PROVIDER_ERROR);return K}),{type:xZ.WEB3_PROVIDER_ERROR})}async function createReadOnlyProviders(G,K){if(G.isProduction&&K?.has(MZ.ETHEREUM))return K;if(K?.has(MZ.SEPOLIA))return K;const ne=new Map;return(await getNetworkAllowList(G,{type:tY.ALL})).networks.forEach((K=>{const ue=G.networkMap.get(K.chainId)?.rpcUrls[0],pe=new Ju(ue);ne.set(K.chainId,pe)})),ne}const itemAggregator=G=>(G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.ERC1155)return void ne.push(G);const{contractAddress:pe,spenderAddress:he,id:ye,amount:me}=G,be=`${pe}${he}${ye}`,ve=K.get(be);ve&&ve.type===dY.ERC1155?ve.amount=Oi.from(ve.amount).add(me):K.set(be,{...G})})),ne.concat(Array.from(K.values()))})((G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.ERC721)return void ne.push(G);const{contractAddress:pe,spenderAddress:he,id:ye}=G,me=`${pe}${he}${ye}`;K.get(me)||K.set(me,{...G})})),ne.concat(Array.from(K.values()))})((G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.ERC20||G.isFee)return void ne.push(G);const pe={...G,isFee:"isFee"in G&&G.isFee},{tokenAddress:he,spenderAddress:ye,amount:me}=pe,be=`${he}${ye}`,ve=K.get(be);ve&&ve.type===dY.ERC20?ve.amount=Oi.from(ve.amount).add(me):K.set(be,{...pe})})),ne.concat(Array.from(K.values()))})((G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.NATIVE||G.isFee)return void ne.push(G);const pe={...G,isFee:"isFee"in G&&G.isFee},{amount:he}=pe,ye=K.get(ue);ye&&ye.type===dY.NATIVE?ye.amount=Oi.from(ye.amount).add(he):K.set(ue,{...pe})})),ne.concat(Array.from(K.values()))})(G)))),getERC20Allowance=async(G,K,ne,ue)=>{try{const pe=new iu(ne,JSON.stringify(JZ),G);return await pe.allowance(K,ue)}catch(G){throw new CheckoutError("Failed to get the allowance for ERC20",xZ.GET_ERC20_ALLOWANCE_ERROR,{contractAddress:ne,error:G})}},getERC20ApprovalTransaction=async(G,K,ne,ue,pe)=>{try{const he=new iu(ne,JSON.stringify(JZ),G),ye=await he.populateTransaction.approve(ue,pe);return ye&&(ye.from=K),ye}catch(G){throw new CheckoutError("Failed to get the approval transaction for ERC20",xZ.GET_ERC20_ALLOWANCE_ERROR,{contractAddress:ne,error:G})}},getERC721ApprovedForAll=async(G,K,ne,ue)=>{try{const pe=new iu(ne,JSON.stringify(XZ),G);return await pe.isApprovedForAll(K,ue)}catch(G){throw new CheckoutError("Failed to check approval for all ERC721s of collection",xZ.GET_ERC721_ALLOWANCE_ERROR,{ownerAddress:K,contractAddress:ne,spenderAddress:ue,error:G})}},getApproveTransaction=async(G,K,ne,ue,pe)=>{try{const he=new iu(ne,JSON.stringify(XZ),G),ye=await he.populateTransaction.approve(ue,pe);return ye&&(ye.from=K),ye}catch(G){throw new CheckoutError("Failed to get the approval transaction for ERC721",xZ.GET_ERC721_ALLOWANCE_ERROR,{id:pe.toString(),contractAddress:ne,spenderAddress:ue,ownerAddress:K,error:G})}},getERC721ApprovedAddress=async(G,K,ne)=>{try{const ue=new iu(K,JSON.stringify(XZ),G);return await ue.getApproved(ne)}catch(G){throw new CheckoutError("Failed to get approved address for ERC721",xZ.GET_ERC721_ALLOWANCE_ERROR,{id:ne.toString(),contractAddress:K,error:G})}},convertIdToNumber=(G,K)=>{try{return Oi.from(G)}catch(ne){throw new CheckoutError("Invalid ERC721 ID",xZ.GET_ERC721_ALLOWANCE_ERROR,{id:G,contractAddress:K})}},hasERC721Allowances=async(G,K,ne)=>{let ue=!0;const pe=[],he=new Map,ye=new Map,me=new Map,be=new Map,ve=await(async(G,K,ne)=>{const ue=new Map,pe=new Map;for(const he of K){if(he.type!==dY.ERC721)continue;const{contractAddress:K,spenderAddress:ye}=he,me=`${K}-${ye}`;ue.set(me,!1),pe.has(me)||pe.set(me,getERC721ApprovedForAll(G,ne,K,ye))}const he=await Promise.all(pe.values()),ye=Array.from(pe.keys());return he.forEach(((G,K)=>{ue.set(ye[K],G)})),ue})(G,ne,K);for(const K of ne){if(K.type!==dY.ERC721)continue;const{contractAddress:ne,id:ue,spenderAddress:me}=K,be=`${ne}-${me}`;if(ve.get(be)){pe.push({sufficient:!0,itemRequirement:K});continue}const _e=`${ne}-${ue}`,Te=convertIdToNumber(ue,ne);he.set(_e,K),ye.set(_e,getERC721ApprovedAddress(G,ne,Te))}const _e=await Promise.all(ye.values()),Te=Array.from(ye.keys());for(let ne=0;ne<_e.length;ne++){const ye=he.get(Te[ne]);if(!ye||ye.type!==dY.ERC721)continue;if(_e[ne]===ye.spenderAddress){pe.push({sufficient:!0,itemRequirement:ye});continue}ue=!1;const{contractAddress:ve,id:Ee,spenderAddress:Pe}=ye,Se=`${ve}-${Ee}`,Ce=convertIdToNumber(Ee,ve);me.set(Se,{type:dY.ERC721,sufficient:!1,itemRequirement:ye,approvalTransaction:void 0}),be.set(Se,getApproveTransaction(G,K,ve,Pe,Ce))}const Ee=await Promise.all(be.values()),Pe=Array.from(be.keys());return Ee.forEach(((G,K)=>{const ne=me.get(Pe[K]);ne&&(ne.sufficient||(ne.approvalTransaction=G))})),{sufficient:ue,allowances:pe.concat(Array.from(me.values()))}},hasERC1155Allowances=async(G,K,ne)=>{const ue=ne.filter((G=>G.type===dY.ERC1155)),pe=await Promise.all(ue.map((async ne=>{const ue=await(async(G,K,ne,ue)=>{try{const pe=new iu(ne,JSON.stringify(QZ),G);return await pe.isApprovedForAll(K,ue)}catch(G){throw new CheckoutError("Failed to check approval for all ERC1155s of collection",xZ.GET_ERC1155_ALLOWANCE_ERROR,{ownerAddress:K,contractAddress:ne,spenderAddress:ue,error:G})}})(G,K,ne.contractAddress,ne.spenderAddress);if(ue)return{sufficient:!0,itemRequirement:ne};const pe=await(async(G,K,ne,ue)=>{try{const pe=new iu(ne,JSON.stringify(QZ),G),he=await pe.populateTransaction.setApprovalForAll(ue,!0);return he&&(he.from=K),he}catch(G){throw new CheckoutError("Failed to get the approval transaction for ERC1155",xZ.GET_ERC1155_ALLOWANCE_ERROR,{contractAddress:ne,spenderAddress:ue,ownerAddress:K,error:G})}})(G,K,ne.contractAddress,ne.spenderAddress);return{type:dY.ERC1155,sufficient:!1,itemRequirement:ne,approvalTransaction:pe}})));return{sufficient:pe.some((G=>G.sufficient)),allowances:pe}},balanceAggregator=G=>(G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.ERC721)return void ne.push(G);const{contractAddress:pe,id:he}=G,ye=`${pe}${he}`;K.get(ye)||K.set(ye,{...G})})),ne.concat(Array.from(K.values()))})((G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.ERC20||G.isFee)return void ne.push(G);const{tokenAddress:pe,amount:he}=G,ye=`${pe}`,me=K.get(ye);me&&me.type===dY.ERC20?me.amount=Oi.from(me.amount).add(he):K.set(ye,{...G})})),ne.concat(Array.from(K.values()))})((G=>{const K=new Map,ne=[];return G.forEach((G=>{const{type:ue}=G;if(ue!==dY.NATIVE||G.isFee)return void ne.push(G);const{amount:pe}=G,he=K.get(ue);he&&he.type===dY.NATIVE?he.amount=Oi.from(he.amount).add(pe):K.set(ue,{...G})})),ne.concat(Array.from(K.values()))})(G))),getTokenFromBalances=(G,K)=>G.type===dY.ERC20?K.find((K=>isMatchingAddress(K.token?.address,G.tokenAddress))):K.find((G=>isNativeToken(G.token?.address))),getTokenBalances=async(G,K,ne,ue,pe=!1)=>{try{const he=new Map;(G=>G.map((G=>{switch(G.type){case dY.ERC20:return{address:G.tokenAddress};case dY.NATIVE:return{address:UZ};case dY.ERC721:default:return{address:G.contractAddress}}})))(ue).forEach((G=>{G.address&&he.set(G.address.toLocaleLowerCase(),G)}));const{balances:ye}=await getAllBalances(G,K,ne,getL2ChainId(G),pe);return ye.filter((G=>he.get((G.token.address||UZ).toLocaleLowerCase())))}catch(G){throw new CheckoutError("Failed to get balances",xZ.GET_BALANCE_ERROR,{error:G})}},balanceCheck=async(G,K,ne,ue,pe=!1)=>{const he=balanceAggregator(ue),ye=[],me=[];if(he.forEach((G=>{switch(G.type){case dY.ERC20:case dY.NATIVE:ye.push(G);break;case dY.ERC721:me.push(G)}})),ye.sort((G=>"isFee"in G&&G.isFee?1:-1)),0===me.length&&0===ye.length)throw new CheckoutError("Unsupported item requirement balance check",xZ.UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);const be=[];ye.length>0&&be.push(getTokenBalances(G,K,ne,he,pe)),me.length>0&&be.push((async(G,K,ne)=>{const ue=[],pe=new Map,he=new Map;ne.forEach((K=>{if(K.type!==dY.ERC721)return;const ne=new iu(K.contractAddress,JSON.stringify(XZ),G);pe.set(K.contractAddress,K),he.set(K.contractAddress,ne.ownerOf(K.id))}));try{const G=await Promise.all(he.values()),ne=Array.from(he.keys());G.forEach(((G,he)=>{const ye=pe.get(ne[he]);let me=0;ye&&isMatchingAddress(K,G)&&(me=1),ue.push({type:dY.ERC721,balance:Oi.from(me),formattedBalance:me.toString(),contractAddress:ye.contractAddress,id:ye.id})}))}catch(G){throw new CheckoutError("Failed to get ERC721 balances",xZ.GET_ERC721_BALANCE_ERROR,{error:G})}return ue})(K,ne,he));const ve=await Promise.all(be),_e=[];if(ye.length>0){const G=ve.shift()??[],ne=new Map(G.map((G=>[G.type===dY.NATIVE?UZ:G.token.address?.toLowerCase(),G]))),ue=await(async(G,K,ne)=>{const ue={};for(const pe of G){if(pe.type===dY.NATIVE){ue[UZ]=$Z;continue}const G=getTokenFromBalances(pe,K);let he=G?.token.address??"",ye=G?.token.name??"",me=G?.token.symbol??"",be=G?.token.decimals??LZ;if(!G&&pe.type===dY.ERC20){if(he=pe.tokenAddress,he.toLowerCase()in ue)continue;try{const G=new iu(pe.tokenAddress,JSON.stringify(JZ),ne),[K,ue,ve]=await Promise.all([G.name(),G.symbol(),G.decimals()]);he=pe.tokenAddress,be=ve,ye=K,me=ue}catch(G){console.error("Failed to query contract information",pe.tokenAddress)}}ue[he.toLowerCase()]={address:he,name:ye,symbol:me,decimals:be}}return ue})(ye,G,K);ye.forEach((G=>{const K=(G.tokenAddress??UZ).toLowerCase(),pe=ue[K],he=ne.get(K),ye=((G,K,ne)=>{let ue=getTokenFromBalances(G,K);const pe=G.amount,he=pe.isNegative()||pe.isZero()||(ue?.balance.gte(pe)??!1),ye=pe.sub(ue?.balance??Oi.from(0));return G.type===dY.NATIVE?(ue||(ue={type:dY.NATIVE,balance:Oi.from(0),formattedBalance:"0",token:ne}),{sufficient:he,type:dY.NATIVE,delta:{balance:ye,formattedBalance:formatUnits(ye,ne.decimals)},current:{...ue,type:dY.NATIVE,token:ne},required:{...ue,type:dY.NATIVE,balance:Oi.from(G.amount),formattedBalance:formatUnits(G.amount,ne.decimals),token:ne},isFee:G.isFee}):(ue||(ue={type:G.type,balance:Oi.from(0),formattedBalance:"0",token:ne}),{sufficient:he,type:dY.ERC20,delta:{balance:ye,formattedBalance:formatUnits(ye,ne.decimals)},current:{...ue,token:ne},required:{...ue,token:ne,balance:Oi.from(G.amount),formattedBalance:formatUnits(G.amount,ne.decimals)},isFee:G.isFee})})(G,[...ne.values()],pe);if(_e.push(ye),!he)return;const me=he.balance.sub(ye.required.balance);ne.set(K,{...he,balance:me,formattedBalance:formatUnits(me,ye.required.token.decimals)})}))}if(me.length>0){const G=ve.shift()??[];me.forEach((K=>{_e.push(((G,K)=>{const ne=Oi.from(1),ue=K.find((K=>{const ne=K;return isMatchingAddress(ne.contractAddress,G.contractAddress)&&ne.id===G.id})),pe=ne.isNegative()||ne.isZero()||(ue?.balance.gte(ne)??!1),he=ne.sub(ue?.balance??Oi.from(0));let ye=ue;return ye||(ye={type:dY.ERC721,balance:Oi.from(0),formattedBalance:"0",contractAddress:G.contractAddress,id:G.id}),{sufficient:pe,type:dY.ERC721,delta:{balance:he,formattedBalance:he.toString()},current:ye,required:{...ye,balance:Oi.from(1),formattedBalance:"1"},isFee:!1}})(K,G))}))}return{sufficient:void 0===_e.find((G=>!G.sufficient)),balanceRequirements:_e}},estimateGas=async(G,K)=>{try{return await G.estimateGas(K)}catch(G){throw new CheckoutError("Failed to estimate gas for transaction",xZ.UNPREDICTABLE_GAS_LIMIT,{error:G})}},gasCalculator=async(G,K,ne)=>{const ue=[];let pe=Oi.from(0);for(const ne of K)void 0!==ne.approvalTransaction&&ue.push(estimateGas(G,ne.approvalTransaction));if(ne.type===uY.TRANSACTION)ue.push(estimateGas(G,ne.transaction));else{const K=(G=>(G=>!!G.maxFeePerGas&&!!G.maxPriorityFeePerGas)(G)?Oi.from(G.lastBaseFeePerGas).add(Oi.from(G.maxPriorityFeePerGas)):G.gasPrice?Oi.from(G.gasPrice):null)(await G.getFeeData());if(null!==K){const G=K?.mul(ne.gasToken.limit);G&&(pe=pe.add(G))}}return(await Promise.all(ue)).forEach((G=>{pe=pe.add(G)})),pe.eq(0)?null:((G,K)=>K.type===uY.TRANSACTION||K.gasToken.type===fY.NATIVE?{type:dY.NATIVE,amount:G,isFee:!0}:{type:dY.ERC20,amount:G,tokenAddress:K.gasToken.tokenAddress,spenderAddress:"",isFee:!0})(pe,ne)},isOnRampAvailable=async()=>!0,isSwapAvailable=async G=>{const K=availabilityService(G.isDevelopment,G.isProduction);try{return await K.checkDexAvailability()}catch{return!1}},quoteFetcher=async(G,K,ne,ue,pe)=>{const he=new Map;try{const ye=await createExchangeInstance(K,G),me=[],be=[];for(const G of pe)G!==ue.address&&(me.push(ye.getUnsignedSwapTxFromAmountOut(ne,G,ue.address,ue.amount,1)),be.push(G));return(await measureAsyncExecution(G,"Time to resolve swap quotes from the dex",Promise.allSettled(me))).forEach(((G,K)=>{if("rejected"===G.status)return;const ne=be[K];he.set(ne,{quote:G.value.quote,approval:G.value.approval?.gasFeeEstimate??null,swap:G.value.swap.gasFeeEstimate})})),he}catch{return he}},constructFees$1=(G,K,ne)=>{let ue,pe=Oi.from(0),he="0";G&&(pe=G.value,he=formatUnits(G.value,G.token.decimals),ue={name:G.token.name??"",symbol:G.token.symbol??"",address:G.token.address,decimals:G.token.decimals});let ye,me=Oi.from(0),be="0";K&&(me=K.value,be=formatUnits(K.value,K.token.decimals),ye={name:K.token.name??"",symbol:K.token.symbol??"",address:K.token.address,decimals:K.token.decimals});const ve=[];for(const G of ne)ve.push({type:pY.SWAP_FEE,amount:G.amount.value,formattedAmount:formatUnits(G.amount.value,G.amount.token.decimals),basisPoints:G.basisPoints,token:{name:G.amount.token.name??"",symbol:G.amount.token.symbol??"",address:G.amount.token.address,decimals:G.amount.token.decimals}});return{approvalGasFee:{type:pY.GAS,amount:pe,formattedAmount:he,token:ue},swapGasFee:{type:pY.GAS,amount:me,formattedAmount:be,token:ye},swapFees:ve}},constructSwapRoute=(G,K,ne,ue)=>{const pe=ne.token.address;let he=dY.ERC20;return isNativeToken(pe)&&(he=dY.NATIVE),{type:hY.SWAP,chainId:G,fundingItem:{type:he,fundsRequired:{amount:K,formattedAmount:formatSmartCheckoutAmount(formatUnits(K,ne.token.decimals))},userBalance:{balance:ne.balance,formattedBalance:ne.formattedBalance},token:ne.token},fees:ue}},checkUserCanCoverApprovalFees=(G,K)=>{if(!K)return{sufficient:!0,approvalGasFee:Oi.from(0),approvalGasTokenAddress:""};const ne=K.value,ue=K.token.address;if(0===G.length)return{sufficient:!1,approvalGasFee:ne,approvalGasTokenAddress:ue};const pe=G.find((G=>isNativeToken(G.token.address)&&isNativeToken(ue)||isMatchingAddress(G.token.address,ue)));return pe?pe.balance.lt(ne)?{sufficient:!1,approvalGasFee:ne,approvalGasTokenAddress:ue}:{sufficient:!0,approvalGasFee:ne,approvalGasTokenAddress:ue}:{sufficient:!1,approvalGasFee:ne,approvalGasTokenAddress:ue}},checkUserCanCoverSwapFees=(G,K,ne,ue,pe)=>{const he=new Map;if(K.approvalGasFee.gt(Oi.from(0))&&he.set(K.approvalGasTokenAddress,K.approvalGasFee),ne){const G=he.get(ne.token.address);G?he.set(ne.token.address,G.add(ne.value)):he.set(ne.token.address,ne.value)}if(pe){const G=he.get(pe.address);G?he.set(pe.address,G.add(pe.amount)):he.set(pe.address,pe.amount)}for(const G of ue){const K=he.get(G.amount.token.address);K?he.set(G.amount.token.address,K.add(G.amount.value)):he.set(G.amount.token.address,G.amount.value)}for(const[K,ne]of he.entries()){if(ne===Oi.from(0))continue;const ue=G.find((G=>isNativeToken(G.token.address)&&isNativeToken(K)||isMatchingAddress(G.token.address,K)));if(!ue)return!1;if(ue.balance.lt(ne))return!1}return!0},checkIfUserCanCoverRequirement=(G,K,ne,ue,pe,he)=>{let ye=Oi.from(0),me="",be=!1;if(K.balanceRequirements.forEach((K=>{K.type!==dY.NATIVE&&K.type!==dY.ERC20||K.required.token.address&&isMatchingAddress(K.required.token.address,ne)&&(me=K.required.token.address,be=!0,ye=G.sub(K.required.balance))})),!be)return!0;isMatchingAddress(pe.approvalGasTokenAddress,me)&&(ye=ye.sub(pe.approvalGasFee));for(const G of he)isMatchingAddress(G.amount.token.address,me)&&(ye=ye.sub(G.amount.value));return ye.gte(ue)},swapRoute=async(G,K,ne,ue,pe,he,ye)=>{const me=[];if(!K.swap)return me;if(0===he.length)return me;if(!(G=>G.type===dY.ERC20?!!G.required.token.address:G.type===dY.NATIVE&&isNativeToken(G.required.token.address))(ue))return me;const be=(G=>{let K="",ne=Oi.from(0);switch(G.type){case dY.ERC20:K=G.required.token.address,ne=G.delta.balance;break;case dY.NATIVE:ne=G.delta.balance}return{address:K,amount:ne}})(ue),ve=getL2ChainId(G),_e=pe.get(ve);if(!_e)return me;const Te=_e.balances;if(0===Te.length)return me;const Ee=await quoteFetcher(G,getL2ChainId(G),ne,be,he),Pe=Array.from(Ee.keys());for(const G of Pe){const K=Ee.get(G);if(!K)continue;const ne=Te.find((K=>isMatchingAddress(K.token.address,G)));if(!ne)continue;const ue=K.quote.amountWithMaxSlippage;if(ne.balance.lt(ue.value))continue;const pe=checkUserCanCoverApprovalFees(Te,K.approval);if(!pe.sufficient)continue;if(!checkUserCanCoverSwapFees(Te,pe,K.swap,K.quote.fees,{amount:ue.value,address:G}))continue;if(!checkIfUserCanCoverRequirement(ne.balance,ye,G,ue.value,pe,K.quote.fees))continue;const he=constructFees$1(K.approval,K.swap,K.quote.fees);me.push(constructSwapRoute(ve,ue.value,ne,he))}return me},filterTokens=(G,K)=>K&&K.success?G.filter((G=>"address"in G?K.balances.find((K=>isMatchingAddress(K.token.address,G.address)&&K.balance.gt(0))):K.balances.find((G=>!("address"in G.token)&&G.balance.gt(0))))):[],allowListCheckForOnRamp=async(G,K)=>{if(K.onRamp){return(await getTokenAllowList(G,{type:rY.ONRAMP})).tokens}return[]},allowListCheckForBridge=async(G,K,ne)=>{if(ne.bridge){const ne=getL1ChainId(G),ue=(await getTokenAllowList(G,{type:rY.BRIDGE,chainId:ne})).tokens,pe=K.get(ne);return filterTokens(ue,pe)}return[]},allowListCheck=async(G,K,ne)=>{const ue={};return ue.swap=await(async(G,K,ne)=>{if(ne.swap){const ne=(await getTokenAllowList(G,{type:rY.SWAP})).tokens,ue=K.get(getL2ChainId(G));return filterTokens(ne,ue)}return[]})(G,K,ne),ue.bridge=await allowListCheckForBridge(G,K,ne),ue.onRamp=await allowListCheckForOnRamp(G,ne),ue},TY="0x0000000000000000000000000000000000000eee",getImxL1Representation=async(G,K)=>(await K.remote.getConfig("imxAddressMapping"))[G]??"",fetchL1Representation=async(G,K)=>{if(isNativeToken(K))return{l1address:await getImxL1Representation(getL1ChainId(G),G),l2address:UZ};const ne=(ue=getL2ChainId(G))===MZ.IMTBL_ZKEVM_MAINNET?FZ.IMTBL_ZKEVM_MAINNET:ue===MZ.IMTBL_ZKEVM_TESTNET?FZ.IMTBL_ZKEVM_TESTNET:ue===MZ.IMTBL_ZKEVM_DEVNET?FZ.IMTBL_ZKEVM_DEVNET:"";var ue;const pe=createBlockchainDataInstance(G),he=(await pe.getToken({chainName:ne,contractAddress:K})).result.root_contract_address;return isMatchingAddress(he??"",TY)?{l1address:"native",l2address:K}:null!==he?{l1address:he,l2address:K}:void 0},hasSufficientL1Eth=(G,K)=>(G=>{for(const K of G.balances)if(isNativeToken(K.token.address))return K.balance;return Oi.from(0)})(G).gte(K),constructFees=(G,K,ne,ue,pe)=>{const he=pe?.decimals??LZ,ye=[];return K.gt(0)&&ye.push({type:pY.BRIDGE_FEE,amount:K,formattedAmount:formatUnits(K,he),token:pe}),ne.gt(0)&&ye.push({type:pY.IMMUTABLE_FEE,amount:ne,formattedAmount:formatUnits(ne,he),token:pe}),{approvalGasFee:{type:pY.GAS,amount:ue,formattedAmount:formatUnits(ue,LZ),token:pe},bridgeGasFee:{type:pY.GAS,amount:G,formattedAmount:formatUnits(G,LZ),token:pe},bridgeFees:ye}},constructBridgeFundingRoute=(G,K,ne,ue,pe)=>({type:hY.BRIDGE,chainId:G,fundingItem:{type:ue,fundsRequired:{amount:ne.amount,formattedAmount:formatSmartCheckoutAmount(ne.formattedAmount)},userBalance:{balance:K.balance,formattedBalance:K.formattedBalance},token:{name:K.token.name,symbol:K.token.symbol,address:K.token.address,decimals:K.token.decimals}},fees:pe}),bridgeRoute=async(G,K,ne,ue,pe)=>{if(!ne.bridge)return;const he=getL1ChainId(G),ye=getL2ChainId(G),me=G.networkMap.get(he)?.nativeCurrency,be=pe.get(he);if(!K.get(he))throw new CheckoutError("No L1 provider available",xZ.PROVIDER_ERROR,{chainId:he.toString()});if(void 0===be||!1===be.success)return;const ve=await allowListCheckForBridge(G,pe,ne);if(0===ve.length)return;const _e=await fetchL1Representation(G,ue.l2address);if(!_e)return;const{l1address:Te}=_e;if(isNativeToken(Te)){if(!ve.find((G=>isNativeToken(G.address))))return}else if(!ve.find((G=>isMatchingAddress(G.address,Te))))return;const Ee=await(async(G,K,ne,ue)=>{const pe=createBridgeInstance(ne,ue,K,G);try{return{...await pe.getFee({action:cz.DEPOSIT,gasMultiplier:"auto",sourceChainId:ne.toString(),destinationChainId:ue.toString()}),approvalGas:Oi.from(0)}}catch(G){throw new CheckoutError("Error estimating gas for bridge",xZ.BRIDGE_GAS_ESTIMATE_ERROR,{error:G})}})(G,K,he,ye),{sourceChainGas:Pe,approvalGas:Se,bridgeFee:Ce,imtblFee:ke,totalFees:Oe}=Ee;if(!hasSufficientL1Eth(be,Oe))return;if(isNativeToken(Te)){const G=be.balances.find((G=>isNativeToken(G.token.address)));if(G&&G.balance.gte(ue.amount.add(Oe))){const K=constructFees(Pe,Ce,ke,Se,me);return constructBridgeFundingRoute(he,G,ue,dY.NATIVE,K)}return}const xe=be.balances.find((G=>isMatchingAddress(G.token.address,Te)));if(xe&&xe.balance.gte(ue.amount)){const G=constructFees(Pe,Ce,ke,Se,me);return constructBridgeFundingRoute(he,xe,ue,dY.ERC20,G)}},getFeesForTokenAddress=(G,K)=>{let ne=Oi.from(0);return G.quote.fees.forEach((G=>{isMatchingAddress(G.amount.token.address,K)&&(ne=ne.add(G.amount.value))})),G.approval&&isMatchingAddress(G.approval.token.address,K)&&(ne=ne.add(G.approval.value)),ne},getAmountFromBalanceRequirement=(G,K)=>{for(const ne of G.balanceRequirements)if((ne.type===dY.NATIVE||ne.type===dY.ERC20)&&isMatchingAddress(ne.required.token.address,K))return ne.required.balance;return Oi.from(0)},getAmountToBridge=(G,K,ne)=>{const ue=ne?.balance??Oi.from(0);if(ue.gte(G.add(K)))return Oi.from(0);if(ue.lte(0))return G.add(K);const pe=ue.sub(K);return pe.gte(0)?G.sub(pe):G.add(K).sub(ue)},bridgeAndSwapRoute=async(G,K,ne,ue,pe,he,ye,me,be)=>{const{l1balances:ve,l2balances:_e}=((G,K)=>{const ne={l1balances:[],l2balances:[]},ue=K.get(getL1ChainId(G)),pe=K.get(getL2ChainId(G));return ue?void 0!==ue.error?ne:ue.success&&pe?void 0!==pe.error?ne:pe.success?{l1balances:ue.balances,l2balances:pe.balances}:ne:ne:ne})(G,he),Te=ue.required.token.address;if(((G,K,ne,ue,pe,he)=>0===G.length||0===K.length||0===ne.length||0===ue.length||!pe.bridge||!pe.swap||void 0===he||""===he)(ye,me,ve,_e,ne,Te))return[];const Ee=await(async(G,K)=>{const ne=K.map((K=>fetchL1Representation(G,K.address??"")));return(await Promise.all(ne)).filter((G=>void 0!==G))})(G,me),Pe=((G,K,ne,ue)=>{const pe=[];for(const he of ue){if(!K.includes(he.l1address))continue;if(isMatchingAddress(he.l2address,G))continue;const ue=ne.find((G=>isMatchingAddress(G.address,he.l2address)));ue&&pe.push(ue)}return pe})(Te,ye,me,Ee);if(0===Pe.length)return[];const Se=await(async(G,K,ne,ue,pe)=>{const he=[];for(const G of pe)G.address&&he.push(G.address);return await quoteFetcher(G,getL2ChainId(G),K,{address:ne,amount:ue.delta.balance},he)})(G,pe,Te,ue,Pe),Ce=((G,K,ne,ue,pe)=>{const he=[];for(const[ye,me]of G){const G=ne.find((G=>isMatchingAddress(G.token.address,ye))),be=ue.find((G=>isMatchingAddress(G.l2address,ye)));if(!be)continue;const{l1address:ve,l2address:_e}=be;if(!ve)continue;const Te=K.find((G=>!(void 0!==G.token.address||!isMatchingAddress(ve,TY))||isMatchingAddress(G.token.address,ve)));if(!Te)continue;const Ee=me.quote.amountWithMaxSlippage.value,Pe=getFeesForTokenAddress(me,ye),Se=Ee.add(Pe),Ce=getAmountFromBalanceRequirement(pe,ye),ke=getAmountToBridge(Se,Ce,G);ke.lte(0)||ke.gte(Te.balance)||he.push({amount:ke,formattedAmount:formatSmartCheckoutAmount(formatUnits(ke,Te.token.decimals)),l2address:_e})}return he})(Se,ve,_e,Ee,be);if(0===Ce.length)return[];const ke=new Map,Oe=new Map,xe=[];for(const ue of Ce)ue.l2address&&(ke.set(ue.l2address,bridgeRoute(G,K,ne,ue,he)),Oe.set(ue.l2address,{amount:ue.amount,formattedAmount:ue.formattedAmount,l2address:ue.l2address}));const Ne=await Promise.all(ke.values()),Me=Array.from(ke.keys()),Be=[];if(Ne.forEach(((G,K)=>{const ne=Me[K];if(void 0===G)return;Be.push(ne);const ue=Oe.get(ne);ue&&xe.push({amount:ue.amount,formattedAmount:ue.formattedAmount,l2address:ue.l2address})})),0===Be.length)return[];if(0===xe.length)return[];const Fe=((G,K,ne,ue,pe)=>{const he=new Map;for(const[G,ne]of K)he.set(G,{success:ne.success,balances:ne.balances});const ye=new Map;for(const G of ne)G.token.address&&ye.set(G.token.address,G);for(const G of ue){const{amount:K,l2address:ne}=G;if(""===ne)continue;let ue=Oi.from(0);const he=ye.get(ne);he&&(ue=he.balance);const me=ue.add(K),be=pe.find((G=>isMatchingAddress(G.address,ne)));ye.set(ne,{balance:me,formattedBalance:formatUnits(me,be.decimals),token:be})}const me=Array.from(ye.values());return he.set(getL2ChainId(G),{success:!0,balances:me}),he})(G,he,_e,xe,me),De=await swapRoute(G,ne,pe,ue,Fe,Be,be);if(!De)return[];const Le=((G,K)=>{const ne=[];for(const ue of K){const{chainId:K,fundingItem:pe}=ue,{userBalance:he}=ue.fundingItem,ye=G.get(K);if(!ye)continue;let me=Oi.from(0),be="0";const ve=ye.balances.find((G=>isMatchingAddress(G.token.address,pe.token.address)));ve&&(me=ve.balance,be=ve.formattedBalance),he.balance=me,he.formattedBalance=be,ne.push(ue)}return ne})(he,De);return((G,K,ne)=>{const ue=[];for(const pe of G){if(!pe)continue;const G=ne.find((G=>void 0===pe.fundingItem.token.address?isMatchingAddress(G.l1address,TY)&&G.l2address:isMatchingAddress(G.l1address,pe.fundingItem.token.address)&&G.l2address));if(!G)continue;const he=K.find((K=>isMatchingAddress(K.fundingItem.token.address,G.l2address)));he&&ue.push({bridgeFundingStep:pe,swapFundingStep:he})}return ue})(Ne,Le,Ee)},getOnRampFundingStep=async(G,K,ne)=>{if(!K.onRamp)return;if(void 0===ne)return;const ue=await(async(G,K,ne)=>{if(![dY.ERC20,dY.NATIVE].includes(ne.type))return;const{required:ue,current:pe,delta:he}=ne;let ye=!1;return(await allowListCheckForOnRamp(G,K)).forEach((G=>{G.address&&ue.token&&(isNativeToken(ue.token.address)||isMatchingAddress(G.address,ue.token.address))&&(ye=!0)})),ye?{type:hY.ONRAMP,chainId:getL2ChainId(G),fundingItem:{type:isNativeToken(ue.token.address)?dY.NATIVE:dY.ERC20,fundsRequired:{amount:he.balance,formattedAmount:formatSmartCheckoutAmount(he.formattedBalance)},userBalance:{balance:pe.balance,formattedBalance:pe.formattedBalance},token:ue.token}}:void 0})(G,K,ne);return ue},AY=1,EY=2,PY=3,SY=4,handleRouteProgress=(G,K,ne,ue)=>{if(!G)return;let pe;pe="bridgeFundingStep"in G&&"swapFundingStep"in G?[G.bridgeFundingStep,G.swapFundingStep]:[G];const he={priority:K,steps:pe};ne.push(he),ue?.(he)},routingCalculator=async(G,K,ne,ue,pe)=>{if(!(G=>G.bridge||G.swap||G.onRamp)(ue))return{type:lY.NO_ROUTE_OPTIONS,message:"No routing options are available"};let he;try{he=await createReadOnlyProviders(G)}catch(G){throw new CheckoutError("Error occurred while creating read only providers",xZ.PROVIDER_ERROR,{error:G})}const ye=await measureAsyncExecution(G,"Time to get token balances inside router",(async(G,K,ne,ue)=>{const pe=new Map,he=new Map;if(0===K.size){const K={success:!1,error:new CheckoutError("No L1 or L2 provider available",xZ.PROVIDER_ERROR),balances:[]};return pe.set(getL1ChainId(G),K),pe.set(getL2ChainId(G),K),pe}if(ue.bridge){const ue=getL1ChainId(G);K.has(ue)?he.set(ue,getAllBalances(G,K.get(ue),ne,ue)):pe.set(getL1ChainId(G),{success:!1,error:new CheckoutError(`No L1 provider available for ${ue}`,xZ.PROVIDER_ERROR),balances:[]})}const ye=getL2ChainId(G);if(K.has(ye)?he.set(ye,getAllBalances(G,K.get(ye),ne,ye)):pe.set(getL2ChainId(G),{success:!1,error:new CheckoutError(`No L2 provider available for ${ye}`,xZ.PROVIDER_ERROR),balances:[]}),he.size>0){const G=Array.from(he.keys());(await Promise.allSettled(he.values())).forEach(((K,ne)=>{const ue=G[ne];"fulfilled"===K.status?pe.set(ue,{success:!0,balances:K.value.balances}):pe.set(ue,{success:!1,error:new CheckoutError(`Error getting ${ye} balances`,xZ.GET_BALANCE_ERROR),balances:[]})}))}return pe})(G,he,K,ue)),me=await measureAsyncExecution(G,"Time to get routing allowlist",allowListCheck(G,ye,ue)),be=(G=>{let K,ne=0;for(const ue of G.balanceRequirements)ue.sufficient||(ne++,K=ue);if(1===ne)return K})(ne),ve=[],_e=[];return ue.swap&&ve.push((async(G,K,ne,ue,pe,he,ye)=>{const me=[];if(!K.swap)return me;if(void 0===ne)return me;if(void 0===he)return me;const be=pe.get(getL2ChainId(G));if(!be)return me;if(void 0!==be.error||!be.success)return me;if(0===he.length)return me;const ve=he.filter((G=>G.address)).map((G=>G.address));return 0===ve.length?me:await swapRoute(G,K,ue,ne,pe,ve,ye)})(G,ue,be,K,ye,me.swap,ne).then((G=>{G.forEach((G=>{handleRouteProgress(G,AY,_e,pe)}))}))),ue.bridge&&ve.push((async(G,K,ne,ue,pe)=>{let he;if(void 0===ue)return;if(ue.type!==dY.NATIVE&&ue.type!==dY.ERC20)return;const ye={amount:ue.delta.balance,formattedAmount:ue.delta.formattedBalance,l2address:ue.required.token.address??""};return ne.bridge&&ue&&(he=await bridgeRoute(G,K,ne,ye,pe)),he})(G,he,ue,be,ye).then((G=>{handleRouteProgress(G,EY,_e,pe)}))),ue.onRamp&&ve.push(getOnRampFundingStep(G,ue,be).then((G=>{handleRouteProgress(G,PY,_e,pe)}))),ue.swap&&ue.bridge&&ve.push((async(G,K,ne,ue,pe,he,ye,me)=>{if(!ue)return[];const be=he.get(getL1ChainId(G)),ve=he.get(getL2ChainId(G));if(!be)return[];if(void 0!==be.error||!be.success)return[];if(!ve)return[];if(void 0!==ve.error||!ve.success)return[];const _e=(ye?.bridge??[]).map((G=>void 0===G.address?TY:G.address)),Te=ye?.swap??[];return ue.type!==dY.NATIVE&&ue.type!==dY.ERC20?[]:await bridgeAndSwapRoute(G,K,ne,ue,pe,he,_e,Te,me)})(G,he,ue,be,K,ye,me,ne).then((G=>{G.forEach((G=>{handleRouteProgress(G,SY,_e,pe)}))}))),await measureAsyncExecution(G,"Time to resolve all routes",Promise.all(ve)),0===_e.length?{type:lY.NO_ROUTES_FOUND,message:"Smart Checkout did not find any funding routes to fulfill the transaction"}:{type:lY.ROUTES_FOUND,fundingRoutes:_e}},processRoutes=async(G,K,ne,ue,pe,he,ye,me,be)=>{const ve=!ye||ne&&me?(G=>({sufficient:!1,balanceRequirements:G.balanceRequirements.map((G=>G.type===dY.ERC20&&G.sufficient?{...G,sufficient:!1,delta:{balance:G.required.balance,formattedBalance:G.required.formattedBalance}}:G))}))(he):he,_e=await measureAsyncExecution(G,"Total time to run the routing calculator",routingCalculator(G,K,ve,ue,be));return me?.({sufficient:ne,transactionRequirements:pe,router:{availableRoutingOptions:ue,routingOutcome:_e}}),_e},smartCheckout=async(G,K,ne,ue,pe,he,ye,me=!1)=>{const be=await K.getSigner().getAddress();let ve=itemAggregator(ne);const _e=(async(G,K,ne)=>{let ue=!0;const pe=[],he=new Map,ye=new Map,me=new Map,be=new Map;for(const ue of ne){if(ue.type!==dY.ERC20)continue;const{tokenAddress:ne,spenderAddress:pe}=ue,me=`${ne}${pe}`;he.set(me,ue),ye.set(me,getERC20Allowance(G,K,ne,pe))}const ve=await Promise.all(ye.values()),_e=Array.from(ye.keys());for(let ne=0;ne<ve.length;ne++){const ye=he.get(_e[ne]);if(!ye||ye.type!==dY.ERC20)continue;if(ve[ne].gte(ye.amount)){pe.push({sufficient:!0,itemRequirement:ye});continue}ue=!1;const{tokenAddress:Te,spenderAddress:Ee}=ye,Pe=`${Te}${Ee}`,Se=ye.amount.sub(ve[ne]);me.set(Pe,{type:dY.ERC20,sufficient:!1,delta:Se,itemRequirement:ye,approvalTransaction:void 0}),be.set(Pe,getERC20ApprovalTransaction(G,K,Te,Ee,Se))}const Te=await Promise.all(be.values()),Ee=Array.from(be.keys());return Te.forEach(((G,K)=>{const ne=me.get(Ee[K]);ne&&(ne.sufficient||(ne.approvalTransaction=G))})),{sufficient:ue,allowances:pe.concat(Array.from(me.values()))}})(K,be,ve),Te=hasERC721Allowances(K,be,ve),Ee=hasERC1155Allowances(K,be,ve),Pe=await measureAsyncExecution(G,"Time to calculate token allowances",Promise.all([_e,Te,Ee])),Se=((G,K,ne)=>{const ue=[];if(!G.sufficient)for(const K of G.allowances)K.sufficient||ue.push(K);if(!K.sufficient)for(const G of K.allowances)G.sufficient||ue.push(G);if(!ne.sufficient)for(const G of ne.allowances)G.sufficient||ue.push(G);return ue})(Pe[0],Pe[1],Pe[2]);let Ce=null;ue&&(Ce=await measureAsyncExecution(G,"Time to run gas calculator",gasCalculator(K,Se,ue)),null!==Ce&&(ve.push(Ce),ve=itemAggregator(ve)));const ke=await measureAsyncExecution(G,"Time to run balance checks",balanceCheck(G,K,be,ve,!0)),{sufficient:Oe}=ke,xe=ke.balanceRequirements,Ne=await measureAsyncExecution(G,"Time to fetch available routing options",(async(G,K)=>{const ne={onRamp:G.isOnRampEnabled,swap:G.isSwapEnabled,bridge:G.isBridgeEnabled},ue=[];if(ne.onRamp&&ue.push({id:"onRamp",promise:isOnRampAvailable()}),ne.swap&&ue.push({id:"swap",promise:isSwapAvailable(G)}),ue.length>0){const G=ue.map((G=>G.promise));(await Promise.allSettled(G)).forEach(((G,K)=>{const pe=ue[K].id;ne[pe]=ne[pe]&&"fulfilled"===G.status&&G.value}))}return ne.bridge=ne.bridge&&!(G=>!0===G.provider?.isPassport)(K),ne})(G,K));if(!1===pe?.onRamp&&(Ne.onRamp=!1),!1===pe?.swap&&(Ne.swap=!1),!1===pe?.bridge&&(Ne.bridge=!1),he)return processRoutes(G,be,Oe,Ne,xe,ke,me,he,ye),{sufficient:Oe,transactionRequirements:xe};if(Oe)return{sufficient:Oe,transactionRequirements:xe};return{sufficient:Oe,transactionRequirements:xe,router:{availableRoutingOptions:Ne,routingOutcome:await processRoutes(G,be,Oe,Ne,xe,ke,me,he,ye)}}};var IY;!function(G){G.SUCCESS="SUCCESS",G.FAILED="FAILED"}(IY||(IY={}));const setTransactionGasLimits=async(G,K)=>{const ne=K,{chainId:ue}=await G.getNetwork();return(G=>G===MZ.IMTBL_ZKEVM_DEVNET||G===MZ.IMTBL_ZKEVM_TESTNET||G===MZ.IMTBL_ZKEVM_MAINNET)(ue)?(void 0!==ne.gasPrice||(!function isGasFree(G){return function isPassportProvider(G){return!0===G?.provider?.isPassport}(G)}(G)?(ne.maxFeePerGas=ZZ.maxFeePerGas,ne.maxPriorityFeePerGas=ZZ.maxPriorityFeePerGas):ne.gasPrice=Oi.from(0)),ne):ne},handleProviderError=G=>G.code===ii.INSUFFICIENT_FUNDS?new CheckoutError(G.message,xZ.INSUFFICIENT_FUNDS,{error:G}):G.code===ii.ACTION_REJECTED?new CheckoutError(G.message,xZ.USER_REJECTED_REQUEST_ERROR,{error:G}):G.code===ii.UNPREDICTABLE_GAS_LIMIT?new CheckoutError(G.message,xZ.UNPREDICTABLE_GAS_LIMIT,{error:G}):new CheckoutError(G.message,xZ.TRANSACTION_FAILED,{error:G}),sendTransaction=async(G,K)=>{try{const ne=G.getSigner(),ue=await setTransactionGasLimits(G,K);return{transactionResponse:await ne.sendTransaction(ue)}}catch(G){throw handleProviderError(G)}},signApprovalTransactions=async(G,K)=>{let ne=[];try{const ue=await Promise.all(K.map((K=>sendTransaction(G,K))));ne=await Promise.all(ue.map((G=>G.transactionResponse.wait())))}catch(G){throw new CheckoutError("An error occurred while executing the approval transaction",xZ.EXECUTE_APPROVAL_TRANSACTION_ERROR,{error:G})}for(const G of ne)if(0===G.status)return{type:IY.FAILED,transactionHash:G.transactionHash,reason:"Approval transaction failed and was reverted"};return{type:IY.SUCCESS}},signFulfillmentTransactions=async(G,K)=>{let ne=[];try{const ue=await Promise.all(K.map((K=>sendTransaction(G,K))));ne=await Promise.all(ue.map((G=>G.transactionResponse.wait())))}catch(G){throw new CheckoutError("An error occurred while executing the fulfillment transaction",xZ.EXECUTE_FULFILLMENT_TRANSACTION_ERROR,{error:G})}for(const G of ne)if(0===G.status)return{type:IY.FAILED,transactionHash:G.transactionHash,reason:"Fulfillment transaction failed and was reverted"};return{type:IY.SUCCESS}},getUnsignedFulfillmentTransactions=async G=>{let K=[];const ne=[];for(const K of G)K.type===Wj.TRANSACTION&&K.purpose===zj.FULFILL_ORDER&&ne.push(K.buildTransaction());return K=await Promise.all(ne),K},calculateFeesPercent=(G,K,ne=Oi.from(1))=>{const ue=G.amount,pe=Math.round(ue.percentageDecimal*10**6),he=K.mul(Oi.from(pe)).div(10**6);return he.sub(he.mod(ne))},calculateFeesToken=(G,K)=>parseUnits$1(G.amount.token,K),calculateFees=(G,K,ne=18,ue=Oi.from(1))=>{let pe=Oi.from(0);const he=Oi.from(K),ye=he.mul(1e6).div(10**6),me=[];for(const K of G){let G=Oi.from(0);if(Object.hasOwn(K.amount,"percentageDecimal"))G=calculateFeesPercent(K,he,ue),pe=pe.add(G);else{if(!Object.hasOwn(K.amount,"token"))throw new CheckoutError("Unknown fee type parsed, must be percentageDecimal or token",xZ.ORDER_FEE_ERROR);G=calculateFeesToken(K,ne),pe=pe.add(G)}if(pe.gt(ye))throw new CheckoutError("The combined fees are above the allowed maximum of 100%",xZ.ORDER_FEE_ERROR);G.gt(0)&&me.push({amount:G.toString(),recipientAddress:K.recipient})}return me},getItemRequirement=(G,K,ne,ue,pe=!1)=>{switch(G){case dY.ERC20:return{type:G,amount:ne,tokenAddress:K,spenderAddress:ue,isFee:pe};case dY.NATIVE:default:return{type:dY.NATIVE,amount:ne,isFee:pe}}},buy=async(G,K,ne,ue={waitFulfillmentSettlements:!0})=>{if(Dn("checkout_sdk","buy_initiated"),0===ne.length)throw new CheckoutError("No orders were provided to the orders array. Please provide at least one order.",xZ.FULFILL_ORDER_LISTING_ERROR);let pe,he="",ye=18;const me=rH.estimatedFulfillmentGasGwei,be=createOrderbookInstance(G),ve=createBlockchainDataInstance(G),_e=await measureAsyncExecution(G,"Time to get the address from the provider",K.getSigner().getAddress());resetBlockscoutClientMap(),getAllBalances(G,K,_e,getL1ChainId(G)),getAllBalances(G,K,_e,getL2ChainId(G));const{id:Te,takerFees:Ee,fillAmount:Pe}=ne[0];let Se;try{pe=await measureAsyncExecution(G,"Time to fetch the listing from the orderbook",be.getListing(Te));const{seaportContractAddress:K,chainName:ne}=be.config();Se=ne,he=K}catch(G){throw new CheckoutError("An error occurred while getting the order listing",xZ.GET_ORDER_LISTING_ERROR,{error:G,orderId:Te})}if(0===pe.result.buy.length)throw new CheckoutError("An error occurred with the get order listing",xZ.GET_ORDER_LISTING_ERROR,{orderId:Te,message:"No buy side tokens found on order"});const Ce=pe.result.buy[0];if("ERC20"===Ce.type){const K=await measureAsyncExecution(G,"Time to get decimals of token contract for the buy token",ve.getToken({contractAddress:Ce.contractAddress,chainName:Se}));K.result.decimals&&(ye=K.result.decimals)}let ke=[];if(Ee&&Ee.length>0){const G=pe.result.sell[0].type===dY.ERC721?Oi.from(1):Oi.from(pe.result.sell[0].amount);ke=calculateFees(Ee,Ce.amount,ye,G)}let Oe=[],xe=[],Ne=[];const Me=performance.now();try{const{actions:K}=await measureAsyncExecution(G,"Time to call fulfillOrder from the orderbook",be.fulfillOrder(Te,_e,ke,Pe));Ne=K,Oe=await measureAsyncExecution(G,"Time to construct the unsigned approval transactions",(async G=>{let K=[];const ne=[];for(const K of G)K.type===Wj.TRANSACTION&&K.purpose===zj.APPROVAL&&ne.push(K.buildTransaction());return K=await Promise.all(ne),K})(K))}catch(K){const ne=(performance.now()-Me)/1e3;if(debugLogger(G,"Time to call fulfillOrder from the orderbook",ne),K.message.includes(Gj.EXPIRED))throw new CheckoutError("Order is expired",xZ.ORDER_EXPIRED_ERROR,{orderId:Te});if(!K.message.includes("The fulfiller does not have the balances needed to fulfill"))throw new CheckoutError("Error occurred while trying to fulfill the order",xZ.FULFILL_ORDER_LISTING_ERROR,{orderId:Te,error:K})}try{xe=await measureAsyncExecution(G,"Time to construct the unsigned fulfillment transactions",getUnsignedFulfillmentTransactions(Ne))}catch{}let Be=Oi.from("0"),Fe=dY.NATIVE,De="";const Le=pe.result.buy;if(Le.length>0)switch(Le[0].type){case"NATIVE":Fe=dY.NATIVE;break;case"ERC20":Fe=dY.ERC20,De=Le[0].contractAddress;break;default:throw new CheckoutError("Purchasing token type is unsupported",xZ.UNSUPPORTED_TOKEN_TYPE_ERROR,{orderId:Te})}Le.forEach((G=>{G.type!==dY.ERC721&&(Be=Be.add(Oi.from(G.amount)))}));pe.result.fees.forEach((G=>{Be=Be.add(Oi.from(G.amount))})),"ERC1155"===pe.result.sell[0].type&&Pe&&(Be=Be.mul(Oi.from(Pe)).div(Oi.from(pe.result.sell[0].amount)));const Ue=[getItemRequirement(Fe,De,Be,he)],je=await measureAsyncExecution(G,"Total time running smart checkout",smartCheckout(G,K,Ue,((G,K)=>K.length>0?{type:uY.TRANSACTION,transaction:K[0]}:{type:uY.GAS,gasToken:{type:fY.NATIVE,limit:Oi.from(G)}})(me,xe)));if(je.sufficient){const G=await signApprovalTransactions(K,Oe);if(G.type===IY.FAILED)return{status:cY.FAILED,transactionHash:G.transactionHash,reason:G.reason,smartCheckoutResult:je};try{0===xe.length&&(xe=await getUnsignedFulfillmentTransactions(Ne))}catch(G){throw new CheckoutError("Error fetching fulfillment transaction",xZ.FULFILL_ORDER_LISTING_ERROR,{error:G})}if(ue.waitFulfillmentSettlements){const G=await signFulfillmentTransactions(K,xe);return G.type===IY.FAILED?{status:cY.FAILED,transactionHash:G.transactionHash,reason:G.reason,smartCheckoutResult:je}:{status:cY.SUCCESS,smartCheckoutResult:je}}let ne;try{const G=await Promise.all(xe.map((G=>sendTransaction(K,G))));ne=G.map((G=>G.transactionResponse))}catch(G){throw new CheckoutError("An error occurred while executing the fulfillment transaction",xZ.EXECUTE_FULFILLMENT_TRANSACTION_ERROR,{message:G.message})}return{status:cY.FULFILLMENTS_UNSETTLED,smartCheckoutResult:je,transactions:ne}}return{status:cY.INSUFFICIENT_FUNDS,smartCheckoutResult:je}},cancel=async(G,K,ne,ue={waitFulfillmentSettlements:!0,useGaslessCancel:!1})=>{const pe=createOrderbookInstance(G);return ue.useGaslessCancel?await(async(G,K,ne)=>{try{const ue=K.getSigner(),pe=await ue.getAddress(),{signableAction:he}=await G.prepareOrderCancellations(ne),ye=await ue._signTypedData(he.message.domain,he.message.types,he.message.value),{result:me}=await G.cancelOrders(ne,pe,ye),be=[],ve=[],_e=[];for(const G of me.successful_cancellations)be.push({orderId:G});for(const G of me.failed_cancellations)ve.push({orderId:G.order,reason:G.reason_code});for(const G of me.pending_cancellations)_e.push({orderId:G});return{successfulCancellations:be,failedCancellations:ve,pendingCancellations:_e}}catch(G){throw new CheckoutError("An error occurred while cancelling the order listing",xZ.CANCEL_ORDER_LISTING_ERROR,{orderIds:ne,error:G})}})(pe,K,ne):await(async(G,K,ne,ue,pe)=>{let he;if(0===ue.length)throw new CheckoutError("No orderIds were provided to the orderIds array. Please provide at least one orderId.",xZ.CANCEL_ORDER_LISTING_ERROR);const ye=ue[0];try{const ue=await measureAsyncExecution(G,"Time to get the address from the provider",ne.getSigner().getAddress()),pe=await measureAsyncExecution(G,"Time to get the cancel order from the orderbook",K.cancelOrdersOnChain([ye],ue));he=await pe.cancellationAction.buildTransaction()}catch(G){throw new CheckoutError("An error occurred while cancelling the order listing",xZ.CANCEL_ORDER_LISTING_ERROR,{orderId:ye,error:G})}if(pe){const G=await signFulfillmentTransactions(ne,[he]);return G.type===IY.FAILED?{status:cY.FAILED,transactionHash:G.transactionHash,reason:G.reason}:{status:cY.SUCCESS}}let me;try{const G=await Promise.all([he].map((G=>sendTransaction(ne,G))));me=G.map((G=>G.transactionResponse))}catch(G){throw new CheckoutError("An error occurred while executing the fulfillment transaction",xZ.EXECUTE_FULFILLMENT_TRANSACTION_ERROR,{message:G.message})}return{status:cY.FULFILLMENTS_UNSETTLED,transactions:me}})(G,pe,K,ne,ue.waitFulfillmentSettlements??!0)};async function getItemRequirementsFromRequirements(G,K){const ne=[];K.forEach((K=>{if(K.type===dY.ERC20){const{tokenAddress:ue}=K;ne.push(function getTokenContract(G,K,ne){return new iu(G,K,ne)}(ue,JZ,G).decimals())}}));const ue=await Promise.all(ne),pe=K.map(((G,K)=>G.type===dY.NATIVE?{...G,amount:parseUnits$1(G.amount,18)}:G.type===dY.ERC20?{...G,amount:parseUnits$1(G.amount,ue[K])}:G));return pe}const sell=async(G,K,ne)=>{let ue,pe,he="";if(Dn("checkout_sdk","sell_initiated"),0===ne.length)throw new CheckoutError("No orders were provided to the orders array. Please provide at least one order.",xZ.PREPARE_ORDER_LISTING_ERROR);const{buyToken:ye,sellToken:me,makerFees:be,orderExpiry:ve}=ne[0];let _e=18;if(ye.type===dY.ERC20){const ne=new iu(ye.tokenAddress,JSON.stringify(JZ),K);_e=await measureAsyncExecution(G,"Time to get decimals of token contract for the buy token",ne.decimals())}const Te=((G,K=18)=>{const ne=parseUnits$1(G.amount,K);return G.type===dY.NATIVE?{type:dY.NATIVE,amount:ne.toString()}:{type:dY.ERC20,amount:ne.toString(),contractAddress:G.tokenAddress}})(ye,_e),Ee="type"in me;try{const ne=await measureAsyncExecution(G,"Time to get the address from the provider",K.getSigner().getAddress());ue=createOrderbookInstance(G);const{seaportContractAddress:ye}=ue.config();he=ye;const be=Ee&&me.type===dY.ERC1155?{type:dY.ERC1155,contractAddress:me.collectionAddress,tokenId:me.id,amount:me.amount}:{type:dY.ERC721,contractAddress:me.collectionAddress,tokenId:me.id};pe=await measureAsyncExecution(G,"Time to prepare the listing from the orderbook",ue.prepareListing({makerAddress:ne,buy:Te,sell:be,orderExpiry:ve}))}catch(G){throw new CheckoutError("An error occurred while preparing the listing",xZ.PREPARE_ORDER_LISTING_ERROR,{error:G,id:me.id,collectionAddress:me.collectionAddress})}const Pe=[];if(Ee&&me.type===dY.ERC1155){const G=((G,K,ne,ue)=>({type:dY.ERC1155,id:G,contractAddress:K,spenderAddress:ne,amount:Oi.from(ue)}))(me.id,me.collectionAddress,he,me.amount);Pe.push(G)}else{const G=((G,K,ne)=>({type:dY.ERC721,id:G,contractAddress:K,spenderAddress:ne}))(me.id,me.collectionAddress,he);Pe.push(G)}let Se;const Ce=K.provider?.isPassport;if(Se=Ce?{sufficient:!0,transactionRequirements:[]}:await measureAsyncExecution(G,"Total time running smart checkout",smartCheckout(G,K,Pe,{type:uY.GAS,gasToken:{type:fY.NATIVE,limit:Oi.from(rH.estimatedFulfillmentGasGwei)}})),Se.sufficient){const G=await(async G=>{let K=[],ne=[];const ue=[],pe=[];for(const K of G)K.type===Wj.TRANSACTION&&(K.purpose===zj.APPROVAL&&ue.push(K.buildTransaction()),K.purpose===zj.FULFILL_ORDER&&pe.push(K.buildTransaction()));return K=await Promise.all(ue),ne=await Promise.all(pe),{approvalTransactions:K,fulfillmentTransactions:ne}})(pe.actions),ne=await signApprovalTransactions(K,G.approvalTransactions);if(ne.type===IY.FAILED)return{status:cY.FAILED,transactionHash:ne.transactionHash,reason:ne.reason,smartCheckoutResult:Se};const he=((G,K,ne)=>{let ue;for(const G of ne)G.type===Wj.SIGNABLE&&G.purpose===Vj.CREATE_LISTING&&(ue={domain:G.message.domain,types:G.message.types,value:G.message.value});if(ue)return{orderHash:G,orderComponents:K,unsignedMessage:ue}})(pe.orderHash,pe.orderComponents,pe.actions);if(!he)throw new CheckoutError("The unsigned message is missing after preparing the listing",xZ.SIGN_MESSAGE_ERROR,{id:me.id,collectionAddress:me.collectionAddress});const ye=await(async(G,K)=>{try{const ne=await G.getSigner()._signTypedData(K.unsignedMessage.domain,K.unsignedMessage.types,K.unsignedMessage.value);return{orderComponents:K.orderComponents,orderHash:K.orderHash,signedMessage:ne}}catch(G){throw new CheckoutError("An error occurred while signing the message",xZ.SIGN_MESSAGE_ERROR,{error:G})}})(K,he);let ve="";const Pe={orderComponents:ye.orderComponents,orderHash:ye.orderHash,orderSignature:ye.signedMessage,makerFees:[]};if(void 0!==be){let G=Oi.from(1);Ee&&me.type===dY.ERC1155&&(G=Oi.from(me.amount));const K=calculateFees(be,Te.amount,_e,G);if(K.length!==be.length)throw new CheckoutError("One of the fees is too small, must be greater than 0.000001",xZ.CREATE_ORDER_LISTING_ERROR);Pe.makerFees=K}try{ve=(await ue.createListing(Pe)).result.id}catch(G){throw new CheckoutError("An error occurred while creating the listing",xZ.CREATE_ORDER_LISTING_ERROR,{error:G,collectionId:me.id,collectionAddress:me.collectionAddress})}return{status:cY.SUCCESS,orderIds:[ve],smartCheckoutResult:Se}}return{status:cY.INSUFFICIENT_FUNDS,smartCheckoutResult:Se}},swapQuote=async(G,K,ne,ue,pe,he,ye,me,be)=>{if(!ne.address||0===ne.decimals)throw new CheckoutError("fromToken address or decimals is missing.",xZ.MISSING_PARAMS);if(!ue.address||0===ue.decimals)throw new CheckoutError("toToken address or decimals is missing.",xZ.MISSING_PARAMS);if(pe&&he)throw new CheckoutError("Only one of fromAmount or toAmount can be provided.",xZ.MISSING_PARAMS);if(!pe&&!he)throw new CheckoutError("fromAmount or toAmount must be provided.",xZ.MISSING_PARAMS);const ve=getL2ChainId(G),_e=await createExchangeInstance(ve,G),Te=await K.getSigner().getAddress();return pe?_e.getUnsignedSwapTxFromAmountIn(Te,ne.address,ue.address,Oi.from(parseUnits$1(pe,ne.decimals)),ye,me,be):_e.getUnsignedSwapTxFromAmountOut(Te,ne.address,ue.address,Oi.from(parseUnits$1(he,ue.decimals)),ye,me,be)};async function getLatestVersion(){const G=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@latest/dist/version.json?t=${Date.now()}`,K="latest";try{const ne=await fetch(G);if(!ne.ok)return K;const ue=await ne.json(),pe=ue.version?.trim();return pe||K}catch(G){return K}}async function determineWidgetsVersion(G,K,ne){if(K)return G;if(G.includes("alpha"))return G;if(!ne||!Array.isArray(ne.compatibleVersionMarkers))return G;const ue=function latestCompatibleVersion(G,K){for(const ne of K)if(kZ.valid(ne)&&kZ.lte(G,ne))return ne;return"latest"}(G,ne.compatibleVersionMarkers);return"latest"===ue?await getLatestVersion():ue}var CY;!function(G){G.LOW="Low",G.MEDIUM="Medium",G.HIGH="High",G.SEVERE="Severe"}(CY||(CY={}));const fetchRiskAssessment=async(G,K)=>{const ne=Object.fromEntries(G.map((G=>[G.toLowerCase(),{sanctioned:!1}]))),ue=await K.remote.getConfig("riskAssessment");if(!ue?.enabled)return ne;try{const pe=ue?.levels.map((G=>G.toLowerCase()))??[],he=await er.post(`${GZ[K.environment]}/v1/sanctions/check`,{addresses:G});for(const G of he.data)ne[G.address.toLowerCase()].sanctioned=pe.includes(G.risk.toLowerCase());return ne}catch(G){return console.error("Error fetching risk assessment",G),ne}},isAddressSanctioned=(G,K)=>K?G[K.toLowerCase()].sanctioned:Object.values(G).some((G=>G.sanctioned)),RY={baseConfig:{environment:Jn.SANDBOX},passport:void 0};var kY=Object.freeze({__proto__:null,get AddTokensEventType(){return AZ},BlockExplorerService:class BlockExplorerService{static getTransactionLink(G,K){const ne=KZ?.[G]?.url;if(ne&&K)return`${ne}/tx/${K}`}},get BridgeEventType(){return mZ},get ChainId(){return MZ},get ChainName(){return BZ},get ChainSlug(){return FZ},Checkout:class Checkout{readOnlyProviders;httpClient;config;fiatRampService;availability;passport;constructor(G=RY){this.httpClient=new HttpClient(G),this.config=new CheckoutConfiguration(G,this.httpClient),this.fiatRampService=new FiatRampService(this.config),this.readOnlyProviders=new Map,this.availability=availabilityService(this.config.isDevelopment,this.config.isProduction),this.passport=G.passport,InjectedProvidersManager.getInstance().initialise()}async widgets(G){const K=await this.config.remote.getConfig("checkoutWidgetsVersion"),ne=function validateAndBuildVersion(G){const K="1.78.11";if(void 0===G||void 0===G.major)return K;if(!Number.isInteger(G.major)||G.major<0)return K;if(void 0!==G.minor&&G.minor<0)return K;if(void 0!==G.patch&&G.patch<0)return K;if(0===G.major&&void 0===G.minor)return K;if(0===G.major&&0===G.minor&&void 0===G.patch)return K;if(0===G.major&&void 0===G.minor&&void 0===G.patch)return K;if(0===G.major&&0===G.minor&&0===G.patch)return K;let ne=G.major.toString();return void 0===G.minor||(Number.isInteger(G.minor)&&(ne+=`.${G.minor.toString()}`),void 0===G.patch||(Number.isInteger(G.patch)&&(ne+=`.${G.patch.toString()}`),void 0===G.prerelease||"alpha"!==G.prerelease||("alpha"===G.prerelease&&(ne+=`-${G.prerelease}`),void 0===G.build||Number.isInteger(G.build)&&G.build>=0&&(ne+=`.${G.build.toString()}`)))),ne}(G.version),ue=void 0!==G.version,pe=await determineWidgetsVersion(ne,ue,K);try{return await this.loadEsModules(G.config,pe)}catch(G){throw new CheckoutError("Failed to load widgets script",xZ.WIDGETS_SCRIPT_LOAD_ERROR,{error:G})}}async loadUmdBundle(G,K){const ne=this,ue=new Promise(((ue,pe)=>{try{const he="immutable-checkout-widgets-bundle";document.getElementById(he)&&("undefined"!=typeof ImmutableCheckoutWidgets?ue(new ImmutableCheckoutWidgets.WidgetsFactory(ne,G)):pe(new CheckoutError("Failed to find ImmutableCheckoutWidgets script",xZ.WIDGETS_SCRIPT_LOAD_ERROR)));const ye=document.createElement("script");ye.addEventListener("load",(()=>{"undefined"!=typeof ImmutableCheckoutWidgets?ue(new ImmutableCheckoutWidgets.WidgetsFactory(ne,G)):pe(new CheckoutError("Failed to find ImmutableCheckoutWidgets script",xZ.WIDGETS_SCRIPT_LOAD_ERROR))})),ye.addEventListener("error",(G=>{pe(new CheckoutError("Failed to load widgets script",xZ.WIDGETS_SCRIPT_LOAD_ERROR,{error:G}))})),function loadUnresolvedBundle(G,K,ne){if(void 0===window)throw new Error("missing window object: please run Checkout client side");if(void 0===document)throw new Error("missing document object: please run Checkout client side");let ue=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${ne}/dist/browser/checkout/widgets.js`;G.setAttribute("id",K),G.setAttribute("data-version",ne),G.setAttribute("src",ue),document.head.appendChild(G)}(ye,he,K)}catch(G){pe(new CheckoutError("Failed to load widgets script",xZ.WIDGETS_SCRIPT_LOAD_ERROR,{error:G}))}}));return ue}async loadEsModules(G,K){const ne=this;async function tryLoadEsModule(K){const ue=function getWidgetsEsmUrl(G){return`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${G}/dist/browser/checkout/widgets-esm.js`}(K);try{const pe=await import(ue);if(pe&&pe.WidgetsFactory)return new pe.WidgetsFactory(ne,G);throw new Error(`WidgetsFactory not found in loaded module for version: ${K}`)}catch(G){throw console.warn(`Failed to load ESM bundle for version ${K}. Error: ${G.message}`),G}}try{return await tryLoadEsModule(K)}catch(G){if(K===await getLatestVersion()&&"latest"!==K)try{return await tryLoadEsModule("latest")}catch(G){console.warn(`Failed to resolve Commerce Widgets module, falling back to UMD bundle. Error: ${G.message}`)}else console.warn(`Failed to resolve Commerce Widgets module for version ${K}, falling back to UMD bundle. \n          Error: ${G.message}`)}return await ne.loadUmdBundle(G,K)}async createProvider(G){return await createProvider(G.walletProviderName,this.passport)}getInjectedProviders(){return InjectedProvidersManager.getInstance().getProviders()}findInjectedProvider(G){return InjectedProvidersManager.getInstance().findProvider(G)}onInjectedProvidersChange(G){return InjectedProvidersManager.getInstance().subscribe(G)}clearInjectedProviders(){return InjectedProvidersManager.getInstance().clear()}async checkIsWalletConnected(G){return async function checkIsWalletConnected(G){if(!G?.provider?.request)throw new CheckoutError("Check wallet connection request failed",xZ.PROVIDER_REQUEST_FAILED_ERROR,{rpcMethod:nY.CHECK_CONNECTION});let K=[];try{K=await G.provider.request({method:nY.CHECK_CONNECTION,params:[]})}catch(G){throw new CheckoutError("Check wallet connection request failed",xZ.PROVIDER_REQUEST_FAILED_ERROR,{error:G,rpcMethod:nY.CHECK_CONNECTION})}return{isConnected:K&&K.length>0,walletAddress:K[0]??""}}(await validateProvider(this.config,G.provider,{allowMistmatchedChainId:!0,allowUnsupportedProvider:!0}))}async getRiskAssessment(G){return await fetchRiskAssessment(G,this.config)}checkIsAddressSanctioned(G,K){return isAddressSanctioned(G,K)}async connect(G){const K=await validateProvider(this.config,G.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return G.requestWalletPermissions&&!K.provider?.isPassport?await async function requestPermissions(G){if(!G||!G.provider?.request)throw new CheckoutError("Incompatible provider",xZ.PROVIDER_REQUEST_MISSING_ERROR,{details:"Attempting to connect with an incompatible provider"});return await withCheckoutError((async()=>{G.provider.request&&await G.provider.request({method:nY.REQUEST_PERMISSIONS,params:[{eth_accounts:{}}]})}),{type:xZ.USER_REJECTED_REQUEST_ERROR}),G}(K):await async function connectSite(G){if(!G||!G.provider?.request)throw new CheckoutError("Incompatible provider",xZ.PROVIDER_REQUEST_MISSING_ERROR,{details:"Attempting to connect with an incompatible provider"});return await withCheckoutError((async()=>{G.provider.request&&await G.provider.request({method:nY.CONNECT,params:[]})}),{type:xZ.USER_REJECTED_REQUEST_ERROR}),G}(K),{provider:K}}async addNetwork(G){return await addNetworkToWallet(this.config.networkMap,G.provider,G.chainId)}async switchNetwork(G){const K=await validateProvider(this.config,G.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await switchWalletNetwork(this.config,K,G.chainId)}async getTokenInfo(G){return await getERC20TokenInfo(G.provider,G.tokenAddress)}async getBalance(G){const K=await validateProvider(this.config,G.provider);return G.tokenAddress&&""!==G.tokenAddress?await getERC20Balance(K,G.walletAddress,G.tokenAddress):await getBalance(this.config,K,G.walletAddress)}async getAllBalances(G){return getAllBalances(this.config,G.provider,G.walletAddress,G.chainId)}async getNetworkAllowList(G){return await getNetworkAllowList(this.config,G)}async getTokenAllowList(G){return await getTokenAllowList(this.config,G)}async getWalletAllowList(G){return await async function getWalletAllowList(G){const K=[],ne=G.exclude?.map((G=>G.walletProviderName))??[];let ue=Object.values(iY);0!==ne.length&&(ue=ue.filter((G=>!ne.includes(G))));for(const G of ue)K.push({walletProviderName:G});return{wallets:K}}(G)}async sendTransaction(G){const K=await validateProvider(this.config,G.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await sendTransaction(K,G.transaction)}async providerCall(G,K){const ne=await validateProvider(this.config,G,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});try{return await K(ne)}catch(G){throw handleProviderError(G)}}async getNetworkInfo(G){const K=await validateProvider(this.config,G.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await getNetworkInfo(this.config,K)}async buy(G){G.orders.length>1&&console.warn("This endpoint currently only processes the first order in the array.");const K=await validateProvider(this.config,G.provider);return await buy(this.config,K,G.orders,G.overrides)}async sell(G){G.orders.length>1&&console.warn("This endpoint currently only processes the first order in the array.");const K=await validateProvider(this.config,G.provider);return await sell(this.config,K,G.orders)}async cancel(G){console.warn("This endpoint currently only processes the first order in the array.");const K=await validateProvider(this.config,G.provider);return await cancel(this.config,K,G.orderIds,G.overrides)}async smartCheckout(G){const K=await validateProvider(this.config,G.provider);let ne=[];try{ne=await getItemRequirementsFromRequirements(K,G.itemRequirements)}catch(G){throw new CheckoutError("Failed to map item requirements",xZ.ITEM_REQUIREMENTS_ERROR,{error:G})}return await smartCheckout(this.config,K,ne,G.transactionOrGasAmount,G.routingOptions,G.onComplete,G.onFundingRoute,G.fundingRouteFullAmount)}static isWeb3Provider(G){return isWeb3Provider(G)}async gasEstimate(G){return this.readOnlyProviders=await createReadOnlyProviders(this.config,this.readOnlyProviders),await gasEstimator(G,this.readOnlyProviders,this.config)}async createFiatRampUrl(G){let K,ne,ue="IMX";const pe=await G.web3Provider.getSigner().getAddress(),he=G.web3Provider.provider?.isPassport||!1;if(he&&G.passport){const K=await G.passport.getUserInfo();ne=K?.email}const ye=await getTokenAllowList(this.config,{type:rY.ONRAMP}),me=ye.tokens?.find((K=>isMatchingAddress(K.address,G.tokenAddress)));me&&(K=G.tokenAmount,ue=me.symbol);const be=ye?.tokens?.filter((G=>G.symbol)).map((G=>G.symbol));return await this.fiatRampService.createWidgetUrl({exchangeType:G.exchangeType,isPassport:he,walletAddress:pe,tokenAmount:K,tokenSymbol:ue,email:ne,allowedTokens:be})}async getExchangeFeeEstimate(){return await this.fiatRampService.feeEstimate()}async isSwapAvailable(){return this.availability.checkDexAvailability()}async swap(G){const K=await validateProvider(this.config,G.provider);return(async(G,K,ne,ue,pe,he,ye,me,be)=>{const ve=await swapQuote(G,K,ne,ue,pe,he,ye,me,be);if(ve.approval){const G=await sendTransaction(K,ve.approval.transaction);if(0===(await G.transactionResponse.wait()).status)throw new CheckoutError("Approval transaction failed and was reverted",xZ.APPROVAL_TRANSACTION_FAILED)}const _e=await sendTransaction(K,ve.swap.transaction),Te=await _e.transactionResponse.wait();if(0===Te.status)throw new CheckoutError("Swap transaction failed and was reverted",xZ.TRANSACTION_FAILED);return{swapReceipt:Te,quote:ve.quote,swap:ve.swap}})(this.config,K,G.fromToken,G.toToken,G.fromAmount,G.toAmount,G.slippagePercent,G.maxHops,G.deadline)}async swapQuote(G){const K=await validateProvider(this.config,G.provider);return swapQuote(this.config,K,G.fromToken,G.toToken,G.fromAmount,G.toAmount,G.slippagePercent,G.maxHops,G.deadline)}},CheckoutConfiguration:CheckoutConfiguration,CheckoutError:CheckoutError,get CheckoutErrorType(){return xZ},get CheckoutStatus(){return cY},get CommerceEventType(){return vZ},get CommerceFailureEventType(){return _Z},get CommerceFlowType(){return CZ},get CommerceSuccessEventType(){return wZ},get CommerceUserActionEventType(){return TZ},get ConnectEventType(){return fZ},get ConnectTargetLayer(){return SZ},get ExchangeType(){return yY},get FeeType(){return pY},get FundingStepType(){return hY},get GasEstimateType(){return eY},get GasTokenType(){return fY},IMMUTABLE_API_BASE_URL:GZ,get IMTBLWidgetEvents(){return dZ},get ItemType(){return dY},get NetworkFilterTypes(){return tY},get OnRampEventType(){return gZ},get OrchestrationEventType(){return bZ},get ProviderEventType(){return uZ},get PurchaseEventType(){return EZ},get RoutingOutcomeType(){return lY},get SaleEventType(){return hZ},get SalePaymentTypes(){return yZ},get SwapDirection(){return IZ},get SwapEventType(){return pZ},get TokenFilterTypes(){return rY},get TransactionOrGasType(){return uY},get WalletEventType(){return lZ},get WalletFilterTypes(){return aY},get WalletProviderName(){return iY},get WalletProviderRdns(){return sY},get WidgetTheme(){return RZ},get WidgetType(){return PZ},fetchRiskAssessment:fetchRiskAssessment,getMetaMaskProviderDetail:G=>({info:wY,provider:G}),getPassportProviderDetail:G=>({info:_Y,provider:G}),isAddressSanctioned:isAddressSanctioned,validateProvider:validateProvider});async function validateChain(G,K){if(!function isChainValid(G,K){return G===K.ethConfiguration.chainID}(await G.getChainId(),K))throw new Error("The wallet used for this operation is not connected to the correct network.")}async function isRegisteredOnChain(G,K,ne){await validateChain(K,ne.immutableXConfig);const ue=ne.immutableXConfig,pe=Bv.RegistrationV4.connect(ue.ethConfiguration.registrationV4ContractAddress||ue.ethConfiguration.registrationContractAddress,K);try{return await pe.isRegistered(G)}catch(G){if("USER_UNREGISTERED"===G.reason)return!1;throw G}}const assertIsDefined=G=>{if(void 0!==G)return G;throw new Error("undefined field exception")};async function prepareWithdrawalAction(G,K){const{signers:{ethSigner:ne,starkSigner:ue}}=G;await validateChain(ne,G.config);const pe="ERC721"===G.type?"1":G.amount,he=await K.getSignableWithdrawalV2({getSignableWithdrawalRequest:{user:await ne.getAddress(),token:convertToSignableToken(G),amount:pe}}),{signable_message:ye,payload_hash:me}=he.data,be=await ue.signMessage(me),{ethAddress:ve,ethSignature:_e}=await async function signMessage$1(G,K){return{message:G,ethAddress:await K.getAddress(),ethSignature:await signRaw(G,K)}}(ye,ne);return(await K.createWithdrawalV2({createWithdrawalRequestV2:{sender_stark_key:assertIsDefined(he.data.sender_stark_key),sender_vault_id:assertIsDefined(he.data.sender_vault_id),receiver_stark_key:assertIsDefined(he.data.receiver_stark_key),receiver_vault_id:assertIsDefined(he.data.receiver_vault_id),amount:pe,asset_id:assertIsDefined(he.data.asset_id),expiration_timestamp:assertIsDefined(he.data.expiration_timestamp),nonce:assertIsDefined(he.data.nonce),stark_signature:be},xImxEthAddress:ve,xImxEthSignature:_e})).data}async function getEncodeAssetInfo(G,K,ne,ue){const pe=new wa.EncodingApi(ne.apiConfiguration);return(await pe.encodeAsset({assetType:G,encodeAssetRequest:{token:{type:K,...ue&&{data:ue}}}})).data}async function getWithdrawalBalance(G,K,ne,ue){return Bv.CoreV4.connect(ue.ethConfiguration.coreContractAddress,G).getWithdrawalBalance(K,ne)}async function getWithdrawalBalanceWorkflow(G,K,ne,ue,pe,he){switch(ne.type){case"ETH":return await async function getETHWithdrawalBalance(G,K,ne){const ue=await getEncodeAssetInfo("asset","ETH",ne);return await getWithdrawalBalance(G,K,ue.asset_id,ne)}(G,K,he);case"ERC20":return await async function getERC20WithdrawalBalance(G,K,ne,ue){const pe=await getEncodeAssetInfo("asset","ERC20",ue,{token_address:ne});return await getWithdrawalBalance(G,K,pe.asset_id,ue)}(G,K,ne.tokenAddress,he);case"ERC721":return await async function getERC721WithdrawalBalance(G,K,ne,ue,pe,he){try{const ue=await pe.getMintableTokenDetailsByClientTokenId({tokenAddress:ne.tokenAddress,tokenId:ne.tokenId}),ye=await getEncodeAssetInfo("mintable-asset","ERC721",he,{id:ne.tokenId,token_address:ne.tokenAddress,...ue.data.blueprint&&{blueprint:ue.data.blueprint}});return await getWithdrawalBalance(G,K,ye.asset_id,he)}catch(ue){if(404===ue.response?.status){const ue=await getEncodeAssetInfo("asset","ERC721",he,{token_id:ne.tokenId,token_address:ne.tokenAddress});return await getWithdrawalBalance(G,K,ue.asset_id,he)}throw ue}}(G,K,ne,0,pe,he);default:throw new Error("Unsupported token type")}}async function getWithdrawalBalances(G,K,ne,ue,pe){new EncodingApi(pe.apiConfiguration);const he=new MintsApi(pe.apiConfiguration);return{v3Balance:await getWithdrawalBalanceWorkflow(G,K,ue,0,he,pe),v4Balance:await getWithdrawalBalanceWorkflow(G,ne,ue,0,he,pe)}}const OY="ERC20";async function executeRegisterAndWithdrawAllFungible(G,K,ne,ue,pe){const he=await G.getAddress(),ye=await signRegisterEthAddress(K,he,ne),me=Bv.RegistrationV4.connect(pe.ethConfiguration.registrationV4ContractAddress||pe.ethConfiguration.registrationContractAddress,G),be=await me.populateTransaction.registerAndWithdrawAll(he,ne,ye,ue);return G.sendTransaction(be)}async function executeWithdrawAllFungible(G,K,ne,ue){const pe=Bv.RegistrationV4.connect(ue.ethConfiguration.registrationV4ContractAddress||ue.ethConfiguration.registrationContractAddress,G),he=await pe.populateTransaction.withdrawAll(await G.getAddress(),K,ne);return G.sendTransaction(he)}async function executeWithdrawFungible(G,K,ne,ue){const pe=Bv.CoreV4.connect(ue.ethConfiguration.coreContractAddress,G),he=await pe.populateTransaction.withdraw(await G.getAddress(),ne);return G.sendTransaction(he)}const xY="ERC721";function getMintingBlob(G){const{id:K}=G.data,ne=G.data.blueprint||"";return As(ms(`{${K}}:{${ne}}`))}async function completeERC721RegisterAndWithdrawal(G,K,ne,ue,pe){return G.getMintableTokenDetailsByClientTokenId({tokenAddress:ue.tokenAddress,tokenId:ue.tokenId}).then((G=>async function executeMintableERC721RegisterAndWithdraw(G,K,ne,ue){const pe=await G.getAddress(),he=await K.getAddress(),ye=await getEncodeAssetInfo("mintable-asset",xY,ue,{id:ne.data.id,token_address:ne.data.tokenAddress,...ne.data.blueprint&&{blueprint:ne.data.blueprint}}),me=getMintingBlob(ne),be=await signRegisterEthAddress(K,pe,he),ve=Bv.RegistrationV4.connect(ue.ethConfiguration.registrationV4ContractAddress||ue.ethConfiguration.registrationContractAddress,G),_e=await ve.populateTransaction.registerWithdrawAndMint(pe,he,be,ye.asset_type,me);return G.sendTransaction(_e)}(K,ne,{type:xY,data:{id:ue.tokenId,tokenAddress:ue.tokenAddress,blueprint:G.data.blueprint}},pe))).catch((G=>{if(404===G.response?.status)return async function executeERC721RegisterAndWithdraw(G,K,ne,ue){const pe=await G.getAddress(),he=await K.getAddress(),ye=await getEncodeAssetInfo("asset",xY,ue,{token_id:ne.tokenId,token_address:ne.tokenAddress}),me=await signRegisterEthAddress(K,pe,he),be=Bv.RegistrationV4.connect(ue.ethConfiguration.registrationV4ContractAddress||ue.ethConfiguration.registrationContractAddress,G),ve=await be.populateTransaction.registerAndWithdrawNft(pe,he,me,ye.asset_type,ne.tokenId);return G.sendTransaction(ve)}(K,ne,ue,pe);throw G}))}async function completeERC721Withdrawal(G,K,ne,ue,pe){return G.getMintableTokenDetailsByClientTokenId({tokenAddress:ue.tokenAddress,tokenId:ue.tokenId}).then((G=>async function executeMintableERC721Withdrawal(G,K,ne,ue){const pe=await getEncodeAssetInfo("mintable-asset",xY,ue,{id:ne.data.id,token_address:ne.data.tokenAddress,...ne.data.blueprint&&{blueprint:ne.data.blueprint}}),he=getMintingBlob(ne),ye=Bv.CoreV4.connect(ue.ethConfiguration.coreContractAddress,G),me=await ye.populateTransaction.withdrawAndMint(K,pe.asset_type,he);return G.sendTransaction(me)}(K,ne,{type:xY,data:{id:ue.tokenId,tokenAddress:ue.tokenAddress,blueprint:G.data.blueprint}},pe))).catch((G=>{if(404===G.response?.status)return async function executeERC721Withdrawal(G,K,ne,ue){const pe=await getEncodeAssetInfo("asset",xY,ue,{token_id:ne.tokenId,token_address:ne.tokenAddress}),he=Bv.CoreV4.connect(ue.ethConfiguration.coreContractAddress,G),ye=await he.populateTransaction.withdrawNft(K,pe.asset_type,ne.tokenId);return G.sendTransaction(ye)}(K,ne,ue,pe);throw G}))}async function completeERC721WithdrawalAction({ethSigner:G,starkSigner:K,starkPublicKey:ne,token:ue,config:pe},he){await validateChain(G,pe.immutableXConfig);const ye=await G.getAddress(),{v3Balance:me,v4Balance:be}=await async function getWithdrawalBalancesERC721(G,K,ne,ue,pe,he){return new EncodingApi(pe.apiConfiguration),{v3Balance:await getWithdrawalBalanceWorkflow(G,K,ue,0,he,pe),v4Balance:await getWithdrawalBalanceWorkflow(G,ne,ue,0,he,pe)}}(G,ne,ye,{type:xY,tokenAddress:ue.tokenAddress,tokenId:ue.tokenId},pe.immutableXConfig,he);if(!me.isZero()&&!me.isNegative()){return await isRegisteredOnChain(ne,G,pe)?completeERC721Withdrawal(he,G,ne,ue,pe.immutableXConfig):completeERC721RegisterAndWithdrawal(he,G,K,ue,pe.immutableXConfig)}if(!be.isZero()&&!be.isNegative())return completeERC721Withdrawal(he,G,ye,ue,pe.immutableXConfig);throw new Error("No balance to withdraw")}const NY="ETH";async function completeWithdrawal({signers:{ethSigner:G,starkSigner:K},starkPublicKey:ne,token:ue,config:pe}){const he=new wa.MintsApi(pe.immutableXConfig.apiConfiguration);switch(ue.type){case"ETH":return async function completeEthWithdrawalAction({ethSigner:G,starkSigner:K,starkPublicKey:ne,config:ue}){await validateChain(G,ue.immutableXConfig);const{v3Balance:pe,v4Balance:he}=await getWithdrawalBalances(G,ne,await G.getAddress(),{type:NY},ue.immutableXConfig),ye=await getEncodeAssetInfo("asset",NY,ue.immutableXConfig);if(!pe.isZero()&&!pe.isNegative())return await isRegisteredOnChain(ne,G,ue)?executeWithdrawAllFungible(G,ne,ye.asset_type,ue.immutableXConfig):executeRegisterAndWithdrawAllFungible(G,K,ne,ye.asset_type,ue.immutableXConfig);if(!he.isZero()&&!he.isNegative())return executeWithdrawFungible(G,0,ye.asset_type,ue.immutableXConfig);throw new Error("No balance to withdraw")}({ethSigner:G,starkSigner:K,starkPublicKey:ne,config:pe});case"ERC20":return async function completeERC20WithdrawalAction({ethSigner:G,starkSigner:K,starkPublicKey:ne,token:ue,config:pe}){await validateChain(G,pe.immutableXConfig);const{v3Balance:he,v4Balance:ye}=await getWithdrawalBalances(G,ne,await G.getAddress(),{type:OY,tokenAddress:ue.tokenAddress},pe.immutableXConfig),me=await getEncodeAssetInfo("asset",OY,pe.immutableXConfig,{token_address:ue.tokenAddress});if(!he.isZero()&&!he.isNegative())return await isRegisteredOnChain(ne,G,pe)?executeWithdrawAllFungible(G,ne,me.asset_type,pe.immutableXConfig):executeRegisterAndWithdrawAllFungible(G,K,ne,me.asset_type,pe.immutableXConfig);if(!ye.isZero()&&!ye.isNegative())return executeWithdrawFungible(G,0,me.asset_type,pe.immutableXConfig);throw new Error("No balance to withdraw")}({ethSigner:G,starkSigner:K,starkPublicKey:ne,token:ue,config:pe});case"ERC721":return completeERC721WithdrawalAction({ethSigner:G,starkSigner:K,starkPublicKey:ne,token:ue,config:pe},he)}}async function depositEth({signers:{ethSigner:G},deposit:K,config:ne}){await validateChain(G,ne.immutableXConfig);const ue=await G.getAddress(),pe=parseUnits$1(K.amount,"wei"),he=ne.immutableXConfig,ye=new wa.DepositsApi(he.apiConfiguration),me=new wa.EncodingApi(he.apiConfiguration),be={user:ue,token:{type:K.type,data:{decimals:18}},amount:pe.toString()},ve=await ye.getSignableDeposit({getSignableDepositRequest:be});return async function executeDepositEth(G,K,ne,ue,pe,he){const ye=Bv.CoreV4.connect(he.ethConfiguration.coreContractAddress,G),me=await ye.populateTransaction["deposit(uint256,uint256,uint256)"](ue,ne,pe);return G.sendTransaction({...me,value:K})}(G,pe,(await me.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:K.type}}})).data.asset_type,ve.data.stark_key,ve.data.vault_id,he)}async function depositERC20({signers:{ethSigner:G},deposit:K,config:ne}){await validateChain(G,ne.immutableXConfig);const{apiConfiguration:ue,ethConfiguration:pe}=ne.immutableXConfig,he=await G.getAddress(),ye=new wa.TokensApi(ue),me=new wa.DepositsApi(ue),be=new wa.EncodingApi(ue),ve=await ye.getToken({address:K.tokenAddress}),_e={decimals:parseInt(ve.data.decimals),token_address:K.tokenAddress},Te=parseUnits$1(K.amount,0),Ee=Bv.IERC20.connect(K.tokenAddress,G),Pe=await Ee.populateTransaction.approve(pe.coreContractAddress,Te);await G.sendTransaction(Pe);const Se={user:he,token:{type:K.type,data:_e},amount:Te.toString()},Ce=await me.getSignableDeposit({getSignableDepositRequest:Se}),ke=(await be.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:K.type,data:{token_address:K.tokenAddress}}}})).data.asset_type,Oe=Ce.data.stark_key,xe=Ce.data.vault_id;return async function executeDepositERC20(G,K,ne,ue,pe,he){const ye=Bv.CoreV4.connect(he.coreContractAddress,G),me=await ye.populateTransaction.depositERC20(ue,ne,pe,K);return G.sendTransaction(me)}(G,Oi.from(Ce.data.amount),ke,Oe,xe,pe)}async function depositERC721({signers:{ethSigner:G},deposit:K,config:ne}){await validateChain(G,ne.immutableXConfig);const ue=await G.getAddress(),{immutableXConfig:pe}=ne,he=new wa.DepositsApi(pe.apiConfiguration),ye=new wa.EncodingApi(pe.apiConfiguration),me={token_address:K.tokenAddress,token_id:K.tokenId},be={user:ue,token:{type:K.type,data:me},amount:"1".toString()},ve=await he.getSignableDeposit({getSignableDepositRequest:be}),_e=(await ye.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:K.type,data:{token_address:K.tokenAddress,token_id:K.tokenId}}}})).data.asset_type,Te=ve.data.stark_key,Ee=ve.data.vault_id,Pe=Bv.IERC721.connect(K.tokenAddress,G),Se=pe.ethConfiguration.coreContractAddress;return await Pe.isApprovedForAll(ue,Se)||await Pe.setApprovalForAll(Se,!0),async function executeDepositERC721(G,K,ne,ue,pe,he){const ye=Bv.CoreV4.connect(he.ethConfiguration.coreContractAddress,G),me=await ye.populateTransaction.depositNft(ue,ne,pe,K);return G.sendTransaction(me)}(G,K.tokenId,_e,Te,Ee,pe)}class GenericIMXProvider{config;signers;constructor(G,K,ne){this.config=G,this.signers={ethSigner:K,starkSigner:ne}}async getAddress(){return this.signers.ethSigner.getAddress()}async isRegisteredOffchain(){return async function isRegisteredOffchain(G,K){try{const ne=new wa.UsersApi(K.immutableXConfig.apiConfiguration),ue=await ne.getUsers({user:G}),{accounts:pe}=ue.data;return pe?.length>0}catch(G){if(Hr(G)&&404===G.response?.status)return!1;throw G}}(await this.getAddress(),this.config)}registerOffchain(){return async function registerOffchain(G,K){await validateChain(G.ethSigner,K.immutableXConfig);const ne=new wa.UsersApi(K.immutableXConfig.apiConfiguration),ue=await G.ethSigner.getAddress(),pe=await G.starkSigner.getAddress(),he=await ne.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:ue,stark_key:pe}}),{signable_message:ye,payload_hash:me}=he.data,be=await signRaw(ye,G.ethSigner),ve=await G.starkSigner.signMessage(me);return(await ne.registerUser({registerUserRequest:{eth_signature:be,ether_key:ue,stark_signature:ve,stark_key:pe}})).data}(this.signers,this.config)}batchNftTransfer(G){return async function batchTransfer({signers:{ethSigner:G,starkSigner:K},request:ne,config:ue}){await validateChain(G,ue.immutableXConfig);const pe=await G.getAddress(),he=new wa.TransfersApi(ue.immutableXConfig.apiConfiguration),ye=ne.map((G=>({amount:"1",token:convertToSignableToken({type:"ERC721",tokenId:G.tokenId,tokenAddress:G.tokenAddress}),receiver:G.receiver}))),me=await he.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:pe,signable_requests:ye}}),be=me.data.signable_message;if(void 0===be)throw new Error("Invalid response from Signable registration offchain");const ve=await signRaw(be,G),_e=[];for(const G of me.data.signable_responses){const ne=await K.signMessage(G.payload_hash),ue={sender_vault_id:G.sender_vault_id,receiver_stark_key:G.receiver_stark_key,receiver_vault_id:G.receiver_vault_id,asset_id:G.asset_id,amount:G.amount,nonce:G.nonce,expiration_timestamp:G.expiration_timestamp,stark_signature:ne};_e.push(ue)}const Te={sender_stark_key:me.data.sender_stark_key,requests:_e},Ee=await he.createTransfer({createTransferRequestV2:Te,xImxEthAddress:pe,xImxEthSignature:ve});return{transfer_ids:Ee?.data.transfer_ids}}({signers:this.signers,request:G,config:this.config})}cancelOrder(G){return async function cancelOrder({signers:G,request:K,config:ne}){const ue=new wa.OrdersApi(ne.immutableXConfig.apiConfiguration),pe=await ue.getSignableCancelOrderV3({getSignableCancelOrderRequest:{order_id:K.order_id}}),{signable_message:he,payload_hash:ye}=pe.data,me=await signRaw(he,G.ethSigner),be=await G.starkSigner.signMessage(ye),ve=await G.ethSigner.getAddress(),_e=await ue.cancelOrderV3({id:K.order_id.toString(),cancelOrderRequest:{order_id:K.order_id,stark_signature:be},xImxEthAddress:ve,xImxEthSignature:me});return{order_id:_e.data.order_id,status:_e.data.status}}({signers:this.signers,request:G,config:this.config})}completeWithdrawal(G,K){return completeWithdrawal({config:this.config,signers:this.signers,token:K,starkPublicKey:G})}createOrder(G){return async function createOrder({signers:G,request:K,config:ne}){await validateChain(G.ethSigner,ne.immutableXConfig);const ue=await G.ethSigner.getAddress(),pe=new wa.OrdersApi(ne.immutableXConfig.apiConfiguration),he="ERC721"===K.sell.type?"1":K.sell.amount,ye={user:ue,amount_buy:"ERC721"===K.buy.type?"1":K.buy.amount,token_buy:convertToSignableToken(K.buy),amount_sell:he,token_sell:convertToSignableToken(K.sell),fees:K.fees,expiration_timestamp:K.expiration_timestamp},me=await pe.getSignableOrder({getSignableOrderRequestV3:ye}),{signable_message:be,payload_hash:ve}=me.data,_e=await signRaw(be,G.ethSigner),Te=await G.starkSigner.signMessage(ve),Ee=me.data,Pe={createOrderRequest:{amount_buy:Ee.amount_buy,amount_sell:Ee.amount_sell,asset_id_buy:Ee.asset_id_buy,asset_id_sell:Ee.asset_id_sell,expiration_timestamp:Ee.expiration_timestamp,fees:K.fees,nonce:Ee.nonce,stark_key:Ee.stark_key,stark_signature:Te,vault_id_buy:Ee.vault_id_buy,vault_id_sell:Ee.vault_id_sell},xImxEthAddress:ue,xImxEthSignature:_e};return{...(await pe.createOrderV3(Pe)).data}}({signers:this.signers,request:G,config:this.config})}createTrade(G){return async function createTrade({signers:{ethSigner:G,starkSigner:K},request:ne,config:ue}){await validateChain(G,ue.immutableXConfig);const pe=await G.getAddress(),he=new wa.TradesApi(ue.immutableXConfig.apiConfiguration),ye=await he.getSignableTrade({getSignableTradeRequest:{user:pe,order_id:ne.order_id,fees:ne.fees}}),{signable_message:me,payload_hash:be}=ye.data,ve=await signRaw(me,G),_e=await K.signMessage(be);return(await he.createTradeV3({createTradeRequest:{amount_buy:ye.data.amount_buy,amount_sell:ye.data.amount_sell,asset_id_buy:ye.data.asset_id_buy,asset_id_sell:ye.data.asset_id_sell,expiration_timestamp:ye.data.expiration_timestamp,fee_info:ye.data.fee_info,fees:ne.fees,include_fees:!0,nonce:ye.data.nonce,order_id:ne.order_id,stark_key:ye.data.stark_key,vault_id_buy:ye.data.vault_id_buy,vault_id_sell:ye.data.vault_id_sell,stark_signature:_e},xImxEthAddress:pe,xImxEthSignature:ve})).data}({signers:this.signers,request:G,config:this.config})}deposit(G){return async function deposit({signers:G,deposit:K,config:ne}){switch(K.type){case"ETH":return depositEth({signers:G,deposit:K,config:ne});case"ERC20":return depositERC20({signers:G,deposit:K,config:ne});case"ERC721":return depositERC721({signers:G,deposit:K,config:ne})}}({signers:this.signers,deposit:G,config:this.config})}exchangeTransfer(G){return async function exchangeTransfer({signers:G,request:K,config:ne}){await validateChain(G.ethSigner,ne.immutableXConfig);const ue=new wa.ExchangesApi(ne.immutableXConfig.apiConfiguration),pe=await G.ethSigner.getAddress(),he=K.amount,ye=await ue.getExchangeSignableTransfer({id:K.transactionID,getSignableTransferRequest:{sender:pe,token:convertToSignableToken(K),amount:he,receiver:K.receiver}}),{signable_message:me,payload_hash:be}=ye.data,ve=await signRaw(me,G.ethSigner),_e=await G.starkSigner.signMessage(be),Te={sender_stark_key:ye.data.sender_stark_key,sender_vault_id:ye.data.sender_vault_id,receiver_stark_key:ye.data.receiver_stark_key,receiver_vault_id:ye.data.receiver_vault_id,asset_id:ye.data.asset_id,amount:ye.data.amount,nonce:ye.data.nonce,expiration_timestamp:ye.data.expiration_timestamp,stark_signature:_e},Ee=await ue.createExchangeTransfer({id:K.transactionID,createTransferRequest:Te,xImxEthAddress:pe,xImxEthSignature:ve});return{sent_signature:Ee?.data.sent_signature,status:Ee?.data.status?.toString(),time:Ee?.data.time,transfer_id:Ee?.data.transfer_id}}({signers:this.signers,request:G,config:this.config})}async isRegisteredOnchain(){return isRegisteredOnChain(await this.signers.starkSigner.getAddress(),this.signers.ethSigner,this.config)}prepareWithdrawal(G){return async function prepareWithdrawal({signers:G,withdrawal:K,config:ne}){const ue=new wa.WithdrawalsApi(ne.immutableXConfig.apiConfiguration);return prepareWithdrawalAction({signers:G,config:ne.immutableXConfig,...K},ue)}({signers:this.signers,withdrawal:G,config:this.config})}transfer(G){return async function transfer({signers:{ethSigner:G,starkSigner:K},request:ne,config:ue}){await validateChain(G,ue.immutableXConfig);const pe=await G.getAddress(),he=new wa.TransfersApi(ue.immutableXConfig.apiConfiguration),ye="ERC721"===ne.type?"1":ne.amount,me=await he.getSignableTransferV1({getSignableTransferRequest:{sender:pe,token:convertToSignableToken(ne),amount:ye,receiver:ne.receiver}}),{signable_message:be,payload_hash:ve}=me.data,_e=await signRaw(be,G),Te=await K.signMessage(ve),Ee={sender_stark_key:me.data.sender_stark_key,sender_vault_id:me.data.sender_vault_id,receiver_stark_key:me.data.receiver_stark_key,receiver_vault_id:me.data.receiver_vault_id,asset_id:me.data.asset_id,amount:me.data.amount,nonce:me.data.nonce,expiration_timestamp:me.data.expiration_timestamp,stark_signature:Te},Pe=await he.createTransferV1({createTransferRequest:Ee,xImxEthAddress:pe,xImxEthSignature:_e});return{sent_signature:Pe?.data.sent_signature,status:Pe?.data.status?.toString(),time:Pe?.data.time,transfer_id:Pe?.data.transfer_id}}({signers:this.signers,request:G,config:this.config})}}const MY={SWITCH_CHAIN:"wallet_switchEthereumChain",CONNECT:"eth_requestAccounts"};const BY="The Metamask provider was not found";async function connect$1({chainID:G}){const K=await oZ();if(!function isRequestableProvider(G){return!!G?.request}(K))throw new Error(BY);return await async function connectProvider(G,K){await G.request({method:MY.CONNECT}),K&&await G.request({method:MY.SWITCH_CHAIN,params:[{chainId:`0x${K.toString(16)}`}]})}(K,G),new Web3Provider(K)}const FY="message";var DY,LY;function postRequestMessage(G,K){G&&G.contentWindow&&G.contentWindow.postMessage(K,new URL(G.src).origin)}function messageResponseListener(G,K,ne,ue){if(G&&K.source!==G.contentWindow)return;const pe=K.data;pe.type===ne&&ue(pe.details)}!function(G){G.GET_CONNECTION_REQUEST="GET_CONNECTION_REQUEST",G.CONNECT_WALLET_REQUEST="CONNECT_WALLET_REQUEST",G.SIGN_MESSAGE_REQUEST="SIGN_MESSAGE_REQUEST",G.DISCONNECT_WALLET_REQUEST="DISCONNECT_WALLET_REQUEST",G.GET_Y_COORDINATE_REQUEST="GET_Y_COORDINATE_REQUEST"}(DY||(DY={})),function(G){G.CONNECT_WALLET_RESPONSE="CONNECT_WALLET_RESPONSE",G.SIGN_MESSAGE_RESPONSE="SIGN_MESSAGE_RESPONSE",G.GET_CONNECTION_RESPONSE="GET_CONNECTION_RESPONSE",G.DISCONNECT_WALLET_RESPONSE="DISCONNECT_WALLET_RESPONSE",G.GET_Y_COORDINATE_RESPONSE="GET_Y_COORDINATE_RESPONSE"}(LY||(LY={}));class ImxSigner{publicAddress;iframe;constructor(G,K){this.publicAddress=G,this.iframe=K}getAddress(){return this.publicAddress}signMessage(G){return new Promise(((K,ne)=>{const listener=G=>{messageResponseListener(this.iframe,G,LY.SIGN_MESSAGE_RESPONSE,(G=>{window.removeEventListener(FY,listener),G.success||ne(new Error(G.error?.message)),K(G.data.signedMessage)}))};window.addEventListener(FY,listener),postRequestMessage(this.iframe,{type:DY.SIGN_MESSAGE_REQUEST,details:{starkPublicKey:this.publicAddress,message:G}})}))}getIFrame(){return this.iframe}getYCoordinate(){return new Promise(((G,K)=>{const listener=ne=>{messageResponseListener(this.iframe,ne,LY.GET_Y_COORDINATE_RESPONSE,(ne=>{window.removeEventListener(FY,listener),ne.success||K(new Error(ne.error?.message)),G(ne.data.yCoordinate)}))};window.addEventListener(FY,listener),postRequestMessage(this.iframe,{type:DY.GET_Y_COORDINATE_REQUEST,details:{starkPublicKey:this.publicAddress}})}))}}const UY="imx-wallet-app",$Y={[Jn.SANDBOX]:"https://wallets.sandbox.immutable.com",[Jn.PRODUCTION]:"https://wallets.immutable.com"},qY="display: none;";async function getOrSetupIFrame(G){const K=function getIFrame(){return document.querySelector(`iframe#${UY}`)}();return K||await async function setupIFrame(G){return new Promise((K=>{const ne=document.createElement("iframe");ne.setAttribute("id",UY),ne.setAttribute("src",$Y[G]),ne.setAttribute("style",qY),document.body.appendChild(ne),ne.onload=()=>K(ne)}))}(G)}var GY;!function(G){G.PROVIDER_CONNECTION_ERROR="PROVIDER_CONNECTION_ERROR",G.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR"}(GY||(GY={}));class ProviderError extends Error{type;constructor(G,K){super(G),this.type=K}}const withProviderError=async(G,K)=>{try{return await G()}catch(G){const ne=K.message||`${G.message}`||"UnknownError";throw new ProviderError(ne,K.type)}};class MetaMaskIMXProvider extends GenericIMXProvider{static imxSigner;static async connect(G){return await withProviderError((async()=>{const K=await connect$1({chainID:G.immutableXConfig.ethConfiguration.chainID});return this.imxSigner=await async function connect(G,K){const ne=G.getSigner(),ue=await ne.getAddress(),pe=await ne.signMessage("Only sign this request if you’ve initiated an action with Immutable X."),he=await getOrSetupIFrame(K);return new Promise(((G,K)=>{const listener=ne=>{messageResponseListener(he,ne,LY.CONNECT_WALLET_RESPONSE,(ne=>{window.removeEventListener(FY,listener),ne.success||K(new Error("The L2 IMX Wallet connection has failed")),G(new ImxSigner(ne.data.starkPublicKey,he))}))};window.addEventListener(FY,listener),postRequestMessage(he,{type:DY.CONNECT_WALLET_REQUEST,details:{ethAddress:ue,signature:pe}})}))}(K,G.baseConfig.environment),new MetaMaskIMXProvider(G,K.getSigner(),this.imxSigner)}),{type:GY.WALLET_CONNECTION_ERROR})}static async disconnect(){if(!this.imxSigner)throw new ProviderError("Attempted to disconnect from the MetaMask IMX provider without an established connection",GY.PROVIDER_CONNECTION_ERROR);return withProviderError((async()=>{await async function disconnect(G){const K=G.getIFrame();return new Promise(((ne,ue)=>{const listener=G=>{messageResponseListener(K,G,LY.DISCONNECT_WALLET_RESPONSE,(G=>{window.removeEventListener(FY,listener),!G.success&&G.error&&ue(G.error),K.remove(),ne()}))};window.addEventListener(FY,listener),postRequestMessage(K,{type:DY.DISCONNECT_WALLET_REQUEST,details:{starkPublicKey:G.getAddress()}})}))}(this.imxSigner)}),{type:GY.PROVIDER_CONNECTION_ERROR})}static async signMessage(G){if(!this.imxSigner)throw new ProviderError("Attempted to sign a message with the MetaMask IMX provider without an established connection",GY.PROVIDER_CONNECTION_ERROR);return withProviderError((async()=>await this.imxSigner.signMessage(G)),{type:GY.PROVIDER_CONNECTION_ERROR})}}var jY=Object.freeze({__proto__:null,ApiConfiguration:ApiConfiguration,AssetsApi:AssetsApi,BalancesApi:BalancesApi,CollectionsApi:CollectionsApi,Contracts:Bv,DepositsApi:DepositsApi,EncodingApi:EncodingApi,get Environment(){return Jn},EthSigner:Qo,ExchangesApi:ExchangesApi,GenericIMXProvider:GenericIMXProvider,IMXClient:IMXClient,IMXError:IMXError,ImmutableConfiguration:ImmutableConfiguration,ImmutableX:class ImmutableX extends IMXClient{},ImxConfiguration:ImxConfiguration,MetaMaskIMXProvider:MetaMaskIMXProvider,MetadataApi:MetadataApi,MetadataRefreshesApi:MetadataRefreshesApi,MetadataSchemaRequestTypeEnum:Fv,MintsApi:MintsApi,NftCheckoutPrimaryApi:NftCheckoutPrimaryApi,OrdersApi:OrdersApi,ProjectsApi:ProjectsApi,ProviderConfiguration:class ProviderConfiguration{immutableXConfig;baseConfig;constructor({baseConfig:G,overrides:K}){if(this.baseConfig=G,K)this.immutableXConfig=K.immutableXConfig;else{const K=new ImxConfiguration({baseConfig:G});this.immutableXConfig=K.immutableXConfig}}},TokensApi:TokensApi,TradesApi:TradesApi,TransfersApi:TransfersApi,UsersApi:UsersApi,WithdrawalsApi:WithdrawalsApi,createConfig:createConfig,createImmutableXConfiguration:createImmutableXConfiguration,createStarkSigner:createStarkSigner,generateLegacyStarkPrivateKey:generateLegacyStarkPrivateKey,generateStarkPrivateKey:function generateStarkPrivateKey(){return grindKey$1(wv.genKeyPair().getPrivate("hex"))},imxClientConfig:G=>{if(!G)throw new Error("configOptions is required");if(-1===Object.values(Jn).indexOf(G.environment))throw new Error(`Invalid environment: ${G.environment}`);return{baseConfig:new ImmutableConfiguration(G)}},imxClientCreateStarkSigner:createStarkSigner,imxClientGenerateLegacyStarkPrivateKey:generateLegacyStarkPrivateKey,production:production,sandbox:sandbox,serializePackedSignature:serializePackedSignature,signRegisterEthAddress:signRegisterEthAddress,starkEcOrder:Sv});G.blockchainData=Ja,G.checkout=kY,G.config=Qn,G.orderbook=nH,G.passport=cP,G.x=jY}));
//# sourceMappingURL=index.browser.js.map
