@snapshot-labs/snapshot.js 0.9.6 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1620,7 +1620,7 @@ var networks = {
1620
1620
  },
1621
1621
  "5": {
1622
1622
  key: "5",
1623
- name: "Ethereum Testnet Goerli",
1623
+ name: "Goerli testnet",
1624
1624
  shortName: "Goerli",
1625
1625
  chainId: 5,
1626
1626
  network: "goerli",
@@ -2891,7 +2891,7 @@ var networks = {
2891
2891
  },
2892
2892
  "11155111": {
2893
2893
  key: "11155111",
2894
- name: "Sepolia",
2894
+ name: "Sepolia testnet",
2895
2895
  shortName: "Sepolia",
2896
2896
  chainId: 11155111,
2897
2897
  network: "sepolia",
@@ -3294,7 +3294,7 @@ var RankedChoiceVoting = /** @class */ (function () {
3294
3294
  });
3295
3295
  };
3296
3296
  RankedChoiceVoting.prototype.getScoresTotal = function () {
3297
- return getScoresMethod(this.votes, this.proposal).reduce(function (a, b) { return a + b; });
3297
+ return this.votes.reduce(function (a, b) { return a + b.balance; }, 0);
3298
3298
  };
3299
3299
  RankedChoiceVoting.prototype.getChoiceString = function () {
3300
3300
  var _this = this;
@@ -1611,7 +1611,7 @@ var networks = {
1611
1611
  },
1612
1612
  "5": {
1613
1613
  key: "5",
1614
- name: "Ethereum Testnet Goerli",
1614
+ name: "Goerli testnet",
1615
1615
  shortName: "Goerli",
1616
1616
  chainId: 5,
1617
1617
  network: "goerli",
@@ -2882,7 +2882,7 @@ var networks = {
2882
2882
  },
2883
2883
  "11155111": {
2884
2884
  key: "11155111",
2885
- name: "Sepolia",
2885
+ name: "Sepolia testnet",
2886
2886
  shortName: "Sepolia",
2887
2887
  chainId: 11155111,
2888
2888
  network: "sepolia",
@@ -3285,7 +3285,7 @@ var RankedChoiceVoting = /** @class */ (function () {
3285
3285
  });
3286
3286
  };
3287
3287
  RankedChoiceVoting.prototype.getScoresTotal = function () {
3288
- return getScoresMethod(this.votes, this.proposal).reduce(function (a, b) { return a + b; });
3288
+ return this.votes.reduce(function (a, b) { return a + b.balance; }, 0);
3289
3289
  };
3290
3290
  RankedChoiceVoting.prototype.getChoiceString = function () {
3291
3291
  var _this = this;
@@ -18,4 +18,4 @@
18
18
  || ${h} === "boolean" || ${o} === null`).assign(l,Xh._`[${o}]`)}}n.else(),u(t),n.endIf(),n.if(Xh._`${l} !== undefined`,(()=>{n.assign(o,l),function({gen:t,parentData:e,parentDataProperty:r},n){t.if(Xh._`${e} !== undefined`,(()=>t.assign(Xh._`${e}[${r}]`,n)))}(t,l)}))}(t,e,h):u(t)}))}return l};const i=new Set(["string","number","integer","boolean","null"]);function o(t,e,n,i=r.Correct){const o=i===r.Correct?Xh.operators.EQ:Xh.operators.NEQ;let s;switch(t){case"null":return Xh._`${e} ${o} null`;case"array":s=Xh._`Array.isArray(${e})`;break;case"object":s=Xh._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a(Xh._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return Xh._`typeof ${e} ${o} ${t}`}return i===r.Correct?s:(0,Xh.not)(s);function a(t=Xh.nil){return(0,Xh.and)(Xh._`typeof ${e} == "number"`,t,n?Xh._`isFinite(${e})`:Xh.nil)}}function s(t,e,r,n){if(1===t.length)return o(t[0],e,r,n);let i;const s=(0,tl.toHash)(t);if(s.array&&s.object){const t=Xh._`typeof ${e} != "object"`;i=s.null?t:Xh._`!${e} || ${t}`,delete s.null,delete s.array,delete s.object}else i=Xh.nil;s.number&&delete s.integer;for(const t in s)i=(0,Xh.and)(i,o(t,e,r,n));return i}e.checkDataType=o,e.checkDataTypes=s;const a={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?Xh._`{type: ${t}}`:Xh._`{type: ${e}}`};function u(t){const e=function(t){const{gen:e,data:r,schema:n}=t,i=(0,tl.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}(t);(0,nl.reportError)(e,a)}e.reportTypeError=u})),ul=u((function(t,e){function r(t,e,r){const{gen:n,compositeRule:i,data:o,opts:s}=t;if(void 0===r)return;const a=Xh._`${o}${(0,Xh.getProperty)(e)}`;if(i)return void(0,tl.checkStrictMode)(t,`default is ignored for: ${a}`);let u=Xh._`${a} === undefined`;"empty"===s.useDefaults&&(u=Xh._`${u} || ${a} === null || ${a} === ""`),n.if(u,Xh._`${a} = ${(0,Xh.stringify)(r)}`)}Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0,e.assignDefaults=function(t,e){const{properties:n,items:i}=t.schema;if("object"===e&&n)for(const e in n)r(t,e,n[e].default);else"array"===e&&Array.isArray(i)&&i.forEach(((e,n)=>r(t,n,e.default)))}})),hl=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;const r=tl;function n(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Xh._`Object.prototype.hasOwnProperty`})}function i(t,e,r){return Xh._`${n(t)}.call(${e}, ${r})`}function o(t,e,r,n){const o=Xh._`${e}${(0,Xh.getProperty)(r)} === undefined`;return n?(0,Xh.or)(o,(0,Xh.not)(i(t,e,r))):o}function s(t){return t?Object.keys(t).filter((t=>"__proto__"!==t)):[]}e.checkReportMissingProp=function(t,e){const{gen:r,data:n,it:i}=t;r.if(o(r,n,e,i.opts.ownProperties),(()=>{t.setParams({missingProperty:Xh._`${e}`},!0),t.error()}))},e.checkMissingProp=function({gen:t,data:e,it:{opts:r}},n,i){return(0,Xh.or)(...n.map((n=>(0,Xh.and)(o(t,e,n,r.ownProperties),Xh._`${i} = ${n}`))))},e.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},e.hasPropFunc=n,e.isOwnProperty=i,e.propertyInData=function(t,e,r,n){const o=Xh._`${e}${(0,Xh.getProperty)(r)} !== undefined`;return n?Xh._`${o} && ${i(t,e,r)}`:o},e.noPropertyInData=o,e.allSchemaProperties=s,e.schemaProperties=function(t,e){return s(e).filter((r=>!(0,tl.alwaysValidSchema)(t,e[r])))},e.callValidateCode=function({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,u,h){const l=h?Xh._`${t}, ${e}, ${n}${i}`:e,c=[[rl.default.instancePath,(0,Xh.strConcat)(rl.default.instancePath,o)],[rl.default.parentData,s.parentData],[rl.default.parentDataProperty,s.parentDataProperty],[rl.default.rootData,rl.default.rootData]];s.opts.dynamicRef&&c.push([rl.default.dynamicAnchors,rl.default.dynamicAnchors]);const f=Xh._`${l}, ${r.object(...c)}`;return u!==Xh.nil?Xh._`${a}.call(${u}, ${f})`:Xh._`${a}(${f})`};const a=Xh._`new RegExp`;e.usePattern=function({gen:t,it:{opts:e}},n){const i=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(n,i);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:Xh._`${"new RegExp"===o.code?a:(0,r.useFunc)(t,o)}(${n}, ${i})`})},e.validateArray=function(t){const{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){const t=e.let("valid",!0);return s((()=>e.assign(t,!1))),t}return e.var(o,!0),s((()=>e.break())),o;function s(i){const s=e.const("len",Xh._`${r}.length`);e.forRange("i",0,s,(r=>{t.subschema({keyword:n,dataProp:r,dataPropType:tl.Type.Num},o),e.if((0,Xh.not)(o),i)}))}},e.validateUnion=function(t){const{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((t=>(0,tl.alwaysValidSchema)(i,t)))&&!i.opts.unevaluated)return;const o=e.let("valid",!1),s=e.name("_valid");e.block((()=>r.forEach(((r,i)=>{const a=t.subschema({keyword:n,schemaProp:i,compositeRule:!0},s);e.assign(o,Xh._`${o} || ${s}`);t.mergeValidEvaluated(a,s)||e.if((0,Xh.not)(o))})))),t.result(o,(()=>t.reset()),(()=>t.error(!0)))}})),ll=u((function(t,e){function r(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,(()=>e.assign(r,Xh._`${n.parentData}[${n.parentDataProperty}]`)))}function n(t,e,r){if(void 0===r)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,Xh.stringify)(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0,e.macroKeywordCode=function(t,e){const{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=t,u=e.macro.call(a.self,o,s,a),h=n(r,i,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);const l=r.name("valid");t.subschema({schema:u,schemaPath:Xh.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:h,compositeRule:!0},l),t.pass(l,(()=>t.error(!0)))},e.funcKeywordCode=function(t,e){var i;const{gen:o,keyword:s,schema:a,parentSchema:u,$data:h,it:l}=t;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(l,e);const c=!h&&e.compile?e.compile.call(l.self,a,u,l):e.validate,f=n(o,s,c),d=o.let("valid");function p(r=(e.async?Xh._`await `:Xh.nil)){const n=l.opts.passContext?rl.default.this:rl.default.self,i=!("compile"in e&&!h||!1===e.schema);o.assign(d,Xh._`${r}${(0,hl.callValidateCode)(t,f,n,i)}`,e.modifying)}function m(t){var r;o.if((0,Xh.not)(null!==(r=e.valid)&&void 0!==r?r:d),t)}t.block$data(d,(function(){if(!1===e.errors)p(),e.modifying&&r(t),m((()=>t.error()));else{const n=e.async?function(){const t=o.let("ruleErrs",null);return o.try((()=>p(Xh._`await `)),(e=>o.assign(d,!1).if(Xh._`${e} instanceof ${l.ValidationError}`,(()=>o.assign(t,Xh._`${e}.errors`)),(()=>o.throw(e))))),t}():function(){const t=Xh._`${f}.errors`;return o.assign(t,null),p(Xh.nil),t}();e.modifying&&r(t),m((()=>function(t,e){const{gen:r}=t;r.if(Xh._`Array.isArray(${e})`,(()=>{r.assign(rl.default.vErrors,Xh._`${rl.default.vErrors} === null ? ${e} : ${rl.default.vErrors}.concat(${e})`).assign(rl.default.errors,Xh._`${rl.default.vErrors}.length`),(0,nl.extendErrors)(t)}),(()=>t.error()))}(t,n)))}})),t.ok(null!==(i=e.valid)&&void 0!==i?i:d)},e.validSchemaType=function(t,e,r=!1){return!e.length||e.some((e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||r&&void 0===t))},e.validateKeywordUsage=function({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some((e=>!Object.prototype.hasOwnProperty.call(t,e))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema){if(!i.validateSchema(t[o])){const t=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);r.logger.error(t)}}}})),cl=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0,e.getSubschema=function(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(void 0!==e&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==e){const n=t.schema[e];return void 0===r?{schema:n,schemaPath:Xh._`${t.schemaPath}${(0,Xh.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:n[r],schemaPath:Xh._`${t.schemaPath}${(0,Xh.getProperty)(e)}${(0,Xh.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,tl.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===s)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=e;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:s}=e;u(a.let("data",Xh._`${e.data}${(0,Xh.getProperty)(r)}`,!0)),t.errorPath=Xh.str`${i}${(0,tl.getErrorPath)(r,n,s.jsPropertySyntax)}`,t.parentDataProperty=Xh._`${r}`,t.dataPathArr=[...o,t.parentDataProperty]}if(void 0!==i){u(i instanceof Xh.Name?i:a.let("data",i,!0)),void 0!==s&&(t.propertyName=s)}function u(r){t.data=r,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,r]}o&&(t.dataTypes=o)},e.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(t.compositeRule=n),void 0!==i&&(t.createErrors=i),void 0!==o&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}})),fl=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},dl=u((function(t){var e=t.exports=function(t,e,n){"function"==typeof e&&(n=e,e={}),r(e,"function"==typeof(n=e.cb||n)?n:n.pre||function(){},n.post||function(){},t,"",t)};function r(t,n,i,o,s,a,u,h,l,c){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in n(o,s,a,u,h,l,c),o){var d=o[f];if(Array.isArray(d)){if(f in e.arrayKeywords)for(var p=0;p<d.length;p++)r(t,n,i,d[p],s+"/"+f+"/"+p,a,s,f,o,p)}else if(f in e.propsKeywords){if(d&&"object"==typeof d)for(var m in d)r(t,n,i,d[m],s+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,f,o,m)}else(f in e.keywords||t.allKeys&&!(f in e.skipKeywords))&&r(t,n,i,d,s+"/"+f,a,s,f,o)}i(o,s,a,u,h,l,c)}}e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}})),pl=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;const r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!i(t):!!e&&o(t)<=e)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(t){for(const e in t){if(n.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(i))return!0;if("object"==typeof r&&i(r))return!0}return!1}function o(t){let e=0;for(const n in t){if("$ref"===n)return 1/0;if(e++,!r.has(n)&&("object"==typeof t[n]&&(0,tl.eachItem)(t[n],(t=>e+=o(t))),e===1/0))return 1/0}return e}function s(t,e="",r){!1!==r&&(e=h(e));const n=t.parse(e);return a(t,n)}function a(t,e){return t.serialize(e).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=a;const u=/#\/?$/;function h(t){return t?t.replace(u,""):""}e.normalizeId=h,e.resolveUrl=function(t,e,r){return r=h(r),t.resolve(e,r)};const l=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(t,e){if("boolean"==typeof t)return{};const{schemaId:r,uriResolver:n}=this.opts,i=h(t[r]||e),o={"":i},a=s(n,i,!1),u={},c=new Set;return dl(t,{allKeys:!0},((t,e,n,i)=>{if(void 0===i)return;const s=a+e;let p=o[i];function m(e){const r=this.opts.uriResolver.resolve;if(e=h(p?r(p,e):e),c.has(e))throw d(e);c.add(e);let n=this.refs[e];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?f(t,n.schema,e):e!==h(s)&&("#"===e[0]?(f(t,u[e],e),u[e]=t):this.refs[e]=s),e}function g(t){if("string"==typeof t){if(!l.test(t))throw new Error(`invalid anchor "${t}"`);m.call(this,`#${t}`)}}"string"==typeof t[r]&&(p=m.call(this,t[r])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),o[e]=p})),u;function f(t,e,r){if(void 0!==e&&!fl(t,e))throw d(r)}function d(t){return new Error(`reference "${t}" resolves to more than one schema`)}}})),ml=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;const r=al;function n({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,Xh._`${rl.default.data}, ${rl.default.valCxt}`,n.$async,(()=>{t.code(Xh._`"use strict"; ${i(r,o)}`),function(t,e){t.if(rl.default.valCxt,(()=>{t.var(rl.default.instancePath,Xh._`${rl.default.valCxt}.${rl.default.instancePath}`),t.var(rl.default.parentData,Xh._`${rl.default.valCxt}.${rl.default.parentData}`),t.var(rl.default.parentDataProperty,Xh._`${rl.default.valCxt}.${rl.default.parentDataProperty}`),t.var(rl.default.rootData,Xh._`${rl.default.valCxt}.${rl.default.rootData}`),e.dynamicRef&&t.var(rl.default.dynamicAnchors,Xh._`${rl.default.valCxt}.${rl.default.dynamicAnchors}`)}),(()=>{t.var(rl.default.instancePath,Xh._`""`),t.var(rl.default.parentData,Xh._`undefined`),t.var(rl.default.parentDataProperty,Xh._`undefined`),t.var(rl.default.rootData,rl.default.data),e.dynamicRef&&t.var(rl.default.dynamicAnchors,Xh._`{}`)}))}(t,o),t.code(s)})):t.func(e,Xh._`${rl.default.data}, ${function(t){return Xh._`{${rl.default.instancePath}="", ${rl.default.parentData}, ${rl.default.parentDataProperty}, ${rl.default.rootData}=${rl.default.data}${t.dynamicRef?Xh._`, ${rl.default.dynamicAnchors}={}`:Xh.nil}}={}`}(o)}`,n.$async,(()=>t.code(i(r,o)).code(s)))}function i(t,e){const r="object"==typeof t&&t[e.schemaId];return r&&(e.code.source||e.code.process)?Xh._`/*# sourceURL=${r} */`:Xh.nil}function o(t,e){a(t)&&(u(t),s(t))?function(t,e){const{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&l(t);(function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,pl.resolveUrl)(t.opts.uriResolver,t.baseId,e))})(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const o=n.const("_errs",rl.default.errors);h(t,o),n.var(e,Xh._`${o} === ${rl.default.errors}`)}(t,e):(0,il.boolOrEmptySchema)(t,e)}function s({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function a(t){return"boolean"!=typeof t.schema}function u(t){(0,tl.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,tl.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(t)}function h(t,e){if(t.opts.jtd)return c(t,[],!1,e);const r=(0,al.getSchemaTypes)(t.schema);c(t,r,!(0,al.coerceAndCheckDataType)(t,r),e)}function l({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)t.code(Xh._`${rl.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Xh.str`${n}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code(Xh._`${rl.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function c(t,e,n,i){const{gen:o,schema:s,data:a,allErrors:u,opts:h,self:l}=t,{RULES:c}=l;function g(l){(0,sl.shouldUseGroup)(s,l)&&(l.type?(o.if((0,r.checkDataType)(l.type,a,h.strictNumbers)),f(t,l),1===e.length&&e[0]===l.type&&n&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):f(t,l),u||o.if(Xh._`${rl.default.errors} === ${i||0}`))}!s.$ref||!h.ignoreKeywordsWithRef&&(0,tl.schemaHasRulesButRef)(s,c)?(h.jtd||function(t,e){if(t.schemaEnv.meta||!t.opts.strictTypes)return;(function(t,e){if(!e.length)return;if(!t.dataTypes.length)return void(t.dataTypes=e);e.forEach((e=>{p(t.dataTypes,e)||m(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)})),t.dataTypes=t.dataTypes.filter((t=>p(e,t)))})(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&m(t,"use allowUnionTypes to allow union type keyword")}(t,e);!function(t,e){const r=t.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,sl.shouldUseRule)(t.schema,i)){const{type:r}=i.definition;r.length&&!r.some((t=>d(e,t)))&&m(t,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes)}(t,e),o.block((()=>{for(const t of c.rules)g(t);g(c.post)}))):o.block((()=>y(t,"$ref",c.all.$ref.definition)))}function f(t,e){const{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,ul.assignDefaults)(t,e.type),r.block((()=>{for(const r of e.rules)(0,sl.shouldUseRule)(n,r)&&y(t,r.keyword,r.definition,e.type)}))}function d(t,e){return t.includes(e)||"number"===e&&t.includes("integer")}function p(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function m(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,tl.checkStrictMode)(t,e,t.opts.strictTypes)}e.validateFunctionCode=function(t){a(t)&&(u(t),s(t))?function(t){const{schema:e,opts:r,gen:i}=t;n(t,(()=>{r.$comment&&e.$comment&&l(t),function(t){const{schema:e,opts:r}=t;void 0!==e.default&&r.useDefaults&&r.strictSchema&&(0,tl.checkStrictMode)(t,"default is ignored in the schema root")}(t),i.let(rl.default.vErrors,null),i.let(rl.default.errors,0),r.unevaluated&&function(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",Xh._`${r}.evaluated`),e.if(Xh._`${t.evaluated}.dynamicProps`,(()=>e.assign(Xh._`${t.evaluated}.props`,Xh._`undefined`))),e.if(Xh._`${t.evaluated}.dynamicItems`,(()=>e.assign(Xh._`${t.evaluated}.items`,Xh._`undefined`)))}(t),h(t),function(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if(Xh._`${rl.default.errors} === 0`,(()=>e.return(rl.default.data)),(()=>e.throw(Xh._`new ${i}(${rl.default.vErrors})`))):(e.assign(Xh._`${n}.errors`,rl.default.vErrors),o.unevaluated&&function({gen:t,evaluated:e,props:r,items:n}){r instanceof Xh.Name&&t.assign(Xh._`${e}.props`,r);n instanceof Xh.Name&&t.assign(Xh._`${e}.items`,n)}(t),e.return(Xh._`${rl.default.errors} === 0`))}(t)}))}(t):n(t,(()=>(0,il.topBoolOrEmptySchema)(t)))};class g{constructor(t,e,r){if((0,ll.validateKeywordUsage)(t,e,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,tl.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",b(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ll.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",rl.default.errors))}result(t,e,r){this.failResult((0,Xh.not)(t),e,r)}failResult(t,e,r){this.gen.if(t),r?r():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,Xh.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(Xh._`${e} !== undefined && (${(0,Xh.or)(this.invalid$data(),t)})`)}error(t,e,r){if(e)return this.setParams(e),this._error(t,r),void this.setParams({});this._error(t,r)}_error(t,e){(t?nl.reportExtraError:nl.reportError)(this,this.def.error,e)}$dataError(){(0,nl.reportError)(this,this.def.$dataError||nl.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,nl.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,r=Xh.nil){this.gen.block((()=>{this.check$data(t,r),e()}))}check$data(t=Xh.nil,e=Xh.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Xh.or)(Xh._`${n} === undefined`,e)),t!==Xh.nil&&r.assign(t,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==Xh.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:n,def:i,it:o}=this;return(0,Xh.or)(function(){if(n.length){if(!(e instanceof Xh.Name))throw new Error("ajv implementation error");const t=Array.isArray(n)?n:[n];return Xh._`${(0,r.checkDataTypes)(t,e,o.opts.strictNumbers,r.DataType.Wrong)}`}return Xh.nil}(),function(){if(i.validateSchema){const r=t.scopeValue("validate$data",{ref:i.validateSchema});return Xh._`!${r}(${e})`}return Xh.nil}())}subschema(t,e){const r=(0,cl.getSubschema)(this.it,t);(0,cl.extendSubschemaData)(r,this.it,t),(0,cl.extendSubschemaMode)(r,t);const n={...this.it,...r,items:void 0,props:void 0};return o(n,e),n}mergeEvaluated(t,e){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==t.props&&(r.props=tl.mergeEvaluated.props(n,t.props,r.props,e)),!0!==r.items&&void 0!==t.items&&(r.items=tl.mergeEvaluated.items(n,t.items,r.items,e)))}mergeValidEvaluated(t,e){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(e,(()=>this.mergeEvaluated(t,Xh.Name))),!0}}function y(t,e,r,n){const i=new g(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ll.funcKeywordCode)(i,r):"macro"in r?(0,ll.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ll.funcKeywordCode)(i,r)}e.KeywordCxt=g;const v=/^\/(?:[^~]|~0|~1)*$/,w=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function b(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(""===t)return rl.default.rootData;if("/"===t[0]){if(!v.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=rl.default.rootData}else{const s=w.exec(t);if(!s)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=e)throw new Error(u("property/index",a));return n[e-a]}if(a>e)throw new Error(u("data",a));if(o=r[e-a],!i)return o}let s=o;const a=i.split("/");for(const t of a)t&&(o=Xh._`${o}${(0,Xh.getProperty)((0,tl.unescapeJsonPointer)(t))}`,s=Xh._`${s} && ${o}`);return s;function u(t,r){return`Cannot access ${t} ${r} levels up, current level is ${e}`}}e.getData=b}));class gl extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}var yl=gl,vl=Object.defineProperty({default:yl},"__esModule",{value:!0});class wl extends Error{constructor(t,e,r,n){super(n||`can't resolve reference ${r} from id ${e}`),this.missingRef=(0,pl.resolveUrl)(t,e,r),this.missingSchema=(0,pl.normalizeId)((0,pl.getFullPath)(t,this.missingRef))}}var bl=wl,El=Object.defineProperty({default:bl},"__esModule",{value:!0}),Ml=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;class r{constructor(t){var e;let r;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,pl.normalizeId)(null==r?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function n(t){const e=o.call(this,t);if(e)return e;const r=(0,pl.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Xh.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let u;t.$async&&(u=a.scopeValue("Error",{ref:vl.default,code:Xh._`require("ajv/dist/runtime/validation_error").default`}));const h=a.scopeName("validate");t.validateName=h;const l={gen:a,allErrors:this.opts.allErrors,data:rl.default.data,parentData:rl.default.parentData,parentDataProperty:rl.default.parentDataProperty,dataNames:[rl.default.data],dataPathArr:[Xh.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,Xh.stringify)(t.schema)}:{ref:t.schema}),validateName:h,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xh.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:Xh._`""`,opts:this.opts,self:this};let c;try{this._compilations.add(t),(0,ml.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);const e=a.toString();c=`${a.scopeRefs(rl.default.scope)}return ${e}`,this.opts.code.process&&(c=this.opts.code.process(c,t));const r=new Function(`${rl.default.self}`,`${rl.default.scope}`,c)(this,this.scope.get());if(this.scope.value(h,{ref:r}),r.errors=null,r.schema=t.schema,r.schemaEnv=t,t.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:h,validateCode:e,scopeValues:a._values}),this.opts.unevaluated){const{props:t,items:e}=l;r.evaluated={props:t instanceof Xh.Name?void 0:t,items:e instanceof Xh.Name?void 0:e,dynamicProps:t instanceof Xh.Name,dynamicItems:e instanceof Xh.Name},r.source&&(r.source.evaluated=(0,Xh.stringify)(r.evaluated))}return t.validate=r,t}catch(e){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),e}finally{this._compilations.delete(t)}}function i(t){return(0,pl.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:n.call(this,t)}function o(t){for(const n of this._compilations)if(r=t,(e=n).schema===r.schema&&e.root===r.root&&e.baseId===r.baseId)return n;var e,r}function s(t,e){let r;for(;"string"==typeof(r=this.refs[e]);)e=r;return r||this.schemas[e]||a.call(this,t,e)}function a(t,e){const i=this.opts.uriResolver.parse(e),o=(0,pl._getFullPath)(this.opts.uriResolver,i);let s=(0,pl.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===s)return h.call(this,i,t);const u=(0,pl.normalizeId)(o),l=this.refs[u]||this.schemas[u];if("string"==typeof l){const e=a.call(this,t,l);if("object"!=typeof(null==e?void 0:e.schema))return;return h.call(this,i,e)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||n.call(this,l),u===(0,pl.normalizeId)(e)){const{schema:e}=l,{schemaId:n}=this.opts,i=e[n];return i&&(s=(0,pl.resolveUrl)(this.opts.uriResolver,s,i)),new r({schema:e,schemaId:n,root:t,baseId:s})}return h.call(this,i,l)}}e.SchemaEnv=r,e.compileSchema=n,e.resolveRef=function(t,e,n){var o;n=(0,pl.resolveUrl)(this.opts.uriResolver,e,n);const a=t.refs[n];if(a)return a;let u=s.call(this,t,n);if(void 0===u){const i=null===(o=t.localRefs)||void 0===o?void 0:o[n],{schemaId:s}=this.opts;i&&(u=new r({schema:i,schemaId:s,root:t,baseId:e}))}return void 0!==u?t.refs[n]=i.call(this,u):void 0},e.getCompilingSchema=o,e.resolveSchema=a;const u=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(t,{baseId:e,schema:n,root:i}){var o;if("/"!==(null===(o=t.fragment)||void 0===o?void 0:o[0]))return;for(const r of t.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const t=n[(0,tl.unescapeFragment)(r)];if(void 0===t)return;const i="object"==typeof(n=t)&&n[this.opts.schemaId];!u.has(r)&&i&&(e=(0,pl.resolveUrl)(this.opts.uriResolver,e,i))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,tl.schemaHasRulesButRef)(n,this.RULES)){const t=(0,pl.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=a.call(this,i,t)}const{schemaId:h}=this.opts;return s=s||new r({schema:n,schemaId:h,root:i,baseId:e}),s.schema!==s.root.schema?s:void 0}})),_l={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},Al=u((function(t,e){!function(t){function e(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];if(e.length>1){e[0]=e[0].slice(0,-1);for(var n=e.length-1,i=1;i<n;++i)e[i]=e[i].slice(1,-1);return e[n]=e[n].slice(1),e.join("")}return e[0]}function r(t){return"(?:"+t+")"}function n(t){return void 0===t?"undefined":null===t?"null":Object.prototype.toString.call(t).split(" ").pop().split("]").shift().toLowerCase()}function i(t){return t.toUpperCase()}function o(t){return null!=t?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[]}function s(t,e){var r=t;if(e)for(var n in e)r[n]=e[n];return r}function a(t){var n="[A-Za-z]",i="[0-9]",o=e(i,"[A-Fa-f]"),s=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=e("[\\:\\/\\?\\#\\[\\]\\@]",a),h=t?"[\\uE000-\\uF8FF]":"[]",l=e(n,i,"[\\-\\.\\_\\~]",t?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=(r(n+e(n,i,"[\\+\\-\\.]")+"*"),r(r(s+"|"+e(l,a,"[\\:]"))+"*"),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),f=r(c+"\\."+c+"\\."+c+"\\."+c),d=r(o+"{1,4}"),p=r(r(d+"\\:"+d)+"|"+f),m=r(r(d+"\\:")+"{6}"+p),g=r("\\:\\:"+r(d+"\\:")+"{5}"+p),y=r(r(d)+"?\\:\\:"+r(d+"\\:")+"{4}"+p),v=r(r(r(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+r(d+"\\:")+"{3}"+p),w=r(r(r(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+r(d+"\\:")+"{2}"+p),b=r(r(r(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+p),E=r(r(r(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+p),M=r(r(r(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),_=r(r(r(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),A=r([m,g,y,v,w,b,E,M,_].join("|")),k=r(r(l+"|"+s)+"+"),N=(r("[vV]"+o+"+\\."+e(l,a,"[\\:]")+"+"),r(r(s+"|"+e(l,a))+"*"),r(s+"|"+e(l,a,"[\\:\\@]")));return r(r(s+"|"+e(l,a,"[\\@]"))+"+"),r(r(N+"|"+e("[\\/\\?]",h))+"*"),{NOT_SCHEME:new RegExp(e("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",l,a),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",l,a),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",l,a),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",l,a),"g"),NOT_QUERY:new RegExp(e("[^\\%]",l,a,"[\\:\\@\\/\\?]",h),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",l,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",l,a),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",l,u),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+A+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+k+")")+"?\\]?$")}}var u=a(!1),h=a(!0),l=function(){function t(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},f=2147483647,d=36,p=1,m=26,g=38,y=700,v=72,w=128,b="-",E=/^xn--/,M=/[^\0-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=d-p,N=Math.floor,x=String.fromCharCode;function S(t){throw new RangeError(A[t])}function P(t,e){for(var r=[],n=t.length;n--;)r[n]=e(t[n]);return r}function I(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+P((t=t.replace(_,".")).split("."),e).join(".")}function R(t){for(var e=[],r=0,n=t.length;r<n;){var i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=t.charCodeAt(r++);56320==(64512&o)?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),r--)}else e.push(i)}return e}var C=function(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:d},T=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},O=function(t,e,r){var n=0;for(t=r?N(t/y):t>>1,t+=N(t/e);t>k*m>>1;n+=d)t=N(t/k);return N(n+(k+1)*t/(t+g))},B=function(t){var e=[],r=t.length,n=0,i=w,o=v,s=t.lastIndexOf(b);s<0&&(s=0);for(var a=0;a<s;++a)t.charCodeAt(a)>=128&&S("not-basic"),e.push(t.charCodeAt(a));for(var u=s>0?s+1:0;u<r;){for(var h=n,l=1,c=d;;c+=d){u>=r&&S("invalid-input");var g=C(t.charCodeAt(u++));(g>=d||g>N((f-n)/l))&&S("overflow"),n+=g*l;var y=c<=o?p:c>=o+m?m:c-o;if(g<y)break;var E=d-y;l>N(f/E)&&S("overflow"),l*=E}var M=e.length+1;o=O(n-h,M,0==h),N(n/M)>f-i&&S("overflow"),i+=N(n/M),n%=M,e.splice(n++,0,i)}return String.fromCodePoint.apply(String,e)},$=function(t){var e=[],r=(t=R(t)).length,n=w,i=0,o=v,s=!0,a=!1,u=void 0;try{for(var h,l=t[Symbol.iterator]();!(s=(h=l.next()).done);s=!0){var c=h.value;c<128&&e.push(x(c))}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}var g=e.length,y=g;for(g&&e.push(b);y<r;){var E=f,M=!0,_=!1,A=void 0;try{for(var k,P=t[Symbol.iterator]();!(M=(k=P.next()).done);M=!0){var I=k.value;I>=n&&I<E&&(E=I)}}catch(t){_=!0,A=t}finally{try{!M&&P.return&&P.return()}finally{if(_)throw A}}var C=y+1;E-n>N((f-i)/C)&&S("overflow"),i+=(E-n)*C,n=E;var B=!0,$=!1,D=void 0;try{for(var F,U=t[Symbol.iterator]();!(B=(F=U.next()).done);B=!0){var j=F.value;if(j<n&&++i>f&&S("overflow"),j==n){for(var L=i,z=d;;z+=d){var q=z<=o?p:z>=o+m?m:z-o;if(L<q)break;var V=L-q,G=d-q;e.push(x(T(q+V%G,0))),L=N(V/G)}e.push(x(T(L,0))),o=O(i,C,y==g),i=0,++y}}}catch(t){$=!0,D=t}finally{try{!B&&U.return&&U.return()}finally{if($)throw D}}++i,++n}return e.join("")},D=function(t){return I(t,(function(t){return E.test(t)?B(t.slice(4).toLowerCase()):t}))},F=function(t){return I(t,(function(t){return M.test(t)?"xn--"+$(t):t}))},U={version:"2.1.0",ucs2:{decode:R,encode:function(t){return String.fromCodePoint.apply(String,c(t))}},decode:B,encode:$,toASCII:F,toUnicode:D},j={};function L(t){var e=t.charCodeAt(0);return e<16?"%0"+e.toString(16).toUpperCase():e<128?"%"+e.toString(16).toUpperCase():e<2048?"%"+(e>>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function z(t){for(var e="",r=0,n=t.length;r<n;){var i=parseInt(t.substr(r+1,2),16);if(i<128)e+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(t.substr(r+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var s=parseInt(t.substr(r+4,2),16),a=parseInt(t.substr(r+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else e+=t.substr(r,9);r+=9}else e+=t.substr(r,3),r+=3}return e}function q(t,e){function r(t){var r=z(t);return r.match(e.UNRESERVED)?r:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,r).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,r).replace(e.NOT_USERINFO,L).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,r).toLowerCase().replace(e.NOT_HOST,L).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,r).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,L).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,r).replace(e.NOT_QUERY,L).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,r).replace(e.NOT_FRAGMENT,L).replace(e.PCT_ENCODED,i)),t}function V(t){return t.replace(/^0*(.*)/,"$1")||"0"}function G(t,e){var r=t.match(e.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(V).join("."):t}function H(t,e){var r=t.match(e.IPV6ADDRESS)||[],n=l(r,3),i=n[1],o=n[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),u=a[0],h=a[1],c=h?h.split(":").map(V):[],f=u.split(":").map(V),d=e.IPV4ADDRESS.test(f[f.length-1]),p=d?7:8,m=f.length-p,g=Array(p),y=0;y<p;++y)g[y]=c[y]||f[m+y]||"";d&&(g[p-1]=G(g[p-1],e));var v=g.reduce((function(t,e,r){if(!e||"0"===e){var n=t[t.length-1];n&&n.index+n.length===r?n.length++:t.push({index:r,length:1})}return t}),[]),w=v.sort((function(t,e){return e.length-t.length}))[0],b=void 0;if(w&&w.length>1){var E=g.slice(0,w.index),M=g.slice(w.index+w.length);b=E.join(":")+"::"+M.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return t}var K=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Q=void 0==="".match(/(){0}/)[1];function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==e.iri?h:u;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(K);if(i){Q?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==t.indexOf("@")?i[3]:void 0,r.host=-1!==t.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==t.indexOf("?")?i[7]:void 0,r.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=H(G(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==r.reference&&(r.error=r.error||"URI is not a "+e.reference+" reference.");var o=j[(e.scheme||r.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(e.domainHost||o&&o.domainHost))try{r.host=U.toASCII(r.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(t){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+t}q(r,u)}o&&o.parse&&o.parse(r,e)}else r.error=r.error||"URI can not be parsed.";return r}function Y(t,e){var r=!1!==e.iri?h:u,n=[];return void 0!==t.userinfo&&(n.push(t.userinfo),n.push("@")),void 0!==t.host&&n.push(H(G(String(t.host),r),r).replace(r.IPV6ADDRESS,(function(t,e,r){return"["+e+(r?"%25"+r:"")+"]"}))),"number"!=typeof t.port&&"string"!=typeof t.port||(n.push(":"),n.push(String(t.port))),n.length?n.join(""):void 0}var Z=/^\.\.?\//,W=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,tt=/^\/?(?:.|\n)*?(?=\/|$)/;function et(t){for(var e=[];t.length;)if(t.match(Z))t=t.replace(Z,"");else if(t.match(W))t=t.replace(W,"/");else if(t.match(X))t=t.replace(X,"/"),e.pop();else if("."===t||".."===t)t="";else{var r=t.match(tt);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];t=t.slice(n.length),e.push(n)}return e.join("")}function rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.iri?h:u,n=[],i=j[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(r.IPV6ADDRESS.test(t.host));else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?U.toUnicode(t.host):U.toASCII(t.host.replace(r.PCT_ENCODED,z).toLowerCase())}catch(r){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+r}q(t,r),"suffix"!==e.reference&&t.scheme&&(n.push(t.scheme),n.push(":"));var o=Y(t,e);if(void 0!==o&&("suffix"!==e.reference&&n.push("//"),n.push(o),t.path&&"/"!==t.path.charAt(0)&&n.push("/")),void 0!==t.path){var s=t.path;e.absolutePath||i&&i.absolutePath||(s=et(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==t.query&&(n.push("?"),n.push(t.query)),void 0!==t.fragment&&(n.push("#"),n.push(t.fragment)),n.join("")}function nt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(t=J(rt(t,r),r),e=J(rt(e,r),r)),!(r=r||{}).tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=et(e.path||""),n.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=et(e.path||""),n.query=e.query):(e.path?("/"===e.path.charAt(0)?n.path=et(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path:n.path="/"+e.path,n.path=et(n.path)),n.query=e.query):(n.path=t.path,void 0!==e.query?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function it(t,e,r){var n=s({scheme:"null"},r);return rt(nt(J(t,n),J(e,n),n,!0),n)}function ot(t,e){return"string"==typeof t?t=rt(J(t,e),e):"object"===n(t)&&(t=J(rt(t,e),e)),t}function st(t,e,r){return"string"==typeof t?t=rt(J(t,r),r):"object"===n(t)&&(t=rt(t,r)),"string"==typeof e?e=rt(J(e,r),r):"object"===n(e)&&(e=rt(e,r)),t===e}function at(t,e){return t&&t.toString().replace(e&&e.iri?h.ESCAPE:u.ESCAPE,L)}function ut(t,e){return t&&t.toString().replace(e&&e.iri?h.PCT_ENCODED:u.PCT_ENCODED,z)}var ht={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){var r="https"===String(t.scheme).toLowerCase();return t.port!==(r?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},lt={scheme:"https",domainHost:ht.domainHost,parse:ht.parse,serialize:ht.serialize};function ct(t){return"boolean"==typeof t.secure?t.secure:"wss"===String(t.scheme).toLowerCase()}var ft={scheme:"ws",domainHost:!0,parse:function(t,e){var r=t;return r.secure=ct(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(t,e){if(t.port!==(ct(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){var r=t.resourceName.split("?"),n=l(r,2),i=n[0],o=n[1];t.path=i&&"/"!==i?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},dt={scheme:"wss",domainHost:ft.domainHost,parse:ft.parse,serialize:ft.serialize},pt={},mt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",gt="[0-9A-Fa-f]",yt=r(r("%[EFef]"+gt+"%"+gt+gt+"%"+gt+gt)+"|"+r("%[89A-Fa-f]"+gt+"%"+gt+gt)+"|"+r("%"+gt+gt)),vt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",wt=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),bt="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Et=new RegExp(mt,"g"),Mt=new RegExp(yt,"g"),_t=new RegExp(e("[^]",vt,"[\\.]",'[\\"]',wt),"g"),At=new RegExp(e("[^]",mt,bt),"g"),kt=At;function Nt(t){var e=z(t);return e.match(Et)?e:t}var xt={scheme:"mailto",parse:function(t,e){var r=t,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},s=r.query.split("&"),a=0,u=s.length;a<u;++a){var h=s[a].split("=");switch(h[0]){case"to":for(var l=h[1].split(","),c=0,f=l.length;c<f;++c)n.push(l[c]);break;case"subject":r.subject=ut(h[1],e);break;case"body":r.body=ut(h[1],e);break;default:i=!0,o[ut(h[0],e)]=ut(h[1],e)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,p=n.length;d<p;++d){var m=n[d].split("@");if(m[0]=ut(m[0]),e.unicodeSupport)m[1]=ut(m[1],e).toLowerCase();else try{m[1]=U.toASCII(ut(m[1],e).toLowerCase())}catch(t){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+t}n[d]=m.join("@")}return r},serialize:function(t,e){var r=t,n=o(t.to);if(n){for(var s=0,a=n.length;s<a;++s){var u=String(n[s]),h=u.lastIndexOf("@"),l=u.slice(0,h).replace(Mt,Nt).replace(Mt,i).replace(_t,L),c=u.slice(h+1);try{c=e.iri?U.toUnicode(c):U.toASCII(ut(c,e).toLowerCase())}catch(t){r.error=r.error||"Email address's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+t}n[s]=l+"@"+c}r.path=n.join(",")}var f=t.headers=t.headers||{};t.subject&&(f.subject=t.subject),t.body&&(f.body=t.body);var d=[];for(var p in f)f[p]!==pt[p]&&d.push(p.replace(Mt,Nt).replace(Mt,i).replace(At,L)+"="+f[p].replace(Mt,Nt).replace(Mt,i).replace(kt,L));return d.length&&(r.query=d.join("&")),r}},St=/^([^\:]+)\:(.*)/,Pt={scheme:"urn",parse:function(t,e){var r=t.path&&t.path.match(St),n=t;if(r){var i=e.scheme||n.scheme||"urn",o=r[1].toLowerCase(),s=r[2],a=i+":"+(e.nid||o),u=j[a];n.nid=o,n.nss=s,n.path=void 0,u&&(n=u.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(t,e){var r=e.scheme||t.scheme||"urn",n=t.nid,i=r+":"+(e.nid||n),o=j[i];o&&(t=o.serialize(t,e));var s=t,a=t.nss;return s.path=(n||e.nid)+":"+a,s}},It=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Rt={scheme:"urn:uuid",parse:function(t,e){var r=t;return r.uuid=r.nss,r.nss=void 0,e.tolerant||r.uuid&&r.uuid.match(It)||(r.error=r.error||"UUID is not valid."),r},serialize:function(t,e){var r=t;return r.nss=(t.uuid||"").toLowerCase(),r}};j[ht.scheme]=ht,j[lt.scheme]=lt,j[ft.scheme]=ft,j[dt.scheme]=dt,j[xt.scheme]=xt,j[Pt.scheme]=Pt,j[Rt.scheme]=Rt,t.SCHEMES=j,t.pctEncChar=L,t.pctDecChars=z,t.parse=J,t.removeDotSegments=et,t.serialize=rt,t.resolveComponents=nt,t.resolve=it,t.normalize=ot,t.equal=st,t.escapeComponent=at,t.unescapeComponent=ut,Object.defineProperty(t,"__esModule",{value:!0})}(e)}));Al.code='require("ajv/dist/runtime/uri").default';var kl=Al,Nl=Object.defineProperty({default:kl},"__esModule",{value:!0}),xl=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}});const r=Xh,n=(t,e)=>new RegExp(t,e);n.code="new RegExp";const i=["removeAdditional","useDefaults","coerceTypes"],o=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),s={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},a={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function u(t){var e,r,i,o,s,a,u,h,l,c,f,d,p,m,g,y,v,w,b,E,M,_,A,k,N;const x=t.strict,S=null===(e=t.code)||void 0===e?void 0:e.optimize,P=!0===S||void 0===S?1:S||0,I=null!==(i=null===(r=t.code)||void 0===r?void 0:r.regExp)&&void 0!==i?i:n,R=null!==(o=t.uriResolver)&&void 0!==o?o:Nl.default;return{strictSchema:null===(a=null!==(s=t.strictSchema)&&void 0!==s?s:x)||void 0===a||a,strictNumbers:null===(h=null!==(u=t.strictNumbers)&&void 0!==u?u:x)||void 0===h||h,strictTypes:null!==(c=null!==(l=t.strictTypes)&&void 0!==l?l:x)&&void 0!==c?c:"log",strictTuples:null!==(d=null!==(f=t.strictTuples)&&void 0!==f?f:x)&&void 0!==d?d:"log",strictRequired:null!==(m=null!==(p=t.strictRequired)&&void 0!==p?p:x)&&void 0!==m&&m,code:t.code?{...t.code,optimize:P,regExp:I}:{optimize:P,regExp:I},loopRequired:null!==(g=t.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(y=t.loopEnum)&&void 0!==y?y:200,meta:null===(v=t.meta)||void 0===v||v,messages:null===(w=t.messages)||void 0===w||w,inlineRefs:null===(b=t.inlineRefs)||void 0===b||b,schemaId:null!==(E=t.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(M=t.addUsedSchema)||void 0===M||M,validateSchema:null===(_=t.validateSchema)||void 0===_||_,validateFormats:null===(A=t.validateFormats)||void 0===A||A,unicodeRegExp:null===(k=t.unicodeRegExp)||void 0===k||k,int32range:null===(N=t.int32range)||void 0===N||N,uriResolver:R}}class h{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...u(t)};const{es5:e,lines:n}=this.opts.code;this.scope=new r.ValueScope({scope:{},prefixes:o,es5:e,lines:n}),this.logger=function(t){if(!1===t)return g;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,ol.getRules)(),l.call(this,s,t,"NOT SUPPORTED"),l.call(this,a,t,"DEPRECATED","warn"),this._metaOpts=m.call(this),t.formats&&d.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&p.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),f.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:r}=this.opts;let n=_l;"id"===r&&(n={..._l},n.id=n.$id,delete n.$id),e&&t&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let r;if("string"==typeof t){if(r=this.getSchema(t),!r)throw new Error(`no schema with key or ref "${t}"`)}else r=this.compile(t);const n=r(e);return"$async"in r||(this.errors=r.errors),n}compile(t,e){const r=this._addSchema(t,e);return r.validate||this._compileSchemaEnv(r)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,t,e);async function n(t,e){await i.call(this,t.$schema);const r=this._addSchema(t,e);return r.validate||o.call(this,r)}async function i(t){t&&!this.getSchema(t)&&await n.call(this,{$ref:t},!0)}async function o(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof El.default))throw e;return s.call(this,e),await a.call(this,e.missingSchema),o.call(this,t)}}function s({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function a(t){const r=await u.call(this,t);this.refs[t]||await i.call(this,r.$schema),this.refs[t]||this.addSchema(r,t,e)}async function u(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=r(t))}finally{delete this._loading[t]}}}addSchema(t,e,r,n=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,r,n);return this}let i;if("object"==typeof t){const{schemaId:e}=this.opts;if(i=t[e],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${e} must be string`)}return e=(0,pl.normalizeId)(e||i),this._checkUnique(e),this.schemas[e]=this._addSchema(t,r,e,n,!0),this}addMetaSchema(t,e,r=this.opts.validateSchema){return this.addSchema(t,e,!0,r),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let r;if(r=t.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,t);if(!n&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return n}getSchema(t){let e;for(;"string"==typeof(e=c.call(this,t));)t=e;if(void 0===e){const{schemaId:r}=this.opts,n=new Ml.SchemaEnv({schema:{},schemaId:r});if(e=Ml.resolveSchema.call(this,n,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=c.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{const e=t;this._cache.delete(e);let r=t[this.opts.schemaId];return r&&(r=(0,pl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let r;if("string"==typeof t)r=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=r);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(r=(e=t).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(v.call(this,r,e),!e)return(0,tl.eachItem)(r,(t=>w.call(this,t))),this;E.call(this,e);const n={...e,type:(0,al.getJSONTypes)(e.type),schemaType:(0,al.getJSONTypes)(e.schemaType)};return(0,tl.eachItem)(r,0===n.type.length?t=>w.call(this,t,n):t=>n.type.forEach((e=>w.call(this,t,n,e)))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const r of e.rules){const e=r.rules.findIndex((e=>e.keyword===t));e>=0&&r.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:r="data"}={}){return t&&0!==t.length?t.map((t=>`${r}${t.instancePath} ${t.message}`)).reduce(((t,r)=>t+e+r)):"No errors"}$dataMetaSchema(t,e){const r=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const n of e){const e=n.split("/").slice(1);let i=t;for(const t of e)i=i[t];for(const t in r){const e=r[t];if("object"!=typeof e)continue;const{$data:n}=e.definition,o=i[t];n&&o&&(i[t]=_(o))}}return t}_removeAllSchemas(t,e){for(const r in t){const n=t[r];e&&!e.test(r)||("string"==typeof n?delete t[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[r]))}}_addSchema(t,e,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof t)o=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let a=this._cache.get(t);if(void 0!==a)return a;r=(0,pl.normalizeId)(o||r);const u=pl.getSchemaRefs.call(this,t,r);return a=new Ml.SchemaEnv({schema:t,schemaId:s,meta:e,baseId:r,localRefs:u}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(t,!0),a}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Ml.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{Ml.compileSchema.call(this,t)}finally{this.opts=e}}}function l(t,e,r,n="error"){for(const i in t){const o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function c(t){return t=(0,pl.normalizeId)(t),this.schemas[t]||this.refs[t]}function f(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function d(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function p(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}}function m(){const t={...this.opts};for(const e of i)delete t[e];return t}e.default=h,h.ValidationError=vl.default,h.MissingRefError=El.default;const g={log(){},warn(){},error(){}};const y=/^[a-z_$][a-z0-9_$:-]*$/i;function v(t,e){const{RULES:r}=this;if((0,tl.eachItem)(t,(t=>{if(r.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!y.test(t))throw new Error(`Keyword ${t} has invalid name`)})),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function w(t,e,r){var n;const i=null==e?void 0:e.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((({type:t})=>t===r));if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,al.getJSONTypes)(e.type),schemaType:(0,al.getJSONTypes)(e.schemaType)}};e.before?b.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,null===(n=e.implements)||void 0===n||n.forEach((t=>this.addKeyword(t)))}function b(t,e,r){const n=t.rules.findIndex((t=>t.keyword===r));n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function E(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=_(e)),t.validateSchema=this.compile(e,!0))}const M={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _(t){return{anyOf:[t,M]}}}));var Sl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}},Pl=Object.defineProperty({default:Sl},"__esModule",{value:!0}),Il=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;const r={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:o}=t,{baseId:s,schemaEnv:a,validateName:u,opts:h,self:l}=o,{root:c}=a;if(("#"===r||"#/"===r)&&s===c.baseId)return function(){if(a===c)return i(t,u,a,a.$async);const r=e.scopeValue("root",{ref:c});return i(t,Xh._`${r}.validate`,c,c.$async)}();const f=Ml.resolveRef.call(l,c,s,r);if(void 0===f)throw new El.default(o.opts.uriResolver,s,r);return f instanceof Ml.SchemaEnv?function(e){const r=n(t,e);i(t,r,e,e.$async)}(f):function(n){const i=e.scopeValue("schema",!0===h.code.source?{ref:n,code:(0,Xh.stringify)(n)}:{ref:n}),o=e.name("valid"),s=t.subschema({schema:n,dataTypes:[],schemaPath:Xh.nil,topSchemaRef:i,errSchemaPath:r},o);t.mergeEvaluated(s),t.ok(o)}(f)}};function n(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):Xh._`${r.scopeValue("wrapper",{ref:e})}.validate`}function i(t,e,r,n){const{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:u}=o,h=u.passContext?rl.default.this:Xh.nil;function l(t){const e=Xh._`${t}.errors`;i.assign(rl.default.vErrors,Xh._`${rl.default.vErrors} === null ? ${e} : ${rl.default.vErrors}.concat(${e})`),i.assign(rl.default.errors,Xh._`${rl.default.vErrors}.length`)}function c(t){var e;if(!o.opts.unevaluated)return;const n=null===(e=null==r?void 0:r.validate)||void 0===e?void 0:e.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=tl.mergeEvaluated.props(i,n.props,o.props));else{const e=i.var("props",Xh._`${t}.evaluated.props`);o.props=tl.mergeEvaluated.props(i,e,o.props,Xh.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=tl.mergeEvaluated.items(i,n.items,o.items));else{const e=i.var("items",Xh._`${t}.evaluated.items`);o.items=tl.mergeEvaluated.items(i,e,o.items,Xh.Name)}}n?function(){if(!a.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Xh._`await ${(0,hl.callValidateCode)(t,e,h)}`),c(e),s||i.assign(r,!0)}),(t=>{i.if(Xh._`!(${t} instanceof ${o.ValidationError})`,(()=>i.throw(t))),l(t),s||i.assign(r,!1)})),t.ok(r)}():t.result((0,hl.callValidateCode)(t,e,h),(()=>c(e)),(()=>l(e)))}e.getValidate=n,e.callRef=i,e.default=r}));var Rl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pl.default,Il.default],Cl=Object.defineProperty({default:Rl},"__esModule",{value:!0});const Tl=Xh.operators,Ol={maximum:{okStr:"<=",ok:Tl.LTE,fail:Tl.GT},minimum:{okStr:">=",ok:Tl.GTE,fail:Tl.LT},exclusiveMaximum:{okStr:"<",ok:Tl.LT,fail:Tl.GTE},exclusiveMinimum:{okStr:">",ok:Tl.GT,fail:Tl.LTE}},Bl={message:({keyword:t,schemaCode:e})=>Xh.str`must be ${Ol[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{comparison: ${Ol[t].okStr}, limit: ${e}}`},$l={keyword:Object.keys(Ol),type:"number",schemaType:"number",$data:!0,error:Bl,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data(Xh._`${r} ${Ol[e].fail} ${n} || isNaN(${r})`)}};var Dl=$l,Fl=Object.defineProperty({default:Dl},"__esModule",{value:!0});var Ul={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must be multiple of ${t}`,params:({schemaCode:t})=>Xh._`{multipleOf: ${t}}`},code(t){const{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?Xh._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:Xh._`${s} !== parseInt(${s})`;t.fail$data(Xh._`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}},jl=Object.defineProperty({default:Ul},"__esModule",{value:!0});function Ll(t){const e=t.length;let r,n=0,i=0;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),56320==(64512&r)&&i++);return n}var zl=Ll;Ll.code='require("ajv/dist/runtime/ucs2length").default';var ql=Object.defineProperty({default:zl},"__esModule",{value:!0});const Vl={message({keyword:t,schemaCode:e}){const r="maxLength"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},Gl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vl,code(t){const{keyword:e,data:r,schemaCode:n,it:i}=t,o="maxLength"===e?Xh.operators.GT:Xh.operators.LT,s=!1===i.opts.unicode?Xh._`${r}.length`:Xh._`${(0,tl.useFunc)(t.gen,ql.default)}(${r})`;t.fail$data(Xh._`${s} ${o} ${n}`)}};var Hl=Gl,Kl=Object.defineProperty({default:Hl},"__esModule",{value:!0});var Ql={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match pattern "${t}"`,params:({schemaCode:t})=>Xh._`{pattern: ${t}}`},code(t){const{data:e,$data:r,schema:n,schemaCode:i,it:o}=t,s=o.opts.unicodeRegExp?"u":"",a=r?Xh._`(new RegExp(${i}, ${s}))`:(0,hl.usePattern)(t,n);t.fail$data(Xh._`!${a}.test(${e})`)}},Jl=Object.defineProperty({default:Ql},"__esModule",{value:!0});const Yl={message({keyword:t,schemaCode:e}){const r="maxProperties"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},Zl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Yl,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxProperties"===e?Xh.operators.GT:Xh.operators.LT;t.fail$data(Xh._`Object.keys(${r}).length ${i} ${n}`)}};var Wl=Zl,Xl=Object.defineProperty({default:Wl},"__esModule",{value:!0});var tc={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>Xh.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>Xh._`{missingProperty: ${t}}`},code(t){const{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&0===r.length)return;const u=r.length>=a.loopRequired;if(s.allErrors?function(){if(u||o)t.block$data(Xh.nil,h);else for(const e of r)(0,hl.checkReportMissingProp)(t,e)}():function(){const s=e.let("missing");if(u||o){const r=e.let("valid",!0);t.block$data(r,(()=>function(r,o){t.setParams({missingProperty:r}),e.forOf(r,n,(()=>{e.assign(o,(0,hl.propertyInData)(e,i,r,a.ownProperties)),e.if((0,Xh.not)(o),(()=>{t.error(),e.break()}))}),Xh.nil)}(s,r))),t.ok(r)}else e.if((0,hl.checkMissingProp)(t,r,s)),(0,hl.reportMissingProp)(t,s),e.else()}(),a.strictRequired){const e=t.parentSchema.properties,{definedProperties:n}=t.it;for(const t of r)if(void 0===(null==e?void 0:e[t])&&!n.has(t)){const e=`required property "${t}" is not defined at "${s.schemaEnv.baseId+s.errSchemaPath}" (strictRequired)`;(0,tl.checkStrictMode)(s,e,s.opts.strictRequired)}}function h(){e.forOf("prop",n,(r=>{t.setParams({missingProperty:r}),e.if((0,hl.noPropertyInData)(e,i,r,a.ownProperties),(()=>t.error()))}))}}},ec=Object.defineProperty({default:tc},"__esModule",{value:!0});const rc={message({keyword:t,schemaCode:e}){const r="maxItems"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},nc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:rc,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxItems"===e?Xh.operators.GT:Xh.operators.LT;t.fail$data(Xh._`${r}.length ${i} ${n}`)}};var ic=nc,oc=Object.defineProperty({default:ic},"__esModule",{value:!0});fl.code='require("ajv/dist/runtime/equal").default';var sc=fl,ac=Object.defineProperty({default:sc},"__esModule",{value:!0});var uc={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>Xh.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>Xh._`{i: ${t}, j: ${e}}`},code(t){const{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;const u=e.let("valid"),h=o.items?(0,al.getSchemaTypes)(o.items):[];function l(n,i){const o=e.name("item"),s=(0,al.checkDataTypes)(h,o,a.opts.strictNumbers,al.DataType.Wrong),l=e.const("indices",Xh._`{}`);e.for(Xh._`;${n}--;`,(()=>{e.let(o,Xh._`${r}[${n}]`),e.if(s,Xh._`continue`),h.length>1&&e.if(Xh._`typeof ${o} == "string"`,Xh._`${o} += "_"`),e.if(Xh._`typeof ${l}[${o}] == "number"`,(()=>{e.assign(i,Xh._`${l}[${o}]`),t.error(),e.assign(u,!1).break()})).code(Xh._`${l}[${o}] = ${n}`)}))}function c(n,i){const o=(0,tl.useFunc)(e,ac.default),s=e.name("outer");e.label(s).for(Xh._`;${n}--;`,(()=>e.for(Xh._`${i} = ${n}; ${i}--;`,(()=>e.if(Xh._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{t.error(),e.assign(u,!1).break(s)}))))))}t.block$data(u,(function(){const n=e.let("i",Xh._`${r}.length`),i=e.let("j");t.setParams({i:n,j:i}),e.assign(u,!0),e.if(Xh._`${n} > 1`,(()=>(h.length>0&&!h.some((t=>"object"===t||"array"===t))?l:c)(n,i)))}),Xh._`${s} === false`),t.ok(u)}},hc=Object.defineProperty({default:uc},"__esModule",{value:!0});var lc={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>Xh._`{allowedValue: ${t}}`},code(t){const{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&"object"==typeof o?t.fail$data(Xh._`!${(0,tl.useFunc)(e,ac.default)}(${r}, ${i})`):t.fail(Xh._`${o} !== ${r}`)}},cc=Object.defineProperty({default:lc},"__esModule",{value:!0});var fc={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>Xh._`{allowedValues: ${t}}`},code(t){const{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const a=i.length>=s.opts.loopEnum;let u;const h=()=>null!=u?u:u=(0,tl.useFunc)(e,ac.default);let l;if(a||n)l=e.let("valid"),t.block$data(l,(function(){e.assign(l,!1),e.forOf("v",o,(t=>e.if(Xh._`${h()}(${r}, ${t})`,(()=>e.assign(l,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const t=e.const("vSchema",o);l=(0,Xh.or)(...i.map(((e,n)=>function(t,e){const n=i[e];return"object"==typeof n&&null!==n?Xh._`${h()}(${r}, ${t}[${e}])`:Xh._`${r} === ${n}`}(t,n))))}t.pass(l)}},dc=Object.defineProperty({default:fc},"__esModule",{value:!0});var pc=[Fl.default,jl.default,Kl.default,Jl.default,Xl.default,ec.default,oc.default,hc.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cc.default,dc.default],mc=Object.defineProperty({default:pc},"__esModule",{value:!0}),gc=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;const r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>Xh.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Xh._`{limit: ${t}}`},code(t){const{parentSchema:e,it:r}=t,{items:i}=e;Array.isArray(i)?n(t,i):(0,tl.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function n(t,e){const{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;const a=r.const("len",Xh._`${i}.length`);if(!1===n)t.setParams({len:e.length}),t.pass(Xh._`${a} <= ${e.length}`);else if("object"==typeof n&&!(0,tl.alwaysValidSchema)(s,n)){const n=r.var("valid",Xh._`${a} <= ${e.length}`);r.if((0,Xh.not)(n),(()=>function(n){r.forRange("i",e.length,a,(e=>{t.subschema({keyword:o,dataProp:e,dataPropType:tl.Type.Num},n),s.allErrors||r.if((0,Xh.not)(n),(()=>r.break()))}))}(n))),t.ok(n)}}e.validateAdditionalItems=n,e.default=r})),yc=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;const r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return n(t,"additionalItems",e);r.items=!0,(0,tl.alwaysValidSchema)(r,e)||t.ok((0,hl.validateArray)(t))}};function n(t,e,r=t.schema){const{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;!function(t){const{opts:n,errSchemaPath:i}=a,o=r.length,u=o===t.minItems&&(o===t.maxItems||!1===t[e]);if(n.strictTuples&&!u){const t=`"${s}" is ${o}-tuple, but minItems or maxItems/${e} are not specified or different at path "${i}"`;(0,tl.checkStrictMode)(a,t,n.strictTuples)}}(i),a.opts.unevaluated&&r.length&&!0!==a.items&&(a.items=tl.mergeEvaluated.items(n,r.length,a.items));const u=n.name("valid"),h=n.const("len",Xh._`${o}.length`);r.forEach(((e,r)=>{(0,tl.alwaysValidSchema)(a,e)||(n.if(Xh._`${h} > ${r}`,(()=>t.subschema({keyword:s,schemaProp:r,dataProp:r},u))),t.ok(u))}))}e.validateTuple=n,e.default=r}));var vc={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,yc.validateTuple)(t,"items")},wc=Object.defineProperty({default:vc},"__esModule",{value:!0});const bc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>Xh.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Xh._`{limit: ${t}}`},code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,(0,tl.alwaysValidSchema)(n,e)||(i?(0,gc.validateAdditionalItems)(t,i):t.ok((0,hl.validateArray)(t)))}};var Ec=bc,Mc=Object.defineProperty({default:Ec},"__esModule",{value:!0});var _c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>void 0===e?Xh.str`must contain at least ${t} valid item(s)`:Xh.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>void 0===e?Xh._`{minContains: ${t}}`:Xh._`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;let s,a;const{minContains:u,maxContains:h}=n;o.opts.next?(s=void 0===u?1:u,a=h):s=1;const l=e.const("len",Xh._`${i}.length`);if(t.setParams({min:s,max:a}),void 0===a&&0===s)return void(0,tl.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&s>a)return(0,tl.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void t.fail();if((0,tl.alwaysValidSchema)(o,r)){let e=Xh._`${l} >= ${s}`;return void 0!==a&&(e=Xh._`${e} && ${l} <= ${a}`),void t.pass(e)}o.items=!0;const c=e.name("valid");function f(){const t=e.name("_valid"),r=e.let("count",0);d(t,(()=>e.if(t,(()=>function(t){e.code(Xh._`${t}++`),void 0===a?e.if(Xh._`${t} >= ${s}`,(()=>e.assign(c,!0).break())):(e.if(Xh._`${t} > ${a}`,(()=>e.assign(c,!1).break())),1===s?e.assign(c,!0):e.if(Xh._`${t} >= ${s}`,(()=>e.assign(c,!0))))}(r)))))}function d(r,n){e.forRange("i",0,l,(e=>{t.subschema({keyword:"contains",dataProp:e,dataPropType:tl.Type.Num,compositeRule:!0},r),n()}))}void 0===a&&1===s?d(c,(()=>e.if(c,(()=>e.break())))):0===s?(e.let(c,!0),void 0!==a&&e.if(Xh._`${i}.length > 0`,f)):(e.let(c,!1),f()),t.result(c,(()=>t.reset()))}},Ac=Object.defineProperty({default:_c},"__esModule",{value:!0}),kc=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0,e.error={message:({params:{property:t,depsCount:e,deps:r}})=>{const n=1===e?"property":"properties";return Xh.str`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>Xh._`{property: ${t},
19
19
  missingProperty: ${n},
20
20
  depsCount: ${e},
21
- deps: ${r}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,r]=function({schema:t}){const e={},r={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:r)[n]=t[n]}return[e,r]}(t);n(t,e),i(t,r)}};function n(t,e=t.schema){const{gen:r,data:n,it:i}=t;if(0===Object.keys(e).length)return;const o=r.let("missing");for(const s in e){const a=e[s];if(0===a.length)continue;const u=(0,hl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(u,(()=>{for(const e of a)(0,hl.checkReportMissingProp)(t,e)})):(r.if(Xh._`${u} && (${(0,hl.checkMissingProp)(t,a,o)})`),(0,hl.reportMissingProp)(t,o),r.else())}}function i(t,e=t.schema){const{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(const a in e)(0,tl.alwaysValidSchema)(o,e[a])||(r.if((0,hl.propertyInData)(r,n,a,o.opts.ownProperties),(()=>{const e=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(e,s)}),(()=>r.var(s,!0))),t.ok(s))}e.validatePropertyDeps=n,e.validateSchemaDeps=i,e.default=r}));const Nc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Xh._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,tl.alwaysValidSchema)(i,r))return;const o=e.name("valid");e.forIn("key",n,(r=>{t.setParams({propertyName:r}),t.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),e.if((0,Xh.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var xc=Nc,Sc=Object.defineProperty({default:xc},"__esModule",{value:!0});const Pc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Xh._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=s;if(s.props=!0,"all"!==u.removeAdditional&&(0,tl.alwaysValidSchema)(s,r))return;const h=(0,hl.allSchemaProperties)(n.properties),l=(0,hl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Xh._`delete ${i}[${t}]`)}function f(n){if("all"===u.removeAdditional||u.removeAdditional&&!1===r)c(n);else{if(!1===r)return t.setParams({additionalProperty:n}),t.error(),void(a||e.break());if("object"==typeof r&&!(0,tl.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===u.removeAdditional?(d(n,r,!1),e.if((0,Xh.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Xh.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:tl.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{h.length||l.length?e.if(function(r){let i;if(h.length>8){const t=(0,tl.schemaRefOrVal)(s,n.properties,"properties");i=(0,hl.isOwnProperty)(e,t,r)}else i=h.length?(0,Xh.or)(...h.map((t=>Xh._`${r} === ${t}`))):Xh.nil;return l.length&&(i=(0,Xh.or)(i,...l.map((e=>Xh._`${(0,hl.usePattern)(t,e)}.test(${r})`)))),(0,Xh.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Xh._`${o} === ${rl.default.errors}`)}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&Rc.default.code(new ml.KeywordCxt(o,Rc.default,"additionalProperties"));const s=(0,hl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=tl.mergeEvaluated.props(e,(0,tl.toHash)(s),o.props));const a=s.filter((t=>!(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const u=e.name("valid");for(const r of a)h(r)?l(r):(e.if((0,hl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(u);function h(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},u)}}};var Tc=Cc,Oc=Object.defineProperty({default:Tc},"__esModule",{value:!0});const Bc=tl,$c={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,hl.allSchemaProperties)(r),u=a.filter((t=>(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length||u.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const h=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Xh.Name||(o.props=(0,Bc.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in h)new RegExp(t).test(e)&&(0,tl.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Xh._`${(0,hl.usePattern)(t,r)}.test(${n})`,(()=>{const i=u.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Bc.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Xh._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Xh.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)h&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Dc=$c,Fc=Object.defineProperty({default:Dc},"__esModule",{value:!0});var Uc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,tl.alwaysValidSchema)(n,r))return void t.fail();const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}},jc=Object.defineProperty({default:Uc},"__esModule",{value:!0});var Lc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hl.validateUnion,error:{message:"must match a schema in anyOf"}},zc=Object.defineProperty({default:Lc},"__esModule",{value:!0});var qc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Xh._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,s=e.let("valid",!1),a=e.let("passing",null),u=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,tl.alwaysValidSchema)(i,r)?e.var(u,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},u),n>0&&e.if(Xh._`${u} && ${s}`).assign(s,!1).assign(a,Xh._`[${a}, ${n}]`).else(),e.if(u,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Xh.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Vc=Object.defineProperty({default:qc},"__esModule",{value:!0});var Gc={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=e.name("valid");r.forEach(((e,r)=>{if((0,tl.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},Hc=Object.defineProperty({default:Gc},"__esModule",{value:!0});const Kc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Xh.str`must match "${t.ifClause}" schema`,params:({params:t})=>Xh._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,tl.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Qc(n,"then"),o=Qc(n,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(e)}(),t.reset(),i&&o){const r=e.let("ifClause");t.setParams({ifClause:r}),e.if(a,u("then",r),u("else",r))}else i?e.if(a,u("then")):e.if((0,Xh.not)(a),u("else"));function u(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Xh._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Qc(t,e){const r=t.schema[e];return void 0!==r&&!(0,tl.alwaysValidSchema)(t,r)}var Jc=Kc,Yc=Object.defineProperty({default:Jc},"__esModule",{value:!0});const Zc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,tl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Wc=Zc,Xc=Object.defineProperty({default:Wc},"__esModule",{value:!0});var tf=function(t=!1){const e=[jc.default,zc.default,Vc.default,Hc.default,Yc.default,Xc.default,Sc.default,Rc.default,kc.default,Oc.default,Fc.default];return t?e.push(wc.default,Mc.default):e.push(gc.default,yc.default),e.push(Ac.default),e},ef=Object.defineProperty({default:tf},"__esModule",{value:!0});const rf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match format "${t}"`,params:({schemaCode:t})=>Xh._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:u,errSchemaPath:h,schemaEnv:l,self:c}=a;u.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:u.code.formats}),o=r.const("fDef",Xh._`${i}[${s}]`),a=r.let("fType"),h=r.let("format");r.if(Xh._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Xh._`${o}.type || "string"`).assign(h,Xh._`${o}.validate`)),(()=>r.assign(a,Xh._`"string"`).assign(h,o))),t.fail$data((0,Xh.or)(!1===u.strictSchema?Xh.nil:Xh._`${s} && !${h}`,function(){const t=l.$async?Xh._`(${o}.async ? await ${h}(${n}) : ${h}(${n}))`:Xh._`${h}(${n})`,r=Xh._`(typeof ${h} == "function" ? ${t} : ${h}.test(${n}))`;return Xh._`${h} && ${h} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===u.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Xh.regexpCode)(t):u.code.formats?Xh._`${u.code.formats}${(0,Xh.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,Xh._`${n}.validate`];return["string",t,n]}(i);s===e&&t.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return Xh._`await ${f}(${n})`}return"function"==typeof a?Xh._`${f}(${n})`:Xh._`${f}.test(${n})`}())}())}};var nf=rf;var of=[Object.defineProperty({default:nf},"__esModule",{value:!0}).default],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}));var uf=[Cl.default,mc.default,(0,ef.default)(),sf.default,af.metadataVocabulary,af.contentVocabulary],hf=Object.defineProperty({default:uf},"__esModule",{value:!0}),lf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))}));const cf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===lf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Xh._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},code(t){const{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if("string"!=typeof a)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=e.let("valid",!1),h=e.const("tag",Xh._`${r}${(0,Xh.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Xh.Name),n}e.if(Xh._`typeof ${h} == "string"`,(()=>function(){const r=function(){var t;const e={},r=u(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,tl.schemaHasRulesButRef)(i,o.self.RULES)&&(i=Ml.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof Ml.SchemaEnv&&(i=i.schema));const l=null===(t=null==i?void 0:i.properties)||void 0===t?void 0:t[a];if("object"!=typeof l)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);n=n&&(r||u(i)),h(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function u({required:t}){return Array.isArray(t)&&t.includes(a)}function h(t,e){if(t.const)l(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`);for(const r of t.enum)l(r,e)}}function l(t,r){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${a}" values must be unique strings`);e[t]=r}}();e.if(!1);for(const t in r)e.elseIf(Xh._`${h} === ${t}`),e.assign(u,l(r[t]));e.else(),t.error(!1,{discrError:lf.DiscrError.Mapping,tag:h,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:lf.DiscrError.Tag,tag:h,tagName:a}))),t.ok(u)}};var ff=cf,df=Object.defineProperty({default:ff},"__esModule",{value:!0}),pf={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},mf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=["/properties"],n="http://json-schema.org/draft-07/schema";class i extends xl.default{_addVocabularies(){super._addVocabularies(),hf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(df.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(pf,r):pf;this.addMetaSchema(t,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}})})),gf=s(mf),yf=u((function(t,e){function r(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:r(o,s),time:r(u,h),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&u(e[1],!0)}),c),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return f.test(t)&&d.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(g.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return p.lastIndex=0,p.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=2147483647&&t>=-2147483648}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:m},double:{type:"number",validate:m},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(t){const e=n.exec(t);if(!e)return!1;const r=+e[1],o=+e[2],s=+e[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(r)?29:i[o])}function s(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function u(t,e){const r=a.exec(t);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!e||""!==s)}function h(t,e){if(!t||!e)return;const r=a.exec(t),n=a.exec(e);return r&&n?(t=r[1]+r[2]+r[3]+(r[4]||""))>(e=n[1]+n[2]+n[3]+(n[4]||""))?1:t<e?-1:0:void 0}const l=/t|\s/i;function c(t,e){if(!t||!e)return;const[r,n]=t.split(l),[i,o]=e.split(l),a=s(r,i);return void 0!==a?a||h(n,o):void 0}const f=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(){return!0}const g=/[^\\]\\Z/})),vf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Xh.operators,n={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:t,schemaCode:e})=>Xh.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{comparison: ${n[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(t){const{gen:e,data:r,schemaCode:i,keyword:o,it:s}=t,{opts:a,self:u}=s;if(!a.validateFormats)return;const h=new mf.KeywordCxt(s,u.RULES.all.format.definition,"format");function l(t){return Xh._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}h.$data?function(){const r=e.scopeValue("formats",{ref:u.formats,code:a.code.formats}),n=e.const("fmt",Xh._`${r}[${h.schemaCode}]`);t.fail$data(Xh.or(Xh._`typeof ${n} != "object"`,Xh._`${n} instanceof RegExp`,Xh._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=h.schema,n=u.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${o}": format "${r}" does not define "compare" function`);const i=e.scopeValue("formats",{key:r,ref:n,code:a.code.formats?Xh._`${a.code.formats}${Xh.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),wf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Xh.Name("fullFormats"),n=new Xh.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,yf.fullFormats,r),t;const[i,s]="fast"===e.mode?[yf.fastFormats,n]:[yf.fullFormats,r];return o(t,e.formats||yf.formatNames,i,s),e.keywords&&vf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Xh._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,r[n])}i.get=(t,e="full")=>{const r=("fast"===e?yf.fastFormats:yf.fullFormats)[t];if(!r)throw new Error(`Unknown format "${t}"`);return r},t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i})),bf=s(wf),Ef="__lodash_hash_undefined__",Mf="[object Function]",_f="[object GeneratorFunction]",Af=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kf=/^\w*$/,Nf=/^\./,xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sf=/\\(\\)?/g,Pf=/^\[object .+?Constructor\]$/,If=/^(?:0|[1-9]\d*)$/,Rf="object"==typeof o&&o&&o.Object===Object&&o,Cf="object"==typeof self&&self&&self.Object===Object&&self,Tf=Rf||Cf||Function("return this")();var Of,Bf=Array.prototype,$f=Function.prototype,Df=Object.prototype,Ff=Tf["__core-js_shared__"],Uf=(Of=/[^.]+$/.exec(Ff&&Ff.keys&&Ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Of:"",jf=$f.toString,Lf=Df.hasOwnProperty,zf=Df.toString,qf=RegExp("^"+jf.call(Lf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vf=Tf.Symbol,Gf=Bf.splice,Hf=id(Tf,"Map"),Kf=id(Object,"create"),Qf=Vf?Vf.prototype:void 0,Jf=Qf?Qf.toString:void 0;function Yf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Zf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Xf(t,e,r){var n=t[e];Lf.call(t,e)&&hd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function td(t,e){for(var r=t.length;r--;)if(hd(t[r][0],e))return r;return-1}function ed(t){if(!cd(t)||(e=t,Uf&&Uf in e))return!1;var e,r=function(t){var e=cd(t)?zf.call(t):"";return e==Mf||e==_f}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?qf:Pf;return r.test(function(t){if(null!=t){try{return jf.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function rd(t,e,r,n){if(!cd(t))return t;e=function(t,e){if(ld(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||fd(t))return!0;return kf.test(t)||!Af.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return ld(t)?t:sd(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var u=ad(e[i]),h=r;if(i!=s){var l=a[u];void 0===(h=n?n(l,u,a):void 0)&&(h=cd(l)?l:od(e[i+1])?[]:{})}Xf(a,u,h),a=a[u]}return t}function nd(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function id(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ed(r)?r:void 0}function od(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||If.test(t))&&t>-1&&t%1==0&&t<e}Yf.prototype.clear=function(){this.__data__=Kf?Kf(null):{}},Yf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Yf.prototype.get=function(t){var e=this.__data__;if(Kf){var r=e[t];return r===Ef?void 0:r}return Lf.call(e,t)?e[t]:void 0},Yf.prototype.has=function(t){var e=this.__data__;return Kf?void 0!==e[t]:Lf.call(e,t)},Yf.prototype.set=function(t,e){return this.__data__[t]=Kf&&void 0===e?Ef:e,this},Zf.prototype.clear=function(){this.__data__=[]},Zf.prototype.delete=function(t){var e=this.__data__,r=td(e,t);return!(r<0)&&(r==e.length-1?e.pop():Gf.call(e,r,1),!0)},Zf.prototype.get=function(t){var e=this.__data__,r=td(e,t);return r<0?void 0:e[r][1]},Zf.prototype.has=function(t){return td(this.__data__,t)>-1},Zf.prototype.set=function(t,e){var r=this.__data__,n=td(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Wf.prototype.clear=function(){this.__data__={hash:new Yf,map:new(Hf||Zf),string:new Yf}},Wf.prototype.delete=function(t){return nd(this,t).delete(t)},Wf.prototype.get=function(t){return nd(this,t).get(t)},Wf.prototype.has=function(t){return nd(this,t).has(t)},Wf.prototype.set=function(t,e){return nd(this,t).set(t,e),this};var sd=ud((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(fd(t))return Jf?Jf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return Nf.test(t)&&r.push(""),t.replace(xf,(function(t,e,n,i){r.push(n?i.replace(Sf,"$1"):e||t)})),r}));function ad(t){if("string"==typeof t||fd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ud(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ud.Cache||Wf),r}function hd(t,e){return t===e||t!=t&&e!=e}ud.Cache=Wf;var ld=Array.isArray;function cd(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function fd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==zf.call(t)}var dd=function(t,e,r){return null==t?t:rd(t,e,r)},pd=function(){function t(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}return t.prototype.call=function(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this},t.prototype.execute=function(t){return e(this,void 0,void 0,(function(){var e,n=this;return r(this,(function(r){switch(r.label){case 0:return e=t||{},[4,Zm(this.network,this.provider,this.abi,this.calls,this.options)];case 1:return r.sent().forEach((function(t,r){return dd(e,n.paths[r],t.length>1?t:t[0])})),this.calls=[],this.paths=[],[2,e]}}))}))},t}(),md={},gd=0;const yd=new b("networks/5.6.4");function vd(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return vd(t)},e}function wd(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return wd(t,e)},r}const bd={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:vd("homestead")},Ed={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:vd("ropsten")},Md={chainId:63,name:"classicMordor",_defaultProvider:wd("https://www.ethercluster.com/mordor","classicMordor")},_d={unspecified:{chainId:0,name:"unspecified"},homestead:bd,mainnet:bd,morden:{chainId:2,name:"morden"},ropsten:Ed,testnet:Ed,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:vd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:vd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:vd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:wd("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Md,classicTestnet:Md,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:wd("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:vd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:vd("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"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Ad(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return x(e)}function kd(t){t=x(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Nd{constructor(t){wr(this,"alphabet",t),wr(this,"base",t.length),wr(this,"_alphabetMap",{}),wr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=x(t);if(0===e.length)return"";let r=[0];for(let t=0;t<e.length;++t){let n=e[t];for(let t=0;t<r.length;++t)n+=r[t]<<8,r[t]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let t=0;0===e[t]&&t<e.length-1;++t)n+=this._leader;for(let t=r.length-1;t>=0;--t)n+=this.alphabet[r[t]];return n}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r<t.length;r++){let n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return x(new Uint8Array(e.reverse()))}}new Nd("abcdefghijklmnopqrstuvwxyz234567");const xd=new Nd("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Sd(t){return Me(kn(t))}const Pd="hash/5.6.1",Id=new b(Pd),Rd=new Uint8Array(32);Rd.fill(0);const Cd=new RegExp("^((.*)\\.)?([^.]+)$");function Td(t){"string"!=typeof t&&Id.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Rd;for(;e.length;){const n=e.match(Cd);null!=n&&""!==n[2]||Id.throwArgumentError("invalid ENS address; missing component","name",t);r=Me(S([r,Me(kn(Un(n[3])))])),e=n[2]||""}return C(r)}var Od=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Bd=new b(Pd),$d=new Uint8Array(32);$d.fill(0);const Dd=Ht.from(-1),Fd=Ht.from(0),Ud=Ht.from(1),jd=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Ld=D(Ud.toHexString(),32),zd=D(Fd.toHexString(),32),qd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Vd=["name","version","chainId","verifyingContract","salt"];function Gd(t){return function(e){return"string"!=typeof e&&Bd.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Hd={name:Gd("name"),version:Gd("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return Bd.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch(t){}return Bd.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return Bd.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Kd(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&Bd.throwArgumentError("invalid numeric width","type",t);const i=jd.mask(r?n-1:n),o=r?i.add(Ud).mul(Dd):Fd;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&Bd.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&Bd.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&Bd.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?B([e,$d.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D(Be(t),32)};case"bool":return function(t){return t?Ld:zd};case"bytes":return function(t){return Me(t)};case"string":return function(t){return Sd(t)}}return null}function Qd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Jd{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&Bd.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Bd.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Kd(s)||(r[s]||Bd.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?Bd.throwArgumentError("missing primary type","types",t):i.length>1&&Bd.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&Bd.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=Qd(e,t[e])+r.map((e=>Qd(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=Kd(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&Bd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(Me)),Me(B(i))}}const r=this.types[t];if(r){const e=Sd(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?Me(n):n}));return n.unshift(e),B(n)}}return Bd.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Bd.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Me(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(Kd(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&Bd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):Bd.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Jd(t)}static getPrimaryType(t){return Jd.from(t).primaryType}static hashStruct(t,e,r){return Jd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=qd[r];n||Bd.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>Vd.indexOf(t.name)-Vd.indexOf(e.name))),Jd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return B(["0x1901",Jd.hashDomain(t),Jd.from(e).hash(r)])}static hash(t,e,r){return Me(Jd.encode(t,e,r))}static resolveNames(t,e,r,n){return Od(this,void 0,void 0,(function*(){t=Mr(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Jd.from(e);o.visit(r,((t,e)=>("address"!==t||I(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Jd.hashDomain(t);const n={},i=[];Vd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Hd[e](r),i.push({name:e,type:qd[e]}))}));const o=Jd.from(e),s=Mr(e);return s.EIP712Domain?Bd.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Bd.throwArgumentError("invalid string","value",e),e}return Bd.throwArgumentError("unsupported type","type",t)}))}}}new b("sha2/5.6.1");function Yd(t){return"0x"+Jo.sha256().update(x(t)).digest("hex")}var Zd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};function Wd(t,e){return Zd(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{o[t.toLowerCase()]=n.headers.get(t)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:x(new Uint8Array(i))}}))}var Xd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const tp=new b("web/5.6.1");function ep(t){return new Promise((e=>{setTimeout(e,t)}))}function rp(t,e){if(null==t)return null;if("string"==typeof t)return t;if(A(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return xn(t)}catch(t){}return C(t)}return t}function np(t,e,r){let n=null;if(null!=e){n=kn(e);const r="string"==typeof t?{url:t}:Mr(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=Mr(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return function(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;tp.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;tp.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const h={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||tp.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(c=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(h.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&tp.throwError("basic authentication requires a secure https url",b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+kd(kn(e))}}null!=t.skipFetchSetup&&(h.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:Ad(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){tp.throwError("processing response error",b.errors.SERVER_ERROR,{body:rp(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(h.method="POST",h.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),h.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(tp.makeError("timeout",b.errors.TIMEOUT,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,timeout:c,url:u})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return Xd(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield Wd(u,h),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===h.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,u)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,t))),yield ep(r);continue}}}catch(t){e=t.response,null==e&&(m.cancel(),tp.throwError("missing response",b.errors.SERVER_ERROR,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,serverError:t,url:u}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(m.cancel(),tp.throwError("bad response",b.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:rp(a,e.headers?e.headers["content-type"]:null),requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})),r)try{const t=yield r(a,e);return m.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield ep(e);continue}}m.cancel(),tp.throwError("processing response error",b.errors.SERVER_ERROR,{body:rp(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})}return m.cancel(),a}return tp.throwError("failed response",b.errors.SERVER_ERROR,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})}))}();return Promise.race([m.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(xn(t))}catch(e){tp.throwError("invalid JSON",b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function ip(t,e){return e||(e={}),null==(e=Mr(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var op="qpzry9x8gf2tvdw0s3jn54khce6mua7l",sp={},ap=0;ap<op.length;ap++){var up=op.charAt(ap);if(void 0!==sp[up])throw new TypeError(up+" is ambiguous");sp[up]=ap}function hp(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function lp(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=hp(e)^n>>5}for(e=hp(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=hp(e)^31&i}return e}function cp(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var i=(t=r).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=lp(o);if("string"==typeof a)return a;for(var u=[],h=0;h<s.length;++h){var l=s.charAt(h),c=sp[l];if(void 0===c)return"Unknown character "+l;a=hp(a)^c,h+6>=s.length||u.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function fp(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var dp={decodeUnsafe:function(){var t=cp.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=cp.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=lp(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",o=0;o<e.length;++o){var s=e[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=hp(n)^s,i+=op.charAt(s)}for(o=0;o<6;++o)n=hp(n);for(n^=1,o=0;o<6;++o){i+=op.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=fp(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=fp(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=fp(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=fp(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const pp="providers/5.6.8",mp=new b(pp);class gp{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:gp.allowNull(this.accessList.bind(this),null),blockHash:gp.allowNull(o,null),blockNumber:gp.allowNull(a,null),transactionIndex:gp.allowNull(a,null),confirmations:gp.allowNull(a,null),from:e,gasPrice:gp.allowNull(r),maxPriorityFeePerGas:gp.allowNull(r),maxFeePerGas:gp.allowNull(r),gasLimit:r,to:gp.allowNull(e,null),value:r,nonce:a,data:i,r:gp.allowNull(this.uint256),s:gp.allowNull(this.uint256),v:gp.allowNull(a),creates:gp.allowNull(e,null),raw:gp.allowNull(i)},t.transactionRequest={from:gp.allowNull(e),nonce:gp.allowNull(a),gasLimit:gp.allowNull(r),gasPrice:gp.allowNull(r),maxPriorityFeePerGas:gp.allowNull(r),maxFeePerGas:gp.allowNull(r),to:gp.allowNull(e),value:gp.allowNull(r),data:gp.allowNull((t=>this.data(t,!0))),type:gp.allowNull(a),accessList:gp.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:gp.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:gp.allowNull(this.address,null),from:gp.allowNull(this.address,null),contractAddress:gp.allowNull(e,null),transactionIndex:a,root:gp.allowNull(s),gasUsed:r,logsBloom:gp.allowNull(i),blockHash:o,transactionHash:o,logs:gp.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:gp.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:gp.allowNull(r),status:gp.allowNull(a),type:u},t.block={hash:gp.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:gp.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:gp.allowNull(e),extraData:i,transactions:gp.allowNull(gp.arrayOf(o)),baseFeePerGas:gp.allowNull(r)},t.blockWithTransactions=Mr(t.block),t.blockWithTransactions.transactions=gp.allowNull(gp.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:gp.allowNull(n,void 0),toBlock:gp.allowNull(n,void 0),blockHash:gp.allowNull(o,void 0),address:gp.allowNull(e,void 0),topics:gp.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:gp.allowNull(a),blockHash:gp.allowNull(o),transactionIndex:a,removed:gp.allowNull(this.boolean.bind(this)),address:e,data:gp.allowFalsish(i,"0x"),topics:gp.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Vs(t||[])}number(t){return"0x"===t?0:Ht.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Ht.from(t).toNumber()}bigNumber(t){return Ht.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),I(t))?t.toLowerCase():mp.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return Be(t)}callAddress(t){if(!I(t,32))return null;const e=Be(O(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return De(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||I(t))return $(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==T(r)?mp.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=Ht.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!I(t))throw new Error("invalid uint256");return D(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=gp.check(e,t);return n._difficulty=null==r?null:Ht.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return gp.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Ht.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=gp.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;I(r)&&(r=Ht.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),I(r)&&(r=Ht.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return Js(t)}receiptLog(t){return gp.check(this.formats.receiptLog,t)}receipt(t){const e=gp.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Ht.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&mp.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):mp.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&mp.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return gp.check(this.formats.filter,t)}filterLog(t){return gp.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}var yp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const vp=new b(pp);function wp(t){return null==t?"null":(32!==T(t)&&vp.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function bp(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[wp(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return wp(t)})).join("&")}function Ep(t){if("string"==typeof t){if(32===T(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+bp(t);if(ni.isForkEvent(t))throw vp.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+bp(t.topics||[])}throw new Error("invalid event - "+t)}function Mp(){return(new Date).getTime()}function _p(t){return new Promise((e=>{setTimeout(e,t)}))}const Ap=["block","network","pending","poll"];class kp{constructor(t,e,r){wr(this,"tag",t),wr(this,"listener",e),wr(this,"once",r),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 t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||Ap.indexOf(this.tag)>=0}}const Np={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 xp(t){return D(Ht.from(t).toHexString(),32)}function Sp(t){return xd.encode(S([t,O(Yd(Yd(t)),0,4)]))}const Pp=new RegExp("^(ipfs)://(.*)$","i"),Ip=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Pp,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Rp(t,e){try{return xn(Cp(t,e))}catch(t){}return null}function Cp(t,e){if("0x"===t)return null;const r=Ht.from(O(t,e,e+32)).toNumber(),n=Ht.from(O(t,r,r+32)).toNumber();return O(t,r+32,r+32+n)}function Tp(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):vp.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Op(t){const e=x(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Bp(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function $p(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=x(t[n]);e[n]=Op(r),e.push(Op(i.length)),e.push(Bp(i)),r+=32+32*Math.ceil(i.length/32)}return B(e)}class Dp{constructor(t,e,r,n){wr(this,"provider",t),wr(this,"name",r),wr(this,"address",t.formatter.address(e)),wr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Ht.from(t).eq(1))).catch((t=>{if(t.code===b.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return yp(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:B([t,Td(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=B(["0x9061b923",$p([(i=this.name,C(S(i.split(".").map((t=>{const e=kn("_"+Un(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return x(t).length%32==4&&vp.throwError("resolver threw error",b.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Cp(t,0)),t}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return yp(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Cp(r,0):null}))}_getAddress(t,e){const r=Np[String(t)];if(null==r&&vp.throwError(`unsupported coin type: ${t}`,b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=x(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return Sp(S([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return Sp(S([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=dp.toWords(n.slice(2));return t.unshift(e),dp.encode(r.prefix,t)}}return null}getAddress(t){return yp(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",xp(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&vp.throwError("invalid or unsupported coin data",b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return yp(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;r<Ip.length;r++){const n=e.match(Ip[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Tp(e)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),u=D(Ht.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:B(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=Ht.from(yield this.provider.call({to:a,data:B(["0x00fdd58e",D(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const h={to:this.provider.formatter.address(s[0]),data:B([r,u])};let l=Rp(yield this.provider.call(h),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Tp(l)),t.push({type:"metadata-url",content:l});const c=yield np(l);if(!c)return null;t.push({type:"metadata",content:JSON.stringify(c)});let f=c.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Pp))return null;t.push({type:"url-ipfs",content:f}),f=Tp(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return yp(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+xd.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+xd.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"};return"sia://"+kd("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return vp.throwError("invalid or unsupported content hash data",b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return yp(this,void 0,void 0,(function*(){let e=kn(t);e=S([xp(64),xp(e.length),e]),e.length%32!=0&&(e=S([e,D("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(e));return null==r||"0x"===r?null:xn(r)}))}}let Fp=null,Up=1;class jp extends ii{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),wr(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=br(new.target,"getNetwork")(t);e?(wr(this,"_network",e),this.emit("network",e,null)):vp.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return yp(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||vp.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:wr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return ip((()=>this._ready().then((t=>t),(t=>{if(t.code!==b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Fp&&(Fp=new gp),Fp}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in _d){const r=_d[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=_d[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=_d[t.name];if(!e)return"number"!=typeof t.chainId&&yd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&yd.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var n;return null==r&&e._defaultProvider&&(r=(n=e._defaultProvider)&&"function"==typeof n.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}(null==t?"homestead":t)}ccipReadFetch(t,e,r){return yp(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const e=r[t],s=e.replace("{sender}",n).replace("{data}",i),a=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield np({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const h=u.message||"unknown error";if(u.status>=400&&u.status<500)return vp.throwError(`response not found during CCIP fetch: ${h}`,b.errors.SERVER_ERROR,{url:e,errorMessage:h});o.push(h)}return vp.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,b.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return yp(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(Mp()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=Mp(),r=Er({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Mp();return(t=Ht.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return yp(this,void 0,void 0,(function*(){const t=Up++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)vp.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",vp.makeError("network block skew detected",b.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return yp(this,void 0,void 0,(function*(){return vp.throwError("provider does not support network detection",b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return yp(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,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",e,t),yield _p(0),this._network;const r=vp.makeError("underlying network changed",b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!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))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=Mp();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=Mp(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return yp(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return yp(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},h=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,h),s.push((()=>{this.removeListener(t,h)})),n){let r=n.startBlock,i=null;const h=s=>yp(this,void 0,void 0,(function*(){a||(yield _p(1e3),this.getTransactionCount(n.from).then((l=>yp(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===t)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,e);if(u())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(vp.makeError("transaction was replaced",b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",h)}}))),(t=>{a||this.once("block",h)})))}));if(a)return;this.once("block",h),s.push((()=>{this.removeListener("block",h)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{u()||o(vp.makeError("timeout exceeded",b.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return yp(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Ht.from(t)}catch(e){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return Ht.from(n)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return Ht.from(n).toNumber()}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return C(n)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>$(t)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==T(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&vp.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>yp(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&vp.throwError("transaction failed",b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>C(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return yp(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?Ht.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?C(t):null)))})),this.formatter.transactionRequest(yield Er(r))}))}_getFilter(t){return yp(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield Er(e))}))}_call(t,e,r){return yp(this,void 0,void 0,(function*(){r>=10&&vp.throwError("CCIP read exceeded maximum redirections",b.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&T(i)%32==4)try{const o=O(i,4),s=O(o,0,32);Ht.from(s).eq(n)||vp.throwError("CCIP Read sender did not match",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Ht.from(O(o,32,64)).toNumber(),h=Ht.from(O(o,u,u+32)).toNumber(),l=O(o,u+32);for(let e=0;e<h;e++){const r=Rp(l,32*e);null==r&&vp.throwError("CCIP Read contained corrupt URL string",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Cp(o,64);Ht.from(O(o,100,128)).isZero()||vp.throwError("CCIP Read callback selector included junk",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=O(o,96,100),d=Cp(o,128),p=yield this.ccipReadFetch(t,c,a);null==p&&vp.throwError("CCIP Read disabled or provided no URLs",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:n,data:B([f,$p([p,d])])};return this._call(m,e,r+1)}catch(t){if(t.code===b.errors.SERVER_ERROR)throw t}try{return C(i)}catch(r){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return Ht.from(r)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return yp(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&vp.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&vp.throwError("ENS name not configured",b.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(I(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),I(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){vp.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return ip((()=>yp(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return ip((()=>yp(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return ip((()=>yp(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),gp.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return yp(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return yp(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&vp.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return yp(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new Dp(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return yp(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||vp.throwError("network does not support ENS",b.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Td(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return yp(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(I(t))throw e}"string"!=typeof t&&vp.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return yp(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=Rp(yield this.call({to:r,data:"0x691f3431"+Td(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return yp(this,void 0,void 0,(function*(){let e=null;if(I(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new Dp(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t}try{const t=Rp(yield this.call({to:n,data:"0x691f3431"+Td(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return vp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new kp(Ep(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=Ep(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=Ep(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=Ep(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=Ep(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=Ep(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Lp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const zp=new b(pp),qp=["call","estimateGas"];function Vp(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=I(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=Vp(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return Vp(JSON.parse(t),e)}catch(t){}return null}function Gp(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=Vp(e,!0);if(t)return t.data;zp.throwError("missing revert data in call exception; Transaction reverted without a reason string",b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=Vp(e.body,!1);null==r&&(r=Vp(e,!1)),r&&zp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&zp.throwError("insufficient funds for intrinsic transaction cost",b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&zp.throwError("nonce has already been used",b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&zp.throwError("replacement fee too low",b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&zp.throwError("legacy pre-eip-155 transactions not supported",b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),qp.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&zp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Hp(t){return new Promise((function(e){setTimeout(e,t)}))}function Kp(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Qp(t){return t?t.toLowerCase():t}const Jp={};class Yp extends hi{constructor(t,e,r){if(super(),t!==Jp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");wr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(wr(this,"_address",this.provider.formatter.address(r)),wr(this,"_index",null)):"number"==typeof r?(wr(this,"_index",r),wr(this,"_address",null)):zp.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return zp.throwError("cannot alter JSON-RPC Signer connection",b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Zp(Jp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&zp.throwError("unknown account #"+this._index,b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=Mr(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=Mr(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Lp(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&zp.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Er({tx:Er(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&zp.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>Gp("sendTransaction",t,n)))}))}signTransaction(t){return zp.throwError("signing transactions is unsupported",b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Lp(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield ip((()=>Lp(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return Lp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[C(e),r.toLowerCase()])}))}_legacySignMessage(t){return Lp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),C(e)])}))}_signTypedData(t,e,r){return Lp(this,void 0,void 0,(function*(){const n=yield Jd.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Jd.getPayload(n.domain,e,n.value))])}))}unlock(t){return Lp(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Zp extends Yp{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const Wp={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Xp extends jp{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=br(this.constructor,"defaultUrl")()),wr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(Mr(t))),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 Lp(this,void 0,void 0,(function*(){yield Hp(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=br(this.constructor,"getNetwork");try{return e(Ht.from(t).toNumber())}catch(e){return zp.throwError("could not detect network",b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return zp.throwError("could not detect network",b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Yp(Jp,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Nr(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=np(this.connection,JSON.stringify(r),Kp).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Qp(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Qp(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Qp(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Qp(e.address),D(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Qp(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Lp(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Ht.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=Mr(e)).transaction=Mr(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&zp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return Gp(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Hp(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=Mr(Wp);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||vr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||vr.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=$(Ht.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=C(t[e]))})),t.accessList&&(n.accessList=Vs(t.accessList)),n}}var tm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const em=new b(pp);class rm extends Xp{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return tm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||em.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(wr(this,"_network",e),this.emit("network",e,null))),e}))}}var nm={};function im(t,e){var r=(void 0===e?{}:e).broviderUrl,n=(void 0===r?"https://rpc.snapshot.org":r)+"/"+t;return nm[t]||(nm[t]=new rm({url:n,timeout:25e3,allowGzip:!0},Number(t))),nm[t]}function om(t){return Me(kn(t))}var sm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const am=new b("hash/5.6.1"),um=new Uint8Array(32);um.fill(0);const hm=Ht.from(-1),lm=Ht.from(0),cm=Ht.from(1),fm=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const dm=D(cm.toHexString(),32),pm=D(lm.toHexString(),32),mm={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},gm=["name","version","chainId","verifyingContract","salt"];function ym(t){return function(e){return"string"!=typeof e&&am.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const vm={name:ym("name"),version:ym("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return am.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch(t){}return am.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return am.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function wm(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&am.throwArgumentError("invalid numeric width","type",t);const i=fm.mask(r?n-1:n),o=r?i.add(cm).mul(hm):lm;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&am.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&am.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&am.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?B([e,um.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D(Be(t),32)};case"bool":return function(t){return t?dm:pm};case"bytes":return function(t){return Me(t)};case"string":return function(t){return om(t)}}return null}function bm(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Em{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&am.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&am.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);wm(s)||(r[s]||am.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?am.throwArgumentError("missing primary type","types",t):i.length>1&&am.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&am.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=bm(e,t[e])+r.map((e=>bm(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=wm(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&am.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(Me)),Me(B(i))}}const r=this.types[t];if(r){const e=om(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?Me(n):n}));return n.unshift(e),B(n)}}return am.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||am.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Me(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(wm(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&am.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):am.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Em(t)}static getPrimaryType(t){return Em.from(t).primaryType}static hashStruct(t,e,r){return Em.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=mm[r];n||am.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>gm.indexOf(t.name)-gm.indexOf(e.name))),Em.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return B(["0x1901",Em.hashDomain(t),Em.from(e).hash(r)])}static hash(t,e,r){return Me(Em.encode(t,e,r))}static resolveNames(t,e,r,n){return sm(this,void 0,void 0,(function*(){t=Mr(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Em.from(e);o.visit(r,((t,e)=>("address"!==t||I(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Em.hashDomain(t);const n={},i=[];gm.forEach((e=>{const r=t[e];null!=r&&(n[e]=vm[e](r),i.push({name:e,type:mm[e]}))}));const o=Em.from(e),s=Mr(e);return s.EIP712Domain?am.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&am.throwArgumentError("invalid string","value",e),e}return am.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new b("wallet/5.6.2");function Mm(t,e,r,n){return Ls(Em.hash(t,e,r),n)}function _m(t,n,i,o){return e(this,void 0,void 0,(function(){var e,s,a,u;return r(this,(function(r){switch(r.label){case 0:s="0x1626ba7e",a="function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ym(o,[a],[t,"isValidSignature",[x(i),n]])];case 2:return e=r.sent(),[3,4];case 3:if((u=r.sent()).message.startsWith("missing revert data in call exception"))return[2,!1];throw u;case 4:return[2,e.toLowerCase()===s.toLowerCase()]}}))}))}function Am(t,n,i,o){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e="0x20c13b0b","function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)",[4,Ym(o,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[x(i),n]])];case 1:return[2,r.sent().toLowerCase()===e.toLowerCase()]}}))}))}function km(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e=im(o,s),[4,_m(t,n,i,e)];case 1:return r.sent()?[2,!0]:[4,Am(t,n,i,e)];case 2:return[2,r.sent()]}}))}))}function Nm(t){var e=t.domain,r=t.types,n=t.message;return Vh.hash(e,r,n)}var xm=["cloudflare-ipfs.com","cf-ipfs.com","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],Sm={1:{key:"1",name:"Ethereum Mainnet",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",rpc:["https://rpc.ankr.com/eth",{url:"https://api-geth-archive.ankr.com",user:"balancer_user",password:"balancerAnkr20201015"},"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive","https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main","https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],light:["https://cloudflare-eth.com"],ws:["wss://eth-mainnet.ws.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],explorer:{url:"https://etherscan.io",apiUrl:"https://api.etherscan.io"},start:7929876,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},5:{key:"5",name:"Ethereum Testnet Goerli",shortName:"Goerli",chainId:5,network:"goerli",testnet:!0,multicall:"0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",ensResolvers:["0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750","0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"],ensNameWrapper:"0x114D4603199df73e7D157787f8778E21fCd13066",rpc:["https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"],explorer:{url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io"},start:743550,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},8:{key:"8",name:"Ubiq Mainnet",chainId:8,network:"Ubiq mainnet",multicall:"0x6668750957e4083725926B71C41bDF1434C73262",rpc:["https://rpc.octano.dev"],ws:["wss://ws.octano.dev"],explorer:{url:"https://ubiqscan.io"},start:1,logo:"ipfs://Qmec3HLoN4QhwZAhw4XTi2aN8Wwmcko5hHN22sHARzb9tw"},10:{key:"10",name:"Optimism Mainnet",chainId:10,network:"Optimism mainnet",multicall:"0x35A6Cdb2C9AD4a45112df4a04147EB07dFA01aB7",rpc:["https://opt-mainnet.g.alchemy.com/v2/JzmIL4Q3jBj7it2duxLFeuCa9Wobmm7D"],explorer:{url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io"},start:657806,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb"},19:{key:"19",name:"Songbird Canary-Network",shortName:"Songbird",chainId:19,network:"songbird",multicall:"0x17032Ea9c3a13Ed337665145364c0d2aD1108c91",rpc:["https://songbird-api.flare.network/ext/C/rpc"],explorer:{url:"https://songbird-explorer.flare.network"},start:21807126,logo:"ipfs://QmXyvnrZY8FUxSULfnKKA99sAEkjAHtvhRx5WeHixgaEdu"},24:{key:"24",name:"KardiaChain Mainnet",shortName:"KAI",chainId:24,network:"mainnet",multicall:"0xd9c92F2287B7802A37eC9BEce96Aa65fb5f31E1b",rpc:["https://kai-internal.kardiachain.io"],explorer:{url:"https://explorer.kardiachain.io"},start:8260245,logo:"ipfs://bafkreig73yfyqzbxydv6e3dbj5nks3f57px2iez7tywayey4rilfhhrr34"},25:{key:"25",name:"Cronos Mainnet",shortName:"Cronos",chainId:25,network:"mainnet",multicall:"0x6F522a3982e8F9A50A2EDc9E46ed1A3aE2B3FD3a",rpc:["https://evm-cronos.crypto.org"],explorer:{url:"https://cronos.crypto.org/explorer"},start:4067,logo:"ipfs://QmfSJbtirJoa3Pt7o5Fdm85wbyw9V1hpzqLr5PQbdnfsAj"},30:{key:"30",name:"RSK Mainnet",chainId:30,network:"rsk mainnet",multicall:"0x4eeebb5580769ba6d26bfd07be636300076d1831",rpc:["https://public-node.rsk.co"],explorer:{url:"https://explorer.rsk.co"},start:2516442,logo:"ipfs://QmXTwpE1SqoNZmyY4c3fYWy6qUgQELsyWKbgJo2Pg6K6V9"},46:{key:"46",name:"Darwinia Network",shortName:"Darwinia",chainId:46,network:"mainnet",multicall:"0x67f9ae42EaA9a8aBf065D60ec6Ab3C1A11370607",rpc:["https://rpc.darwinia.network"],explorer:{url:"https://darwinia.subscan.io"},start:141853,logo:"ipfs://bafkreicf55maidhx46pyu3mwsshlr43xbewr6tkckkonh4nesbkp7krwkm"},56:{key:"56",name:"Binance Smart Chain Mainnet",shortName:"BSC",chainId:56,network:"mainnet",multicall:"0x1ee38d535d541c55c9dae27b12edf090c608e6fb",rpc:["https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive","https://rpc.ankr.com/bsc","https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7","https://bsc-private-dataseed1.nariox.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed1.binance.org"],explorer:{url:"https://bscscan.com"},start:461230,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},61:{key:"61",name:"Ethereum Classic Mainnet",shortName:"Ethereum Classic",chainId:61,network:"mainnet",multicall:"0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",rpc:["https://www.ethercluster.com/etc"],explorer:{url:"https://blockscout.com/etc/mainnet"},start:13307544,logo:"ipfs://QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"},66:{key:"66",name:"OKExChain Mainnet",shortName:"OEC Mainnet",chainId:66,network:"oec mainnet",multicall:"0x6EB187d8197Ac265c945b69f3c3064A6f3831866",rpc:["https://exchainrpc.okex.org"],ws:["wss://exchainws.okex.org:8443"],explorer:{url:"https://www.oklink.com/okexchain"},start:5076543,logo:"ipfs://Qmd7dKnNwHRZ4HRCbCXUbkNV7gP28fGqPdjbHtjRtT9sQF"},75:{key:"75",name:"Decimal",shortName:"mainnet",chainId:75,network:"mainnet",multicall:"0x949d1A0757803C51F2EfFFEb5472C861A898B8E8",rpc:[],explorer:{url:"https://explorer.decimalchain.com"},start:16031065,logo:"ipfs://bafkreihkdhbce5rkogl63xegaarlirjrvbfarxbtbf5mqme3s5grvbjyxm"},81:{key:"81",name:"Shibuya Network",shortName:"Shibuya",chainId:81,network:"testnet",testnet:!0,multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shibuya.astar.network:8545"],explorer:{url:"https://blockscout.com/shibuya"},start:856303,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},82:{key:"82",name:"Meter Mainnet",shortName:"Meter",chainId:82,network:"mainnet",multicall:"0x579De77CAEd0614e3b158cb738fcD5131B9719Ae",rpc:["https://rpc.meter.io"],explorer:{url:"https://scan.meter.io"},start:4992871,logo:"ipfs://QmSZvT9w9eUDvV1YVaq3BKKEbubtNVqu1Rin44FuN4wz11"},97:{key:"97",name:"Binance Smart Chain Testnet",shortName:"BSC Testnet",chainId:97,network:"testnet",testnet:!0,multicall:"0x8b54247c6BAe96A6ccAFa468ebae96c4D7445e46",rpc:["https://data-seed-prebsc-1-s1.binance.org:8545","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/bsc/testnet/archive"],explorer:{url:"https://testnet.bscscan.com"},start:3599656,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},100:{key:"100",name:"Gnosis Chain",shortName:"xDAI",chainId:100,network:"mainnet",multicall:"0xb5b692a88bdfc81ca69dcb1d924f59f0413a602a",rpc:["https://gno.getblock.io/mainnet/6c1d1e6e-75d9-452f-a863-a694bff93d5c/","https://xdai-archive.blockscout.com","https://poa-xdai.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://rpc.gnosischain.com"],light:["https://rpc.gnosischain.com"],ws:["wss://rpc.xdaichain.com/wss"],explorer:{url:"https://gnosis.blockscout.com"},start:4108192,logo:"ipfs://QmZeiy8Ax4133wzxUQM9ky8z5XFVf6YLFjJMmTWbWVniZR"},108:{key:"108",name:"Thundercore Mainnet",chainId:108,network:"mainnet",multicall:"0x3017086deef56679e267f67f66c4415109b7a97f",rpc:["https://mainnet-rpc.thundercore.com/archived/SNAPSHOTEuR82a75fLYA"],explorer:{url:"https://viewblock.io/thundercore"},start:94425385,logo:"ipfs://bafkreifc5z5vtvqx2luzgateyvoocwpd2ifv2hwufxdnyl2a767wa6icli"},122:{key:"122",name:"Fuse Mainnet",shortName:"Fuse",chainId:122,network:"mainnet",multicall:"0x7a59441fb06666F6d2D766393d876945D06a169c",rpc:["https://explorer-node.fuse.io/","https://oefusefull1.liquify.info/"],explorer:{url:"https://explorer.fuse.io"},start:11923459,logo:"ipfs://QmXjWb64nako7voaVEifgdjAbDbswpTY8bghsiHpv8yWtb"},137:{key:"137",name:"Polygon PoS",shortName:"Polygon",chainId:137,network:"mainnet",multicall:"0xCBca837161be50EfA5925bB9Cc77406468e76751",rpc:["https://rpc.ankr.com/polygon","https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/polygon/mainnet/archive","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/polygon/mainnet/archive","https://rpc-mainnet.maticvigil.com/v1/1cfd7598e5ba6dcf0b4db58e8be484badc6ea08e"],ws:["wss://ws-mainnet.matic.network"],explorer:{url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com"},start:9834491,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},144:{key:"144",name:"PHI Network",shortName:"PHI",chainId:144,network:"mainnet",multicall:"0xc2f41B404a6757863AAeF49ff93039421acCd630",rpc:["https://connect.phi.network"],explorer:{url:"https://phiscan.com"},start:360030,logo:"ipfs://bafkreid6pm3mic7izp3a6zlfwhhe7etd276bjfsq2xash6a4s2vmcdf65a"},148:{key:"148",name:"ShimmerEVM",shortName:"ShimmerEVM",chainId:148,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.evm.shimmer.network/"},start:1290,logo:"ipfs://bafkreib4xhbgbhrwkmizp4d4nz3wzbpyhdm6wpz2v2pbkk7jxsgg3hdt74"},204:{key:"204",name:"opBNB",shortName:"mainnet",chainId:204,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"http://opbnbscan.com/"},start:512881,logo:"ipfs://bafkreibll4la7wqerzs7zwxjne2j7ayynbg2wlenemssoahxxj5rbt6c64"},246:{key:"246",name:"Energy Web Chain",shortName:"EWC",chainId:246,network:"mainnet",multicall:"0x0767F26d0D568aB61A98b279C0b28a4164A6f05e",rpc:["https://voting-rpc.carbonswap.exchange"],explorer:{url:"https://explorer.energyweb.org"},start:12086501,logo:"ipfs://Qmai7AGHgs8NpeGeXgbMZz7pS2i4kw44qubCJYGrZW2f3a"},250:{key:"250",name:"Fantom Opera",shortName:"fantom",chainId:250,network:"Mainnet",multicall:"0x7f6A10218264a22B4309F3896745687E712962a0",rpc:["https://rpc.ankr.com/fantom","https://rpc.ftm.tools","https://rpcapi.fantom.network"],explorer:{url:"https://ftmscan.com"},start:2497732,logo:"ipfs://QmVEgNeQDKnXygeGxfY9FywZpNGQu98ktZtRJ9bToYF6g7"},269:{key:"269",name:"High Performance Blockchain Mainnet",shortName:"HPB",chainId:269,network:"mainnet",multicall:"0x67D0f263aef2F6167FA77353695D75b582Ff4Bca",rpc:["https://hpbnode.com"],ws:["wss://ws.hpbnode.com"],explorer:{url:"https://hscan.org"},start:13960096,logo:"ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"},280:{key:"280",name:"zkSync Era Testnet",shortName:"zkSync testnet",chainId:280,network:"zkSync alpha testnet",testnet:!0,multicall:"0xbDAd32d600915cB70576D3d935d49bFf3C9cB0CF",rpc:["https://testnet.era.zksync.dev"],explorer:{url:"https://goerli.explorer.zksync.io/"},start:9012429,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},314:{key:"314",name:"Filecoin",shortName:"mainnet",chainId:314,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://filfox.io"},start:3328594,logo:"ipfs://bafybeibyvjfmk6aqlfdrczvth55jkmnoadtrch7ht3rdmvqmy2bfxynecm"},321:{key:"321",name:"KCC Mainnet",shortName:"KCC",chainId:321,network:"mainnet",multicall:"0xa64D6AFb48225BDA3259246cfb418c0b91de6D7a",rpc:["https://rpc-mainnet.kcc.network"],ws:["wss://rpc-ws-mainnet.kcc.network"],explorer:{url:"https://explorer.kcc.io"},start:1487453,logo:"ipfs://QmRdzYGhFRG8QLzMJahHrw3vETE2YZ9sywQbEkenSjKEvb"},324:{key:"324",name:"zkSync Era",shortName:"zkSync-era",chainId:324,network:"zkSync Era Mainnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:["https://mainnet.era.zksync.io"],explorer:{url:"https://explorer.zksync.io/"},start:3908235,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},336:{key:"336",name:"Shiden Network",shortName:"Shiden",chainId:336,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shiden.astar.network:8545","https://shiden.api.onfinality.io/public"],explorer:{url:"https://blockscout.com/shiden"},start:1170016,logo:"ipfs://QmcqGQE4Sk73zXc3e91TUFFefKBVeaNgbxV141XkSNE4xj"},369:{key:"369",name:"Pulsechain Mainnet",shortName:"Pulsechain",chainId:369,network:"mainnet",multicall:"0xdbdd0FD8B16F0092f306392b699D7fbddaA9011B",rpc:["https://rpc.pulsechain.com"],explorer:{url:"https://scan.pulsechain.com/"},start:17657774,logo:"ipfs://QmWUsiEWdejtHZ9B9981TYXn7Ds8C7fkB1S4h5rP3kCCZR"},416:{key:"416",name:"SX Network",shortName:"SX",chainId:416,network:"mainnet",multicall:"0x834a005DDCF990Ba1a79f259e840e58F2D14F49a",rpc:["https://rpc.sx.technology"],ws:["wss://rpc.sx.technology/ws"],explorer:{url:"https://explorer.sx.technology"},start:2680605,logo:"ipfs://QmSXLXqyr2H6Ja5XrmznXbWTEvF2gFaL8RXNXgyLmDHjAF"},592:{key:"592",name:"Astar Network",shortName:"Astar",chainId:592,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://astar.api.onfinality.io/public","https://rpc.astar.network:8545"],explorer:{url:"https://blockscout.com/astar"},start:366482,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},813:{key:"813",name:"Qitmeer Mainnet",shortName:"MEER",chainId:813,network:"mainnet",multicall:"0x55034b2cF530ae3A8fC1e2e4523F58496796610F",rpc:["https://evm-dataseed1.meerscan.io","https://evm-dataseed.meerscan.com","https://evm-dataseed2.meerscan.io","https://evm-dataseed3.meerscan.io"],explorer:{url:"https://evm.meerscan.io"},start:43317,logo:"ipfs://QmXvum7SNVaAqAc2jNzR1NpNZN1GGvNaKWydg8a1GEDQ7y"},841:{key:"841",name:"Taraxa Mainnet",shortName:"841",chainId:841,network:"mainnet",multicall:"0xFCe7a3121B42664AaD145712e1c2Bf2e38f60AA1",rpc:["https://rpc.mainnet.taraxa.io"],ws:["wss://ws.mainnet.taraxa.io"],explorer:{url:"https://mainnet.explorer.taraxa.io"},start:1515906,logo:"ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"},888:{key:"888",name:"Wanchain",chainId:888,network:"mainnet",multicall:"0xba5934ab3056fca1fa458d30fbb3810c3eb5145f",rpc:["https://gwan-ssl.wandevs.org:56891"],ws:["wss://api.wanchain.org:8443/ws/v3/ddd16770c68f30350a21114802d5418eafe039b722de52b488e7eee1ee2cd73f"],explorer:{url:"https://www.wanscan.org"},start:11302663,logo:"ipfs://QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"},1001:{key:"1001",name:"Klaytn Baobab Testnet",shortName:"Boabab",chainId:1001,network:"testnet",testnet:!0,multicall:"0x40643B8Aeaaca0b87Ea1A1E596e64a0e14B1d244",rpc:["https://archive-en.baobab.klaytn.net"],ws:["wss://archive-en.baobab.klaytn.net/ws"],explorer:{url:"https://baobab.scope.klaytn.com"},start:87232478,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},1072:{key:"1072",name:"Shimmer EVM Testnet",shortName:"ShimmerEVM",chainId:1072,network:"testnet",testnet:!0,multicall:"0x751d21047C116413895c259f3f305e38C10B7cF6",rpc:["https://archive.evm.testnet.shimmer.network/v1/chains/rms1pr75wa5xuepg2hew44vnr28wz5h6n6x99zptk2g68sp2wuu2karywgrztx3/evm"],explorer:{url:"https://explorer.evm.testnet.shimmer.network/"},start:10614,logo:"ipfs://bafkreihtwfwrue7klzedwx4rqlk6agklz4lbbk7owsyw6xzn6c2m4t5tgy"},1088:{key:"1088",name:"Metis",shortName:"metis",chainId:1088,network:"mainnet",multicall:"0xc39aBB6c4451089dE48Cffb013c39d3110530e5C",rpc:["https://andromeda.metis.io/?owner=1088"],explorer:{url:"https://andromeda-explorer.metis.io"},start:451,logo:"ipfs://QmYeskHqrEvWHqeAuqett64LxfH52HUXZi2T9BAMmgKvBF"},1101:{key:"1101",name:"Polygon zkEVM",shortName:"mainnet",chainId:1101,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://zkevm.polygonscan.com"},start:57746,logo:"ipfs://bafkreibfiyvhqnme2vbxxfcku7qkxgjpkg6ywdkplxh4oxlkqsbznyorfm"},1116:{key:"1116",name:"Core Chain Mainnet ",shortName:"Core",chainId:1116,network:"mainnet",multicall:"0x024f0041b76B598c2A0a75004F8447FaF67BD004",rpc:["https://rpc.coredao.org/"],explorer:{url:"https://scan.coredao.org"},start:853908,logo:"ipfs://QmVctLQ44vhkwejja9DDjDYUdYgVRBEWs242mhd95SeM5q"},1284:{key:"1284",name:"Moonbeam",shortName:"GLMR",chainId:1284,network:"mainnet",multicall:"0x83e3b61886770de2F64AAcaD2724ED4f08F7f36B",rpc:["https://rpc.api.moonbeam.network"],explorer:{url:"https://moonscan.io/"},start:171135,logo:"ipfs://QmWKTEK2pj5sBBbHnMHQbWgw6euVdBrk2Ligpi2chrWASk"},1285:{key:"1285",name:"Moonriver (Kusama)",shortName:"Moonriver",chainId:1285,network:"mainnet",multicall:"0x537004440ffFE1D4AE9F009031Fc2b0385FCA9F1",rpc:["https://rpc.api.moonriver.moonbeam.network"],explorer:{url:"https://blockscout.moonriver.moonbeam.network"},start:413539,logo:"ipfs://QmXtgPesL87Ejhq2Y7yxsaPYpf4RcnoTYPJWPcv6iiYhoi"},1287:{key:"1287",name:"Moonbase Alpha TestNet",shortName:"Moonbase",chainId:1287,network:"testnet",testnet:!0,multicall:"0xf09FD6B6FF3f41614b9d6be2166A0D07045A3A97",rpc:["https://rpc.testnet.moonbeam.network"],explorer:{url:"https://moonbase-blockscout.testnet.moonbeam.network"},start:859041,logo:"ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"},1559:{key:"1559",name:"Tenet",shortName:"tenet",chainId:1559,network:"mainnet",multicall:"0xcCB3F00bE353950E4C08501ac8Af48765EAAa738",rpc:[],explorer:{url:"https://tenetscan.io"},start:944415,logo:"ipfs://Qmc1gqjWTzNo4pyFSGtQuCu7kRSZZBUVybtTjHn2nNEEPA"},1663:{key:"1663",name:"Horizen Gobi Testnet",shortName:"Gobi",chainId:1663,network:"testnet",testnet:!0,multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:["https://gobi-testnet.horizenlabs.io/ethv1"],explorer:{url:"https://gobi-explorer.horizen.io"},start:1,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},2e3:{key:"2000",name:"Doge Chain",shortName:"dogechain",chainId:2e3,network:"mainnet",multicall:"0x6f9D3f3932B417bd4957585D236Cbc32b32C0BDc",rpc:["https://rpc.dogechain.dog"],explorer:{url:"https://explorer.dogechain.dog"},start:877115,logo:"ipfs://bafkreigovfh3pinsdih777issfgaflwu2yjzroljs2642gbvwikcd3nm4i"},2109:{key:"2109",name:"Exosama Network",shortName:"EXN",chainId:2109,network:"mainnet",multicall:"0x2feFC828e2fEfdE0C9f7740919c6A9139F886067",rpc:["https://rpc.exosama.com"],explorer:{url:"https://explorer.exosama.com"},start:94085,logo:"ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS"},2152:{key:"2152",name:"Findora Mainnet",shortName:"Findora",chainId:2152,network:"mainnet",multicall:"0xCF7D1e21CBe9bdEF235aef06C5d8051B3d4DF0f5",rpc:["https://archive.prod.findora.org:8545/"],explorer:{url:"https://evm.findorascan.io"},start:4219343,logo:"ipfs://QmXkneyRB6HbHTHRLCZpZqSsawiyJY7b2kZ2V8ydvKYAgv"},2400:{key:"2400",name:"TCG Verse Mainnet",shortName:"TCGV",chainId:2400,network:"mainnet",multicall:"0xceC65DEE0b5012F1b7321b2647681F997c7204FC",rpc:["https://rpc.tcgverse.xyz"],explorer:{url:"https://explorer.tcgverse.xyz"},start:57500,logo:"ipfs://bafkreidg4wpewve5mdxrofneqblydkrjl3oevtgpdf3fk3z3vjqam6ocoe"},4337:{key:"4337",name:"Beam",shortName:"Beam",chainId:4337,network:"mainnet",multicall:"0x4956F15eFdc3dC16645e90Cc356eAFA65fFC65Ec",rpc:[],explorer:{url:"https://subnets.avax.network/beam/"},start:1,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF"},4689:{key:"4689",name:"IoTeX Mainnet",shortName:"IoTeX",chainId:4689,network:"mainnet",multicall:"0x9c8B105c94282CDB0F3ecF27e3cfA96A35c07be6",rpc:["https://babel-api.mainnet.iotex.io"],explorer:{url:"https://iotexscan.io"},start:11533283,logo:"ipfs://QmNkr1UPcBYbvLp7d7Pk4eF3YCsHpaNkfusKZNtykL2EQC"},5e3:{key:"5000",name:"Mantle",chainId:5e3,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.mantle.xyz"],explorer:{url:"https://explorer.mantle.xyz"},start:304717,logo:"ipfs://bafkreidkucwfn4mzo2gtydrt2wogk3je5xpugom67vhi4h4comaxxjzoz4"},5555:{key:"5555",name:"Chain Verse Mainnet",shortName:"ChainVerse",chainId:5555,network:"ChainVerse",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.chainverse.info"],explorer:{url:"https://explorer.chainverse.info"},start:6334180,logo:"ipfs://QmQyJt28h4wN3QHPXUQJQYQqGiFUD77han3zibZPzHbitk"},6102:{key:"6102",name:"Cascadia Testnet",shortName:"Cascadia",chainId:6102,network:"testnet",multicall:"0x728989819bAD588F193563008E0a03E8cD6a3e4a",rpc:["https://testnet.cascadia.foundation"],explorer:{url:"https://explorer.cascadia.foundation"},testnet:!0,start:370457,logo:"ipfs://QmWkhZYhReYyaa5pQXj32hEGxoRcBqarFMcfQScELmjYQj"},7332:{key:"7332",name:"Horizen EON",shortName:"EON",chainId:7332,network:"mainnet",multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:[],explorer:{url:"https://eon-explorer.horizenlabs.io"},start:85108,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},7341:{key:"7341",name:"Shyft",shortName:"Shyft",chainId:7341,network:"mainnet",multicall:"0xceb10e9133D771cA93c8002Be527A465E85381a2",rpc:["https://rpc.shyft.network"],explorer:{url:"https://bx.shyft.network"},start:3673983,logo:"ipfs://bafkreifwxnnfk6koabzmxgcxcwlrwt6b5gijdain2gyqee77q4ajfb7fu4"},8217:{key:"8217",name:"Klaytn Mainnet Cypress",shortName:"Cypress",chainId:8217,network:"mainnet",multicall:"0x5f5f0d1b9ff8b3dcace308e39b13b203354906e9",rpc:["https://archive-en.cypress.klaytn.net"],ws:["wss://archive-en.cypress.klaytn.net/ws"],explorer:{url:"https://scope.klaytn.com"},start:91582357,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},8453:{key:"8453",name:"Base",shortName:"mainnet",chainId:8453,network:"mainnet",multicall:"0xca11bde05977b3631167028862be2a173976ca11",rpc:[],explorer:{url:"https://basescan.org/"},start:5022,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},9001:{key:"9001",name:"Evmos Network",shortName:"Evmos",chainId:9001,network:"mainnet",multicall:"0x37763d16f8dBf6F185368E0f256350cAb7E24b26",rpc:["https://eth.bd.evmos.org:8545"],ws:["wss://eth.bd.evmos.org:8546"],explorer:{url:"https://escan.live"},start:13959539,logo:"ipfs://bafkreif4obrdoiretpozdd56seziywc6clha7wwkbldng3ovry2bpzly34"},1e4:{key:"10000",name:"smartBCH",shortName:"BCH",chainId:1e4,network:"mainnet",multicall:"0x1b38EBAd553f218e2962Cb1C0539Abb5d6A37774",rpc:["https://smartbch.greyh.at/"],explorer:{url:"https://smartbch-explorer.web.app"},start:268248,logo:"ipfs://QmWG1p7om4hZ4Yi4uQvDpxg4si7qVYhtppGbcDGrhVFvMd"},10243:{key:"10243",name:"Arthera Testnet",shortName:"Arthera_",chainId:10243,network:"testnet",testnet:!0,multicall:"0x27c7FC597aD2E81C4c1cA1769972f79DaF042Da7",rpc:["https://rpc-test.arthera.net"],explorer:{url:"https://explorer-test.arthera.net"},start:10523,logo:"ipfs://QmYQp3e52KjkT4bYdAvB6ACEEpXs2D8DozsDitaADRY2Ak"},13337:{key:"13337",name:"Beam Testnet",shortName:"testnet",chainId:13337,network:"testnet",multicall:"0x9BF49b704EE2A095b95c1f2D4EB9010510c41C9E",rpc:[],explorer:{url:"https://subnets-test.avax.network/beam/"},start:3,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF",testnet:!0},16718:{key:"16718",name:"AirDAO Mainnet",chainId:16718,network:"mainnet",multicall:"0x25e81aC81A8B03389D78CB45faB78353aB528574",rpc:["https://network-archive.ambrosus.io"],ws:["wss://network-archive.ambrosus.io/ws"],explorer:{url:"https://airdao.io/explorer"},start:22922566,logo:"ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"},29548:{key:"29548",name:"MCH Verse ",shortName:"mainnet",chainId:29548,network:"mainnet",multicall:"0x1d39652386488CE1fE4254E105F5A42a04d43dB2",rpc:[],explorer:{url:"https://explorer.oasys.mycryptoheroes.net"},start:27458402,logo:"ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"},42161:{key:"42161",name:"Arbitrum One",chainId:42161,network:"Arbitrum mainnet",multicall:"0x7A7443F8c577d537f1d8cD4a629d40a3148Dd7ee",rpc:["https://rpc.ankr.com/arbitrum","https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/arbitrum/mainnet","https://arb-mainnet.g.alchemy.com/v2/JDvtNGwnHhTltIwfnxQocKwKkCTKA1DL"],explorer:{url:"https://arbiscan.io"},start:256508,logo:"ipfs://QmWZ5SMRfvcK8tycsDqojQaSiKedgtVkS7CkZdxPgeCVsZ"},42170:{key:"42170",name:"Arbitrum Nova",chainId:42170,network:"Arbitrum Nova",multicall:"0x4E74EBd9CABff51cE9a43EFe059bA8c5A28E4A14",rpc:["https://nova.arbitrum.io/rpc","https://arbitrum-nova.public.blastapi.io"],explorer:{url:"https://nova.arbiscan.io/"},start:6006607,logo:"ipfs://bafkreie5xsqt3mrrwu7v32qpmmctibhzhgxf4emfzzddsdhdlfsa7fmplu"},42220:{key:"42220",name:"Celo Mainnet",shortName:"Celo",chainId:42220,network:"mainnet",multicall:"0xb8d0d2C1391eeB350d2Cd39EfABBaaEC297368D9",rpc:["https://celo.snapshot.org","https://forno.celo.org","https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"],explorer:{url:"https://explorer.celo.org"},start:6599803,logo:"ipfs://QmS2tVJ7rdJRe1NHXAi2L86yCbUwVVrmB2mHQeNdJxvQti"},43113:{key:"43113",name:"Avalanche FUJI Testnet",chainId:43113,network:"testnet",testnet:!0,multicall:"0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",rpc:["https://api.avax-test.network/ext/bc/C/rpc"],explorer:{url:"https://testnet.snowtrace.io"},start:10528153,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},43114:{key:"43114",name:"Avalanche",chainId:43114,network:"mainnet",multicall:"0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",rpc:["https://nd-784-543-849.p2pify.com/aa7b29fc5fed65b34f0ee6b8de33f8c0/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://api.avax.network/ext/bc/C/rpc"],explorer:{url:"https://snowtrace.io"},start:536483,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},47805:{key:"47805",name:"REI Mainnet",chainId:47805,network:"mainnet",multicall:"0x9eE9904815B80C39C1a27294E69a8626EAa7952d",rpc:["https://rpc.rei.network"],explorer:{url:"https://scan.rei.network/"},start:1715902,logo:"ipfs://QmTogMDLmDgJjDjUKDHDuc2KVTVDbXf8bXJLFiVe8PRxgo"},53935:{key:"53935",name:"DFK Chain",chainId:53935,network:"mainnet",multicall:"0x5b24224dC16508DAD755756639E420817DD4c99E",rpc:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"],explorer:{url:"https://subnets.avax.network/defi-kingdoms/"},start:62,logo:"ipfs://QmZNkpVgPbuVbDcsi6arwH1om3456FGnwfDqYQJWUfHDEx"},59140:{key:"59140",name:"Linea Goerli testnet",shortName:"Linea Goerli",chainId:59140,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.goerli.linea.build"],explorer:{url:"https://explorer.goerli.linea.build"},start:498623,logo:"ipfs://QmSwCnEeLoyMApQd1YfhmGvLt97bH5mLPoabjKqUSuQHHF"},80001:{key:"80001",name:"Polygon Mumbai",chainId:80001,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/polygon/mumbai/archive","https://rpc-mumbai.matic.today"],ws:["wss://ws-mumbai.matic.today"],explorer:{url:"https://mumbai.polygonscan.com",apiUrl:"https://api-mumbai.polygonscan.com"},start:12011090,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},84531:{key:"84531",name:"Base Goerli Testnet",chainId:84531,network:"Base",testnet:!0,multicall:"0x0012989E982C2c473e36418384Ab707C72f2B782",rpc:["https://goerli.base.org"],explorer:{url:"https://goerli.basescan.org/"},start:1151797,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},11155111:{key:"11155111",name:"Sepolia",shortName:"Sepolia",chainId:11155111,network:"sepolia",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://sepolia.infura.io/v3/d26b4fd748814fe994b05899fd89e667"],explorer:{url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io"},start:751532,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},245022926:{key:"245022926",name:"Neon Devnet",shortName:"devnet",chainId:245022926,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://devnet.neonscan.org/"},start:205206112,logo:"ipfs://QmecRPQGa4bU7tybg1sUQY48Md9rWnmhrT6WW5ueqvhg6P",testnet:!0},1313161554:{key:"1313161554",name:"Aurora Mainnet",shortName:"Aurora",chainId:1313161554,network:"mainnet",multicall:"0x32b50c286DEFd2932a0247b8bb940b78c063F16c",rpc:["https://mainnet.aurora.dev"],explorer:{url:"https://explorer.mainnet.aurora.dev"},start:57190533,logo:"ipfs://QmeRhsR1UPRTQCizdhmgr2XxphXebVKU5di97uCV2UMFpa"},16666e5:{key:"1666600000",name:"Harmony Mainnet",shortName:"HarmonyMainnet",chainId:16666e5,network:"mainnet",multicall:"0x9c31392D2e0229dC4Aa250F043d46B9E82074BF8",rpc:["https://a.api.s0.t.hmny.io"],ws:["wss://ws.s0.t.hmny.io"],explorer:{url:"https://explorer.harmony.one"},start:10911984,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"},16667e5:{key:"1666700000",name:"Harmony Testnet",shortName:"HarmonyTestnet",chainId:16667e5,network:"testnet",testnet:!0,multicall:"0x9923589503Fd205feE3d367DDFF2378f0F7dD2d4",rpc:["https://api.s0.b.hmny.io"],ws:["wss://ws.s0.b.hmny.io"],explorer:{url:"https://explorer.pops.one"},start:7521509,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"}},Pm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.getValidVotes().filter((function(t){return t.choice===r+1}));return n.reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.strategies.map((function(e,n){var i=t.getValidVotes().filter((function(t){return t.choice===r+1}));return i.reduce((function(t,e){return t+e.scores[n]}),0)}));return n}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){return this.proposal.choices[this.selected-1]},t}(),Im=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.scores[n]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected?this.proposal.choices.filter((function(e,r){return t.selected.includes(r+1)})).join(", "):""},t}();function Rm(t,e){var r=t/e.reduce((function(t,e){return t+e}),0);return isNaN(r)?0:r}function Cm(t,e){return Math.sqrt(t*e)}function Tm(t){return t*t}function Om(t,e){return t.map((function(t){return e*t}))}var Bm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this.getValidVotes(),e=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),r=this.proposal.choices.map((function(e,r){var n=t.map((function(t){return Cm(Rm(t.choice[r+1],Object.values(t.choice)),t.balance)})).reduce((function(t,e){return t+e}),0);return Tm(n)}));return Om(r.map((function(t,e){return Rm(r[e],r)})),e)},t.prototype.getScoresByStrategy=function(){var t=this,e=this.getValidVotes(),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),n=this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.map((function(t){return Cm(Rm(t.choice[n+1],Object.values(t.choice)),t.scores[r])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[Tm(t)]}))}));return n.map((function(e,i){return Om(t.strategies.map((function(t,e){return Rm(n[i][e][0],n.flat(2))})),r)}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1]){var n=Rm(t.selected[r+1],Object.values(t.selected));return Math.round(1e3*n)/10+"% for "+e}})).filter((function(t){return null!=t})).join(", ")},t}();function $m(t,e){var r=i(new Set(t.map((function(t){return t[0]})).flat())),o=Object.entries(t.reduce((function(t,e,r,i){var o=n(e,1)[0],s=i[r][1];t[o[0]][0]+=s;var a=i[r][2];return a.length>1?t[o[0]][1]=a.map((function(e,r){return e+t[o[0]][1][r]||e})):t[o[0]][1]=[t[o[0]][1].concat(a).reduce((function(t,e){return t+e}),0)],t}),Object.assign.apply(Object,i([{}],r.map((function(t){var e;return(e={})[t]=[0,[]],e})))))),s=o.map((function(t){return[t[0],t[1][0]]})),a=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u>o?[a,u]:[i,o]}),["?",-1/0]),2),u=(a[0],a[1]),h=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u<o?[a,u]:[i,o]}),["?",1/0]),2),l=h[0],c=(h[1],o.sort((function(t,e){return e[1][0]-t[1][0]}))),f=t.map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0);return e.push({round:e.length+1,sortedByHighest:c}),u>f/2||c.length<3?e:$m(t.map((function(t){return[t[0].filter((function(t){return t!=l})),t[1],t[2]]})).filter((function(t){return t[0].length>0})),e)}function Dm(t){var e=$m(t.map((function(t){return[t.choice,t.balance,t.scores]})),[]);return e[e.length-1].sortedByHighest}function Fm(t,e){var r=Dm(t);return e.choices.map((function(t,e){return r.filter((function(t){return Number(t[0])===e+1})).reduce((function(t,e){return t+e[1][0]}),0)}))}var Um=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){return Fm(this.getValidVotes(),this.proposal)},t.prototype.getScoresByStrategy=function(){var t=this,e=Dm(this.getValidVotes());return this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.filter((function(t){return Number(t[0])===n+1})).reduce((function(t,e){return t+e[1][1][r]}),0)}))}))},t.prototype.getScoresTotal=function(){return Fm(this.votes,this.proposal).reduce((function(t,e){return t+e}))},t.prototype.getChoiceString=function(){var t=this;return this.selected.map((function(e){if(t.proposal.choices[e-1])return t.proposal.choices[e-1]})).map((function(t,e){return"("+ng(e+1)+") "+t})).join(", ")},t}();function jm(t,e,r){var n=r.reduce((function(t,e){return t+e}),0),i=e[t]/n*100;return isNaN(i)?0:i}function Lm(t,e,r){return jm(t+1,e,Object.values(e))/100*r}var zm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.getValidVotes().map((function(t){return Lm(r,t.choice,t.balance)})).reduce((function(t,e){return t+e}),0)})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(t,r){return jm(r,e,e)})).map((function(t){return r/100*t}))},t.prototype.getScoresByStrategy=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().map((function(t){return Lm(r,t.choice,t.scores[n])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[t]}))})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(n,i){return t.strategies.map((function(t,r){return jm(0,e[i][r],e.flat(2))})).map((function(t){return[r/100*t]})).flat()}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1])return Math.round(10*jm(r+1,t.selected,Object.values(t.selected)))/10+"% for "+e})).filter((function(t){return null!=t})).join(", ")},t}(),qm={"single-choice":Pm,approval:Im,quadratic:Bm,"ranked-choice":Um,weighted:zm,basic:Pm},Vm={1:"https://subgrapher.snapshot.org/gateway-arbitrum.network.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/subgraphs/id/4YgtogVaqoM8CErHWDK8mKQ825BcVdKB8vBYmb4avAQo",5:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",10:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",56:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",100:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",137:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",250:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",42161:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"},Gm=["function text(bytes32 node, string calldata key) external view returns (string memory)"],Hm={Accept:"application/json","Content-Type":"application/json"},Km=new gf({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});bf(Km),Km.addFormat("address",{validate:function(t){try{return $e(t)}catch(t){return!1}}}),Km.addFormat("long",{validate:function(){return!0}}),Km.addFormat("ethValue",{validate:function(t){if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&tu.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=eu.indexOf(e);-1!==t&&(e=3*t)}Ja(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});var Qm=Object.keys(Sm),Jm=Object.keys(Sm).filter((function(t){return!Sm[t].testnet}));function Ym(t,n,o,s){return e(this,void 0,void 0,(function(){var e,a,u;return r(this,(function(r){switch(r.label){case 0:e=new ha(o[0],n,t),r.label=1;case 1:return r.trys.push([1,3,,4]),a=o[2]||[],[4,e[o[1]].apply(e,i(a,[s||{}]))];case 2:return[2,r.sent()];case 3:return u=r.sent(),[2,Promise.reject(u)];case 4:return[2]}}))}))}function Zm(t,i,o,s,a){return e(this,void 0,void 0,(function(){var e,u,h,l,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:e=["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],u=(null==a?void 0:a.multicallAddress)||Sm[t].multicall,h=new ha(u,e,i),l=new ti(o),r.label=1;case 1:return r.trys.push([1,3,,4]),c=(null==a?void 0:a.limit)||500,(null==a?void 0:a.limit)&&delete a.limit,f=Math.ceil(s.length/c),d=[],Array.from(Array(f)).forEach((function(t,e){var r=s.slice(c*e,c*(e+1));d.push(h.aggregate(r.map((function(t){return[t[0].toLowerCase(),l.encodeFunctionData(t[1],t[2])]})),a||{}))})),[4,Promise.all(d)];case 2:return[2,r.sent().reduce((function(t,e){var r=n(e,2)[1];return t.concat(r)}),[]).map((function(t,e){return l.decodeFunctionResult(s[e][1],t)}))];case 3:return p=r.sent(),[2,Promise.reject(p)];case 4:return[2]}}))}))}function Wm(n,i,o){return void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return[4,l(n,{method:"POST",headers:t({Accept:"application/json","Content-Type":"application/json"},null==o?void 0:o.headers),body:JSON.stringify({query:Yh.jsonToGraphQLQuery({query:i})})})];case 1:return[4,(e=r.sent()).text()];case 2:s=r.sent();try{s=JSON.parse(s)}catch(t){throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+s.substring(0,400))}if(s.errors)throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+JSON.stringify(s.errors).substring(0,400));return[2,s.data||{}]}}))}))}function Xm(t,e){void 0===e&&(e=xm[0]);var r="https://"+e;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return r+"/ipfs/"+t;var n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",r+"/ipfs/"):"ipns"===n?t.replace("ipns://",r+"/ipns/"):t}function tg(t,n,i,o){return void 0===i&&(i="1"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return e=o.ensResolvers,s=o.broviderUrl,a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(o,["ensResolvers","broviderUrl"]),u=e||Sm[i].ensResolvers||Sm[1].ensResolvers,h=gh(mh(t)),l=im(i,{broviderUrl:s}),[4,Zm(i,l,Gm,u.map((function(t){return[t,"text",[h,n]]})),a)];case 1:return[2,r.sent().flat().find((function(t){return t}))||""]}}))}))}function eg(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,tg(t,"snapshot",n,i)];case 1:return[2,r.sent()];case 2:return e=r.sent(),console.log(e),[2,null];case 3:return[2]}}))}))}function rg(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a,u;return r(this,(function(r){switch(r.label){case 0:return"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",e=im(n,i),o=new ha("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",["function owner(bytes32) view returns (address)"],e),s=i.ensNameWrapper||Sm[n].ensNameWrapper,a=gh(mh(t)),[4,o.owner(a)];case 1:return(u=r.sent())!==s?[3,3]:[4,new ha(s,["function ownerOf(uint256) view returns (address)"],e).ownerOf(a)];case 2:u=r.sent(),r.label=3;case 3:return[2,u]}}))}))}function ng(t){var e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function ig(t){return!!Sm[t]}function og(t){return $e(t)&&"0x0000000000000000000000000000000000000000"!==t}function sg(t,e){return"latest"===t||"number"==typeof t&&t>=Sm[e].start}function ag(t){return Promise.reject(new Error(t))}Km.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?Jm.includes(e):Qm.includes(e)},error:{message:"network not allowed"}}),Km.addFormat("customUrl",{type:"string",validate:function(t){return!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))}});var ug={call:Ym,multicall:Zm,subgraphRequest:Wm,ipfsGet:function(t,n,i){return void 0===i&&(i="ipfs"),e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,l("https://"+t+"/"+i+"/"+n).then((function(t){return t.json()}))]}))}))},getUrl:Xm,getJSON:function(t,n){return void 0===n&&(n={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){return e=Xm(t,n.gateways),[2,l(e).then((function(t){return t.json()}))]}))}))},sendTransaction:function(t,n,o,s,a,u){return void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,l;return r(this,(function(r){switch(r.label){case 0:return e=t.getSigner(),h=new ha(n,o,t),[4,(l=h.connect(e))[s].apply(l,i(a,[u]))];case 1:return[2,r.sent()]}}))}))},getScores:function(t,n,i,o,s,a,u){return void 0===s&&(s="latest"),void 0===a&&(a="https://score.snapshot.org"),void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:if(!Array.isArray(o))return[2,ag("addresses should be an array of addresses")];if(0===o.length)return[2,ag("addresses can not be empty")];if(e=o.find((function(t){return!og(t)})))return[2,ag("Invalid address: "+e)];if(!ig(i))return[2,ag("Invalid network: "+i)];if(h=n.find((function(t){return t.network&&!ig(t.network)})))return[2,ag("Invalid network ("+h.network+") in strategy "+h.name)];if(!sg(s,i))return[2,ag("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Sm[i].start+")")];(c=new URL(a)).pathname="/api/scores",a=c.toString(),r.label=1;case 1:return r.trys.push([1,4,,5]),f={space:t,network:i,snapshot:s,strategies:n,addresses:o},[4,l(a,{method:"POST",headers:Hm,body:JSON.stringify({params:f})})];case 2:return[4,r.sent().json()];case 3:return(d=r.sent()).error?[2,Promise.reject(d.error)]:[2,"all"===u.returnValue?d.result:d.result[u.returnValue||"scores"]];case 4:return(p=r.sent()).errno?[2,Promise.reject({code:p.errno,message:p.toString(),data:""})]:[2,Promise.reject(p)];case 5:return[2]}}))}))},getVp:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f;return r(this,(function(r){switch(r.label){case 0:if(u||(u={}),u.url||(u.url="https://score.snapshot.org"),!og(t))return[2,ag("Invalid voter address: "+t)];if(!ig(n))return[2,ag("Invalid network: "+n)];if(e=i.find((function(t){return t.network&&!ig(t.network)})))return[2,ag("Invalid network ("+e.network+") in strategy "+e.name)];if(!sg(o,n))return[2,ag("Snapshot ("+o+") must be 'latest' or greater than network start block ("+Sm[n].start+")")];h={method:"POST",headers:Hm,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:n,strategies:i,snapshot:o,space:s,delegation:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(u.url,h)];case 2:return[4,r.sent().json()];case 3:return(c=r.sent()).error?[2,Promise.reject(c.error)]:c.result?[2,c.result]:[3,5];case 4:return(f=r.sent()).errno?[2,Promise.reject({code:f.errno,message:f.toString(),data:""})]:[2,Promise.reject(f)];case 5:return[2]}}))}))},validateSchema:function(t,e,r){void 0===r&&(r={snapshotEnv:"default"});var n=Km.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:tg,getSpaceUri:eg,getEnsOwner:rg,getSpaceController:function(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a;return r(this,(function(r){switch(r.label){case 0:return[4,eg(t,n,i)];case 1:if(e=r.sent()){if($e(e))return[2,e];if(o=e.split("/"),s=o.includes("testnet")?5:4,a=o[s],$e(a))return[2,a]}return[4,rg(t,n,i)];case 2:return[2,r.sent()]}}))}))},getDelegatesBySpace:function(t,n,i,o){return void 0===i&&(i="latest"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:if(!(e=o.subgraphUrl||Vm[t]))return[2,Promise.reject("Delegation subgraph not available for network "+t)];s=["",n],n.includes(".eth")&&s.push(n.replace(".eth","")),u=[],h=0,l={delegations:{__args:{where:{space_in:s},first:a=1e3,skip:0},delegator:!0,space:!0,delegate:!0}},"latest"!==i&&(l.delegations.__args.block={number:i}),r.label=1;case 1:return l.delegations.__args.skip=h*a,[4,Wm(e,l)];case 2:return c=r.sent(),f=c.delegations||[],u=u.concat(f),h++,f.length<a?[3,3]:[3,1];case 3:return[2,u]}}))}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new Promise((function(e){setTimeout(e,t)}))]}))}))},getNumberWithOrdinal:ng,voting:qm,getProvider:im,signMessage:function(t,n,i){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n=C(new Buffer(n,"utf8")),[4,t.send("personal_sign",[n,i])];case 1:return[2,e.sent()]}}))}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.getBlockNumber()];case 1:return e=r.sent(),[2,parseInt(e)];case 2:return r.sent(),[2,Promise.reject()];case 3:return[2]}}))}))},Multicaller:pd,getSnapshots:function(t,n,i,o,s){return void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:return e={},o.forEach((function(t){return e[t]="latest"})),"latest"===n?[2,e]:(a=t+"-"+n+"-"+o.join("-"),u=md[a],h=Date.now(),u&&gd>h?[2,u]:(gd<h&&(md={},gd=h+36e5-h%36e5),e[t]=n,l=Object.keys(e).filter((function(e){return t!==e})),0===l.length?[2,e]:[4,i.getBlock(n)]));case 1:return c=r.sent(),f={blocks:{__args:{where:{ts:c.timestamp,network_in:l}},network:!0,number:!0}},[4,Wm(s.blockFinderUrl||"https://blockfinder.snapshot.org",f)];case 2:return r.sent().blocks.forEach((function(t){return e[t.network]=t.number})),md[a]=e,[2,e]}}))}))},getHash:Nm,verify:function(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:e=i.domain,a=i.types,u=i.message,h=Nm(i);try{if(l=Mm(e,a,u,n),t===l)return[2,!0]}catch(t){}return[4,km(t,n,h,o,s)];case 1:return[2,r.sent()]}}))}))},validate:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c;return r(this,(function(r){switch(r.label){case 0:if(!og(n))return[2,ag("Invalid author: "+n)];if(!ig(o))return[2,ag("Invalid network: "+o)];if(!sg(s,o))return[2,ag("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Sm[o].start+")")];u||(u={}),u.url||(u.url="https://score.snapshot.org"),e={method:"POST",headers:Hm,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:n,space:i,network:o,snapshot:s,params:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(u.url,e)];case 2:return[4,r.sent().json()];case 3:return(h=r.sent()).error?[2,Promise.reject(h.error)]:[2,h.result];case 4:return(c=r.sent()).errno?[2,Promise.reject({code:c.errno,message:c.toString(),data:""})]:[2,Promise.reject(c)];case 5:return[2]}}))}))},SNAPSHOT_SUBGRAPH_URL:Vm};return{Client:ur,Client712:ur,schemas:gr,utils:ug}}));
21
+ deps: ${r}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,r]=function({schema:t}){const e={},r={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:r)[n]=t[n]}return[e,r]}(t);n(t,e),i(t,r)}};function n(t,e=t.schema){const{gen:r,data:n,it:i}=t;if(0===Object.keys(e).length)return;const o=r.let("missing");for(const s in e){const a=e[s];if(0===a.length)continue;const u=(0,hl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(u,(()=>{for(const e of a)(0,hl.checkReportMissingProp)(t,e)})):(r.if(Xh._`${u} && (${(0,hl.checkMissingProp)(t,a,o)})`),(0,hl.reportMissingProp)(t,o),r.else())}}function i(t,e=t.schema){const{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(const a in e)(0,tl.alwaysValidSchema)(o,e[a])||(r.if((0,hl.propertyInData)(r,n,a,o.opts.ownProperties),(()=>{const e=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(e,s)}),(()=>r.var(s,!0))),t.ok(s))}e.validatePropertyDeps=n,e.validateSchemaDeps=i,e.default=r}));const Nc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Xh._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,tl.alwaysValidSchema)(i,r))return;const o=e.name("valid");e.forIn("key",n,(r=>{t.setParams({propertyName:r}),t.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),e.if((0,Xh.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var xc=Nc,Sc=Object.defineProperty({default:xc},"__esModule",{value:!0});const Pc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Xh._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=s;if(s.props=!0,"all"!==u.removeAdditional&&(0,tl.alwaysValidSchema)(s,r))return;const h=(0,hl.allSchemaProperties)(n.properties),l=(0,hl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Xh._`delete ${i}[${t}]`)}function f(n){if("all"===u.removeAdditional||u.removeAdditional&&!1===r)c(n);else{if(!1===r)return t.setParams({additionalProperty:n}),t.error(),void(a||e.break());if("object"==typeof r&&!(0,tl.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===u.removeAdditional?(d(n,r,!1),e.if((0,Xh.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Xh.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:tl.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{h.length||l.length?e.if(function(r){let i;if(h.length>8){const t=(0,tl.schemaRefOrVal)(s,n.properties,"properties");i=(0,hl.isOwnProperty)(e,t,r)}else i=h.length?(0,Xh.or)(...h.map((t=>Xh._`${r} === ${t}`))):Xh.nil;return l.length&&(i=(0,Xh.or)(i,...l.map((e=>Xh._`${(0,hl.usePattern)(t,e)}.test(${r})`)))),(0,Xh.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Xh._`${o} === ${rl.default.errors}`)}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&Rc.default.code(new ml.KeywordCxt(o,Rc.default,"additionalProperties"));const s=(0,hl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=tl.mergeEvaluated.props(e,(0,tl.toHash)(s),o.props));const a=s.filter((t=>!(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const u=e.name("valid");for(const r of a)h(r)?l(r):(e.if((0,hl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(u);function h(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},u)}}};var Tc=Cc,Oc=Object.defineProperty({default:Tc},"__esModule",{value:!0});const Bc=tl,$c={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,hl.allSchemaProperties)(r),u=a.filter((t=>(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length||u.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const h=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Xh.Name||(o.props=(0,Bc.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in h)new RegExp(t).test(e)&&(0,tl.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Xh._`${(0,hl.usePattern)(t,r)}.test(${n})`,(()=>{const i=u.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Bc.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Xh._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Xh.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)h&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Dc=$c,Fc=Object.defineProperty({default:Dc},"__esModule",{value:!0});var Uc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,tl.alwaysValidSchema)(n,r))return void t.fail();const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}},jc=Object.defineProperty({default:Uc},"__esModule",{value:!0});var Lc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hl.validateUnion,error:{message:"must match a schema in anyOf"}},zc=Object.defineProperty({default:Lc},"__esModule",{value:!0});var qc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Xh._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,s=e.let("valid",!1),a=e.let("passing",null),u=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,tl.alwaysValidSchema)(i,r)?e.var(u,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},u),n>0&&e.if(Xh._`${u} && ${s}`).assign(s,!1).assign(a,Xh._`[${a}, ${n}]`).else(),e.if(u,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Xh.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Vc=Object.defineProperty({default:qc},"__esModule",{value:!0});var Gc={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=e.name("valid");r.forEach(((e,r)=>{if((0,tl.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},Hc=Object.defineProperty({default:Gc},"__esModule",{value:!0});const Kc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Xh.str`must match "${t.ifClause}" schema`,params:({params:t})=>Xh._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,tl.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Qc(n,"then"),o=Qc(n,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(e)}(),t.reset(),i&&o){const r=e.let("ifClause");t.setParams({ifClause:r}),e.if(a,u("then",r),u("else",r))}else i?e.if(a,u("then")):e.if((0,Xh.not)(a),u("else"));function u(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Xh._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Qc(t,e){const r=t.schema[e];return void 0!==r&&!(0,tl.alwaysValidSchema)(t,r)}var Jc=Kc,Yc=Object.defineProperty({default:Jc},"__esModule",{value:!0});const Zc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,tl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Wc=Zc,Xc=Object.defineProperty({default:Wc},"__esModule",{value:!0});var tf=function(t=!1){const e=[jc.default,zc.default,Vc.default,Hc.default,Yc.default,Xc.default,Sc.default,Rc.default,kc.default,Oc.default,Fc.default];return t?e.push(wc.default,Mc.default):e.push(gc.default,yc.default),e.push(Ac.default),e},ef=Object.defineProperty({default:tf},"__esModule",{value:!0});const rf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match format "${t}"`,params:({schemaCode:t})=>Xh._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:u,errSchemaPath:h,schemaEnv:l,self:c}=a;u.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:u.code.formats}),o=r.const("fDef",Xh._`${i}[${s}]`),a=r.let("fType"),h=r.let("format");r.if(Xh._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Xh._`${o}.type || "string"`).assign(h,Xh._`${o}.validate`)),(()=>r.assign(a,Xh._`"string"`).assign(h,o))),t.fail$data((0,Xh.or)(!1===u.strictSchema?Xh.nil:Xh._`${s} && !${h}`,function(){const t=l.$async?Xh._`(${o}.async ? await ${h}(${n}) : ${h}(${n}))`:Xh._`${h}(${n})`,r=Xh._`(typeof ${h} == "function" ? ${t} : ${h}.test(${n}))`;return Xh._`${h} && ${h} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===u.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Xh.regexpCode)(t):u.code.formats?Xh._`${u.code.formats}${(0,Xh.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,Xh._`${n}.validate`];return["string",t,n]}(i);s===e&&t.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return Xh._`await ${f}(${n})`}return"function"==typeof a?Xh._`${f}(${n})`:Xh._`${f}.test(${n})`}())}())}};var nf=rf;var of=[Object.defineProperty({default:nf},"__esModule",{value:!0}).default],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}));var uf=[Cl.default,mc.default,(0,ef.default)(),sf.default,af.metadataVocabulary,af.contentVocabulary],hf=Object.defineProperty({default:uf},"__esModule",{value:!0}),lf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))}));const cf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===lf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Xh._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},code(t){const{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if("string"!=typeof a)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=e.let("valid",!1),h=e.const("tag",Xh._`${r}${(0,Xh.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Xh.Name),n}e.if(Xh._`typeof ${h} == "string"`,(()=>function(){const r=function(){var t;const e={},r=u(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,tl.schemaHasRulesButRef)(i,o.self.RULES)&&(i=Ml.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof Ml.SchemaEnv&&(i=i.schema));const l=null===(t=null==i?void 0:i.properties)||void 0===t?void 0:t[a];if("object"!=typeof l)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);n=n&&(r||u(i)),h(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function u({required:t}){return Array.isArray(t)&&t.includes(a)}function h(t,e){if(t.const)l(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`);for(const r of t.enum)l(r,e)}}function l(t,r){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${a}" values must be unique strings`);e[t]=r}}();e.if(!1);for(const t in r)e.elseIf(Xh._`${h} === ${t}`),e.assign(u,l(r[t]));e.else(),t.error(!1,{discrError:lf.DiscrError.Mapping,tag:h,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:lf.DiscrError.Tag,tag:h,tagName:a}))),t.ok(u)}};var ff=cf,df=Object.defineProperty({default:ff},"__esModule",{value:!0}),pf={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},mf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=["/properties"],n="http://json-schema.org/draft-07/schema";class i extends xl.default{_addVocabularies(){super._addVocabularies(),hf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(df.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(pf,r):pf;this.addMetaSchema(t,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}})})),gf=s(mf),yf=u((function(t,e){function r(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:r(o,s),time:r(u,h),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&u(e[1],!0)}),c),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return f.test(t)&&d.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(g.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return p.lastIndex=0,p.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=2147483647&&t>=-2147483648}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:m},double:{type:"number",validate:m},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(t){const e=n.exec(t);if(!e)return!1;const r=+e[1],o=+e[2],s=+e[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(r)?29:i[o])}function s(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function u(t,e){const r=a.exec(t);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!e||""!==s)}function h(t,e){if(!t||!e)return;const r=a.exec(t),n=a.exec(e);return r&&n?(t=r[1]+r[2]+r[3]+(r[4]||""))>(e=n[1]+n[2]+n[3]+(n[4]||""))?1:t<e?-1:0:void 0}const l=/t|\s/i;function c(t,e){if(!t||!e)return;const[r,n]=t.split(l),[i,o]=e.split(l),a=s(r,i);return void 0!==a?a||h(n,o):void 0}const f=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(){return!0}const g=/[^\\]\\Z/})),vf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Xh.operators,n={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:t,schemaCode:e})=>Xh.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{comparison: ${n[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(t){const{gen:e,data:r,schemaCode:i,keyword:o,it:s}=t,{opts:a,self:u}=s;if(!a.validateFormats)return;const h=new mf.KeywordCxt(s,u.RULES.all.format.definition,"format");function l(t){return Xh._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}h.$data?function(){const r=e.scopeValue("formats",{ref:u.formats,code:a.code.formats}),n=e.const("fmt",Xh._`${r}[${h.schemaCode}]`);t.fail$data(Xh.or(Xh._`typeof ${n} != "object"`,Xh._`${n} instanceof RegExp`,Xh._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=h.schema,n=u.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${o}": format "${r}" does not define "compare" function`);const i=e.scopeValue("formats",{key:r,ref:n,code:a.code.formats?Xh._`${a.code.formats}${Xh.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),wf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Xh.Name("fullFormats"),n=new Xh.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,yf.fullFormats,r),t;const[i,s]="fast"===e.mode?[yf.fastFormats,n]:[yf.fullFormats,r];return o(t,e.formats||yf.formatNames,i,s),e.keywords&&vf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Xh._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,r[n])}i.get=(t,e="full")=>{const r=("fast"===e?yf.fastFormats:yf.fullFormats)[t];if(!r)throw new Error(`Unknown format "${t}"`);return r},t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i})),bf=s(wf),Ef="__lodash_hash_undefined__",Mf="[object Function]",_f="[object GeneratorFunction]",Af=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kf=/^\w*$/,Nf=/^\./,xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sf=/\\(\\)?/g,Pf=/^\[object .+?Constructor\]$/,If=/^(?:0|[1-9]\d*)$/,Rf="object"==typeof o&&o&&o.Object===Object&&o,Cf="object"==typeof self&&self&&self.Object===Object&&self,Tf=Rf||Cf||Function("return this")();var Of,Bf=Array.prototype,$f=Function.prototype,Df=Object.prototype,Ff=Tf["__core-js_shared__"],Uf=(Of=/[^.]+$/.exec(Ff&&Ff.keys&&Ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Of:"",jf=$f.toString,Lf=Df.hasOwnProperty,zf=Df.toString,qf=RegExp("^"+jf.call(Lf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vf=Tf.Symbol,Gf=Bf.splice,Hf=id(Tf,"Map"),Kf=id(Object,"create"),Qf=Vf?Vf.prototype:void 0,Jf=Qf?Qf.toString:void 0;function Yf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Zf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Xf(t,e,r){var n=t[e];Lf.call(t,e)&&hd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function td(t,e){for(var r=t.length;r--;)if(hd(t[r][0],e))return r;return-1}function ed(t){if(!cd(t)||(e=t,Uf&&Uf in e))return!1;var e,r=function(t){var e=cd(t)?zf.call(t):"";return e==Mf||e==_f}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?qf:Pf;return r.test(function(t){if(null!=t){try{return jf.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function rd(t,e,r,n){if(!cd(t))return t;e=function(t,e){if(ld(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||fd(t))return!0;return kf.test(t)||!Af.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return ld(t)?t:sd(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var u=ad(e[i]),h=r;if(i!=s){var l=a[u];void 0===(h=n?n(l,u,a):void 0)&&(h=cd(l)?l:od(e[i+1])?[]:{})}Xf(a,u,h),a=a[u]}return t}function nd(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function id(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ed(r)?r:void 0}function od(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||If.test(t))&&t>-1&&t%1==0&&t<e}Yf.prototype.clear=function(){this.__data__=Kf?Kf(null):{}},Yf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Yf.prototype.get=function(t){var e=this.__data__;if(Kf){var r=e[t];return r===Ef?void 0:r}return Lf.call(e,t)?e[t]:void 0},Yf.prototype.has=function(t){var e=this.__data__;return Kf?void 0!==e[t]:Lf.call(e,t)},Yf.prototype.set=function(t,e){return this.__data__[t]=Kf&&void 0===e?Ef:e,this},Zf.prototype.clear=function(){this.__data__=[]},Zf.prototype.delete=function(t){var e=this.__data__,r=td(e,t);return!(r<0)&&(r==e.length-1?e.pop():Gf.call(e,r,1),!0)},Zf.prototype.get=function(t){var e=this.__data__,r=td(e,t);return r<0?void 0:e[r][1]},Zf.prototype.has=function(t){return td(this.__data__,t)>-1},Zf.prototype.set=function(t,e){var r=this.__data__,n=td(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Wf.prototype.clear=function(){this.__data__={hash:new Yf,map:new(Hf||Zf),string:new Yf}},Wf.prototype.delete=function(t){return nd(this,t).delete(t)},Wf.prototype.get=function(t){return nd(this,t).get(t)},Wf.prototype.has=function(t){return nd(this,t).has(t)},Wf.prototype.set=function(t,e){return nd(this,t).set(t,e),this};var sd=ud((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(fd(t))return Jf?Jf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return Nf.test(t)&&r.push(""),t.replace(xf,(function(t,e,n,i){r.push(n?i.replace(Sf,"$1"):e||t)})),r}));function ad(t){if("string"==typeof t||fd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ud(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ud.Cache||Wf),r}function hd(t,e){return t===e||t!=t&&e!=e}ud.Cache=Wf;var ld=Array.isArray;function cd(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function fd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==zf.call(t)}var dd=function(t,e,r){return null==t?t:rd(t,e,r)},pd=function(){function t(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}return t.prototype.call=function(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this},t.prototype.execute=function(t){return e(this,void 0,void 0,(function(){var e,n=this;return r(this,(function(r){switch(r.label){case 0:return e=t||{},[4,Ym(this.network,this.provider,this.abi,this.calls,this.options)];case 1:return r.sent().forEach((function(t,r){return dd(e,n.paths[r],t.length>1?t:t[0])})),this.calls=[],this.paths=[],[2,e]}}))}))},t}(),md={},gd=0;const yd=new b("networks/5.6.4");function vd(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return vd(t)},e}function wd(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return wd(t,e)},r}const bd={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:vd("homestead")},Ed={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:vd("ropsten")},Md={chainId:63,name:"classicMordor",_defaultProvider:wd("https://www.ethercluster.com/mordor","classicMordor")},_d={unspecified:{chainId:0,name:"unspecified"},homestead:bd,mainnet:bd,morden:{chainId:2,name:"morden"},ropsten:Ed,testnet:Ed,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:vd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:vd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:vd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:wd("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Md,classicTestnet:Md,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:wd("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:vd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:vd("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"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Ad(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return x(e)}function kd(t){t=x(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Nd{constructor(t){wr(this,"alphabet",t),wr(this,"base",t.length),wr(this,"_alphabetMap",{}),wr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=x(t);if(0===e.length)return"";let r=[0];for(let t=0;t<e.length;++t){let n=e[t];for(let t=0;t<r.length;++t)n+=r[t]<<8,r[t]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let t=0;0===e[t]&&t<e.length-1;++t)n+=this._leader;for(let t=r.length-1;t>=0;--t)n+=this.alphabet[r[t]];return n}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r<t.length;r++){let n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return x(new Uint8Array(e.reverse()))}}new Nd("abcdefghijklmnopqrstuvwxyz234567");const xd=new Nd("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Sd(t){return Me(kn(t))}const Pd="hash/5.6.1",Id=new b(Pd),Rd=new Uint8Array(32);Rd.fill(0);const Cd=new RegExp("^((.*)\\.)?([^.]+)$");function Td(t){"string"!=typeof t&&Id.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Rd;for(;e.length;){const n=e.match(Cd);null!=n&&""!==n[2]||Id.throwArgumentError("invalid ENS address; missing component","name",t);r=Me(S([r,Me(kn(Un(n[3])))])),e=n[2]||""}return C(r)}var Od=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Bd=new b(Pd),$d=new Uint8Array(32);$d.fill(0);const Dd=Ht.from(-1),Fd=Ht.from(0),Ud=Ht.from(1),jd=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Ld=D(Ud.toHexString(),32),zd=D(Fd.toHexString(),32),qd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Vd=["name","version","chainId","verifyingContract","salt"];function Gd(t){return function(e){return"string"!=typeof e&&Bd.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Hd={name:Gd("name"),version:Gd("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return Bd.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch(t){}return Bd.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return Bd.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Kd(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&Bd.throwArgumentError("invalid numeric width","type",t);const i=jd.mask(r?n-1:n),o=r?i.add(Ud).mul(Dd):Fd;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&Bd.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&Bd.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&Bd.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?B([e,$d.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D(Be(t),32)};case"bool":return function(t){return t?Ld:zd};case"bytes":return function(t){return Me(t)};case"string":return function(t){return Sd(t)}}return null}function Qd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Jd{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&Bd.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Bd.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Kd(s)||(r[s]||Bd.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?Bd.throwArgumentError("missing primary type","types",t):i.length>1&&Bd.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&Bd.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=Qd(e,t[e])+r.map((e=>Qd(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=Kd(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&Bd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(Me)),Me(B(i))}}const r=this.types[t];if(r){const e=Sd(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?Me(n):n}));return n.unshift(e),B(n)}}return Bd.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Bd.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Me(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(Kd(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&Bd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):Bd.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Jd(t)}static getPrimaryType(t){return Jd.from(t).primaryType}static hashStruct(t,e,r){return Jd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=qd[r];n||Bd.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>Vd.indexOf(t.name)-Vd.indexOf(e.name))),Jd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return B(["0x1901",Jd.hashDomain(t),Jd.from(e).hash(r)])}static hash(t,e,r){return Me(Jd.encode(t,e,r))}static resolveNames(t,e,r,n){return Od(this,void 0,void 0,(function*(){t=Mr(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Jd.from(e);o.visit(r,((t,e)=>("address"!==t||I(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Jd.hashDomain(t);const n={},i=[];Vd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Hd[e](r),i.push({name:e,type:qd[e]}))}));const o=Jd.from(e),s=Mr(e);return s.EIP712Domain?Bd.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Bd.throwArgumentError("invalid string","value",e),e}return Bd.throwArgumentError("unsupported type","type",t)}))}}}new b("sha2/5.6.1");function Yd(t){return"0x"+Jo.sha256().update(x(t)).digest("hex")}var Zd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};function Wd(t,e){return Zd(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{o[t.toLowerCase()]=n.headers.get(t)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:x(new Uint8Array(i))}}))}var Xd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const tp=new b("web/5.6.1");function ep(t){return new Promise((e=>{setTimeout(e,t)}))}function rp(t,e){if(null==t)return null;if("string"==typeof t)return t;if(A(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return xn(t)}catch(t){}return C(t)}return t}function np(t,e,r){let n=null;if(null!=e){n=kn(e);const r="string"==typeof t?{url:t}:Mr(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=Mr(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return function(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;tp.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;tp.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const h={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||tp.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(c=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(h.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&tp.throwError("basic authentication requires a secure https url",b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+kd(kn(e))}}null!=t.skipFetchSetup&&(h.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:Ad(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){tp.throwError("processing response error",b.errors.SERVER_ERROR,{body:rp(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(h.method="POST",h.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),h.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(tp.makeError("timeout",b.errors.TIMEOUT,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,timeout:c,url:u})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return Xd(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield Wd(u,h),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===h.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,u)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,t))),yield ep(r);continue}}}catch(t){e=t.response,null==e&&(m.cancel(),tp.throwError("missing response",b.errors.SERVER_ERROR,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,serverError:t,url:u}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(m.cancel(),tp.throwError("bad response",b.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:rp(a,e.headers?e.headers["content-type"]:null),requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})),r)try{const t=yield r(a,e);return m.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield ep(e);continue}}m.cancel(),tp.throwError("processing response error",b.errors.SERVER_ERROR,{body:rp(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})}return m.cancel(),a}return tp.throwError("failed response",b.errors.SERVER_ERROR,{requestBody:rp(h.body,p["content-type"]),requestMethod:h.method,url:u})}))}();return Promise.race([m.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(xn(t))}catch(e){tp.throwError("invalid JSON",b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function ip(t,e){return e||(e={}),null==(e=Mr(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var op="qpzry9x8gf2tvdw0s3jn54khce6mua7l",sp={},ap=0;ap<op.length;ap++){var up=op.charAt(ap);if(void 0!==sp[up])throw new TypeError(up+" is ambiguous");sp[up]=ap}function hp(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function lp(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=hp(e)^n>>5}for(e=hp(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=hp(e)^31&i}return e}function cp(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var i=(t=r).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=lp(o);if("string"==typeof a)return a;for(var u=[],h=0;h<s.length;++h){var l=s.charAt(h),c=sp[l];if(void 0===c)return"Unknown character "+l;a=hp(a)^c,h+6>=s.length||u.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function fp(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var dp={decodeUnsafe:function(){var t=cp.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=cp.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=lp(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",o=0;o<e.length;++o){var s=e[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=hp(n)^s,i+=op.charAt(s)}for(o=0;o<6;++o)n=hp(n);for(n^=1,o=0;o<6;++o){i+=op.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=fp(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=fp(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=fp(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=fp(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const pp="providers/5.6.8",mp=new b(pp);class gp{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:gp.allowNull(this.accessList.bind(this),null),blockHash:gp.allowNull(o,null),blockNumber:gp.allowNull(a,null),transactionIndex:gp.allowNull(a,null),confirmations:gp.allowNull(a,null),from:e,gasPrice:gp.allowNull(r),maxPriorityFeePerGas:gp.allowNull(r),maxFeePerGas:gp.allowNull(r),gasLimit:r,to:gp.allowNull(e,null),value:r,nonce:a,data:i,r:gp.allowNull(this.uint256),s:gp.allowNull(this.uint256),v:gp.allowNull(a),creates:gp.allowNull(e,null),raw:gp.allowNull(i)},t.transactionRequest={from:gp.allowNull(e),nonce:gp.allowNull(a),gasLimit:gp.allowNull(r),gasPrice:gp.allowNull(r),maxPriorityFeePerGas:gp.allowNull(r),maxFeePerGas:gp.allowNull(r),to:gp.allowNull(e),value:gp.allowNull(r),data:gp.allowNull((t=>this.data(t,!0))),type:gp.allowNull(a),accessList:gp.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:gp.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:gp.allowNull(this.address,null),from:gp.allowNull(this.address,null),contractAddress:gp.allowNull(e,null),transactionIndex:a,root:gp.allowNull(s),gasUsed:r,logsBloom:gp.allowNull(i),blockHash:o,transactionHash:o,logs:gp.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:gp.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:gp.allowNull(r),status:gp.allowNull(a),type:u},t.block={hash:gp.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:gp.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:gp.allowNull(e),extraData:i,transactions:gp.allowNull(gp.arrayOf(o)),baseFeePerGas:gp.allowNull(r)},t.blockWithTransactions=Mr(t.block),t.blockWithTransactions.transactions=gp.allowNull(gp.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:gp.allowNull(n,void 0),toBlock:gp.allowNull(n,void 0),blockHash:gp.allowNull(o,void 0),address:gp.allowNull(e,void 0),topics:gp.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:gp.allowNull(a),blockHash:gp.allowNull(o),transactionIndex:a,removed:gp.allowNull(this.boolean.bind(this)),address:e,data:gp.allowFalsish(i,"0x"),topics:gp.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Vs(t||[])}number(t){return"0x"===t?0:Ht.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Ht.from(t).toNumber()}bigNumber(t){return Ht.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),I(t))?t.toLowerCase():mp.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return Be(t)}callAddress(t){if(!I(t,32))return null;const e=Be(O(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return De(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||I(t))return $(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==T(r)?mp.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=Ht.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!I(t))throw new Error("invalid uint256");return D(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=gp.check(e,t);return n._difficulty=null==r?null:Ht.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return gp.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Ht.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=gp.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;I(r)&&(r=Ht.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),I(r)&&(r=Ht.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return Js(t)}receiptLog(t){return gp.check(this.formats.receiptLog,t)}receipt(t){const e=gp.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Ht.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&mp.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):mp.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&mp.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return gp.check(this.formats.filter,t)}filterLog(t){return gp.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}var yp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const vp=new b(pp);function wp(t){return null==t?"null":(32!==T(t)&&vp.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function bp(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[wp(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return wp(t)})).join("&")}function Ep(t){if("string"==typeof t){if(32===T(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+bp(t);if(ni.isForkEvent(t))throw vp.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+bp(t.topics||[])}throw new Error("invalid event - "+t)}function Mp(){return(new Date).getTime()}function _p(t){return new Promise((e=>{setTimeout(e,t)}))}const Ap=["block","network","pending","poll"];class kp{constructor(t,e,r){wr(this,"tag",t),wr(this,"listener",e),wr(this,"once",r),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 t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||Ap.indexOf(this.tag)>=0}}const Np={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 xp(t){return D(Ht.from(t).toHexString(),32)}function Sp(t){return xd.encode(S([t,O(Yd(Yd(t)),0,4)]))}const Pp=new RegExp("^(ipfs)://(.*)$","i"),Ip=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Pp,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Rp(t,e){try{return xn(Cp(t,e))}catch(t){}return null}function Cp(t,e){if("0x"===t)return null;const r=Ht.from(O(t,e,e+32)).toNumber(),n=Ht.from(O(t,r,r+32)).toNumber();return O(t,r+32,r+32+n)}function Tp(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):vp.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Op(t){const e=x(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Bp(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function $p(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=x(t[n]);e[n]=Op(r),e.push(Op(i.length)),e.push(Bp(i)),r+=32+32*Math.ceil(i.length/32)}return B(e)}class Dp{constructor(t,e,r,n){wr(this,"provider",t),wr(this,"name",r),wr(this,"address",t.formatter.address(e)),wr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Ht.from(t).eq(1))).catch((t=>{if(t.code===b.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return yp(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:B([t,Td(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=B(["0x9061b923",$p([(i=this.name,C(S(i.split(".").map((t=>{const e=kn("_"+Un(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return x(t).length%32==4&&vp.throwError("resolver threw error",b.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Cp(t,0)),t}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return yp(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Cp(r,0):null}))}_getAddress(t,e){const r=Np[String(t)];if(null==r&&vp.throwError(`unsupported coin type: ${t}`,b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=x(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return Sp(S([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return Sp(S([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=dp.toWords(n.slice(2));return t.unshift(e),dp.encode(r.prefix,t)}}return null}getAddress(t){return yp(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",xp(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&vp.throwError("invalid or unsupported coin data",b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return yp(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;r<Ip.length;r++){const n=e.match(Ip[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Tp(e)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),u=D(Ht.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:B(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=Ht.from(yield this.provider.call({to:a,data:B(["0x00fdd58e",D(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const h={to:this.provider.formatter.address(s[0]),data:B([r,u])};let l=Rp(yield this.provider.call(h),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Tp(l)),t.push({type:"metadata-url",content:l});const c=yield np(l);if(!c)return null;t.push({type:"metadata",content:JSON.stringify(c)});let f=c.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Pp))return null;t.push({type:"url-ipfs",content:f}),f=Tp(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return yp(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+xd.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+xd.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"};return"sia://"+kd("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return vp.throwError("invalid or unsupported content hash data",b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return yp(this,void 0,void 0,(function*(){let e=kn(t);e=S([xp(64),xp(e.length),e]),e.length%32!=0&&(e=S([e,D("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(e));return null==r||"0x"===r?null:xn(r)}))}}let Fp=null,Up=1;class jp extends ii{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),wr(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=br(new.target,"getNetwork")(t);e?(wr(this,"_network",e),this.emit("network",e,null)):vp.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return yp(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||vp.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:wr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return ip((()=>this._ready().then((t=>t),(t=>{if(t.code!==b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Fp&&(Fp=new gp),Fp}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in _d){const r=_d[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=_d[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=_d[t.name];if(!e)return"number"!=typeof t.chainId&&yd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&yd.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var n;return null==r&&e._defaultProvider&&(r=(n=e._defaultProvider)&&"function"==typeof n.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}(null==t?"homestead":t)}ccipReadFetch(t,e,r){return yp(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const e=r[t],s=e.replace("{sender}",n).replace("{data}",i),a=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield np({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const h=u.message||"unknown error";if(u.status>=400&&u.status<500)return vp.throwError(`response not found during CCIP fetch: ${h}`,b.errors.SERVER_ERROR,{url:e,errorMessage:h});o.push(h)}return vp.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,b.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return yp(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(Mp()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=Mp(),r=Er({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Mp();return(t=Ht.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return yp(this,void 0,void 0,(function*(){const t=Up++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)vp.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",vp.makeError("network block skew detected",b.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return yp(this,void 0,void 0,(function*(){return vp.throwError("provider does not support network detection",b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return yp(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,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",e,t),yield _p(0),this._network;const r=vp.makeError("underlying network changed",b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!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))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=Mp();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=Mp(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return yp(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return yp(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},h=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,h),s.push((()=>{this.removeListener(t,h)})),n){let r=n.startBlock,i=null;const h=s=>yp(this,void 0,void 0,(function*(){a||(yield _p(1e3),this.getTransactionCount(n.from).then((l=>yp(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===t)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,e);if(u())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(vp.makeError("transaction was replaced",b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",h)}}))),(t=>{a||this.once("block",h)})))}));if(a)return;this.once("block",h),s.push((()=>{this.removeListener("block",h)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{u()||o(vp.makeError("timeout exceeded",b.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return yp(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Ht.from(t)}catch(e){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return Ht.from(n)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return Ht.from(n).toNumber()}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return C(n)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>$(t)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==T(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&vp.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>yp(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&vp.throwError("transaction failed",b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>C(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return yp(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?Ht.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?C(t):null)))})),this.formatter.transactionRequest(yield Er(r))}))}_getFilter(t){return yp(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield Er(e))}))}_call(t,e,r){return yp(this,void 0,void 0,(function*(){r>=10&&vp.throwError("CCIP read exceeded maximum redirections",b.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&T(i)%32==4)try{const o=O(i,4),s=O(o,0,32);Ht.from(s).eq(n)||vp.throwError("CCIP Read sender did not match",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Ht.from(O(o,32,64)).toNumber(),h=Ht.from(O(o,u,u+32)).toNumber(),l=O(o,u+32);for(let e=0;e<h;e++){const r=Rp(l,32*e);null==r&&vp.throwError("CCIP Read contained corrupt URL string",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Cp(o,64);Ht.from(O(o,100,128)).isZero()||vp.throwError("CCIP Read callback selector included junk",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=O(o,96,100),d=Cp(o,128),p=yield this.ccipReadFetch(t,c,a);null==p&&vp.throwError("CCIP Read disabled or provided no URLs",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:n,data:B([f,$p([p,d])])};return this._call(m,e,r+1)}catch(t){if(t.code===b.errors.SERVER_ERROR)throw t}try{return C(i)}catch(r){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return Ht.from(r)}catch(t){return vp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return yp(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&vp.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&vp.throwError("ENS name not configured",b.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(I(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),I(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){vp.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return ip((()=>yp(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return ip((()=>yp(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return ip((()=>yp(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return yp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),gp.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return yp(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return yp(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&vp.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return yp(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new Dp(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return yp(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||vp.throwError("network does not support ENS",b.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Td(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return yp(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(I(t))throw e}"string"!=typeof t&&vp.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return yp(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=Rp(yield this.call({to:r,data:"0x691f3431"+Td(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return yp(this,void 0,void 0,(function*(){let e=null;if(I(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new Dp(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t}try{const t=Rp(yield this.call({to:n,data:"0x691f3431"+Td(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return vp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new kp(Ep(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=Ep(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=Ep(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=Ep(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=Ep(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=Ep(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Lp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const zp=new b(pp),qp=["call","estimateGas"];function Vp(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=I(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=Vp(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return Vp(JSON.parse(t),e)}catch(t){}return null}function Gp(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=Vp(e,!0);if(t)return t.data;zp.throwError("missing revert data in call exception; Transaction reverted without a reason string",b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=Vp(e.body,!1);null==r&&(r=Vp(e,!1)),r&&zp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&zp.throwError("insufficient funds for intrinsic transaction cost",b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&zp.throwError("nonce has already been used",b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&zp.throwError("replacement fee too low",b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&zp.throwError("legacy pre-eip-155 transactions not supported",b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),qp.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&zp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Hp(t){return new Promise((function(e){setTimeout(e,t)}))}function Kp(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Qp(t){return t?t.toLowerCase():t}const Jp={};class Yp extends hi{constructor(t,e,r){if(super(),t!==Jp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");wr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(wr(this,"_address",this.provider.formatter.address(r)),wr(this,"_index",null)):"number"==typeof r?(wr(this,"_index",r),wr(this,"_address",null)):zp.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return zp.throwError("cannot alter JSON-RPC Signer connection",b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Zp(Jp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&zp.throwError("unknown account #"+this._index,b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=Mr(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=Mr(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Lp(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&zp.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Er({tx:Er(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&zp.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>Gp("sendTransaction",t,n)))}))}signTransaction(t){return zp.throwError("signing transactions is unsupported",b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Lp(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield ip((()=>Lp(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return Lp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[C(e),r.toLowerCase()])}))}_legacySignMessage(t){return Lp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),C(e)])}))}_signTypedData(t,e,r){return Lp(this,void 0,void 0,(function*(){const n=yield Jd.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Jd.getPayload(n.domain,e,n.value))])}))}unlock(t){return Lp(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Zp extends Yp{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const Wp={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Xp extends jp{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=br(this.constructor,"defaultUrl")()),wr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(Mr(t))),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 Lp(this,void 0,void 0,(function*(){yield Hp(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=br(this.constructor,"getNetwork");try{return e(Ht.from(t).toNumber())}catch(e){return zp.throwError("could not detect network",b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return zp.throwError("could not detect network",b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Yp(Jp,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Nr(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=np(this.connection,JSON.stringify(r),Kp).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Qp(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Qp(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Qp(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Qp(e.address),D(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Qp(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Lp(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Ht.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=Mr(e)).transaction=Mr(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&zp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return Gp(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Hp(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=Mr(Wp);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||vr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||vr.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=$(Ht.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=C(t[e]))})),t.accessList&&(n.accessList=Vs(t.accessList)),n}}var tm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const em=new b(pp);class rm extends Xp{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return tm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||em.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(wr(this,"_network",e),this.emit("network",e,null))),e}))}}var nm={};function im(t,e){var r=(void 0===e?{}:e).broviderUrl,n=(void 0===r?"https://rpc.snapshot.org":r)+"/"+t;return nm[t]||(nm[t]=new rm({url:n,timeout:25e3,allowGzip:!0},Number(t))),nm[t]}function om(t){return Me(kn(t))}var sm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const am=new b("hash/5.6.1"),um=new Uint8Array(32);um.fill(0);const hm=Ht.from(-1),lm=Ht.from(0),cm=Ht.from(1),fm=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const dm=D(cm.toHexString(),32),pm=D(lm.toHexString(),32),mm={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},gm=["name","version","chainId","verifyingContract","salt"];function ym(t){return function(e){return"string"!=typeof e&&am.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const vm={name:ym("name"),version:ym("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return am.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch(t){}return am.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return am.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function wm(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&am.throwArgumentError("invalid numeric width","type",t);const i=fm.mask(r?n-1:n),o=r?i.add(cm).mul(hm):lm;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&am.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&am.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&am.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?B([e,um.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D(Be(t),32)};case"bool":return function(t){return t?dm:pm};case"bytes":return function(t){return Me(t)};case"string":return function(t){return om(t)}}return null}function bm(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Em{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&am.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&am.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);wm(s)||(r[s]||am.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?am.throwArgumentError("missing primary type","types",t):i.length>1&&am.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&am.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=bm(e,t[e])+r.map((e=>bm(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=wm(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&am.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(Me)),Me(B(i))}}const r=this.types[t];if(r){const e=om(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?Me(n):n}));return n.unshift(e),B(n)}}return am.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||am.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Me(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(wm(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&am.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):am.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Em(t)}static getPrimaryType(t){return Em.from(t).primaryType}static hashStruct(t,e,r){return Em.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=mm[r];n||am.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>gm.indexOf(t.name)-gm.indexOf(e.name))),Em.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return B(["0x1901",Em.hashDomain(t),Em.from(e).hash(r)])}static hash(t,e,r){return Me(Em.encode(t,e,r))}static resolveNames(t,e,r,n){return sm(this,void 0,void 0,(function*(){t=Mr(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Em.from(e);o.visit(r,((t,e)=>("address"!==t||I(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Em.hashDomain(t);const n={},i=[];gm.forEach((e=>{const r=t[e];null!=r&&(n[e]=vm[e](r),i.push({name:e,type:mm[e]}))}));const o=Em.from(e),s=Mr(e);return s.EIP712Domain?am.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&am.throwArgumentError("invalid string","value",e),e}return am.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new b("wallet/5.6.2");function Mm(t,e,r,n){return Ls(Em.hash(t,e,r),n)}function _m(t,n,i,o){return e(this,void 0,void 0,(function(){var e,s,a,u;return r(this,(function(r){switch(r.label){case 0:s="0x1626ba7e",a="function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Jm(o,[a],[t,"isValidSignature",[x(i),n]])];case 2:return e=r.sent(),[3,4];case 3:if((u=r.sent()).message.startsWith("missing revert data in call exception"))return[2,!1];throw u;case 4:return[2,e.toLowerCase()===s.toLowerCase()]}}))}))}function Am(t,n,i,o){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e="0x20c13b0b","function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)",[4,Jm(o,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[x(i),n]])];case 1:return[2,r.sent().toLowerCase()===e.toLowerCase()]}}))}))}function km(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e=im(o,s),[4,_m(t,n,i,e)];case 1:return r.sent()?[2,!0]:[4,Am(t,n,i,e)];case 2:return[2,r.sent()]}}))}))}function Nm(t){var e=t.domain,r=t.types,n=t.message;return Vh.hash(e,r,n)}var xm=["cloudflare-ipfs.com","cf-ipfs.com","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],Sm={1:{key:"1",name:"Ethereum Mainnet",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",rpc:["https://rpc.ankr.com/eth",{url:"https://api-geth-archive.ankr.com",user:"balancer_user",password:"balancerAnkr20201015"},"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive","https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main","https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],light:["https://cloudflare-eth.com"],ws:["wss://eth-mainnet.ws.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],explorer:{url:"https://etherscan.io",apiUrl:"https://api.etherscan.io"},start:7929876,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},5:{key:"5",name:"Goerli testnet",shortName:"Goerli",chainId:5,network:"goerli",testnet:!0,multicall:"0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",ensResolvers:["0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750","0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"],ensNameWrapper:"0x114D4603199df73e7D157787f8778E21fCd13066",rpc:["https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"],explorer:{url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io"},start:743550,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},8:{key:"8",name:"Ubiq Mainnet",chainId:8,network:"Ubiq mainnet",multicall:"0x6668750957e4083725926B71C41bDF1434C73262",rpc:["https://rpc.octano.dev"],ws:["wss://ws.octano.dev"],explorer:{url:"https://ubiqscan.io"},start:1,logo:"ipfs://Qmec3HLoN4QhwZAhw4XTi2aN8Wwmcko5hHN22sHARzb9tw"},10:{key:"10",name:"Optimism Mainnet",chainId:10,network:"Optimism mainnet",multicall:"0x35A6Cdb2C9AD4a45112df4a04147EB07dFA01aB7",rpc:["https://opt-mainnet.g.alchemy.com/v2/JzmIL4Q3jBj7it2duxLFeuCa9Wobmm7D"],explorer:{url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io"},start:657806,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb"},19:{key:"19",name:"Songbird Canary-Network",shortName:"Songbird",chainId:19,network:"songbird",multicall:"0x17032Ea9c3a13Ed337665145364c0d2aD1108c91",rpc:["https://songbird-api.flare.network/ext/C/rpc"],explorer:{url:"https://songbird-explorer.flare.network"},start:21807126,logo:"ipfs://QmXyvnrZY8FUxSULfnKKA99sAEkjAHtvhRx5WeHixgaEdu"},24:{key:"24",name:"KardiaChain Mainnet",shortName:"KAI",chainId:24,network:"mainnet",multicall:"0xd9c92F2287B7802A37eC9BEce96Aa65fb5f31E1b",rpc:["https://kai-internal.kardiachain.io"],explorer:{url:"https://explorer.kardiachain.io"},start:8260245,logo:"ipfs://bafkreig73yfyqzbxydv6e3dbj5nks3f57px2iez7tywayey4rilfhhrr34"},25:{key:"25",name:"Cronos Mainnet",shortName:"Cronos",chainId:25,network:"mainnet",multicall:"0x6F522a3982e8F9A50A2EDc9E46ed1A3aE2B3FD3a",rpc:["https://evm-cronos.crypto.org"],explorer:{url:"https://cronos.crypto.org/explorer"},start:4067,logo:"ipfs://QmfSJbtirJoa3Pt7o5Fdm85wbyw9V1hpzqLr5PQbdnfsAj"},30:{key:"30",name:"RSK Mainnet",chainId:30,network:"rsk mainnet",multicall:"0x4eeebb5580769ba6d26bfd07be636300076d1831",rpc:["https://public-node.rsk.co"],explorer:{url:"https://explorer.rsk.co"},start:2516442,logo:"ipfs://QmXTwpE1SqoNZmyY4c3fYWy6qUgQELsyWKbgJo2Pg6K6V9"},46:{key:"46",name:"Darwinia Network",shortName:"Darwinia",chainId:46,network:"mainnet",multicall:"0x67f9ae42EaA9a8aBf065D60ec6Ab3C1A11370607",rpc:["https://rpc.darwinia.network"],explorer:{url:"https://darwinia.subscan.io"},start:141853,logo:"ipfs://bafkreicf55maidhx46pyu3mwsshlr43xbewr6tkckkonh4nesbkp7krwkm"},56:{key:"56",name:"Binance Smart Chain Mainnet",shortName:"BSC",chainId:56,network:"mainnet",multicall:"0x1ee38d535d541c55c9dae27b12edf090c608e6fb",rpc:["https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive","https://rpc.ankr.com/bsc","https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7","https://bsc-private-dataseed1.nariox.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed1.binance.org"],explorer:{url:"https://bscscan.com"},start:461230,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},61:{key:"61",name:"Ethereum Classic Mainnet",shortName:"Ethereum Classic",chainId:61,network:"mainnet",multicall:"0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",rpc:["https://www.ethercluster.com/etc"],explorer:{url:"https://blockscout.com/etc/mainnet"},start:13307544,logo:"ipfs://QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"},66:{key:"66",name:"OKExChain Mainnet",shortName:"OEC Mainnet",chainId:66,network:"oec mainnet",multicall:"0x6EB187d8197Ac265c945b69f3c3064A6f3831866",rpc:["https://exchainrpc.okex.org"],ws:["wss://exchainws.okex.org:8443"],explorer:{url:"https://www.oklink.com/okexchain"},start:5076543,logo:"ipfs://Qmd7dKnNwHRZ4HRCbCXUbkNV7gP28fGqPdjbHtjRtT9sQF"},75:{key:"75",name:"Decimal",shortName:"mainnet",chainId:75,network:"mainnet",multicall:"0x949d1A0757803C51F2EfFFEb5472C861A898B8E8",rpc:[],explorer:{url:"https://explorer.decimalchain.com"},start:16031065,logo:"ipfs://bafkreihkdhbce5rkogl63xegaarlirjrvbfarxbtbf5mqme3s5grvbjyxm"},81:{key:"81",name:"Shibuya Network",shortName:"Shibuya",chainId:81,network:"testnet",testnet:!0,multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shibuya.astar.network:8545"],explorer:{url:"https://blockscout.com/shibuya"},start:856303,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},82:{key:"82",name:"Meter Mainnet",shortName:"Meter",chainId:82,network:"mainnet",multicall:"0x579De77CAEd0614e3b158cb738fcD5131B9719Ae",rpc:["https://rpc.meter.io"],explorer:{url:"https://scan.meter.io"},start:4992871,logo:"ipfs://QmSZvT9w9eUDvV1YVaq3BKKEbubtNVqu1Rin44FuN4wz11"},97:{key:"97",name:"Binance Smart Chain Testnet",shortName:"BSC Testnet",chainId:97,network:"testnet",testnet:!0,multicall:"0x8b54247c6BAe96A6ccAFa468ebae96c4D7445e46",rpc:["https://data-seed-prebsc-1-s1.binance.org:8545","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/bsc/testnet/archive"],explorer:{url:"https://testnet.bscscan.com"},start:3599656,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},100:{key:"100",name:"Gnosis Chain",shortName:"xDAI",chainId:100,network:"mainnet",multicall:"0xb5b692a88bdfc81ca69dcb1d924f59f0413a602a",rpc:["https://gno.getblock.io/mainnet/6c1d1e6e-75d9-452f-a863-a694bff93d5c/","https://xdai-archive.blockscout.com","https://poa-xdai.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://rpc.gnosischain.com"],light:["https://rpc.gnosischain.com"],ws:["wss://rpc.xdaichain.com/wss"],explorer:{url:"https://gnosis.blockscout.com"},start:4108192,logo:"ipfs://QmZeiy8Ax4133wzxUQM9ky8z5XFVf6YLFjJMmTWbWVniZR"},108:{key:"108",name:"Thundercore Mainnet",chainId:108,network:"mainnet",multicall:"0x3017086deef56679e267f67f66c4415109b7a97f",rpc:["https://mainnet-rpc.thundercore.com/archived/SNAPSHOTEuR82a75fLYA"],explorer:{url:"https://viewblock.io/thundercore"},start:94425385,logo:"ipfs://bafkreifc5z5vtvqx2luzgateyvoocwpd2ifv2hwufxdnyl2a767wa6icli"},122:{key:"122",name:"Fuse Mainnet",shortName:"Fuse",chainId:122,network:"mainnet",multicall:"0x7a59441fb06666F6d2D766393d876945D06a169c",rpc:["https://explorer-node.fuse.io/","https://oefusefull1.liquify.info/"],explorer:{url:"https://explorer.fuse.io"},start:11923459,logo:"ipfs://QmXjWb64nako7voaVEifgdjAbDbswpTY8bghsiHpv8yWtb"},137:{key:"137",name:"Polygon PoS",shortName:"Polygon",chainId:137,network:"mainnet",multicall:"0xCBca837161be50EfA5925bB9Cc77406468e76751",rpc:["https://rpc.ankr.com/polygon","https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/polygon/mainnet/archive","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/polygon/mainnet/archive","https://rpc-mainnet.maticvigil.com/v1/1cfd7598e5ba6dcf0b4db58e8be484badc6ea08e"],ws:["wss://ws-mainnet.matic.network"],explorer:{url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com"},start:9834491,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},144:{key:"144",name:"PHI Network",shortName:"PHI",chainId:144,network:"mainnet",multicall:"0xc2f41B404a6757863AAeF49ff93039421acCd630",rpc:["https://connect.phi.network"],explorer:{url:"https://phiscan.com"},start:360030,logo:"ipfs://bafkreid6pm3mic7izp3a6zlfwhhe7etd276bjfsq2xash6a4s2vmcdf65a"},148:{key:"148",name:"ShimmerEVM",shortName:"ShimmerEVM",chainId:148,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.evm.shimmer.network/"},start:1290,logo:"ipfs://bafkreib4xhbgbhrwkmizp4d4nz3wzbpyhdm6wpz2v2pbkk7jxsgg3hdt74"},204:{key:"204",name:"opBNB",shortName:"mainnet",chainId:204,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"http://opbnbscan.com/"},start:512881,logo:"ipfs://bafkreibll4la7wqerzs7zwxjne2j7ayynbg2wlenemssoahxxj5rbt6c64"},246:{key:"246",name:"Energy Web Chain",shortName:"EWC",chainId:246,network:"mainnet",multicall:"0x0767F26d0D568aB61A98b279C0b28a4164A6f05e",rpc:["https://voting-rpc.carbonswap.exchange"],explorer:{url:"https://explorer.energyweb.org"},start:12086501,logo:"ipfs://Qmai7AGHgs8NpeGeXgbMZz7pS2i4kw44qubCJYGrZW2f3a"},250:{key:"250",name:"Fantom Opera",shortName:"fantom",chainId:250,network:"Mainnet",multicall:"0x7f6A10218264a22B4309F3896745687E712962a0",rpc:["https://rpc.ankr.com/fantom","https://rpc.ftm.tools","https://rpcapi.fantom.network"],explorer:{url:"https://ftmscan.com"},start:2497732,logo:"ipfs://QmVEgNeQDKnXygeGxfY9FywZpNGQu98ktZtRJ9bToYF6g7"},269:{key:"269",name:"High Performance Blockchain Mainnet",shortName:"HPB",chainId:269,network:"mainnet",multicall:"0x67D0f263aef2F6167FA77353695D75b582Ff4Bca",rpc:["https://hpbnode.com"],ws:["wss://ws.hpbnode.com"],explorer:{url:"https://hscan.org"},start:13960096,logo:"ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"},280:{key:"280",name:"zkSync Era Testnet",shortName:"zkSync testnet",chainId:280,network:"zkSync alpha testnet",testnet:!0,multicall:"0xbDAd32d600915cB70576D3d935d49bFf3C9cB0CF",rpc:["https://testnet.era.zksync.dev"],explorer:{url:"https://goerli.explorer.zksync.io/"},start:9012429,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},314:{key:"314",name:"Filecoin",shortName:"mainnet",chainId:314,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://filfox.io"},start:3328594,logo:"ipfs://bafybeibyvjfmk6aqlfdrczvth55jkmnoadtrch7ht3rdmvqmy2bfxynecm"},321:{key:"321",name:"KCC Mainnet",shortName:"KCC",chainId:321,network:"mainnet",multicall:"0xa64D6AFb48225BDA3259246cfb418c0b91de6D7a",rpc:["https://rpc-mainnet.kcc.network"],ws:["wss://rpc-ws-mainnet.kcc.network"],explorer:{url:"https://explorer.kcc.io"},start:1487453,logo:"ipfs://QmRdzYGhFRG8QLzMJahHrw3vETE2YZ9sywQbEkenSjKEvb"},324:{key:"324",name:"zkSync Era",shortName:"zkSync-era",chainId:324,network:"zkSync Era Mainnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:["https://mainnet.era.zksync.io"],explorer:{url:"https://explorer.zksync.io/"},start:3908235,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},336:{key:"336",name:"Shiden Network",shortName:"Shiden",chainId:336,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shiden.astar.network:8545","https://shiden.api.onfinality.io/public"],explorer:{url:"https://blockscout.com/shiden"},start:1170016,logo:"ipfs://QmcqGQE4Sk73zXc3e91TUFFefKBVeaNgbxV141XkSNE4xj"},369:{key:"369",name:"Pulsechain Mainnet",shortName:"Pulsechain",chainId:369,network:"mainnet",multicall:"0xdbdd0FD8B16F0092f306392b699D7fbddaA9011B",rpc:["https://rpc.pulsechain.com"],explorer:{url:"https://scan.pulsechain.com/"},start:17657774,logo:"ipfs://QmWUsiEWdejtHZ9B9981TYXn7Ds8C7fkB1S4h5rP3kCCZR"},416:{key:"416",name:"SX Network",shortName:"SX",chainId:416,network:"mainnet",multicall:"0x834a005DDCF990Ba1a79f259e840e58F2D14F49a",rpc:["https://rpc.sx.technology"],ws:["wss://rpc.sx.technology/ws"],explorer:{url:"https://explorer.sx.technology"},start:2680605,logo:"ipfs://QmSXLXqyr2H6Ja5XrmznXbWTEvF2gFaL8RXNXgyLmDHjAF"},592:{key:"592",name:"Astar Network",shortName:"Astar",chainId:592,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://astar.api.onfinality.io/public","https://rpc.astar.network:8545"],explorer:{url:"https://blockscout.com/astar"},start:366482,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},813:{key:"813",name:"Qitmeer Mainnet",shortName:"MEER",chainId:813,network:"mainnet",multicall:"0x55034b2cF530ae3A8fC1e2e4523F58496796610F",rpc:["https://evm-dataseed1.meerscan.io","https://evm-dataseed.meerscan.com","https://evm-dataseed2.meerscan.io","https://evm-dataseed3.meerscan.io"],explorer:{url:"https://evm.meerscan.io"},start:43317,logo:"ipfs://QmXvum7SNVaAqAc2jNzR1NpNZN1GGvNaKWydg8a1GEDQ7y"},841:{key:"841",name:"Taraxa Mainnet",shortName:"841",chainId:841,network:"mainnet",multicall:"0xFCe7a3121B42664AaD145712e1c2Bf2e38f60AA1",rpc:["https://rpc.mainnet.taraxa.io"],ws:["wss://ws.mainnet.taraxa.io"],explorer:{url:"https://mainnet.explorer.taraxa.io"},start:1515906,logo:"ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"},888:{key:"888",name:"Wanchain",chainId:888,network:"mainnet",multicall:"0xba5934ab3056fca1fa458d30fbb3810c3eb5145f",rpc:["https://gwan-ssl.wandevs.org:56891"],ws:["wss://api.wanchain.org:8443/ws/v3/ddd16770c68f30350a21114802d5418eafe039b722de52b488e7eee1ee2cd73f"],explorer:{url:"https://www.wanscan.org"},start:11302663,logo:"ipfs://QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"},1001:{key:"1001",name:"Klaytn Baobab Testnet",shortName:"Boabab",chainId:1001,network:"testnet",testnet:!0,multicall:"0x40643B8Aeaaca0b87Ea1A1E596e64a0e14B1d244",rpc:["https://archive-en.baobab.klaytn.net"],ws:["wss://archive-en.baobab.klaytn.net/ws"],explorer:{url:"https://baobab.scope.klaytn.com"},start:87232478,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},1072:{key:"1072",name:"Shimmer EVM Testnet",shortName:"ShimmerEVM",chainId:1072,network:"testnet",testnet:!0,multicall:"0x751d21047C116413895c259f3f305e38C10B7cF6",rpc:["https://archive.evm.testnet.shimmer.network/v1/chains/rms1pr75wa5xuepg2hew44vnr28wz5h6n6x99zptk2g68sp2wuu2karywgrztx3/evm"],explorer:{url:"https://explorer.evm.testnet.shimmer.network/"},start:10614,logo:"ipfs://bafkreihtwfwrue7klzedwx4rqlk6agklz4lbbk7owsyw6xzn6c2m4t5tgy"},1088:{key:"1088",name:"Metis",shortName:"metis",chainId:1088,network:"mainnet",multicall:"0xc39aBB6c4451089dE48Cffb013c39d3110530e5C",rpc:["https://andromeda.metis.io/?owner=1088"],explorer:{url:"https://andromeda-explorer.metis.io"},start:451,logo:"ipfs://QmYeskHqrEvWHqeAuqett64LxfH52HUXZi2T9BAMmgKvBF"},1101:{key:"1101",name:"Polygon zkEVM",shortName:"mainnet",chainId:1101,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://zkevm.polygonscan.com"},start:57746,logo:"ipfs://bafkreibfiyvhqnme2vbxxfcku7qkxgjpkg6ywdkplxh4oxlkqsbznyorfm"},1116:{key:"1116",name:"Core Chain Mainnet ",shortName:"Core",chainId:1116,network:"mainnet",multicall:"0x024f0041b76B598c2A0a75004F8447FaF67BD004",rpc:["https://rpc.coredao.org/"],explorer:{url:"https://scan.coredao.org"},start:853908,logo:"ipfs://QmVctLQ44vhkwejja9DDjDYUdYgVRBEWs242mhd95SeM5q"},1284:{key:"1284",name:"Moonbeam",shortName:"GLMR",chainId:1284,network:"mainnet",multicall:"0x83e3b61886770de2F64AAcaD2724ED4f08F7f36B",rpc:["https://rpc.api.moonbeam.network"],explorer:{url:"https://moonscan.io/"},start:171135,logo:"ipfs://QmWKTEK2pj5sBBbHnMHQbWgw6euVdBrk2Ligpi2chrWASk"},1285:{key:"1285",name:"Moonriver (Kusama)",shortName:"Moonriver",chainId:1285,network:"mainnet",multicall:"0x537004440ffFE1D4AE9F009031Fc2b0385FCA9F1",rpc:["https://rpc.api.moonriver.moonbeam.network"],explorer:{url:"https://blockscout.moonriver.moonbeam.network"},start:413539,logo:"ipfs://QmXtgPesL87Ejhq2Y7yxsaPYpf4RcnoTYPJWPcv6iiYhoi"},1287:{key:"1287",name:"Moonbase Alpha TestNet",shortName:"Moonbase",chainId:1287,network:"testnet",testnet:!0,multicall:"0xf09FD6B6FF3f41614b9d6be2166A0D07045A3A97",rpc:["https://rpc.testnet.moonbeam.network"],explorer:{url:"https://moonbase-blockscout.testnet.moonbeam.network"},start:859041,logo:"ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"},1559:{key:"1559",name:"Tenet",shortName:"tenet",chainId:1559,network:"mainnet",multicall:"0xcCB3F00bE353950E4C08501ac8Af48765EAAa738",rpc:[],explorer:{url:"https://tenetscan.io"},start:944415,logo:"ipfs://Qmc1gqjWTzNo4pyFSGtQuCu7kRSZZBUVybtTjHn2nNEEPA"},1663:{key:"1663",name:"Horizen Gobi Testnet",shortName:"Gobi",chainId:1663,network:"testnet",testnet:!0,multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:["https://gobi-testnet.horizenlabs.io/ethv1"],explorer:{url:"https://gobi-explorer.horizen.io"},start:1,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},2e3:{key:"2000",name:"Doge Chain",shortName:"dogechain",chainId:2e3,network:"mainnet",multicall:"0x6f9D3f3932B417bd4957585D236Cbc32b32C0BDc",rpc:["https://rpc.dogechain.dog"],explorer:{url:"https://explorer.dogechain.dog"},start:877115,logo:"ipfs://bafkreigovfh3pinsdih777issfgaflwu2yjzroljs2642gbvwikcd3nm4i"},2109:{key:"2109",name:"Exosama Network",shortName:"EXN",chainId:2109,network:"mainnet",multicall:"0x2feFC828e2fEfdE0C9f7740919c6A9139F886067",rpc:["https://rpc.exosama.com"],explorer:{url:"https://explorer.exosama.com"},start:94085,logo:"ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS"},2152:{key:"2152",name:"Findora Mainnet",shortName:"Findora",chainId:2152,network:"mainnet",multicall:"0xCF7D1e21CBe9bdEF235aef06C5d8051B3d4DF0f5",rpc:["https://archive.prod.findora.org:8545/"],explorer:{url:"https://evm.findorascan.io"},start:4219343,logo:"ipfs://QmXkneyRB6HbHTHRLCZpZqSsawiyJY7b2kZ2V8ydvKYAgv"},2400:{key:"2400",name:"TCG Verse Mainnet",shortName:"TCGV",chainId:2400,network:"mainnet",multicall:"0xceC65DEE0b5012F1b7321b2647681F997c7204FC",rpc:["https://rpc.tcgverse.xyz"],explorer:{url:"https://explorer.tcgverse.xyz"},start:57500,logo:"ipfs://bafkreidg4wpewve5mdxrofneqblydkrjl3oevtgpdf3fk3z3vjqam6ocoe"},4337:{key:"4337",name:"Beam",shortName:"Beam",chainId:4337,network:"mainnet",multicall:"0x4956F15eFdc3dC16645e90Cc356eAFA65fFC65Ec",rpc:[],explorer:{url:"https://subnets.avax.network/beam/"},start:1,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF"},4689:{key:"4689",name:"IoTeX Mainnet",shortName:"IoTeX",chainId:4689,network:"mainnet",multicall:"0x9c8B105c94282CDB0F3ecF27e3cfA96A35c07be6",rpc:["https://babel-api.mainnet.iotex.io"],explorer:{url:"https://iotexscan.io"},start:11533283,logo:"ipfs://QmNkr1UPcBYbvLp7d7Pk4eF3YCsHpaNkfusKZNtykL2EQC"},5e3:{key:"5000",name:"Mantle",chainId:5e3,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.mantle.xyz"],explorer:{url:"https://explorer.mantle.xyz"},start:304717,logo:"ipfs://bafkreidkucwfn4mzo2gtydrt2wogk3je5xpugom67vhi4h4comaxxjzoz4"},5555:{key:"5555",name:"Chain Verse Mainnet",shortName:"ChainVerse",chainId:5555,network:"ChainVerse",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.chainverse.info"],explorer:{url:"https://explorer.chainverse.info"},start:6334180,logo:"ipfs://QmQyJt28h4wN3QHPXUQJQYQqGiFUD77han3zibZPzHbitk"},6102:{key:"6102",name:"Cascadia Testnet",shortName:"Cascadia",chainId:6102,network:"testnet",multicall:"0x728989819bAD588F193563008E0a03E8cD6a3e4a",rpc:["https://testnet.cascadia.foundation"],explorer:{url:"https://explorer.cascadia.foundation"},testnet:!0,start:370457,logo:"ipfs://QmWkhZYhReYyaa5pQXj32hEGxoRcBqarFMcfQScELmjYQj"},7332:{key:"7332",name:"Horizen EON",shortName:"EON",chainId:7332,network:"mainnet",multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:[],explorer:{url:"https://eon-explorer.horizenlabs.io"},start:85108,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},7341:{key:"7341",name:"Shyft",shortName:"Shyft",chainId:7341,network:"mainnet",multicall:"0xceb10e9133D771cA93c8002Be527A465E85381a2",rpc:["https://rpc.shyft.network"],explorer:{url:"https://bx.shyft.network"},start:3673983,logo:"ipfs://bafkreifwxnnfk6koabzmxgcxcwlrwt6b5gijdain2gyqee77q4ajfb7fu4"},8217:{key:"8217",name:"Klaytn Mainnet Cypress",shortName:"Cypress",chainId:8217,network:"mainnet",multicall:"0x5f5f0d1b9ff8b3dcace308e39b13b203354906e9",rpc:["https://archive-en.cypress.klaytn.net"],ws:["wss://archive-en.cypress.klaytn.net/ws"],explorer:{url:"https://scope.klaytn.com"},start:91582357,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},8453:{key:"8453",name:"Base",shortName:"mainnet",chainId:8453,network:"mainnet",multicall:"0xca11bde05977b3631167028862be2a173976ca11",rpc:[],explorer:{url:"https://basescan.org/"},start:5022,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},9001:{key:"9001",name:"Evmos Network",shortName:"Evmos",chainId:9001,network:"mainnet",multicall:"0x37763d16f8dBf6F185368E0f256350cAb7E24b26",rpc:["https://eth.bd.evmos.org:8545"],ws:["wss://eth.bd.evmos.org:8546"],explorer:{url:"https://escan.live"},start:13959539,logo:"ipfs://bafkreif4obrdoiretpozdd56seziywc6clha7wwkbldng3ovry2bpzly34"},1e4:{key:"10000",name:"smartBCH",shortName:"BCH",chainId:1e4,network:"mainnet",multicall:"0x1b38EBAd553f218e2962Cb1C0539Abb5d6A37774",rpc:["https://smartbch.greyh.at/"],explorer:{url:"https://smartbch-explorer.web.app"},start:268248,logo:"ipfs://QmWG1p7om4hZ4Yi4uQvDpxg4si7qVYhtppGbcDGrhVFvMd"},10243:{key:"10243",name:"Arthera Testnet",shortName:"Arthera_",chainId:10243,network:"testnet",testnet:!0,multicall:"0x27c7FC597aD2E81C4c1cA1769972f79DaF042Da7",rpc:["https://rpc-test.arthera.net"],explorer:{url:"https://explorer-test.arthera.net"},start:10523,logo:"ipfs://QmYQp3e52KjkT4bYdAvB6ACEEpXs2D8DozsDitaADRY2Ak"},13337:{key:"13337",name:"Beam Testnet",shortName:"testnet",chainId:13337,network:"testnet",multicall:"0x9BF49b704EE2A095b95c1f2D4EB9010510c41C9E",rpc:[],explorer:{url:"https://subnets-test.avax.network/beam/"},start:3,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF",testnet:!0},16718:{key:"16718",name:"AirDAO Mainnet",chainId:16718,network:"mainnet",multicall:"0x25e81aC81A8B03389D78CB45faB78353aB528574",rpc:["https://network-archive.ambrosus.io"],ws:["wss://network-archive.ambrosus.io/ws"],explorer:{url:"https://airdao.io/explorer"},start:22922566,logo:"ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"},29548:{key:"29548",name:"MCH Verse ",shortName:"mainnet",chainId:29548,network:"mainnet",multicall:"0x1d39652386488CE1fE4254E105F5A42a04d43dB2",rpc:[],explorer:{url:"https://explorer.oasys.mycryptoheroes.net"},start:27458402,logo:"ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"},42161:{key:"42161",name:"Arbitrum One",chainId:42161,network:"Arbitrum mainnet",multicall:"0x7A7443F8c577d537f1d8cD4a629d40a3148Dd7ee",rpc:["https://rpc.ankr.com/arbitrum","https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/arbitrum/mainnet","https://arb-mainnet.g.alchemy.com/v2/JDvtNGwnHhTltIwfnxQocKwKkCTKA1DL"],explorer:{url:"https://arbiscan.io"},start:256508,logo:"ipfs://QmWZ5SMRfvcK8tycsDqojQaSiKedgtVkS7CkZdxPgeCVsZ"},42170:{key:"42170",name:"Arbitrum Nova",chainId:42170,network:"Arbitrum Nova",multicall:"0x4E74EBd9CABff51cE9a43EFe059bA8c5A28E4A14",rpc:["https://nova.arbitrum.io/rpc","https://arbitrum-nova.public.blastapi.io"],explorer:{url:"https://nova.arbiscan.io/"},start:6006607,logo:"ipfs://bafkreie5xsqt3mrrwu7v32qpmmctibhzhgxf4emfzzddsdhdlfsa7fmplu"},42220:{key:"42220",name:"Celo Mainnet",shortName:"Celo",chainId:42220,network:"mainnet",multicall:"0xb8d0d2C1391eeB350d2Cd39EfABBaaEC297368D9",rpc:["https://celo.snapshot.org","https://forno.celo.org","https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"],explorer:{url:"https://explorer.celo.org"},start:6599803,logo:"ipfs://QmS2tVJ7rdJRe1NHXAi2L86yCbUwVVrmB2mHQeNdJxvQti"},43113:{key:"43113",name:"Avalanche FUJI Testnet",chainId:43113,network:"testnet",testnet:!0,multicall:"0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",rpc:["https://api.avax-test.network/ext/bc/C/rpc"],explorer:{url:"https://testnet.snowtrace.io"},start:10528153,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},43114:{key:"43114",name:"Avalanche",chainId:43114,network:"mainnet",multicall:"0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",rpc:["https://nd-784-543-849.p2pify.com/aa7b29fc5fed65b34f0ee6b8de33f8c0/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://api.avax.network/ext/bc/C/rpc"],explorer:{url:"https://snowtrace.io"},start:536483,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},47805:{key:"47805",name:"REI Mainnet",chainId:47805,network:"mainnet",multicall:"0x9eE9904815B80C39C1a27294E69a8626EAa7952d",rpc:["https://rpc.rei.network"],explorer:{url:"https://scan.rei.network/"},start:1715902,logo:"ipfs://QmTogMDLmDgJjDjUKDHDuc2KVTVDbXf8bXJLFiVe8PRxgo"},53935:{key:"53935",name:"DFK Chain",chainId:53935,network:"mainnet",multicall:"0x5b24224dC16508DAD755756639E420817DD4c99E",rpc:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"],explorer:{url:"https://subnets.avax.network/defi-kingdoms/"},start:62,logo:"ipfs://QmZNkpVgPbuVbDcsi6arwH1om3456FGnwfDqYQJWUfHDEx"},59140:{key:"59140",name:"Linea Goerli testnet",shortName:"Linea Goerli",chainId:59140,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.goerli.linea.build"],explorer:{url:"https://explorer.goerli.linea.build"},start:498623,logo:"ipfs://QmSwCnEeLoyMApQd1YfhmGvLt97bH5mLPoabjKqUSuQHHF"},80001:{key:"80001",name:"Polygon Mumbai",chainId:80001,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/polygon/mumbai/archive","https://rpc-mumbai.matic.today"],ws:["wss://ws-mumbai.matic.today"],explorer:{url:"https://mumbai.polygonscan.com",apiUrl:"https://api-mumbai.polygonscan.com"},start:12011090,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},84531:{key:"84531",name:"Base Goerli Testnet",chainId:84531,network:"Base",testnet:!0,multicall:"0x0012989E982C2c473e36418384Ab707C72f2B782",rpc:["https://goerli.base.org"],explorer:{url:"https://goerli.basescan.org/"},start:1151797,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},11155111:{key:"11155111",name:"Sepolia testnet",shortName:"Sepolia",chainId:11155111,network:"sepolia",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://sepolia.infura.io/v3/d26b4fd748814fe994b05899fd89e667"],explorer:{url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io"},start:751532,logo:"ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"},245022926:{key:"245022926",name:"Neon Devnet",shortName:"devnet",chainId:245022926,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://devnet.neonscan.org/"},start:205206112,logo:"ipfs://QmecRPQGa4bU7tybg1sUQY48Md9rWnmhrT6WW5ueqvhg6P",testnet:!0},1313161554:{key:"1313161554",name:"Aurora Mainnet",shortName:"Aurora",chainId:1313161554,network:"mainnet",multicall:"0x32b50c286DEFd2932a0247b8bb940b78c063F16c",rpc:["https://mainnet.aurora.dev"],explorer:{url:"https://explorer.mainnet.aurora.dev"},start:57190533,logo:"ipfs://QmeRhsR1UPRTQCizdhmgr2XxphXebVKU5di97uCV2UMFpa"},16666e5:{key:"1666600000",name:"Harmony Mainnet",shortName:"HarmonyMainnet",chainId:16666e5,network:"mainnet",multicall:"0x9c31392D2e0229dC4Aa250F043d46B9E82074BF8",rpc:["https://a.api.s0.t.hmny.io"],ws:["wss://ws.s0.t.hmny.io"],explorer:{url:"https://explorer.harmony.one"},start:10911984,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"},16667e5:{key:"1666700000",name:"Harmony Testnet",shortName:"HarmonyTestnet",chainId:16667e5,network:"testnet",testnet:!0,multicall:"0x9923589503Fd205feE3d367DDFF2378f0F7dD2d4",rpc:["https://api.s0.b.hmny.io"],ws:["wss://ws.s0.b.hmny.io"],explorer:{url:"https://explorer.pops.one"},start:7521509,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"}},Pm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.getValidVotes().filter((function(t){return t.choice===r+1}));return n.reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.strategies.map((function(e,n){var i=t.getValidVotes().filter((function(t){return t.choice===r+1}));return i.reduce((function(t,e){return t+e.scores[n]}),0)}));return n}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){return this.proposal.choices[this.selected-1]},t}(),Im=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.scores[n]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected?this.proposal.choices.filter((function(e,r){return t.selected.includes(r+1)})).join(", "):""},t}();function Rm(t,e){var r=t/e.reduce((function(t,e){return t+e}),0);return isNaN(r)?0:r}function Cm(t,e){return Math.sqrt(t*e)}function Tm(t){return t*t}function Om(t,e){return t.map((function(t){return e*t}))}var Bm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this.getValidVotes(),e=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),r=this.proposal.choices.map((function(e,r){var n=t.map((function(t){return Cm(Rm(t.choice[r+1],Object.values(t.choice)),t.balance)})).reduce((function(t,e){return t+e}),0);return Tm(n)}));return Om(r.map((function(t,e){return Rm(r[e],r)})),e)},t.prototype.getScoresByStrategy=function(){var t=this,e=this.getValidVotes(),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),n=this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.map((function(t){return Cm(Rm(t.choice[n+1],Object.values(t.choice)),t.scores[r])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[Tm(t)]}))}));return n.map((function(e,i){return Om(t.strategies.map((function(t,e){return Rm(n[i][e][0],n.flat(2))})),r)}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1]){var n=Rm(t.selected[r+1],Object.values(t.selected));return Math.round(1e3*n)/10+"% for "+e}})).filter((function(t){return null!=t})).join(", ")},t}();function $m(t,e){var r=i(new Set(t.map((function(t){return t[0]})).flat())),o=Object.entries(t.reduce((function(t,e,r,i){var o=n(e,1)[0],s=i[r][1];t[o[0]][0]+=s;var a=i[r][2];return a.length>1?t[o[0]][1]=a.map((function(e,r){return e+t[o[0]][1][r]||e})):t[o[0]][1]=[t[o[0]][1].concat(a).reduce((function(t,e){return t+e}),0)],t}),Object.assign.apply(Object,i([{}],r.map((function(t){var e;return(e={})[t]=[0,[]],e})))))),s=o.map((function(t){return[t[0],t[1][0]]})),a=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u>o?[a,u]:[i,o]}),["?",-1/0]),2),u=(a[0],a[1]),h=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u<o?[a,u]:[i,o]}),["?",1/0]),2),l=h[0],c=(h[1],o.sort((function(t,e){return e[1][0]-t[1][0]}))),f=t.map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0);return e.push({round:e.length+1,sortedByHighest:c}),u>f/2||c.length<3?e:$m(t.map((function(t){return[t[0].filter((function(t){return t!=l})),t[1],t[2]]})).filter((function(t){return t[0].length>0})),e)}function Dm(t){var e=$m(t.map((function(t){return[t.choice,t.balance,t.scores]})),[]);return e[e.length-1].sortedByHighest}var Fm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){return function(t,e){var r=Dm(t);return e.choices.map((function(t,e){return r.filter((function(t){return Number(t[0])===e+1})).reduce((function(t,e){return t+e[1][0]}),0)}))}(this.getValidVotes(),this.proposal)},t.prototype.getScoresByStrategy=function(){var t=this,e=Dm(this.getValidVotes());return this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.filter((function(t){return Number(t[0])===n+1})).reduce((function(t,e){return t+e[1][1][r]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected.map((function(e){if(t.proposal.choices[e-1])return t.proposal.choices[e-1]})).map((function(t,e){return"("+rg(e+1)+") "+t})).join(", ")},t}();function Um(t,e,r){var n=r.reduce((function(t,e){return t+e}),0),i=e[t]/n*100;return isNaN(i)?0:i}function jm(t,e,r){return Um(t+1,e,Object.values(e))/100*r}var Lm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.getValidVotes().map((function(t){return jm(r,t.choice,t.balance)})).reduce((function(t,e){return t+e}),0)})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(t,r){return Um(r,e,e)})).map((function(t){return r/100*t}))},t.prototype.getScoresByStrategy=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().map((function(t){return jm(r,t.choice,t.scores[n])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[t]}))})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(n,i){return t.strategies.map((function(t,r){return Um(0,e[i][r],e.flat(2))})).map((function(t){return[r/100*t]})).flat()}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1])return Math.round(10*Um(r+1,t.selected,Object.values(t.selected)))/10+"% for "+e})).filter((function(t){return null!=t})).join(", ")},t}(),zm={"single-choice":Pm,approval:Im,quadratic:Bm,"ranked-choice":Fm,weighted:Lm,basic:Pm},qm={1:"https://subgrapher.snapshot.org/gateway-arbitrum.network.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/subgraphs/id/4YgtogVaqoM8CErHWDK8mKQ825BcVdKB8vBYmb4avAQo",5:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",10:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",56:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",100:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",137:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",250:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",42161:"https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"},Vm=["function text(bytes32 node, string calldata key) external view returns (string memory)"],Gm={Accept:"application/json","Content-Type":"application/json"},Hm=new gf({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});bf(Hm),Hm.addFormat("address",{validate:function(t){try{return $e(t)}catch(t){return!1}}}),Hm.addFormat("long",{validate:function(){return!0}}),Hm.addFormat("ethValue",{validate:function(t){if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&tu.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=eu.indexOf(e);-1!==t&&(e=3*t)}Ja(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});var Km=Object.keys(Sm),Qm=Object.keys(Sm).filter((function(t){return!Sm[t].testnet}));function Jm(t,n,o,s){return e(this,void 0,void 0,(function(){var e,a,u;return r(this,(function(r){switch(r.label){case 0:e=new ha(o[0],n,t),r.label=1;case 1:return r.trys.push([1,3,,4]),a=o[2]||[],[4,e[o[1]].apply(e,i(a,[s||{}]))];case 2:return[2,r.sent()];case 3:return u=r.sent(),[2,Promise.reject(u)];case 4:return[2]}}))}))}function Ym(t,i,o,s,a){return e(this,void 0,void 0,(function(){var e,u,h,l,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:e=["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],u=(null==a?void 0:a.multicallAddress)||Sm[t].multicall,h=new ha(u,e,i),l=new ti(o),r.label=1;case 1:return r.trys.push([1,3,,4]),c=(null==a?void 0:a.limit)||500,(null==a?void 0:a.limit)&&delete a.limit,f=Math.ceil(s.length/c),d=[],Array.from(Array(f)).forEach((function(t,e){var r=s.slice(c*e,c*(e+1));d.push(h.aggregate(r.map((function(t){return[t[0].toLowerCase(),l.encodeFunctionData(t[1],t[2])]})),a||{}))})),[4,Promise.all(d)];case 2:return[2,r.sent().reduce((function(t,e){var r=n(e,2)[1];return t.concat(r)}),[]).map((function(t,e){return l.decodeFunctionResult(s[e][1],t)}))];case 3:return p=r.sent(),[2,Promise.reject(p)];case 4:return[2]}}))}))}function Zm(n,i,o){return void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return[4,l(n,{method:"POST",headers:t({Accept:"application/json","Content-Type":"application/json"},null==o?void 0:o.headers),body:JSON.stringify({query:Yh.jsonToGraphQLQuery({query:i})})})];case 1:return[4,(e=r.sent()).text()];case 2:s=r.sent();try{s=JSON.parse(s)}catch(t){throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+s.substring(0,400))}if(s.errors)throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+JSON.stringify(s.errors).substring(0,400));return[2,s.data||{}]}}))}))}function Wm(t,e){void 0===e&&(e=xm[0]);var r="https://"+e;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return r+"/ipfs/"+t;var n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",r+"/ipfs/"):"ipns"===n?t.replace("ipns://",r+"/ipns/"):t}function Xm(t,n,i,o){return void 0===i&&(i="1"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return e=o.ensResolvers,s=o.broviderUrl,a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(o,["ensResolvers","broviderUrl"]),u=e||Sm[i].ensResolvers||Sm[1].ensResolvers,h=gh(mh(t)),l=im(i,{broviderUrl:s}),[4,Ym(i,l,Vm,u.map((function(t){return[t,"text",[h,n]]})),a)];case 1:return[2,r.sent().flat().find((function(t){return t}))||""]}}))}))}function tg(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Xm(t,"snapshot",n,i)];case 1:return[2,r.sent()];case 2:return e=r.sent(),console.log(e),[2,null];case 3:return[2]}}))}))}function eg(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a,u;return r(this,(function(r){switch(r.label){case 0:return"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",e=im(n,i),o=new ha("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",["function owner(bytes32) view returns (address)"],e),s=i.ensNameWrapper||Sm[n].ensNameWrapper,a=gh(mh(t)),[4,o.owner(a)];case 1:return(u=r.sent())!==s?[3,3]:[4,new ha(s,["function ownerOf(uint256) view returns (address)"],e).ownerOf(a)];case 2:u=r.sent(),r.label=3;case 3:return[2,u]}}))}))}function rg(t){var e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function ng(t){return!!Sm[t]}function ig(t){return $e(t)&&"0x0000000000000000000000000000000000000000"!==t}function og(t,e){return"latest"===t||"number"==typeof t&&t>=Sm[e].start}function sg(t){return Promise.reject(new Error(t))}Hm.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?Qm.includes(e):Km.includes(e)},error:{message:"network not allowed"}}),Hm.addFormat("customUrl",{type:"string",validate:function(t){return!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))}});var ag={call:Jm,multicall:Ym,subgraphRequest:Zm,ipfsGet:function(t,n,i){return void 0===i&&(i="ipfs"),e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,l("https://"+t+"/"+i+"/"+n).then((function(t){return t.json()}))]}))}))},getUrl:Wm,getJSON:function(t,n){return void 0===n&&(n={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){return e=Wm(t,n.gateways),[2,l(e).then((function(t){return t.json()}))]}))}))},sendTransaction:function(t,n,o,s,a,u){return void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,l;return r(this,(function(r){switch(r.label){case 0:return e=t.getSigner(),h=new ha(n,o,t),[4,(l=h.connect(e))[s].apply(l,i(a,[u]))];case 1:return[2,r.sent()]}}))}))},getScores:function(t,n,i,o,s,a,u){return void 0===s&&(s="latest"),void 0===a&&(a="https://score.snapshot.org"),void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:if(!Array.isArray(o))return[2,sg("addresses should be an array of addresses")];if(0===o.length)return[2,sg("addresses can not be empty")];if(e=o.find((function(t){return!ig(t)})))return[2,sg("Invalid address: "+e)];if(!ng(i))return[2,sg("Invalid network: "+i)];if(h=n.find((function(t){return t.network&&!ng(t.network)})))return[2,sg("Invalid network ("+h.network+") in strategy "+h.name)];if(!og(s,i))return[2,sg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Sm[i].start+")")];(c=new URL(a)).pathname="/api/scores",a=c.toString(),r.label=1;case 1:return r.trys.push([1,4,,5]),f={space:t,network:i,snapshot:s,strategies:n,addresses:o},[4,l(a,{method:"POST",headers:Gm,body:JSON.stringify({params:f})})];case 2:return[4,r.sent().json()];case 3:return(d=r.sent()).error?[2,Promise.reject(d.error)]:[2,"all"===u.returnValue?d.result:d.result[u.returnValue||"scores"]];case 4:return(p=r.sent()).errno?[2,Promise.reject({code:p.errno,message:p.toString(),data:""})]:[2,Promise.reject(p)];case 5:return[2]}}))}))},getVp:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f;return r(this,(function(r){switch(r.label){case 0:if(u||(u={}),u.url||(u.url="https://score.snapshot.org"),!ig(t))return[2,sg("Invalid voter address: "+t)];if(!ng(n))return[2,sg("Invalid network: "+n)];if(e=i.find((function(t){return t.network&&!ng(t.network)})))return[2,sg("Invalid network ("+e.network+") in strategy "+e.name)];if(!og(o,n))return[2,sg("Snapshot ("+o+") must be 'latest' or greater than network start block ("+Sm[n].start+")")];h={method:"POST",headers:Gm,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:n,strategies:i,snapshot:o,space:s,delegation:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(u.url,h)];case 2:return[4,r.sent().json()];case 3:return(c=r.sent()).error?[2,Promise.reject(c.error)]:c.result?[2,c.result]:[3,5];case 4:return(f=r.sent()).errno?[2,Promise.reject({code:f.errno,message:f.toString(),data:""})]:[2,Promise.reject(f)];case 5:return[2]}}))}))},validateSchema:function(t,e,r){void 0===r&&(r={snapshotEnv:"default"});var n=Hm.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:Xm,getSpaceUri:tg,getEnsOwner:eg,getSpaceController:function(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a;return r(this,(function(r){switch(r.label){case 0:return[4,tg(t,n,i)];case 1:if(e=r.sent()){if($e(e))return[2,e];if(o=e.split("/"),s=o.includes("testnet")?5:4,a=o[s],$e(a))return[2,a]}return[4,eg(t,n,i)];case 2:return[2,r.sent()]}}))}))},getDelegatesBySpace:function(t,n,i,o){return void 0===i&&(i="latest"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:if(!(e=o.subgraphUrl||qm[t]))return[2,Promise.reject("Delegation subgraph not available for network "+t)];s=["",n],n.includes(".eth")&&s.push(n.replace(".eth","")),u=[],h=0,l={delegations:{__args:{where:{space_in:s},first:a=1e3,skip:0},delegator:!0,space:!0,delegate:!0}},"latest"!==i&&(l.delegations.__args.block={number:i}),r.label=1;case 1:return l.delegations.__args.skip=h*a,[4,Zm(e,l)];case 2:return c=r.sent(),f=c.delegations||[],u=u.concat(f),h++,f.length<a?[3,3]:[3,1];case 3:return[2,u]}}))}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new Promise((function(e){setTimeout(e,t)}))]}))}))},getNumberWithOrdinal:rg,voting:zm,getProvider:im,signMessage:function(t,n,i){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n=C(new Buffer(n,"utf8")),[4,t.send("personal_sign",[n,i])];case 1:return[2,e.sent()]}}))}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.getBlockNumber()];case 1:return e=r.sent(),[2,parseInt(e)];case 2:return r.sent(),[2,Promise.reject()];case 3:return[2]}}))}))},Multicaller:pd,getSnapshots:function(t,n,i,o,s){return void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:return e={},o.forEach((function(t){return e[t]="latest"})),"latest"===n?[2,e]:(a=t+"-"+n+"-"+o.join("-"),u=md[a],h=Date.now(),u&&gd>h?[2,u]:(gd<h&&(md={},gd=h+36e5-h%36e5),e[t]=n,l=Object.keys(e).filter((function(e){return t!==e})),0===l.length?[2,e]:[4,i.getBlock(n)]));case 1:return c=r.sent(),f={blocks:{__args:{where:{ts:c.timestamp,network_in:l}},network:!0,number:!0}},[4,Zm(s.blockFinderUrl||"https://blockfinder.snapshot.org",f)];case 2:return r.sent().blocks.forEach((function(t){return e[t.network]=t.number})),md[a]=e,[2,e]}}))}))},getHash:Nm,verify:function(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:e=i.domain,a=i.types,u=i.message,h=Nm(i);try{if(l=Mm(e,a,u,n),t===l)return[2,!0]}catch(t){}return[4,km(t,n,h,o,s)];case 1:return[2,r.sent()]}}))}))},validate:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c;return r(this,(function(r){switch(r.label){case 0:if(!ig(n))return[2,sg("Invalid author: "+n)];if(!ng(o))return[2,sg("Invalid network: "+o)];if(!og(s,o))return[2,sg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Sm[o].start+")")];u||(u={}),u.url||(u.url="https://score.snapshot.org"),e={method:"POST",headers:Gm,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:n,space:i,network:o,snapshot:s,params:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(u.url,e)];case 2:return[4,r.sent().json()];case 3:return(h=r.sent()).error?[2,Promise.reject(h.error)]:[2,h.result];case 4:return(c=r.sent()).errno?[2,Promise.reject({code:c.errno,message:c.toString(),data:""})]:[2,Promise.reject(c)];case 5:return[2]}}))}))},SNAPSHOT_SUBGRAPH_URL:qm};return{Client:ur,Client712:ur,schemas:gr,utils:ag}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapshot-labs/snapshot.js",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "repository": "snapshot-labs/snapshot.js",
5
5
  "license": "MIT",
6
6
  "main": "dist/snapshot.cjs.js",
package/src/networks.json CHANGED
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "5": {
39
39
  "key": "5",
40
- "name": "Ethereum Testnet Goerli",
40
+ "name": "Goerli testnet",
41
41
  "shortName": "Goerli",
42
42
  "chainId": 5,
43
43
  "network": "goerli",
@@ -1297,7 +1297,7 @@
1297
1297
  },
1298
1298
  "11155111": {
1299
1299
  "key": "11155111",
1300
- "name": "Sepolia",
1300
+ "name": "Sepolia testnet",
1301
1301
  "shortName": "Sepolia",
1302
1302
  "chainId": 11155111,
1303
1303
  "network": "sepolia",
@@ -149,7 +149,7 @@ export default class RankedChoiceVoting {
149
149
  }
150
150
 
151
151
  getScoresTotal(): number {
152
- return getScoresMethod(this.votes, this.proposal).reduce((a, b) => a + b);
152
+ return this.votes.reduce((a, b: any) => a + b.balance, 0);
153
153
  }
154
154
 
155
155
  getChoiceString(): string {