PageSourceSearch

https://joai.ai/_next/static/chunks/36952-26e0a80f616f895d.js?dpl=dpl_CZwjg7v2qnjRSeHeZqkV5Bhm9zRT

js joai.ai collected 2026-10-05 12:07:37 UTC 830,968 bytes, 101 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36952],{429:(e,t,r)=>{"use strict";r.d(t,{B8:()=>h,D0:()=>function e(t,r,n=!1,p={}){let g;if(t<=a)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:b,nByteLength:$}=x(t,r);if($>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let E=Object.freeze({ORDER:t,isLE:n,BITS:b,BYTES:$,MASK:(0,i.OG)(b),ZERO:a,ONE:s,create:e=>d(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return a<=e&&e<t},is0:e=>e===a,isOdd:e=>(e&s)===s,neg:e=>d(-e,t),eql:(e,t)=>e===t,sqr:e=>d(e*e,t),add:(e,r)=>d(e+r,t),sub:(e,r)=>d(e-r,t),mul:(e,r)=>d(e*r,t),pow:(e,t)=>(function(e,t,r){if(r<a)throw Error("invalid exponent, negatives unsupported");if(r===a)return e.ONE;if(r===s)return t;let n=e.ONE,i=t;for(;r>a;)r&s&&(n=e.mul(n,i)),i=e.sqr(i),r>>=s;return n})(E,e,t),div:(e,r)=>d(e*h(r,t),t),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>h(e,t),sqrt:p.sqrt||(r=>(g||(g=t%l===u?m:t%f===c?y:function(t){if(t<BigInt(3))throw Error("sqrt is not defined for small field");let r=t-s,n=0;for(;r%o===a;)r/=o,n++;let i=o,u=e(t);for(;1===v(u,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===n)return m;let l=u.pow(i,r),c=(r+s)/o;return function(e,t){if(e.is0(t))return t;if(1!==v(e,t))throw Error("Cannot find square root");let i=n,a=e.mul(e.ONE,l),o=e.pow(t,r),u=e.pow(t,c);for(;!e.eql(o,e.ONE);){if(e.is0(o))return e.ZERO;let t=1,r=e.sqr(o);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=s<<BigInt(i-t-1),l=e.pow(a,n);i=t,a=e.sqr(l),o=e.mul(o,a),u=e.mul(u,l)}return u}}(t)),g(E,r))),toBytes:e=>n?(0,i.z)(e,$):(0,i.lq)(e,$),fromBytes:e=>{if(e.length!==$)throw Error("Field.fromBytes: expected "+$+" bytes, got "+e.length);return n?(0,i.lX)(e):(0,i.Ph)(e)},invertBatch:e=>w(E,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(E)},LH:()=>x,Tp:()=>E,jr:()=>b,pS:()=>w,qy:()=>P,zH:()=>p,zi:()=>d});var n=r(82766),i=r(37942);let a=BigInt(0),s=BigInt(1),o=BigInt(2),u=BigInt(3),l=BigInt(4),c=BigInt(5),f=BigInt(8);function d(e,t){let r=e%t;return r>=a?r:t+r}function p(e,t,r){let n=e;for(;t-- >a;)n*=n,n%=r;return n}function h(e,t){if(e===a)throw Error("invert: expected non-zero number");if(t<=a)throw Error("invert: expected positive modulus, got "+t);let r=d(e,t),n=t,i=a,o=s,u=s,l=a;for(;r!==a;){let e=n/r,t=n%r,a=i-u*e,s=o-l*e;n=r,r=t,i=u,o=l,u=a,l=s}if(n!==s)throw Error("invert: does not exist");return d(i,t)}function m(e,t){let r=(e.ORDER+s)/l,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function y(e,t){let r=(e.ORDER-c)/f,n=e.mul(t,o),i=e.pow(n,r),a=e.mul(t,i),s=e.mul(e.mul(a,o),i),u=e.mul(a,e.sub(s,e.ONE));if(!e.eql(e.sqr(u),t))throw Error("Cannot find square root");return u}let g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e){let t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.Q5)(e,t)}function w(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),a=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),a),n}function v(e,t){let r=(e.ORDER-s)/o,n=e.pow(t,r),i=e.eql(n,e.ONE),a=e.eql(n,e.ZERO),u=e.eql(n,e.neg(e.ONE));if(!i&&!a&&!u)throw Error("invalid Legendre symbol result");return i?1:a?0:-1}function x(e,t){void 0!==t&&(0,n.Fe)(t);let r=void 0!==t?t:e.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function $(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function E(e){let t=$(e);return t+Math.ceil(t/2)}function P(e,t,r=!1){let n=e.length,a=$(t),o=E(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let u=d(r?(0,i.lX)(e):(0,i.Ph)(e),t-s)+s;return r?(0,i.z)(u,a):(0,i.lq)(u,a)}},1410:e=>{"use strict";e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true}
vendor: 7,267 bytes, line 1
1,"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')},1883:(e,t,r)=>{"use strict";r.d(t,{GK:()=>P,BI:()=>_,dm:()=>I,ST:()=>S,D4:()=>g,lF:()=>b,GP:()=>v,HT:()=>x});var n=r(62320),i=r(73614),a=r(15163),s=r(47420),o=r(97195),u=r(30837),l=r(94734),c=r(75228),f=r(56184),d=r(70234);function p(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=f.Ej(i)}let r=[],n=[],i=0;for(let a=0;a<e.length;a++){let{dynamic:s,encoded:o}=e[a];s?(r.push(f.oB(t+i,{size:32})),n.push(o),i+=f.Ej(o)):r.push(o)}return f.xW(...r,...n)}function h(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function m(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(m);let r=h(e.type);return!!(r&&m({...e,type:r[1]}))}var y=r(46089);function g(e,t,r={}){let{as:n="Array",checksumAddress:i=!1}=r,a="string"==typeof t?l.aD(t):t,s=y.vt(a);if(0===l.Ej(a)&&e.length>0)throw new E;if(l.Ej(a)&&32>l.Ej(a))throw new $({data:"string"==typeof t?t:f.uK(t),parameters:e,size:l.Ej(a)});let o=0,c="Array"===n?[]:{};for(let t=0;t<e.length;++t){let r=e[t];o<a.length&&s.setPosition(o);let[d,p]=function e(t,r,n){var i,a,s;let{checksumAddress:o,staticPosition:c}=n,d=h(r.type);if(d){let[n,i]=d;return function(t,r,n){let{checksumAddress:i,length:a,staticPosition:s}=n;if(null===a){let n=s+l.Ro(t.readBytes(32)),a=n+32;t.setPosition(n);let o=l.Ro(t.readBytes(32)),u=m(r),c=0,f=[];for(let n=0;n<o;++n){t.setPosition(a+(u?32*n:c));let[s,o]=e(t,r,{checksumAddress:i,staticPosition:a});c+=o,f.push(s),0===o&&(t.assertReadLimit(),t._touch())}return t.setPosition(s+32),[f,32]}if(m(r)){let n=s+l.Ro(t.readBytes(32)),o=[];for(let s=0;s<a;++s){t.setPosition(n+32*s);let[a]=e(t,r,{checksumAddress:i,staticPosition:n});o.push(a)}return t.setPosition(s+32),[o,32]}let o=0,u=[];for(let n=0;n<a;++n){let[n,a]=e(t,r,{checksumAddress:i,staticPosition:s+o});o+=a,u.push(n),0===a&&(t.assertReadLimit(),t._touch())}return[u,o]}(t,{...r,type:i},{checksumAddress:o,length:n,staticPosition:c})}if("tuple"===r.type)return function(t,r,n){let{checksumAddress:i,staticPosition:a}=n,s=0===r.components.length||r.components.some(({name:e})=>!e),o=s?[]:{},u=0;if(m(r)){let n=a+l.Ro(t.readBytes(32));for(let a=0;a<r.components.length;++a){let l=r.components[a];t.setPosition(n+u);let[c,f]=e(t,l,{checksumAddress:i,staticPosition:n});u+=f,o[s?a:l?.name]=c}return t.setPosition(a+32),[o,32]}for(let n=0;n<r.components.length;++n){let l=r.components[n],[c,f]=e(t,l,{checksumAddress:i,staticPosition:a});o[s?n:l?.name]=c,u+=f}return[o,u]}(t,r,{checksumAddress:o,staticPosition:c});if("address"===r.type)return function(e,t={}){let r,{checksum:n=!1}=t,i=e.readBytes(32);return[(r=f.uK(l.di(i,-20)),n?u.cM(r):r),32]}(t,{checksum:o});if("bool"===r.type){return i=t,[l.G4(i.readBytes(32),{size:32}),32]}if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=l.Ro(e.readBytes(32));e.setPosition(r+t);let n=l.Ro(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[f.uK(i),32]}return[f.uK(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:c});if(r.type.startsWith("uint")||r.type.startsWith("int")){let e,n,i;return a=t,e=(s=r).type.startsWith("int"),n=Number.parseInt(s.type.split("int")[1]||"256",10),i=a.readBytes(32),[n>48?l.Dg(i,{signed:e}):l.Ro(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=l.Ro(e.readBytes(32));e.setPosition(t+r);let n=l.Ro(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),a=l.dI(l.Mr(i));return e.setPosition(t+32),[a,32]}(t,{staticPosition:c});throw new S(r.type)}(s,r,{checksumAddress:i,staticPosition:0});o+=p,"Array"===n?c.push(d):c[r.name??t]=d}return c}function b(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new A({expectedLength:e.length,givenLength:t.length});let i=p(function({checksumAddress:e,parameters:t,values:r}){let n=[];for(let i=0;i<t.length;i++)n.push(function e({checksumAddress:t=!1,parameter:r,value:n}){let i=h(r.type);if(i){let[a,s]=i;return function(t,r){let{checksumAddress:n,length:i,parameter:a}=r,s=null===i;if(!Array.isArray(t))throw new I(t);if(!s&&t.length!==i)throw new P({expectedLength:i,givenLength:t.length,type:`${a.type}[${i}]`});let o=0===t.length&&m(a),u=[];for(let r=0;r<t.length;r++){let i=e({checksumAddress:n,parameter:a,value:t[r]});i.dynamic&&(o=!0),u.push(i)}if(s||o){let e=p(u);if(s){let t=f.oB(u.length,{size:32});return{dynamic:!0,encoded:u.length>0?f.xW(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:f.xW(...u.map(({encoded:e})=>e))}}(n,{checksumAddress:t,length:a,parameter:{...r,type:s}})}if("tuple"===r.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,a=!1,s=[];for(let r=0;r<i.components.length;r++){let o=i.components[r],u=Array.isArray(t)?r:o.name,l=e({checksumAddress:n,parameter:o,value:t[u]});s.push(l),l.dynamic&&(a=!0)}return{dynamic:a,encoded:a?p(s):f.xW(...s.map(({encoded:e})=>e))}}(n,{checksumAddress:t,parameter:r});if("address"===r.type)return function(e,t){let{checksum:r=!1}=t;return u.vA(e,{strict:r}),{dynamic:!1,encoded:f.Ho(e.toLowerCase())}}(n,{checksum:t});if("bool"===r.type){var a=n;if("boolean"!=typeof a)throw new c.C(`Invalid boolean value: "${a}" (type: ${typeof a}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:f.Ho(f.xb(a))}}if(r.type.startsWith("uint")||r.type.startsWith("int")){let e=r.type.startsWith("int"),[,,t="256"]=d.Ge.exec(r.type)??[];return function(e,{signed:t,size:r}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new f.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:f.oB(e,{size:32,signed:t})}}(n,{signed:e,size:Number(t)})}if(r.type.startsWith("bytes"))return function(e,{type:t}
1){let[,r]=t.split("bytes"),n=f.Ej(e);if(!r){let t=e;return n%32!=0&&(t=f.M7(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:f.xW(f.Ho(f.oB(n,{size:32})),t)}}if(n!==Number.parseInt(r,10))throw new _({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:f.M7(e)}}(n,{type:r.type});if("string"===r.type){var s=n;let e=f.sH(s),t=Math.ceil(f.Ej(e)/32),r=[];for(let n=0;n<t;n++)r.push(f.M7(f.di(e,32*n,(n+1)*32)));return{dynamic:!0,encoded:f.xW(f.M7(f.oB(f.Ej(e),{size:32})),...r)}}throw new S(r.type)}({checksumAddress:e,parameter:t[i],value:r[i]}));return n}({checksumAddress:n,parameters:e,values:t}));return 0===i.length?"0x":i}function w(e,t){if(e.length!==t.length)throw new A({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n];r.push(w.encode(i,a))}return f.xW(...r)}function v(e){return n.Q(e)}function x(e){return Array.isArray(e)&&"string"==typeof e[0]||"string"==typeof e?function(e){let t=[];if("string"==typeof e){let r=(0,o.NV)(e),n=r.length;for(let e=0;e<n;e++)t.push((0,o.Pj)(r[e],{modifiers:a.Dv}))}else{let r=(0,s.e)(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if((0,a.WL)(n))continue;let s=(0,o.NV)(n),u=s.length;for(let e=0;e<u;e++)t.push((0,o.Pj)(s[e],{modifiers:a.Dv,structs:r}))}}if(0===t.length)throw new i.A9({params:e});return t}(e):e}(w||(w={})).encode=function e(t,r,n=!1){if("address"===t)return u.vA(r),f.Ho(r.toLowerCase(),32*!!n);if("string"===t)return f.sH(r);if("bytes"===t)return r;if("bool"===t)return f.Ho(f.xb(r),n?32:1);let i=t.match(d.Ge);if(i){let[e,t,a="256"]=i,s=Number.parseInt(a,10)/8;return f.oB(r,{size:n?32:s,signed:"int"===t})}let a=t.match(d.BD);if(a){let[e,t]=a;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new _({expectedSize:Number.parseInt(t,10),value:r});return f.M7(r,32*!!n)}let s=t.match(d.D5);if(s&&Array.isArray(r)){let[t,n]=s,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":f.xW(...i)}throw new S(t)};class $ extends c.C{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${n.Q(t)})`,`Data:   ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class E extends c.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class P extends c.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class _ extends c.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${f.Ej(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class A extends c.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
2Expected length (parameters): ${e}
3Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class I extends c.C{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class S extends c.C{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}},3028:(e,t,r)=>{"use strict";r.d(t,{m_:()=>b,HT:()=>p,n1:()=>h,go:()=>m,ri:()=>y});var n=r(17120),i=r(15163),a=r(47420),s=r(97195),o=r(6735),u=r(75228),l=r(6871),c=r(56184),f=r(30837);function d(e){let t=!0,r="",n=0,i="",a=!1;for(let s=0;s<e.length;s++){let o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function","error",""].includes(i))i="";else if(i+=o,")"===o){a=!0;break}continue}if(" "===o){","!==e[s-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!a)throw new u.C("Unable to normalize signature.");return i}function p(e,t={}){let{prepare:r=!0}=t,o=Array.isArray(e)||"string"==typeof e?function(e){let t;if("string"==typeof e)t=(0,s.uT)(e);else{let r=(0,a.e)(e),n=e.length;for(let a=0;a<n;a++){let n=e[a];if(!(0,i.WL)(n)){t=(0,s.uT)(n,r);break}}}if(!t)throw new n.xo({signature:e});return t}(e):e;return{...o,...r?{hash:y(o)}:{}}}function h(e,t,r){let n,{args:i=[],prepare:a=!0}=r??{},s=c.tf(t,{strict:!1}),o=e.filter(e=>s?"function"===e.type||"error"===e.type?m(e)===c.di(t,0,4):"event"===e.type&&y(e)===t:"name"in e&&e.name===t);if(0===o.length)throw new b({name:t});if(1===o.length)return{...o[0],...a?{hash:y(o[0])}:{}};for(let e of o){if("inputs"in e){if(!i||0===i.length){if(!e.inputs||0===e.inputs.length)return{...e,...a?{hash:y(e)}:{}};continue}
vendor: 1,968 bytes, line 3
3if(e.inputs&&0!==e.inputs.length&&e.inputs.length===i.length&&i.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return f.tf(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(n&&"inputs"in n&&n.inputs){let t=function e(t,r,n){for(let i in t){let a=t[i],s=r[i];if("tuple"===a.type&&"tuple"===s.type&&"components"in a&&"components"in s)return e(a.components,s.components,n[i]);let o=[a.type,s.type];if(o.includes("address")&&o.includes("bytes20")||(o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes"))&&f.tf(n[i],{strict:!1}))return o}}(e.inputs,n.inputs,i);if(t)throw new g({abiItem:e,type:t[0]},{abiItem:n,type:t[1]})}n=e}}}let u=(()=>{if(n)return n;let[e,...t]=o;return{...e,overloads:t}})();if(!u)throw new b({name:t});return{...u,...a?{hash:y(u)}:{}}}function m(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return h(t,r)}return e[0]})();return c.di(y(t),0,4)}function y(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return h(t,r)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:l.So(c.sH(function(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return h(t,r)}return e[0]})();return d("string"==typeof t?t:o.B(t))}(t)))}class g extends u.C{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}
3\` in \`${d(o.B(e.abiItem))}\`, and`,`\`${t.type}\` in \`${d(o.B(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class b extends u.C{constructor({name:e,data:t,type:r="item"}){const n=e?` with name "${e}"`:t?` with data "${t}"`:"";super(`ABI ${r}${n} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}u.C},3399:(e,t,r)=>{"use strict";function n(){return"0.1.1"}function i(e){if(!e)return"";let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>`  ${`${e}:`.padEnd(r+1)}  ${t}`).join("\n")}r.d(t,{HF:()=>n,aO:()=>i})},3974:(e,t,r)=>{"use strict";r.d(t,{c:()=>g});var n=r(66568);class i extends n.C{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}var a=r(49586),s=r(28992),o=r(43609),u=r(45437),l=r(7528),c=r(91497),f=r(81693),d=r(12581),p=r(94747),h=r(73260),m=r(75255);async function y(e,t){let r;async function n(t){if(t.endsWith(m.vB.slice(2))){let r=(0,d.B)((0,f.iN)(t,-64,-32)),n=(0,f.iN)(t,0,-64).slice(2).match(/.{1,64}/g),i=await Promise.all(n.map(t=>m.BH.slice(2)!==t?e.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0)),a=i.some(e=>null===e)?100:i.every(e=>e?.status==="0x1")?200:i.every(e=>e?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,p.ME)(r),receipts:i.filter(Boolean),status:a,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[t]})}let{atomic:i=!1,chainId:a,receipts:s,version:o="2.0.0",...u}=await n(t.id),[l,c]=(r=u.status)>=100&&r<200?["pending",r]:r>=200&&r<300?["success",r]:r>=300&&r<700?["failure",r]:"CONFIRMED"===r?["success",200]:"PENDING"===r?["pending",100]:[void 0,r];return{...u,atomic:i,chainId:a?(0,p.ME)(a):void 0,receipts:s?.map(e=>({...e,blockNumber:(0,p.uU)(e.blockNumber),gasUsed:(0,p.uU)(e.gasUsed),status:h.Lj[e.status]}))??[],statusCode:c,status:l,version:o}}async function g(e,t){let r,{id:n,pollingInterval:f=e.pollingInterval,status:d=({statusCode:e})=>200===e||e>=300,retryCount:p=4,retryDelay:h=({count:e})=>200*~~(1<<e),timeout:m=6e4,throwOnFailure:g=!1}=t,w=(0,c.A)(["waitForCallsStatus",e.uid,n]),{promise:v,resolve:x,reject:$}=(0,u.Y)(),E=(0,s.lB)(w,{resolve:x,reject:$},t=>{let s=(0,o.w)(async()=>{let o=e=>{clearTimeout(r),s(),e(),E()};try{let r=await (0,l.b)(async()=>{let t=await (0,a.T)(e,y,"getCallsStatus")({id:n});if(g&&"failure"===t.status)throw new i(t);return t},{retryCount:p,delay:h});if(!d(r))return;o(()=>t.resolve(r))}catch(e){o(()=>t.reject(e))}},{interval:f,emitOnBegin:!0});return s});return r=m?setTimeout(()=>{E(),clearTimeout(r),$(new b({id:n}))},m):void 0,await v}class b extends n.C{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}},4016:(e,t,r)=>{"use strict";r.d(t,{j:()=>u});var n=r(80044),i=r(66568),a=r(78568),s=r(93247),o=r(65261);function u(e,{abi:t,address:r,args:l,docsPath:c,functionName:f,sender:d}){let p=e instanceof a.$S?e:e instanceof i.C?e.walk(e=>"data"in e)||e.walk():{},{code:h,data:m,details:y,message:g,shortMessage:b}=p,w=e instanceof n.O?new a.rR({functionName:f,cause:e}):[3,o.bq.code].includes(h)&&(m||y||g||b)||h===o.Di.code&&"execution reverted"===y&&m?new a.M({abi:t,data:"object"==typeof m?m.data:m,functionName:f,message:p instanceof s.J8?y:b??g,cause:e}):e;return new a.bG(w,{abi:t,args:l,contractAddress:r,docsPath:c,functionName:f,sender:d})}},4174:(e,t,r)=>{"use strict";r.d(t,{A7:()=>a,BG:()=>s,Fo:()=>p,K0:()=>u,Oh:()=>l,RM:()=>y,jj:()=>o,k5:()=>f,lN:()=>m,lY:()=>d,uC:()=>h,vW:()=>c});var n=r(22160),i=r(66568);class a extends i.C{constructor({cause:e,message:t}={}){const r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class s extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class o extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class u extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.
4Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class c extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class f extends i.C{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class d extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class h extends i.C{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class m extends i.C{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.Q)(r)} gwei`:""}).`,{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(m,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class y extends i.C{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}},4181:(e,t,r)=>{"use strict";r.d(t,{p:()=>c});var n=r(76429),i=r(44497),a=r(80044),s=r(56213),o=r(24029),u=r(42330);let l="/docs/contract/encodeFunctionData";function c(e){let{args:t}=e,{abi:r,functionName:c}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){let{abi:t,args:r,functionName:n}=e,i=t[0];if(n){let e=(0,u.iY)({abi:t,args:r,name:n});if(!e)throw new a.Iz(n,{docsPath:l});i=e}if("function"!==i.type)throw new a.Iz(void 0,{docsPath:l});return{abi:[i],functionName:(0,s.V)((0,o.B)(i))}}
4(e),f=r[0],d="inputs"in f&&f.inputs?(0,i.h)(f.inputs,t??[]):void 0;return(0,n.aP)([c,d??"0x"])}},4257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(95230),i=r(93608),a=r(17950);t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,a._)`{pattern: ${e}}`},code(e){let{gen:t,data:r,$data:s,schema:o,schemaCode:u,it:l}=e,c=l.opts.unicodeRegExp?"u":"";if(s){let{regExp:n}=l.opts.code,s="new RegExp"===n.code?(0,a._)`new RegExp`:(0,i.useFunc)(t,n),o=t.let("valid");t.try(()=>t.assign(o,(0,a._)`${s}(${u}, ${c}).test(${r})`),()=>t.assign(o,!1)),e.fail$data((0,a._)`!${o}`)}else{let t=(0,n.usePattern)(e,o);e.fail$data((0,a._)`!${t}.test(${r})`)}}}},4638:(e,t,r)=>{"use strict";r.d(t,{U:()=>s});var n=r(15163),i=r(47420),a=r(97195);function s(e){let t=(0,i.e)(e),r=[],s=e.length;for(let i=0;i<s;i++){let s=e[i];(0,n.WL)(s)||r.push((0,a.uT)(s,t))}return r}},4879:(e,t,r)=>{"use strict";r.d(t,{EH:()=>a,YE:()=>o,jF:()=>s,qD:()=>u,rj:()=>i});var n=r(66568);class i extends n.C{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class a extends n.C{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID:  ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class s extends n.C{constructor(){super("No chain was provided to the request.\nPlease provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.",{name:"ChainNotFoundError"})}}class o extends n.C{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class u extends n.C{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}
4" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}},5773:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let n=r(17950),i=r(93608),a=r(95230);function s(e,t,r=e.schema){let{gen:a,parentSchema:o,data:u,keyword:l,it:c}=e;(function(e){let{opts:n,errSchemaPath:a}=c,s=r.length,o=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!o){let e=`"${l}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${a}"`;(0,i.checkStrictMode)(c,e,n.strictTuples)}})(o),c.opts.unevaluated&&r.length&&!0!==c.items&&(c.items=i.mergeEvaluated.items(a,r.length,c.items));let f=a.name("valid"),d=a.const("len",(0,n._)`${u}.length`);r.forEach((t,r)=>{(0,i.alwaysValidSchema)(c,t)||(a.if((0,n._)`${d} > ${r}`,()=>e.subschema({keyword:l,schemaProp:r,dataProp:r},f)),e.ok(f))})}t.validateTuple=s,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return s(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,a.validateArray)(e))}}},5812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608);t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,n._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:a,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&a.discriminator)return;let o=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block(function(){r.forEach((r,a)=>{let c;(0,i.alwaysValidSchema)(s,r)?t.var(l,!0):c=e.subschema({keyword:"oneOf",schemaProp:a,compositeRule:!0},l),a>0&&t.if((0,n._)`${l} && ${o}`).assign(o,!1).assign(u,(0,n._)`[${u}, ${a}]`).else(),t.if(l,()=>{t.assign(o,!0),t.assign(u,a),c&&e.mergeEvaluated(c,n.Name)})})}),e.result(o,()=>e.reset(),()=>e.error(!0))}}},6100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(14252);
4class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},6593:(e,t,r)=>{"use strict";r.d(t,{T:()=>i,Z:()=>a});var n=r(66568);class i extends n.C{constructor({docsPath:e}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.",{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class a extends n.C{constructor({docsPath:e,metaMessages:t,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}},6735:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var n=r(62320);function i(e){return"function"===e.type?`function ${e.name}(${(0,n.Q)(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${(0,n.Q)(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${(0,n.Q)(e.inputs)})`:"error"===e.type?`error ${e.name}(${(0,n.Q)(e.inputs)})`:"constructor"===e.type?`constructor(${(0,n.Q)(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?`fallback() external${"payable"===e.stateMutability?" payable":""}`:"receive() external payable"}},6871:(e,t,r)=>{"use strict";r.d(t,{So:()=>o,sc:()=>u,tf:()=>l});var n=r(89913),i=r(45089),a=r(94734),s=r(56184);function o(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,i=(0,n.lY)(a.HT(e));return"Bytes"===r?i:s.uK(i)}function u(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,n=(0,i.sc)(a.HT(e));return"Bytes"===r?n:s.uK(n)}function l(e){return 66===e.length&&s.tf(e,{strict:!0})}},7211:(e,t,r)=>{"use strict";r.d(t,{EQ:()=>o});var n=r(66568),i=r(14870),a=r(22106),s=r(84428);function o(e,t="hex"){let r=function e(t){var r,n;let i,s,o,l;return Array.isArray(t)?(s=u(i=(r=t.map(t=>e(t))).reduce((e,t)=>e+t.length,0)),{length:i<=55?1+i:1+s+i,encode(e){for(let{encode:t}of(i<=55?e.pushByte(192+i):(e.pushByte(247+s),1===s?e.pushUint8(i):2===s?e.pushUint16(i):3===s?e.pushUint24(i):e.pushUint32(i)),r))t(e)}}):(l=u((o="string"==typeof(n=t)?(0,a.aT)(n):n).length),{length:1===o.length&&o[0]<128?1:o.length<=55?1+o.length:1+l+o.length,encode(e){1===o.length&&o[0]<128||(o.length<=55?e.pushByte(128+o.length):(e.pushByte(183+l),1===l?e.pushUint8(o.length):2===l?e.pushUint16(o.length):3===l?e.pushUint24(o.length):e.pushUint32(o.length))),e.pushBytes(o)}})}(e),n=(0,i.l)(new Uint8Array(r.length));return(r.encode(n),"hex"===t)?(0,s.My)(n.bytes):n.bytes}function u(e){if(e<256)return 1;if(e<65536)return 2;if(e<0x1000000)return 3;if(e<0x100000000)return 4;throw new n.C("Length is too large.")}},7528:(e,t,r)=>{"use strict";r.d(t,{b:()=>a});var n=r(18267),i=r(46269);function a(e,{delay:t=100,retryCount:r=2,shouldRetry:s=()=>!0,signal:o}={}){return new Promise((a,u)=>{let l=async({count:c=0}={})=>{if(o?.aborted)return void u((0,n.TY)(o));let f=async({error:e})=>{let r="function"==typeof t?t({count:c,error:e}):t;if(r)try{await (0,i.u)(r,{signal:o})}catch(e){u(e);return}return l({count:c+1})};try{let t=await e();a(t)}catch(e){if(o?.aborted)return void u((0,n.TY)(o));if((0,n.zf)(e))return void u(e);if(c<r&&await s({count:c,error:e}))return f({error:e});u(e)}};l().catch(u)})}},8356:(e,t,r)=>{"use strict";r.d(t,{v:()=>l});var n=r(51011),i=r(73320),a=r(4181),s=r(4016),o=r(49586),u=r(76900);async function l(e,t){let{abi:r,address:l,args:c,functionName:f,dataSuffix:d="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...p}=t,h=p.account?(0,n.J)(p.account):e.account,m=(0,a.p)({abi:r,args:c,functionName:f});try{let{data:n}=await (0,o.T)(e,u.T,"call")({batch:!1,data:`${m}${d?d.replace("0x",""):""}`,to:l,...p,account:h}),a=(0,i.e)({abi:r,args:c,functionName:f,data:n||"0x"}),s=r.filter(e=>"name"in e&&e.name===t.functionName);return{result:a,request:{abi:s,address:l,args:c,dataSuffix:d,functionName:f,...p,account:h}}}catch(e){throw(0,s.j)(e,{abi:r,address:l,args:c,docsPath:"/docs/contract/simulateContract",functionName:f,sender:h?.address})}}},8685:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});let n=r(27475).k},9269:(e,t,r)=>{"use strict";
4Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let n=r(96420),i=r(58419),a=r(13452),s=r(58419),o=r(61609),u=r(77334),l=r(40100),c=r(17950),f=r(64032),d=r(14252),p=r(93608),h=r(95519);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},a){var s;i.code.es5?e.func(t,(0,c._)`${f.default.data}, ${f.default.valCxt}`,n.$async,()=>{var t,n;e.code((0,c._)`"use strict"; ${y(r,i)}`),t=e,n=i,t.if(f.default.valCxt,()=>{t.var(f.default.instancePath,(0,c._)`${f.default.valCxt}.${f.default.instancePath}`),t.var(f.default.parentData,(0,c._)`${f.default.valCxt}.${f.default.parentData}`),t.var(f.default.parentDataProperty,(0,c._)`${f.default.valCxt}.${f.default.parentDataProperty}`),t.var(f.default.rootData,(0,c._)`${f.default.valCxt}.${f.default.rootData}`),n.dynamicRef&&t.var(f.default.dynamicAnchors,(0,c._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{t.var(f.default.instancePath,(0,c._)`""`),t.var(f.default.parentData,(0,c._)`undefined`),t.var(f.default.parentDataProperty,(0,c._)`undefined`),t.var(f.default.rootData,f.default.data),n.dynamicRef&&t.var(f.default.dynamicAnchors,(0,c._)`{}`)}),e.code(a)}):e.func(t,(0,c._)`${f.default.data}, ${(s=i,(0,c._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${s.dynamicRef?(0,c._)`, ${f.default.dynamicAnchors}={}`:c.nil}}={}`)}`,n.$async,()=>e.code(y(r,i)).code(a))}function y(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${r} */`:c.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function w(e){(0,p.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return $(e,[],!1,t);let r=(0,i.getSchemaTypes)(e.schema),n=(0,i.coerceAndCheckDataType)(e,r);$(e,r,!n,t)}function x({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let a=r.$comment;if(!0===i.$comment)e.code((0,c._)`${f.default.self}.logger.log(${a})`);else if("function"==typeof i.$comment){let r=(0,c.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,c._)`${f.default.self}.opts.$comment(${a}, ${r}, ${i}.schema)`)}}function $(e,t,r,n){var i,o,u,l;let{gen:d,schema:h,data:m,allErrors:y,opts:g,self:b}=e,{RULES:w}=b;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(h,w)))return void d.block(()=>I(e,"$ref",w.all.$ref.definition));function v(i){(0,a.shouldUseGroup)(h,i)&&(i.type?(d.if((0,s.checkDataType)(i.type,m,g.strictNumbers)),E(e,i),1===t.length&&t[0]===i.type&&r&&(d.else(),(0,s.reportTypeError)(e)),d.endIf()):E(e,i),y||d.if((0,c._)`${f.default.errors} === ${n||0}`))}g.jtd||(i=e,o=t,!i.schemaEnv.meta&&i.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{P(e.dataTypes,t)||_(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let n of e.dataTypes)P(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)}}(i,o),i.opts.allowUnionTypes||(u=i,(l=o).length>1&&!(2===l.length&&l.includes("null"))&&_(u,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if("object"==typeof i&&(0,a.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>{var r,n;return r=t,n=e,r.includes(n)||"number"===n&&r.includes("integer")})&&_(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(i,i.dataTypes))),d.block(()=>{for(let e of w.rules)v(e);v(w.post)})}function E(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,a.shouldUseRule)(n,r)&&I(e,r.keyword,r.definition,t.type)})}function P(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function _(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(w(e),g(e))?function(e){let{schema:t,opts:r,gen:n}=e;m(e,()=>{r.$comment&&t.$comment&&x(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(f.default.vErrors,null),n.let(f.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,c._)`${r}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}(e),v(e),function(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:a}=e;r.$async?t.if((0,c._)`${f.default.errors} === 0`,()=>t.return(f.default.data),()=>t.throw((0,c._)`new ${i}(${f.default.vErrors})`)):(t.assign((0,c._)`${n}.errors`,f.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof c.Name&&e.assign((0,c._)`${t}.props`,r),n instanceof c.Name&&e.assign((0,c._)`${t}.items`,n)}(e),t.return((0,c._)`${f.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,n.topBoolOrEmptySchema)(e))};class A{constructor(e,t,r){if((0,u.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",k(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,u.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,r){this.failResult((0,c.not)(e),t,r)}
4failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=c.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:a}=this;r.if((0,c.or)((0,c._)`${n} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(i.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,c.or)(function(){if(r.length){if(!(t instanceof c.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,c._)`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return c.nil}(),function(){if(n.validateSchema){let r=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,c._)`!${r}(${t})`}return c.nil}())}subschema(e,t){let r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(b(e)&&(w(e),g(e)))return function(e,t){var r;let n,{schema:i,gen:a,opts:s}=e;s.$comment&&i.$comment&&x(e),(n=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,d.resolveUrl)(r.opts.uriResolver,r.baseId,n)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let o=a.const("_errs",f.default.errors);v(e,o),a.var(t,(0,c._)`${o} === ${f.default.errors}`)}(e,t);(0,n.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){let{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=p.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=p.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}}function I(e,t,r,n){let i=new A(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,u.funcKeywordCode)(i,r):"macro"in r?(0,u.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,u.funcKeywordCode)(i,r)}t.KeywordCxt=A;let S=/^\/(?:[^~]|~0|~1)*$/,z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function k(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,a;if(""===e)return f.default.rootData;if("/"===e[0]){if(!S.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=f.default.rootData}else{let s=z.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let u=+s[1];if("#"===(i=s[2])){if(u>=t)throw Error(o("property/index",u));return n[t-u]}if(u>t)throw Error(o("data",u));if(a=r[t-u],!i)return a}let s=a;for(let e of i.split("/"))e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,p.unescapeJsonPointer)(e))}`,s=(0,c._)`${s} && ${a}`);return s;function o(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=k},9459:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base64:()=>z,base64url:()=>k,bigint:()=>D,boolean:()=>W,browserEmail:()=>$,cidrv4:()=>I,cidrv6:()=>S,cuid:()=>i,cuid2:()=>a,date:()=>N,datetime:()=>U,domain:()=>C,duration:()=>c,e164:()=>B,email:()=>g,emoji:()=>E,extendedDuration:()=>f,guid:()=>d,hex:()=>Z,hostname:()=>O,html5Email:()=>b,httpProtocol:()=>T,idnEmail:()=>x,integer:()=>q,ipv4:()=>P,ipv6:()=>_,ksuid:()=>u,lowercase:()=>K,mac:()=>A,md5_base64:()=>X,md5_base64url:()=>ee,md5_hex:()=>Q,nanoid:()=>l,null:()=>H,number:()=>F,rfc5322Email:()=>w,sha1_base64:()=>er,sha1_base64url:()=>en,sha1_hex:()=>et,sha256_base64:()=>ea,sha256_base64url:()=>es,sha256_hex:()=>ei,sha384_base64:()=>eu,sha384_base64url:()=>el,sha384_hex:()=>eo,sha512_base64:()=>ef,sha512_base64url:()=>ed,sha512_hex:()=>
4ec,string:()=>L,time:()=>R,ulid:()=>s,undefined:()=>V,unicodeEmail:()=>v,uppercase:()=>G,uuid:()=>p,uuid4:()=>h,uuid6:()=>m,uuid7:()=>y,xid:()=>o});var n=r(68056);let i=/^[cC][0-9a-z]{6,}$/,a=/^[0-9a-z]+$/,s=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,o=/^[0-9a-vA-V]{20}$/,u=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,c=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,f=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,d=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,p=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,h=p(4),m=p(6),y=p(7),g=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,b=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,w=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,v=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,x=v,$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function E(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let P=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,A=e=>{let t=n.escapeRegex(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},I=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,S=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,z=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,k=/^[A-Za-z0-9_-]*$/,O=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,C=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,T=/^https?$/,B=/^\+[1-9]\d{6,14}$/,j="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",N=RegExp(`^${j}$`);function M(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function R(e){return RegExp(`^${M(e)}$`)}function U(e){let t=M({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${j}T(?:${n})$`)}let L=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},D=/^-?\d+n?$/,q=/^-?\d+$/,F=/^-?\d+(?:\.\d+)?$/,W=/^(?:true|false)$/i,H=/^null$/i,V=/^undefined$/i,K=/^[^A-Z]*$/,G=/^[^a-z]*$/,Z=/^[0-9a-fA-F]*$/;function J(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Y(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let Q=/^[0-9a-fA-F]{32}$/,X=J(22,"=="),ee=Y(22),et=/^[0-9a-fA-F]{40}$/,er=J(27,"="),en=Y(27),ei=/^[0-9a-fA-F]{64}$/,ea=J(43,"="),es=Y(43),eo=/^[0-9a-fA-F]{96}$/,eu=J(64,""),el=Y(64),ec=/^[0-9a-fA-F]{128}$/,ef=J(86,"=="),ed=Y(86)},9471:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var n=r(66568);class i extends n.C{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}},10155:(e,t,r)=>{"use strict";r.d(t,{O:()=>l,_:()=>u});
4var n=r(50474),i=r(49586),a=r(14124),s=r(42073),o=r(94310);async function u(e,t){return l(e,t)}async function l(e,t){let{block:r,chain:u=e.chain,request:l,type:c="eip1559"}=t||{},f=await (async()=>"function"==typeof u?.fees?.baseFeeMultiplier?u.fees.baseFeeMultiplier({block:r,client:e,request:l}):u?.fees?.baseFeeMultiplier??1.2)();if(f<1)throw new n.sM;let d=f.toString().split(".")[1]?.length??0,p=10**d,h=e=>e*BigInt(Math.round(f*p))/BigInt(p),m=r||await (0,i.T)(e,s.g,"getBlock")({});if("function"==typeof u?.fees?.estimateFeesPerGas){let t=await u.fees.estimateFeesPerGas({block:r,client:e,multiply:h,request:l,type:c});if(null!==t)return t}if("eip1559"===c){if("bigint"!=typeof m.baseFeePerGas)throw new n.pw;let t="bigint"==typeof l?.maxPriorityFeePerGas?l.maxPriorityFeePerGas:await (0,a.N)(e,{block:m,chain:u,request:l}),r=h(m.baseFeePerGas);return{maxFeePerGas:l?.maxFeePerGas??r+t,maxPriorityFeePerGas:t}}return{gasPrice:l?.gasPrice??h(await (0,i.T)(e,o.L,"getGasPrice")({}))}}},11475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(22721),i=r(90516),a=r(99644),s=r(4257),o=r(16257),u=r(32296),l=r(34156),c=r(49194),f=r(80440),d=r(77148);t.default=[n.default,i.default,a.default,s.default,o.default,u.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,d.default]},12515:(e,t,r)=>{"use strict";r.d(t,{Hi:()=>i,ft:()=>a,uj:()=>o});var n=r(66568);class i extends n.C{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class a extends n.C{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function s(e){return e.reduce((e,{slot:t,value:r})=>`${e}        ${t}: ${r}
5`,"")}function o(e){return e.reduce((e,{address:t,...r})=>{let n=`${e}    ${t}:
6`;return r.nonce&&(n+=`      nonce: ${r.nonce}
7`),r.balance&&(n+=`      balance: ${r.balance}
8`),r.code&&(n+=`      code: ${r.code}
9`),r.state&&(n+="      state:\n",n+=s(r.state)),r.stateDiff&&(n+="      stateDiff:\n",n+=s(r.stateDiff)),n},"  State Override:\n").slice(0,-1)}},12581:(e,t,r)=>{"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,i=0;for(let e=0;e<r.length-1;e++)if("0"===r["left"===t?e:r.length-e-1].toString())i++;else break;return(r="left"===t?r.slice(i):r.slice(0,r.length-i),"string"==typeof e)?(1===r.length&&"right"===t&&(r=`${r}0`),`0x${r.length%2==1?`0${r}`:r}`):r}r.d(t,{B:()=>n})},13452:(e,t)=>{"use strict";function r(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){let i=t.RULES.types[n];return i&&!0!==i&&r(e,i)},t.shouldUseGroup=r,t.shouldUseRule=n},14124:(e,t,r)=>{"use strict";r.d(t,{N:()=>l,b:()=>u});var n=r(50474),i=r(94747),a=r(49586),s=r(42073),o=r(94310);async function u(e,t){return l(e,t)}async function l(e,t){let{block:r,chain:u=e.chain,request:l}=t||{};try{let t=u?.fees?.maxPriorityFeePerGas??u?.fees?.defaultPriorityFee;if("function"==typeof t){let n=r||await (0,a.T)(e,s.g,"getBlock")({}),i=await t({block:n,client:e,request:l});if(null===i)throw Error();return i}if(void 0!==t)return t;let n=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,i.uU)(n)}catch{let[t,i]=await Promise.all([r?Promise.resolve(r):(0,a.T)(e,s.g,"getBlock")({}),(0,a.T)(e,o.L,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new n.pw;let u=i-t.baseFeePerGas;if(u<0n)return 0n;return u}}},14252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let n=r(93608),i=r(68054),a=r(16317),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!function e(t){for(let r in t){if(o.has(r))return!0;let n=t[r];
9if(Array.isArray(n)&&n.some(e)||"object"==typeof n&&e(n))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let i in t)if("$ref"===i||(r++,!s.has(i)&&("object"==typeof t[i]&&(0,n.eachItem)(t[i],t=>r+=e(t)),r===1/0)))return 1/0;return r}(e)<=t)};let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e,t="",r){!1!==r&&(t=f(t));let n=e.parse(t);return l(e,n)}function l(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=l;let c=/#\/?$/;function f(e){return e?e.replace(c,""):""}t.normalizeId=f,t.resolveUrl=function(e,t,r){return r=f(r),e.resolve(t,r)};let d=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:n}=this.opts,s=f(e[r]||t),o={"":s},l=u(n,s,!1),c={},p=new Set;return a(e,{allKeys:!0},(e,t,n,i)=>{if(void 0===i)return;let a=l+t,s=o[i];function u(t){let r=this.opts.uriResolver.resolve;if(t=f(s?r(s,t):t),p.has(t))throw m(t);p.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==f(a)&&("#"===t[0]?(h(e,c[t],t),c[t]=e):this.refs[t]=a),t}function y(e){if("string"==typeof e){if(!d.test(e))throw Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=u.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),o[t]=s}),c;function h(e,t,r){if(void 0!==t&&!i(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},14390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608);t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,n._)`{propertyName: ${e.propertyName}}`}
9,code(e){let{gen:t,schema:r,data:a,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;let o=t.name("valid");t.forIn("key",a,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,n.not)(o),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(o)}}},14870:(e,t,r)=>{"use strict";r.d(t,{l:()=>a});var n=r(41568);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n.hX({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n.SK({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function a(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}},15163:(e,t,r)=>{"use strict";r.d(t,{Dv:()=>P,FO:()=>m,If:()=>x,Ji:()=>f,Rv:()=>u,WL:()=>h,Yo:()=>b,ej:()=>d,fC:()=>_,iB:()=>l,kz:()=>s,l9:()=>g,pc:()=>a,sP:()=>E,v7:()=>A,v8:()=>v});var n=r(27075);let i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function a(e){return i.test(e)}function s(e){return(0,n.Yv)(i,e)}let o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function u(e){return o.test(e)}function l(e){return(0,n.Yv)(o,e)}let c=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function f(e){return c.test(e)}function d(e){return(0,n.Yv)(c,e)}let p=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function h(e){return p.test(e)}function m(e){return(0,n.Yv)(p,e)}let y=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function g(e){return y.test(e)}function b(e){return(0,n.Yv)(y,e)}let w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(e){return w.test(e)}function x(e){return(0,n.Yv)(w,e)}let $=/^receive\(\) external payable$/;function E(e){return $.test(e)}let P=new Set(["memory","indexed","storage","calldata"]),_=new Set(["indexed"]),A=new Set(["calldata","memory","storage"])},15904:(e,t,r)=>{"use strict";r.d(t,{GP:()=>i,HT:()=>o,Q_:()=>s,ck:()=>a});let n={wei:0,gwei:9,szabo:12,finney:15,ether:18};function i(e,t=0){if(!Number.isInteger(t)||t<0)throw new l({decimals:t});let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[a,s]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${a||"0"}${s?`.${s}`:""}`}function a(e,t="wei"){return i(e,n.ether-n[t])}function s(e,t="wei"){return i(e,n.gwei-n[t])}function o(e,t=0){if(!Number.isInteger(t)||t<0)throw new l({decimals:t});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(e))throw new u({value:e});let[r="",n="0"]=e.split("."),i=r.startsWith("-");if(i&&(r=r.slice(1)),""===r&&(r="0"),n=n.replace(/(0+)$/,""),0===t)n.length>0&&Number.parseInt(n[0],10)>=5&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let e=n.slice(0,t);if(Number.parseInt(n.slice(t,t+1),10)>=5){let i=function(e){let t=e.split(""),r=t.length-1;for(;r>=0;){let e=Number.parseInt(t[r],10)+1;if(e<10)return t[r]=String(e),t.join("");t[r]="0",r--}return`1${t.join("")}`}(e);i.length>t?(n=i.slice(1),r=`${BigInt(r)+1n}`):n=i}else n=e}else n=n.padEnd(t,"0");return BigInt(`${i?"-":""}${r}${n}`)}
vendor: 4,806 bytes, line 9
9class u extends Error{constructor({value:e}){super(`Value \`${e}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}}class l extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}},16100:(e,t,r)=>{"use strict";r.d(t,{sc:()=>w,qt:()=>x,Zf:()=>v});var n=r(82766);class i extends n.Vw{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,n.O8)(this.buffer)}update(e){(0,n.CC)(this),e=(0,n.ZJ)(e),(0,n.DO)(e);let{view:t,buffer:r,blockLen:i}=this,a=e.length;for(let s=0;s<a;){let o=Math.min(i-this.pos,a-s);if(o===i){let t=(0,n.O8)(e);for(;i<=a-s;s+=i)this.process(t,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.CC)(this),(0,n.Ht)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:a}=this,{pos:s}=this;t[s++]=128,(0,n.uH)(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),a=BigInt(0xffffffff),s=Number(r>>i&a),o=Number(r&a),u=4*!!n,l=4*!n;e.setUint32(t+u,s,n),e.setUint32(t+l,o,n)}(r,i-8,BigInt(8*this.length),a),this.process(r,0);let o=(0,n.O8)(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=u/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)o.setUint32(4*e,c[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let a=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),s=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),o=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]);var u=r(77144);let l=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array(64);class f extends i{constructor(e=32){super(64,e,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:a,G:s,H:o}=this;return[e,t,r,n,i,a,s,o]}set(e,t,r,n,i,a,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|a,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=c[e-15],r=c[e-2],i=(0,n.Ow)(t,7)^(0,n.Ow)(t,18)^t>>>3,a=(0,n.Ow)(r,17)^(0,n.Ow)(r,19)^r>>>10;c[e]=a+c[e-7]+i+c[e-16]|0}let{A:r,B:i,C:a,D:s,E:o,F:u,G:f,H:d}=this;for(let e=0;e<64;e++){var p,h,m,y;let t=d+((0,n.Ow)(o,6)^(0,n.Ow)(o,11)^(0,n.Ow)(o,25))+((p=o)&u^~p&f)+l[e]+c[e]|0,g=((0,n.Ow)(r,2)^(0,n.Ow)(r,13)^(0,n.Ow)(r,22))+((h=r)&(m=i)^h&(y=a)^m&y)|0;d=f,f=u,u=o,o=s+t|0,s=a,a=i,i=r,r=t+g|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,u=u+this.F|0,f=f+this.G|0,d=d+this.H|0,this.set(r,i,a,s,o,u,f,d)}roundClean(){(0,n.uH)(c)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.uH)(this.buffer)}}let d=u.lD(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
96f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),p=d[0],h=d[1],m=new Uint32Array(80),y=new Uint32Array(80);class g extends i{constructor(e=64){super(128,e,16,!1),this.Ah=0|o[0],this.Al=0|o[1],this.Bh=0|o[2],this.Bl=0|o[3],this.Ch=0|o[4],this.Cl=0|o[5],this.Dh=0|o[6],this.Dl=0|o[7],this.Eh=0|o[8],this.El=0|o[9],this.Fh=0|o[10],this.Fl=0|o[11],this.Gh=0|o[12],this.Gl=0|o[13],this.Hh=0|o[14],this.Hl=0|o[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:a,Dh:s,Dl:o,Eh:u,El:l,Fh:c,Fl:f,Gh:d,Gl:p,Hh:h,Hl:m}=this;return[e,t,r,n,i,a,s,o,u,l,c,f,d,p,h,m]}set(e,t,r,n,i,a,s,o,u,l,c,f,d,p,h,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|a,this.Dh=0|s,this.Dl=0|o,this.Eh=0|u,this.El=0|l,this.Fh=0|c,this.Fl=0|f,this.Gh=0|d,this.Gl=0|p,this.Hh=0|h,this.Hl=0|m}process(e,t){for(let r=0;r<16;r++,t+=4)m[r]=e.getUint32(t),y[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|m[e-15],r=0|y[e-15],n=u.rE(t,r,1)^u.rE(t,r,8)^u.xn(t,r,7),i=u.ry(t,r,1)^u.ry(t,r,8)^u.jm(t,r,7),a=0|m[e-2],s=0|y[e-2],o=u.rE(a,s,19)^u.qh(a,s,61)^u.xn(a,s,6),l=u.ry(a,s,19)^u.Ei(a,s,61)^u.jm(a,s,6),c=u.CW(i,l,y[e-7],y[e-16]),f=u.CQ(c,n,o,m[e-7],m[e-16]);m[e]=0|f,y[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:a,Ch:s,Cl:o,Dh:l,Dl:c,Eh:f,El:d,Fh:g,Fl:b,Gh:w,Gl:v,Hh:x,Hl:$}=this;for(let e=0;e<80;e++){let t=u.rE(f,d,14)^u.rE(f,d,18)^u.qh(f,d,41),E=u.ry(f,d,14)^u.ry(f,d,18)^u.Ei(f,d,41),P=f&g^~f&w,_=d&b^~d&v,A=u.F8($,E,_,h[e],y[e]),I=u.TH(A,x,t,P,p[e],m[e]),S=0|A,z=u.rE(r,n,28)^u.qh(r,n,34)^u.qh(r,n,39),k=u.ry(r,n,28)^u.Ei(r,n,34)^u.Ei(r,n,39),O=r&i^r&s^i&s,C=n&a^n&o^a&o;x=0|w,$=0|v,w=0|g,v=0|b,g=0|f,b=0|d,({h:f,l:d}=u.WQ(0|l,0|c,0|I,0|S)),l=0|s,c=0|o,s=0|i,o=0|a,i=0|r,a=0|n;let T=u.Vl(S,k,C);r=u.Vr(T,I,z,O),n=0|T}({h:r,l:n}=u.WQ(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:a}=u.WQ(0|this.Bh,0|this.Bl,0|i,0|a)),({h:s,l:o}=u.WQ(0|this.Ch,0|this.Cl,0|s,0|o)),({h:l,l:c}=u.WQ(0|this.Dh,0|this.Dl,0|l,0|c)),({h:f,l:d}=u.WQ(0|this.Eh,0|this.El,0|f,0|d)),({h:g,l:b}=u.WQ(0|this.Fh,0|this.Fl,0|g,0|b)),({h:w,l:v}=u.WQ(0|this.Gh,0|this.Gl,0|w,0|v)),({h:x,l:$}=u.WQ(0|this.Hh,0|this.Hl,0|x,0|$)),this.set(r,n,i,a,s,o,l,c,f,d,g,b,w,v,x,$)}roundClean(){(0,n.uH)(m,y)}destroy(){(0,n.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class b extends g{constructor(){super(48),this.Ah=0|s[0],this.Al=0|s[1],this.Bh=0|s[2],this.Bl=0|s[3],this.Ch=0|s[4],this.Cl=0|s[5],this.Dh=0|s[6],this.Dl=0|s[7],this.Eh=0|s[8],this.El=0|s[9],this.Fh=0|s[10],this.Fl=0|s[11],this.Gh=0|s[12],this.Gl=0|s[13],this.Hh=0|s[14],this.Hl=0|s[15]}}let w=(0,n.qj)(()=>new f),v=(0,n.qj)(()=>new g),x=(0,n.qj)(()=>new b)},16257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950);t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>
9(0,n.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,a="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`Object.keys(${r}).length ${a} ${i}`)}}},16317:e=>{"use strict";var t=e.exports=function(e,r,n){"function"==typeof r&&(n=r,r={});var i="function"==typeof(n=r.cb||n)?n:n.pre||function(){};!function e(r,n,i,a,s,o,u,l,c,f){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var d in n(a,s,o,u,l,c,f),a){var p=a[d];if(Array.isArray(p)){if(d in t.arrayKeywords)for(var h=0;h<p.length;h++)e(r,n,i,p[h],s+"/"+d+"/"+h,o,s,d,a,h)}else if(d in t.propsKeywords){if(p&&"object"==typeof p)for(var m in p)e(r,n,i,p[m],s+"/"+d+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),o,s,d,a,m)}else(d in t.keywords||r.allKeys&&!(d in t.skipKeywords))&&e(r,n,i,p,s+"/"+d,o,s,d,a)}i(a,s,o,u,l,c,f)}}(r,i,n.post||function(){},e,"",e)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},17120:(e,t,r)=>{"use strict";r.d(t,{UG:()=>s,xo:()=>i,zz:()=>a});var n=r(47347);class i extends n.C{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class a extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class s extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}},17286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let n=r(6100),i=r(95230),a=r(17950),s=r(64032),o=r(92280),u=r(93608);function l(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,a._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function c(e,t,r,n){let{gen:o,it:l}=e,{allErrors:c,schemaEnv:f,opts:d}=l,p=d.passContext?s.default.this:a.nil;function h(e){let t=(0,a._)`${e}.errors`;o.assign(s.default.vErrors,(0,a._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),o.assign(s.default.errors,(0,a._)`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;let n=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==l.props)if(n&&!n.dynamicProps)void 0!==n.props&&(l.props=u.mergeEvaluated.props(o,n.props,l.props));else{let t=o.var("props",(0,a._)`${e}.evaluated.props`);l.props=u.mergeEvaluated.props(o,t,l.props,a.Name)}if(!0!==l.items)if(n&&!n.dynamicItems)void 0!==n.items&&(l.items=u.mergeEvaluated.items(o,n.items,l.items));else{let t=o.var("items",(0,a._)`${e}.evaluated.items`);l.items=u.mergeEvaluated.items(o,t,l.items,a.Name)}}n?function(){if(!f.$async)throw Error("async schema referenced by sync schema");let r=o.let("valid");o.try(()=>{o.code((0,a._)`await ${(0,i.callValidateCode)(e,t,p)}`),m(t),c||o.assign(r,!0)},e=>{o.if((0,a._)`!(${e} instanceof ${l.ValidationError})`,()=>o.throw(e)),h(e),c||o.assign(r,!1)}),e.ok(r)}():e.result((0,i.callValidateCode)(e,t,p),()=>m(t),()=>h(t))}t.getValidate=l,t.callRef=c,t.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let i,s,u,f,{gen:d,schema:p,it:h}=e,{baseId:m,schemaEnv:y,validateName:g,opts:b,self:w}=h,{root:v}=y;if(("#"===p||"#/"===p)&&m===v.baseId){if(y===v)return c(e,g,y,y.$async);let t=d.scopeValue("root",{ref:v});return c(e,(0,a._)`${t}.validate`,v,v.$async)}let x=o.resolveRef.call(w,v,m,p);if(void 0===x)throw new n.default(h.opts.uriResolver,m,p);
9return x instanceof o.SchemaEnv?(i=l(e,t=x),void c(e,i,t,t.$async)):(r=x,s=d.scopeValue("schema",!0===b.code.source?{ref:r,code:(0,a.stringify)(r)}:{ref:r}),u=d.name("valid"),f=e.subschema({schema:r,dataTypes:[],schemaPath:a.nil,topSchemaRef:s,errSchemaPath:p},u),void(e.mergeEvaluated(f),e.ok(u)))}}},17950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let n=r(93339),i=r(72254);var a=r(93339);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var s=r(72254);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class u extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class l extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,t),this}get names(){return O(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class c extends l{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class p extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;for(;n--;){let i=r[n];i.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>k(e,t.names),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class b extends y{}b.kind="else";class w extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}
9return t?!1===e?t instanceof w?t:t.nodes:this.nodes.length?this:new w(T(e),t instanceof w?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&k(e,this.else.names),e}}w.kind="if";class v extends y{}v.kind="for";class x extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class $ extends v{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:a}=this;return`for(${t} ${r}=${n}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){let e=O(super.names,this.from);return O(e,this.to)}}class E extends v{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class P extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}P.kind="func";class _ extends m{render(e){return"return "+super.render(e)}}_.kind="return";class A extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(n=this.finally)||n.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class I extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}I.kind="catch";class S extends y{render(e){return"finally"+super.render(e)}}S.kind="finally";class z{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new u(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new l(e,t,r))}add(e,r){return this._leafNode(new c(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(...e){let t=["{"];for(let[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new w(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new w(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(w,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new x(e),t)}forRange(e,t,r,n,a=this.opts.es5?i.varKinds.var:i.varKinds.let){let s=this._scope.toName(e);return this._for(new $(a,s,t,r),()=>n(s))}forOf(e,t,r,a=i.varKinds.const){let s=this._scope.toName(e);
9if(this.opts.es5){let e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,t=>{this.var(s,(0,n._)`${e}[${t}]`),r(s)})}return this._for(new E("of",a,s,t),()=>r(s))}forIn(e,t,r,a=this.opts.es5?i.varKinds.var:i.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,n._)`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new E("in",a,s,t),()=>r(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new d(e))}return(e){let t=new _;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(_)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new A;if(this._blockNode(n),this.code(e),t){let e=this.name("e");this._currNode=n.catch=new I(e),t(e)}return r&&(this._currNode=n.finally=new S,this.code(r)),this._endBlockNode(I,S)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new P(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(P)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}function k(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,t){return t instanceof n._CodeOrName?k(e,t.names):e}function C(e,t,r){var i;if(e instanceof n.Name)return a(e);if(!((i=e)instanceof n._Code&&i._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=a(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[]));function a(e){let n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function T(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,n._)`!${M(e)}`}t.CodeGen=z,t.not=T;let B=N(t.operators.AND);t.and=function(...e){return e.reduce(B)};let j=N(t.operators.OR);function N(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof n.Name?e:(0,n._)`(${e})`}t.or=function(...e){return e.reduce(j)}},18231:(e,t,r)=>{"use strict";r.d(t,{KK:()=>C});var n=r(1883),i=r(75228),a=r(56184);let s="0x6492649264926492649264926492649264926492649264926492649264926492";class o extends i.C{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}var u=r(98908),l=r(34651);let c=n.HT("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function f(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==a.di(e,-32))throw new d(e)}else l.vA(e.authorization)}class d extends i.C{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}var p=r(18587),h=r(32547),m=r(78568),y=r(24642),g=r(4181),b=r(96685),w=r(53385),v=r(46149);async function x({address:e,authorization:t,signature:r}){return(0,w.h)((0,b.b)(e),await (0,v.g)({authorization:t,signature:r}))}var $=r(76429),E=r(89762),P=r(94747),_=r(84428),A=r(49586),I=r(86190),S=r(78283),z=r(76900),k=r(74833),O=r(27854);async function C(e,t){let r,{address:n,chain:i=e.chain,hash:a,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??i?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??i?.contracts?.multicall3?.address,mode:u="auto"}=t;if(i?.verifyHash)return await i.verifyHash(e,t);let l=(r=t.signature,(0,E.q)(r)?r:"object"==typeof r&&"r"in r&&"s"in r?(0,S.h)(r):(0,_.My)(r));try{if("eoa"===u)try{if((0,w.h)((0,b.b)(n),await (0,I.x)({hash:a,signature:l})))return!0}catch{}if(function(e){try{return f(e),!0}catch{return!1}}(l))return await T(e,{...t,multicallAddress:o,signature:l});return await B(e,{...t,verifierAddress:s,signature:l})}catch(e){if("eoa"!==u)try{if((0,w.h)((0,b.b)(n),await (0,I.x)({hash:a,signature:l})))return!0}catch{}if(e instanceof N)return!1;throw e}}async function T(e,t){let{address:r,blockHash:i,blockNumber:s,blockTag:o,hash:l,multicallAddress:d,requireCanonical:m}=t,{authorization:y,data:b,signature:w,to:v}=function(e){f(e);let t=a.Ro(a.di(e,-64,-32)),r=a.di(e,-t-64,-64),i=a.di(e,0,-t-64),[s,o,l]=n.D4(c,r);return{authorization:u.HT({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:i,...l&&"0x"!==l?{data:l,to:o}:{}}}(t.signature);if(await (0,k.Q)(e,{address:r,blockHash:i,blockNumber:s,blockTag:o,requireCanonical:m})===(0,$.aP)(["0xef0100",y.address]))return await j(e,{...t,signature:w});let E={address:y.address,chainId:Number(y.chainId),nonce:Number(y.nonce),r:(0,_.cK)(y.r,{size:32}),s:(0,_.cK)(y.s,{size:32}),yParity:y.yParity};if(!await x({address:r,authorization:E}))throw new N;let P=await (0,A.T)(e,O.J,"readContract")({...d?{address:d}:{code:h.Ez},authorizationList:[E],abi:p.v2,blockHash:i,blockNumber:s,blockTag:"pending",functionName:"aggregate3",requireCanonical:m,args:[[...b?[{allowFailure:!0,target:v??r,callData:b}
9]:[],{allowFailure:!0,target:r,callData:(0,g.p)({abi:p.UW,functionName:"isValidSignature",args:[l,w]})}]]}),I=P[P.length-1]?.returnData;if(I?.startsWith("0x1626ba7e"))return!0;throw new N}async function B(e,t){let{address:r,factory:i,factoryData:u,hash:l,signature:c,verifierAddress:f,...d}=t,b=await (async()=>!i&&!u||function(e){try{if(a.di(e,-32)!==s)throw new o(e);return!0}catch{return!1}}(c)?c:function(e){let{data:t,signature:r,to:i}=e;return a.xW(n.lF(n.HT("address, bytes, bytes"),[i,t,r]),s)}({data:u,signature:c,to:i}))(),w=f?{to:f,data:(0,g.p)({abi:p.E5,functionName:"isValidSig",args:[r,l,b]}),...d}:{data:(0,y.m)({abi:p.E5,args:[r,l,b],bytecode:h.fT}),...d},{data:v}=await (0,A.T)(e,z.T,"call")(w).catch(e=>{if(e instanceof m.zX)throw new N;throw e});if((0,P.Nx)(v??"0x0"))return!0;throw new N}async function j(e,t){let{address:r,blockHash:n,blockNumber:i,blockTag:a,hash:s,requireCanonical:o,signature:u}=t;if((await (0,A.T)(e,O.J,"readContract")({address:r,abi:p.UW,args:[s,u],blockHash:n,blockNumber:i,blockTag:a,functionName:"isValidSignature",requireCanonical:o}).catch(e=>{if(e instanceof m.bG)throw new N;throw e})).startsWith("0x1626ba7e"))return!0;throw new N}class N extends Error{}},18267:(e,t,r)=>{"use strict";r.d(t,{ID:()=>s,RZ:()=>n,TY:()=>i,zf:()=>a});let n=e=>e;function i(e){if(e?.reason)return e.reason;if("function"==typeof DOMException)return new DOMException("This operation was aborted","AbortError");let t=Error("This operation was aborted");return t.name="AbortError",t}function a(e){return"object"==typeof e&&null!==e&&"name"in e&&"AbortError"===e.name}let s=e=>{try{let t=new URL(e);if(!t.username&&!t.password)return e;return t.username="",t.password="",t.toString()}catch{return e}}},18587:(e,t,r)=>{"use strict";r.d(t,{Ag:()=>s,E5:()=>f,Rm:()=>l,SJ:()=>u,UW:()=>c,b2:()=>i,oX:()=>o,v2:()=>n,xw:()=>d});let n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],i=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],a=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],s=[...a,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[...a,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],u=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],l=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],c=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],f=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
9],d=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]},18860:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(89913),i=r(89762),a=r(22106),s=r(84428);function o(e,t){let r=(0,n.lY)((0,i.q)(e,{strict:!1})?(0,a.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,s.nj)(r)}},22106:(e,t,r)=>{"use strict";r.d(t,{Af:()=>d,ZJ:()=>l,aT:()=>f});var n=r(66568),i=r(89762),a=r(89950),s=r(94747),o=r(84428);let u=new TextEncoder;function l(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,f((0,o.cK)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,s.Sl)(r,{size:t.size}),(0,a.eV)(r,{size:t.size})):r}(e,t):(0,i.q)(e)?f(e,t):d(e,t)}function c(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function f(e,t={}){let r=e;t.size&&((0,s.Sl)(r,{size:t.size}),r=(0,a.eV)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let o=i.length/2,u=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=c(i.charCodeAt(t++)),a=c(i.charCodeAt(t++));if(void 0===r||void 0===a)throw new n.C(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);u[e]=16*r+a}return u}function d(e,t={}){let r=u.encode(e);return"number"==typeof t.size?((0,s.Sl)(r,{size:t.size}),(0,a.eV)(r,{dir:"right",size:t.size})):r}},22160:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(15904);function i(e,t="wei"){return n.Q_(e,t)}},22721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=n.operators,a={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}};t.default={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${a[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,n._)`${r} ${a[t].fail} ${i} || isNaN(${r})`)}}},23026:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},24029:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,B:()=>i});var n=r(80044);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.d_(e.type);return`${e.name}(${a(e.inputs,{includeName:t})})`}function a(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${a(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},24642:(e,t,r)=>{"use strict";r.d(t,{m:()=>
9o});var n=r(80044),i=r(76429),a=r(44497);let s="/docs/contract/encodeDeployData";function o(e){let{abi:t,args:r,bytecode:o}=e;if(!r||0===r.length)return o;let u=t.find(e=>"type"in e&&"constructor"===e.type);if(!u)throw new n.YW({docsPath:s});if(!("inputs"in u)||!u.inputs||0===u.inputs.length)throw new n.YF({docsPath:s});let l=(0,a.h)(u.inputs,r);return(0,i.aP)([o,l])}},25274:(e,t,r)=>{"use strict";r.d(t,{secp256k1:()=>p});var n=r(16100),i=r(33438),a=r(429);let s=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),o=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u=BigInt(0),l=BigInt(1),c=BigInt(2),f=(e,t)=>(e+t/c)/t,d=(0,a.D0)(s,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),u=BigInt(44),l=BigInt(88),f=e*e*e%s,p=f*f*e%s,h=(0,a.zH)(p,t,s)*p%s,m=(0,a.zH)(h,t,s)*p%s,y=(0,a.zH)(m,c,s)*f%s,g=(0,a.zH)(y,n,s)*y%s,b=(0,a.zH)(g,i,s)*g%s,w=(0,a.zH)(b,u,s)*b%s,v=(0,a.zH)(w,l,s)*w%s,x=(0,a.zH)(v,u,s)*b%s,$=(0,a.zH)(x,t,s)*p%s,E=(0,a.zH)($,o,s)*g%s,P=(0,a.zH)(E,r,s)*f%s,_=(0,a.zH)(P,c,s);if(!d.eql(d.sqr(_),e))throw Error("Cannot find square root");return _}}),p=(0,i.s)({a:u,b:BigInt(7),Fp:d,n:o,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=f(t*e,o),u=f(-r*e,o),c=(0,a.zi)(e-s*t-u*n,o),d=(0,a.zi)(-s*r-u*t,o),p=c>i,h=d>i;if(p&&(c=o-c),h&&(d=o-d),c>i||d>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:c,k2neg:h,k2:d}}}},n.sc)},25801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(9269);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(17950);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});let a=r(27069),s=r(6100),o=r(75279),u=r(92280),l=r(17950),c=r(14252),f=r(58419),d=r(93608),p=r(38432),h=r(52399),m=(e,t)=>
9new RegExp(e,t);m.code="new RegExp";let y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={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."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class v{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,n,i,a,s,o,u,l,c,f,d,p,y,g,b,w,v,x,$,E,P,_,A,I;let S=e.strict,z=null==(t=e.code)?void 0:t.optimize,k=!0===z||void 0===z?1:z||0,O=null!=(n=null==(r=e.code)?void 0:r.regExp)?n:m,C=null!=(i=e.uriResolver)?i:h.default;return{strictSchema:null==(s=null!=(a=e.strictSchema)?a:S)||s,strictNumbers:null==(u=null!=(o=e.strictNumbers)?o:S)||u,strictTypes:null!=(c=null!=(l=e.strictTypes)?l:S)?c:"log",strictTuples:null!=(d=null!=(f=e.strictTuples)?f:S)?d:"log",strictRequired:null!=(y=null!=(p=e.strictRequired)?p:S)&&y,code:e.code?{...e.code,optimize:k,regExp:O}:{optimize:k,regExp:O},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(b=e.loopEnum)?b:200,meta:null==(w=e.meta)||w,messages:null==(v=e.messages)||v,inlineRefs:null==(x=e.inlineRefs)||x,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(E=e.addUsedSchema)||E,validateSchema:null==(P=e.validateSchema)||P,validateFormats:null==(_=e.validateFormats)||_,unicodeRegExp:null==(A=e.unicodeRegExp)||A,int32range:null==(I=e.int32range)||I,uriResolver:C}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return I;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),x.call(this,b,e,"NOT SUPPORTED"),x.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=A.call(this),e.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=p;"id"===r&&((n={...p}).id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return o.call(this,t),await u.call(this,t.missingSchema),a.call(this,e)}}function o({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function u(e){let r=await l.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){let i;
9if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,n);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(i=e[t])&&"string"!=typeof i)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,n=new u.SchemaEnv({schema:{},schemaId:r});if(!(t=u.resolveSchema.call(this,n,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,c.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(z.call(this,r,t),!t)return(0,d.eachItem)(r,e=>k.call(this,e)),this;C.call(this,t);let n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach(t=>k.call(this,e,n,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let n of(e=JSON.parse(JSON.stringify(e)),t)){let t=n.split("/").slice(1),i=e;for(let e of t)i=i[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:n}=t.definition,a=i[e];n&&a&&(i[e]=B(a))}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];(!t||t.test(r))&&("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if("object"==typeof e)a=e[s];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let o=this._cache.get(e);if(void 0!==o)return o;r=(0,c.normalizeId)(a||r);let l=c.getSchemaRefs.call(this,e,r);return o=new u.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:l}),this._cache.set(o.schema,o),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=o),n&&this.validateSchema(e,!0),o}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):u.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{u.compileSchema.call(this,e)}finally{this.opts=t}}}function x(e,t,r,n="error"){for(let i in e)i in t&&this.logger[n](`${r}: option ${i}. ${e[i]}`)}
9function $(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function P(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function A(){let e={...this.opts};for(let t of y)delete e[t];return e}v.ValidationError=a.default,v.MissingRefError=s.default,t.default=v;let I={log(){},warn(){},error(){}},S=/^[a-z_$][a-z0-9_$:-]*$/i;function z(e,t){let{RULES:r}=this;if((0,d.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!S.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var n;let i=null==t?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,s=i?a.post:a.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,o,t.before):s.rules.push(o),a.all[e]=o,null==(n=t.implements)||n.forEach(e=>this.addKeyword(e))}function O(e,t,r){let n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function C(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=B(t)),e.validateSchema=this.compile(t,!0))}let T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function B(e){return{anyOf:[e,T]}}},26030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(95230).validateUnion,error:{message:"must match a schema in anyOf"}}},26801:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=u(e),s=a[0],o=a[1],l=new i((s+o)*3/4-o),c=0,f=o>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(function(e,t,n){for(var i,a=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},26859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=[r(34554).default]},27041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(84974),i=r(33881),a=r(5773),s=r(27661),o=r(56678),u=r(76590),l=r(14390),c=r(59419),f=r(43570),d=r(66750),p=r(53772),h=r(26030),m=r(5812),y=r(78423),g=r(89840),b=r(58313);t.default=function(e=!1){let t=[p.default,h.default,m.default,y.default,g.default,b.default,l.default,c.default,u.default,f.default,d.default];return e?t.push(i.default,s.default):t.push(n.default,a.default),t.push(o.default),t}},27069:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});
9class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},27075:(e,t,r)=>{"use strict";function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{BD:()=>i,Ge:()=>a,Yv:()=>n,wj:()=>s});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,a=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s=/^\(.+?\).*?$/},27426:(e,t,r)=>{"use strict";r.d(t,{v:()=>w});var n=r(51011),i=r(6593),a=r(66568),s=r(46149),o=r(81278),u=r(76429),l=r(70969),c=r(89649),f=r(58637),d=r(49586),p=r(86301),h=r(97948),m=r(69960),y=r(29562),g=r(45312);let b=new p.A(128);async function w(e,t){let r,{account:p=e.account,assertChainId:w=!0,chain:v=e.chain,accessList:x,authorizationList:$,blobs:E,data:P,dataSuffix:_="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,gas:A,gasPrice:I,maxFeePerBlobGas:S,maxFeePerGas:z,maxPriorityFeePerGas:k,nonce:O,type:C,value:T,...B}=t;if(void 0===p)throw new i.T({docsPath:"/docs/actions/wallet/sendTransaction"});let j=p?(0,n.J)(p):null;try{(0,h.c)(t);let n=await (async()=>t.to?t.to:null!==t.to&&$&&$.length>0?await (0,s.g)({authorization:$[0]}).catch(()=>{throw new a.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(j?.type==="json-rpc"||null===j){let t;null!==v&&(t=await (0,d.T)(e,m.T,"getChainId")({}),w&&(0,o.v)({currentChainId:t,chain:v}));let r=e.chain?.formatters?.transactionRequest?.format,i=(r||f.Bv)({...(0,c.o)(B,{format:r}),accessList:x,account:j,authorizationList:$,blobs:E,chainId:t,data:_?(0,u.xW)([P??"0x",_]):P,gas:A,gasPrice:I,maxFeePerBlobGas:S,maxFeePerGas:z,maxPriorityFeePerGas:k,nonce:O,to:n,type:C,value:T},"sendTransaction"),a=b.get(e.uid);try{return await e.request({method:a?"wallet_sendTransaction":"eth_sendTransaction",params:[i]},{retryCount:0})}catch(t){if(!1===a)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[i]},{retryCount:0}).then(t=>(b.set(e.uid,!0),t)).catch(r=>{if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw b.set(e.uid,!1),t;throw r});throw t}}if(j?.type==="local"){let t=(()=>{if(!j.nonceManager||void 0!==O)return j.nonceManager;let e=j.nonceManager;return{consume:t=>(r={address:t.address,chainId:t.chainId},e.consume(t)),get:t=>e.get(t),increment:t=>e.increment(t),reset:t=>e.reset(t)}})(),i=await (0,d.T)(e,y.ft,"prepareTransactionRequest")({account:j,accessList:x,authorizationList:$,blobs:E,chain:v,data:_?(0,u.xW)([P??"0x",_]):P,gas:A,gasPrice:I,maxFeePerBlobGas:S,maxFeePerGas:z,maxPriorityFeePerGas:k,nonce:O,nonceManager:t,parameters:[...y.MM,"sidecars"],type:C,value:T,...B,to:n}),a=v?.serializers?.transaction,s=await j.signTransaction(i,{serializer:a}),o=(v??e.chain)?.serializers?.transactionEnvelope,l=o?await o({serializedTransaction:s,transaction:i}):s;return await (0,d.T)(e,g.L,"sendRawTransaction")({serializedTransaction:l})}if(j?.type==="smart")throw new i.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new i.Z({docsPath:"/docs/actions/wallet/sendTransaction",type:j?.type})}catch(e){if(e instanceof i.Z)throw e;throw r&&j?.nonceManager?.reset(r),(0,l.p)(e,{...t,account:j,chain:t.chain||void 0})}}},27475:(e,t,r)=>{"use strict";r.d(t,{k:()=>o});var n=r(22106),i=r(18860),a=r(6735),s=r(66568);function o(e){var t;return t=function(e){let t=!0,r="",n=0,i="",a=!1;for(let s=0;s<e.length;s++){let o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function",""].includes(i))i="";else if(i+=o,")"===o){a=!0;break}continue}if(" "===o){","!==e[s-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!a)throw new s.C("Unable to normalize signature.");return i}("string"==typeof e?e:(0,a.B)(e)),(0,i.S)((0,n.ZJ)(t))}},27661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608),a=r(95230),s=r(84974);t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`}
9,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(o?(0,s.validateAdditionalItems)(e,o):e.ok((0,a.validateArray)(e)))}}},27854:(e,t,r)=>{"use strict";r.d(t,{J:()=>u});var n=r(73320),i=r(4181),a=r(4016),s=r(49586),o=r(76900);async function u(e,t){let{abi:r,address:u,args:l,functionName:c,...f}=t,d=(0,i.p)({abi:r,args:l,functionName:c});try{let{data:t}=await (0,s.T)(e,o.T,"call")({...f,data:d,to:u});return(0,n.e)({abi:r,args:l,functionName:c,data:t||"0x"})}catch(e){throw(0,a.j)(e,{abi:r,address:u,args:l,docsPath:"/docs/contract/readContract",functionName:c})}}},27855:(e,t,r)=>{"use strict";r.d(t,{JM:()=>u,Kd:()=>o,S1:()=>d,Wk:()=>l,ZC:()=>c,a$:()=>s,sR:()=>f});var n=r(55503),i=r(68056);let a=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,i.jsonStringifyReplacer,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},s=(0,n.xI)("$ZodError",a),o=(0,n.xI)("$ZodError",a,{Parent:Error});function u(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function l(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(a))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r}function c(e,t=e=>e.message){let r={errors:[]},n=(e,i=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)n({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)n({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length){r.errors.push(t(o));continue}let n=r,u=0;for(;u<e.length;){let r=e[u],i=u===e.length-1;"string"==typeof r?(n.properties??(n.properties={}),(a=n.properties)[r]??(a[r]={errors:[]}),n=n.properties[r]):(n.items??(n.items=[]),(s=n.items)[r]??(s[r]={errors:[]}),n=n.items[r]),i&&n.errors.push(t(o)),u++}}};return n(e),r}function f(e){let t=[];for(let r of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function d(e){let t=[];for(let r of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`✖ ${r.message}`),r.path?.length&&t.push(`  → at ${f(r.path)}`);return t.join("\n")}},28285:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>n});let n=2n**256n-1n},28992:(e,t,r)=>{"use strict";r.d(t,{lB:()=>s});let n=new Map,i=new Map,a=0;function s(e,t,r){let s=++a,o=()=>n.get(e)||[],u=()=>{let t=o();if(!t.some(e=>e.id===s))return;let r=i.get(e);if(1===t.length&&r){let e=r();e instanceof Promise&&e.catch(()=>{})}(()=>
9{let t=o().filter(e=>e.id!==s);if(0===t.length){n.delete(e),i.delete(e);return}n.set(e,t)})()},l=o();if(n.set(e,[...l,{id:s,fns:t}]),l&&l.length>0)return u;let c={};for(let e in t)c[e]=(...t)=>{let r=o();if(0!==r.length)for(let n of r)n.fns[e]?.(...t)};let f=r(c);return"function"==typeof f&&i.set(e,f),u}},29562:(e,t,r)=>{"use strict";r.d(t,{MM:()=>v,ft:()=>E});var n=r(51011),i=r(10155),a=r(73062),s=r(42073),o=r(80771),u=r(50474),l=r(96002),c=r(94073),f=r(77022),d=r(73331),p=r(57723),h=r(49586),m=r(86301),y=r(97948),g=r(72401),b=r(49155),w=r(69960);let v=["blobVersionedHashes","chainId","fees","gas","nonce","type"],x=new Map,$=new m.A(128);async function E(e,t){let r,m,E=t;E.account??=e.account,E.parameters??=v;let{account:P,chain:_=e.chain,nonceManager:A,parameters:I}=E,S="function"==typeof _?.prepareTransactionRequest?{fn:_.prepareTransactionRequest,runAt:["beforeFillTransaction"]}:Array.isArray(_?.prepareTransactionRequest)?{fn:_.prepareTransactionRequest[0],runAt:_.prepareTransactionRequest[1].runAt}:void 0;async function z(){return r?r:void 0!==E.chainId?E.chainId:_?_.id:r=await (0,h.T)(e,w.T,"getChainId")({})}let k=P?(0,n.J)(P):P,O=E.nonce;if(S?.fn&&S.runAt?.includes("beforeFillTransaction")){E=await S.fn({...E,chain:_},{client:e,phase:"beforeFillTransaction"}),O??=E.nonce;let t=E.account??E.from;k=t?(0,n.J)(t):void 0}if(I.includes("nonce")&&void 0===O&&k&&A){let t=await z();O=await A.consume({address:k.address,chainId:t,client:e})}let C=(!(I.includes("blobVersionedHashes")||I.includes("sidecars"))||!E.kzg||!E.blobs)&&(I.length>0&&"feePayer"in E&&E.feePayer&&(!("feePayerSignature"in E)||!E.feePayerSignature)||!1!==$.get(e.uid)&&["fees","gas"].some(e=>I.includes(e))&&(I.includes("chainId")&&"number"!=typeof E.chainId||I.includes("nonce")&&"number"!=typeof O||I.includes("fees")&&"bigint"!=typeof E.gasPrice&&("bigint"!=typeof E.maxFeePerGas||"bigint"!=typeof E.maxPriorityFeePerGas)||I.includes("gas")&&"bigint"!=typeof E.gas))?await (0,h.T)(e,b.a,"fillTransaction")({...E,nonce:O}).then(t=>{let{chainId:r,from:n,gas:i,gasPrice:a,nonce:s,maxFeePerBlobGas:o,maxFeePerGas:u,maxPriorityFeePerGas:l,type:c,...f}=t.transaction,d="feeToken"in f?f.feeToken:void 0,p="feePayerSignature"in f&&null!==f.feePayerSignature&&void 0!==f.feePayerSignature,h=null!=d&&(!("feeToken"in E)||p);return $.set(e.uid,!0),{...E,...n?{from:n}:{},...c&&!E.type?{type:c}:{},...void 0!==r?{chainId:r}:{},...void 0!==i?{gas:i}:{},...void 0!==a?{gasPrice:a}:{},...void 0!==s?{nonce:s}:{},...void 0!==o&&"legacy"!==E.type&&"eip2930"!==E.type?{maxFeePerBlobGas:o}:{},...void 0!==u&&"legacy"!==E.type&&"eip2930"!==E.type?{maxFeePerGas:u}:{},...void 0!==l&&"legacy"!==E.type&&"eip2930"!==E.type?{maxPriorityFeePerGas:l}:{},..."nonceKey"in f&&void 0!==f.nonceKey?{nonceKey:f.nonceKey}:{},..."keyAuthorization"in f&&void 0!==f.keyAuthorization&&null!==f.keyAuthorization&&!("keyAuthorization"in E)?{keyAuthorization:f.keyAuthorization}:{},..."feePayerSignature"in f&&void 0!==f.feePayerSignature&&null!==f.feePayerSignature?{feePayerSignature:f.feePayerSignature}:{},...h?{feeToken:d}:{},...t.capabilities?{_capabilities:t.capabilities}:{}}}).catch(t=>{if("TransactionExecutionError"!==t.name)return E;if(t.walk?.(e=>e instanceof l.dz)||t.walk?.(e=>"ExecutionRevertedError"===e.name))throw t;return t.walk?.(e=>"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name||e.message?.includes("eth_fillTransaction is not available"))&&$.set(e.uid,!1),E}):E;O??=C.nonce;let{blobs:T,gas:B,kzg:j,type:N}=E={...C,...k?{from:k?.address}:{},...void 0!==O?{nonce:O}:{}};async function M(){return m||(m=await (0,h.T)(e,s.g,"getBlock")({blockTag:"latest"}))}if(S?.fn&&S.runAt?.includes("beforeFillParameters")&&(E=await S.fn({...E,chain:_},{client:e,phase:"beforeFillParameters"})),I.includes("nonce")&&void 0===O&&k&&!A&&(E.nonce=await (0,h.T)(e,o.y,"getTransactionCount")({address:k.address,blockTag:"pending"})),(I.includes("blobVersionedHashes")||I.includes("sidecars"))&&T&&j){let e=(0,c.S)({blobs:T,kzg:j});if(I.includes("blobVersionedHashes")){let t=(0,d.d)({commitments:e,to:"hex"});E.blobVersionedHashes=t}if(I.includes("sidecars")){let t=(0,f.t)({blobs:T,commitments:e,kzg:j}),r=(0,p.T)({blobs:T,commitments:e,proofs:t,to:"hex"});E.sidecars=r}}if(I.includes("chainId")&&(E.chainId=await z()),(I.includes("fees")||I.includes("type"))&&void 0===N)try{E.type=(0,g.L)(E)}catch{let t=x.get(e.uid);if(void 0===t){let r=await M();t="bigint"==typeof r?.baseFeePerGas,x.set(e.uid,t)}E.type=t?"eip1559":"legacy"}
9if(I.includes("fees"))if("legacy"!==E.type&&"eip2930"!==E.type){if(void 0===E.maxFeePerGas||void 0===E.maxPriorityFeePerGas){let t=await M(),{maxFeePerGas:r,maxPriorityFeePerGas:n}=await (0,i.O)(e,{block:t,chain:_,request:E});if(void 0===E.maxPriorityFeePerGas&&E.maxFeePerGas&&E.maxFeePerGas<n)throw new u.RR({maxPriorityFeePerGas:n});E.maxPriorityFeePerGas=n,E.maxFeePerGas=r}}else{if(void 0!==E.maxFeePerGas||void 0!==E.maxPriorityFeePerGas)throw new u.pw;if(void 0===E.gasPrice){let t=await M(),{gasPrice:r}=await (0,i.O)(e,{block:t,chain:_,request:E,type:"legacy"});E.gasPrice=r}}return I.includes("gas")&&void 0===B&&(E.gas=await (0,h.T)(e,a.Q,"estimateGas")({...E,account:k,prepare:k?.type==="local"?[]:["blobVersionedHashes"]})),S?.fn&&S.runAt?.includes("afterFillParameters")&&(E=await S.fn({...E,chain:_},{client:e,phase:"afterFillParameters"})),(0,y.c)(E),delete E.parameters,E}},30837:(e,t,r)=>{"use strict";r.d(t,{vA:()=>c,cM:()=>f,HT:()=>d,bI:()=>p,n4:()=>h,tf:()=>m});var n=r(94734);class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let a={checksum:new i(8192)}.checksum;var s=r(75228),o=r(6871),u=r(48409);let l=/^0x[a-fA-F0-9]{40}$/;function c(e,t={}){let{strict:r=!0}=t;if(!l.test(e))throw new y({address:e,cause:new g});if(r){if(e.toLowerCase()===e)return;if(f(e)!==e)throw new y({address:e,cause:new b})}}function f(e){if(a.has(e))return a.get(e);c(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=o.So(n.sH(t),{as:"Bytes"}),i=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>
9=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let s=`0x${i.join("")}`;return a.set(e,s),s}function d(e,t={}){let{checksum:r=!1}=t;return(c(e),r)?f(e):e}function p(e,t={}){let r=o.So(`0x${u.nj(e).slice(4)}`).substring(26);return d(`0x${r}`,t)}function h(e,t){return c(e,{strict:!1}),c(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function m(e,t={}){let{strict:r=!0}=t??{};try{return c(e,{strict:r}),!0}catch{return!1}}class y extends s.C{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class g extends s.C{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class b extends s.C{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}},31711:(e,t,r)=>{"use strict";var n;r.d(t,{UY:()=>i,fd:()=>u,nP:()=>a,rs:()=>s,u5:()=>o});let i=Symbol("ZodOutput"),a=Symbol("ZodInput");class s{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function o(){return new s}(n=globalThis).__zod_globalRegistry??(n.__zod_globalRegistry=o());let u=globalThis.__zod_globalRegistry},31750:(e,t,r)=>{"use strict";r.d(t,{l:()=>a});var n=r(66568),i=r(4174);function a(e,t){let r=(e.details||"").toLowerCase(),a=e instanceof n.C?e.walk(e=>e?.code===i.A7.code):e;return a instanceof n.C?new i.A7({cause:e,message:a.details}):i.A7.nodeMessage.test(r)?new i.A7({cause:e,message:e.details}):i.BG.nodeMessage.test(r)?new i.BG({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.jj.nodeMessage.test(r)?new i.jj({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.K0.nodeMessage.test(r)?new i.K0({cause:e,nonce:t?.nonce}):i.Oh.nodeMessage.test(r)?new i.Oh({cause:e,nonce:t?.nonce}):i.vW.nodeMessage.test(r)?new i.vW({cause:e,nonce:t?.nonce}):i.k5.nodeMessage.test(r)?new i.k5({cause:e}):i.lY.nodeMessage.test(r)?new i.lY({cause:e,gas:t?.gas}):i.Fo.nodeMessage.test(r)?new i.Fo({cause:e,gas:t?.gas}):i.uC.nodeMessage.test(r)?new i.uC({cause:e}):i.lN.nodeMessage.test(r)?new i.lN({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new i.RM({cause:e})}},32296:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(95230),i=r(17950),a=r(93608);t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,i.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,i._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:s,data:o,$data:u,it:l}=e,{opts:c}=l;if(!u&&0===r.length)return;let f=r.length>=c.loopRequired;if(l.allErrors?function(){if(f||u)e.block$data(i.nil,d);else for(let t of r)(0,n.checkReportMissingProp)(e,t)}():function(){let a=t.let("missing");if(f||u){let r=t.let("valid",!0);e.block$data(r,()=>{var u,l;return u=a,l=r,void(e.setParams({missingProperty:u}),t.forOf(u,s,()=>{t.assign(l,(0,n.propertyInData)(t,o,u,c.ownProperties)),t.if((0,i.not)(l),()=>{e.error(),t.break()})},i.nil))}),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,a)),(0,n.reportMissingProp)(e,a),t.else()}(),c.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!n.has(e)){let t=l.schemaEnv.baseId+l.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,a.checkStrictMode)(l,r,l.opts.strictRequired)}}function d(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,o,r,c.ownProperties),()=>e.error())})}}}},32547:(e,t,r)=>{"use strict";r.d(t,{Ez:()=>s,LX:()=>n,WN:()=>i,fT:()=>a});let n="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
9602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",a="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
9603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",s="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"},32872:(e,t,r)=>{"use strict";r.d(t,{Bq:()=>u,Sl:()=>i,X:()=>s,eV:()=>o,kK:()=>a});var n=r(56184);function i(e,t){if(n.Ej(e)>t)throw new n.u({givenSize:n.Ej(e),maxSize:t})}function a(e,t){if("number"==typeof t&&t>0&&t>n.Ej(e)-1)throw new n.ii({offset:t,position:"start",size:n.Ej(e)})}function s(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.Ej(e)!==r-t)throw new n.ii({offset:r,position:"end",size:n.Ej(e)})}function o(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;let a=e.replace("0x","");if(a.length>2*i)throw new n.Fl({size:Math.ceil(a.length/2),targetSize:i,type:"Hex"});return`0x${a["right"===r?"padEnd":"padStart"](2*i,"0")}`}function u(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"0"===(n="left"===r?n.slice(i):n.slice(0,n.length-i))?"0x":"right"===r&&n.length%2==1?`0x${n}0`:`0x${n}`}},33438:(e,t,r)=>{"use strict";r.d(t,{s:()=>A});var n=r(82766);class i extends n.Vw{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.sd)(e);const r=(0,n.ZJ)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),(0,n.uH)(a)}update(e){return(0,n.CC)(this),this.iHash.update(e),this}digestInto(e){(0,n.CC)(this),(0,n.DO)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:a,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=a,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let a=(e,t,r)=>new i(e,t).update(r).digest();a.create=(e,t)=>
9new i(e,t);var s=r(429),o=r(37942);let u=BigInt(0),l=BigInt(1);function c(e,t){let r=t.negate();return e?r:t}function f(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function d(e,t){f(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:(0,o.OG)(e),maxNumber:i,shiftBy:BigInt(e)}}function p(e,t,r){let{windowSize:n,mask:i,maxNumber:a,shiftBy:s}=r,o=Number(e&i),u=e>>s;o>n&&(o-=a,u+=l);let c=t*n,f=c+Math.abs(o)-1,d=0===o;return{nextN:u,offset:f,isZero:d,isNeg:o<0,isNegF:t%2!=0,offsetF:c}}let h=new WeakMap,m=new WeakMap;function y(e){return m.get(e)||1}function g(e){return(0,s.jr)(e.Fp),(0,o.Q5)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,s.LH)(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function b(e){void 0!==e.lowS&&(0,o.e8)("lowS",e.lowS),void 0!==e.prehash&&(0,o.e8)("prehash",e.prehash)}class w extends Error{constructor(e=""){super(e)}}let v={Err:w,_tlv:{encode:(e,t)=>{let{Err:r}=v;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=(0,o.zW)(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let a=n>127?(0,o.zW)(i.length/2|128):"";return(0,o.zW)(e)+a+i+t},decode(e,t){let{Err:r}=v,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],a=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)a=a<<8|e;if(n+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=i;let s=t.subarray(n,n+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+a)}}},_int:{encode(e){let{Err:t}=v;if(e<$)throw new t("integer: negative integers are not allowed");let r=(0,o.zW)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=v;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return(0,o.Ph)(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=v,i=(0,o.qj)("signature",e),{v:a,l:s}=n.decode(48,i);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:u,l:l}=n.decode(2,a),{v:c,l:f}=n.decode(2,l);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=v,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}};function x(e,t){return(0,o.My)((0,o.lq)(e,t))}let $=BigInt(0),E=BigInt(1),P=(BigInt(2),BigInt(3)),_=BigInt(4);function A(e,t){let r=t=>(function(e){let t,r=(t=g(e),(0,o.Q5)(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})),{Fp:n,n:i,nByteLength:a,nBitLength:w}=r,A=n.BYTES+1,I=2*n.BYTES+1;function S(e){return(0,s.zi)(e,i)}function z(e){return(0,s.B8)(e,i)}let{ProjectivePoint:k,normPrivateKeyToScalar:O,weierstrassEquation:C,isWithinCurveOrder:T}=function(e){var t;let r=function(e){let t=g(e);(0,o.Q5)(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=(0,s.D0)(r.n,r.nBitLength),a=r.toBytes||((e,t,r)=>{let i=t.toAffine();return(0,o.Id)(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),b=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function w(e){let{a:t,b:i}=r,a=n.sqr(e),s=n.mul(a,e);return n.add(n.add(s,n.mul(e,t)),i)}function v(e,t){let r=n.sqr(t),i=w(e);return n.eql(r,i)}if(!v(r.Gx,r.Gy))throw Error("bad curve params: generator point");let x=n.mul(n.pow(r.a,P),_),A=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(x,A)))throw Error("bad curve params: a or b");function I(e){let t,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:a,n:u}=r;if(n&&"bigint"!=typeof e){if((0,o.aY)(e)&&(e=(0,o.My)(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:(0,o.Ph)((0,o.qj)("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return a&&(t=(0,s.zi)(t,u)),(0,o.aK)("private key",t,E,u),t}function S(e){if(!(e instanceof O))throw Error("ProjectivePoint expected")}let z=(0,o.x)((e,t)=>{let{px:r,py:i,pz:a}=e;if(n.eql(a,n.ONE))return{x:r,y:i};let s=e.is0();null==t&&(t=s?n.ONE:n.inv(a));let o=n.mul(r,t),u=n.mul(i,t),l=n.mul(a,t);if(s)return{x:n.ZERO,y:n.ZERO};
vendor: 3,763 bytes, line 9
9if(!n.eql(l,n.ONE))throw Error("invZ was invalid");return{x:o,y:u}}),k=(0,o.x)(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!v(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class O{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof O)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?O.ZERO:new O(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=(0,s.pS)(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(O.fromAffine)}static fromHex(e){let t=O.fromAffine(b((0,o.qj)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return O.BASE.multiply(I(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let i=r.length,a=n.length;if(i!==a)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,u=(0,o.dJ)(BigInt(i)),l=1;u>12?l=u-3:u>4?l=u-2:u>0&&(l=2);let c=(0,o.OG)(l),f=Array(Number(c)+1).fill(s),d=Math.floor((t.BITS-1)/l)*l,p=s;for(let e=d;e>=0;e-=l){f.fill(s);for(let t=0;t<a;t++){let i=Number(n[t]>>BigInt(e)&c);f[i]=f[i].add(r[t])}let t=s;for(let e=f.length-1,r=s;e>0;e--)r=r.add(f[e]),t=t.add(r);if(p=p.add(t),0!==e)for(let e=0;e<l;e++)p=p.double()}return p}(O,i,e,t)}_setWindowSize(e){B.setWindowSize(this,e)}assertValidity(){k(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){S(e);let{px:t,py:r,pz:i}=this,{px:a,py:s,pz:o}=e,u=n.eql(n.mul(t,o),n.mul(a,i)),l=n.eql(n.mul(r,o),n.mul(s,i));return u&&l}negate(){return new O(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,P),{px:a,py:s,pz:o}=this,u=n.ZERO,l=n.ZERO,c=n.ZERO,f=n.mul(a,a),d=n.mul(s,s),p=n.mul(o,o),h=n.mul(a,s);return h=n.add(h,h),c=n.mul(a,o),c=n.add(c,c),u=n.mul(e,c),l=n.mul(i,p),l=n.add(u,l),u=n.sub(d,l),l=n.add(d,l),l=n.mul(u,l),u=n.mul(h,u),c=n.mul(i,c),p=n.mul(e,p),h=n.sub(f,p),h=n.mul(e,h),h=n.add(h,c),c=n.add(f,f),f=n.add(c,f),f=n.add(f,p),f=n.mul(f,h),l=n.add(l,f),p=n.mul(s,o),p=n.add(p,p),f=n.mul(p,h),u=n.sub(u,f),c=n.mul(p,d),c=n.add(c,c),new O(u,l,c=n.add(c,c))}add(e){S(e);let{px:t,py:i,pz:a}=this,{px:s,py:o,pz:u}=e,l=n.ZERO,c=n.ZERO,f=n.ZERO,d=r.a,p=n.mul(r.b,P),h=n.mul(t,s),m=n.mul(i,o),y=n.mul(a,u),g=n.add(t,i),b=n.add(s,o);g=n.mul(g,b),b=n.add(h,m),g=n.sub(g,b),b=n.add(t,a);let w=n.add(s,u);return b=n.mul(b,w),w=n.add(h,y),b=n.sub(b,w),w=n.add(i,a),l=n.add(o,u),w=n.mul(w,l),l=n.add(m,y),w=n.sub(w,l),f=n.mul(d,b),l=n.mul(p,y),f=n.add(l,f),l=n.sub(m,f),f=n.add(m,f),c=n.mul(l,f),m=n.add(h,h),m=n.add(m,h),y=n.mul(d,y),b=n.mul(p,b),m=n.add(m,y),y=n.sub(h,y),y=n.mul(d,y),b=n.add(b,y),h=n.mul(m,b),c=n.add(c,h),h=n.mul(w,b),l=n.mul(g,l),l=n.sub(l,h),h=n.mul(g,m),f=n.mul(w,f),new O(l,c,f=n.add(f,h))}subtract(e){return this.add(e.negate())}is0(){return this.equals(O.ZERO)}wNAF(e){return B.wNAFCached(this,e,O.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;(0,o.aK)("scalar",e,$,i);let a=O.ZERO;if(e===$)return a;
9if(this.is0()||e===E)return this;if(!t||B.hasPrecomputes(this))return B.wNAFCachedUnsafe(this,e,O.normalizeZ);let{k1neg:s,k1:u,k2neg:l,k2:c}=t.splitScalar(e),f=a,d=a,p=this;for(;u>$||c>$;)u&E&&(f=f.add(p)),c&E&&(d=d.add(p)),p=p.double(),u>>=E,c>>=E;return s&&(f=f.negate()),l&&(d=d.negate()),d=new O(n.mul(d.px,t.beta),d.py,d.pz),f.add(d)}multiply(e){let t,i,{endo:a,n:s}=r;if((0,o.aK)("scalar",e,E,s),a){let{k1neg:r,k1:s,k2neg:o,k2:u}=a.splitScalar(e),{p:l,f:c}=this.wNAF(s),{p:f,f:d}=this.wNAF(u);l=B.constTimeNegate(r,l),f=B.constTimeNegate(o,f),f=new O(n.mul(f.px,a.beta),f.py,f.pz),t=l.add(f),i=c.add(d)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return O.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=O.BASE,i=(e,t)=>t!==$&&t!==E&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),a=i(this,t).add(i(e,r));return a.is0()?void 0:a}toAffine(e){return z(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===E)return!0;if(t)return t(O,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===E?this:t?t(O,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return(0,o.e8)("isCompressed",e),this.assertValidity(),a(O,this,e)}toHex(e=!0){return(0,o.e8)("isCompressed",e),(0,o.My)(this.toRawBytes(e))}}O.BASE=new O(r.Gx,r.Gy,n.ONE),O.ZERO=new O(n.ZERO,n.ONE,n.ZERO);let{endo:C,nBitLength:T}=r,B=(t=C?Math.ceil(T/2):T,{constTimeNegate:c,hasPrecomputes:e=>1!==y(e),unsafeLadder(e,t,r=O.ZERO){let n=e;for(;t>u;)t&l&&(r=r.add(n)),n=n.double(),t>>=l;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=d(r,t),a=[],s=e,o=s;for(let e=0;e<n;e++){o=s,a.push(o);for(let e=1;e<i;e++)o=o.add(s),a.push(o);s=o.double()}return a},wNAF(e,r,n){let i=O.ZERO,a=O.BASE,s=d(e,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:o,isZero:u,isNeg:l,isNegF:f,offsetF:d}=p(n,e,s);n=t,u?a=a.add(c(f,r[d])):i=i.add(c(l,r[o]))}return{p:i,f:a}},wNAFUnsafe(e,r,n,i=O.ZERO){let a=d(e,t);for(let e=0;e<a.windows&&n!==u;e++){let{nextN:t,offset:s,isZero:o,isNeg:u}=p(n,e,a);if(n=t,!o){let e=r[s];i=i.add(u?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=h.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&h.set(t,r(n))),n},wNAFCached(e,t,r){let n=y(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=y(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){f(r,t),m.set(e,r),h.delete(e)}});return{CURVE:r,ProjectivePoint:O,normPrivateKeyToScalar:I,weierstrassEquation:w,isWithinCurveOrder:function(e){return(0,o.r4)(e,E,r.n)}}}({...r,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),s=o.Id;return((0,o.e8)("isCompressed",r),r)?s(Uint8Array.from([t.hasEvenY()?2:3]),a):s(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],i=e.subarray(1);if(t===A&&(2===r||3===r)){let e,t=(0,o.Ph)(i);if(!(0,o.r4)(t,E,n.ORDER))throw Error("Point is not on curve");let a=C(t);try{e=n.sqrt(a)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&r)==1!=((e&E)===E)&&(e=n.neg(e)),{x:t,y:e}}if(t===I&&4===r)return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))};throw Error("invalid Point, expected length of "+A+", or uncompressed "+I+", got "+t)}}),B=(e,t,r)=>(0,o.Ph)(e.slice(t,r));class j{constructor(e,t,r){(0,o.aK)("r",e,E,i),(0,o.aK)("s",t,E,i),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new j(B(e=(0,o.qj)("compactSignature",e,2*a),0,a),B(e,a,2*a))}static fromDER(e){let{r:t,s:r}=v.toSig((0,o.qj)("DER",e));return new j(t,r)}assertValidity(){}addRecoveryBit(e){return new j(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:i,recovery:a}=this,s=R((0,o.qj)("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");let u=2===a||3===a?t+r.n:t;if(u>=n.ORDER)throw Error("recovery id 2 or 3 invalid");let l=(1&a)==0?"02":"03",c=k.fromHex(l+x(u,n.BYTES)),f=z(u),d=S(-s*f),p=S(i*f),h=k.BASE.multiplyAndAddUnsafe(c,d,p);if(!h)throw Error("point at infinify");return h.assertValidity(),h}hasHighS(){return this.s>i>>E}normalizeS(){return this.hasHighS()?new j(this.r,S(-this.s),this.recovery):this}toDERRawBytes(){return(0,o.aT)(this.toDERHex())}toDERHex(){return v.hexFromSig(this)}toCompactRawBytes(){return(0,o.aT)(this.toCompactHex())}toCompactHex(){return x(this.r,a)+x(this.s,a)}}function N(e){if("bigint"==typeof e)return!1;if(e instanceof k)return!0;let t=(0,o.qj)("key",e).length,i=n.BYTES,s=i+1;if(!r.allowedPrivateKeyLengths&&a!==s)return t===s||t===2*i+1}let M=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=(0,o.Ph)(e),r=8*e.length-w;return r>0?t>>BigInt(r):t},R=r.bits2int_modN||function(e){return S(M(e))},U=(0,o.OG)(w);function L(e){return(0,o.aK)("num < 2^"+w,e,$,U),(0,o.lq)(e,a)}let D={lowS:r.lowS,prehash:!1},q={lowS:r.lowS,prehash:!1};return k.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return k.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===N(e))throw Error("first arg must be private key");if(!1===N(t))throw Error("second arg must be public key");
9return k.fromHex(t).multiply(O(e)).toRawBytes(r)},sign:function(e,t,a=D){let{seed:s,k2sig:u}=function(e,t,a=D){if(["recovered","canonical"].some(e=>e in a))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:u}=r,{lowS:l,prehash:c,extraEntropy:f}=a;null==l&&(l=!0),e=(0,o.qj)("msgHash",e),b(a),c&&(e=(0,o.qj)("prehashed msgHash",s(e)));let d=R(e),p=O(t),h=[L(p),L(d)];if(null!=f&&!1!==f){let e=!0===f?u(n.BYTES):f;h.push((0,o.qj)("extraEntropy",e))}return{seed:(0,o.Id)(...h),k2sig:function(e){var t;let r=M(e);if(!T(r))return;let n=z(r),a=k.BASE.multiply(r).toAffine(),s=S(a.x);if(s===$)return;let o=S(n*S(d+s*p));if(o===$)return;let u=2*(a.x!==s)|Number(a.y&E),c=o;return l&&o>i>>E&&(c=(t=o)>i>>E?S(-t):t,u^=1),new j(s,c,u)}}}(e,t,a);return(0,o.fg)(r.hash.outputLen,r.nByteLength,r.hmac)(s,u)},verify:function(e,t,n,i=q){let a,s;t=(0,o.qj)("msgHash",t),n=(0,o.qj)("publicKey",n);let{lowS:u,prehash:l,format:c}=i;if(b(i),"strict"in i)throw Error("options.strict was renamed to lowS");if(void 0!==c&&"compact"!==c&&"der"!==c)throw Error("format must be compact or der");let f="string"==typeof e||(0,o.aY)(e),d=!f&&!c&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!f&&!d)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(d&&(s=new j(e.r,e.s)),f){try{"compact"!==c&&(s=j.fromDER(e))}catch(e){if(!(e instanceof v.Err))throw e}s||"der"===c||(s=j.fromCompact(e))}a=k.fromHex(n)}catch(e){return!1}if(!s||u&&s.hasHighS())return!1;l&&(t=r.hash(t));let{r:p,s:h}=s,m=R(t),y=z(h),g=S(m*y),w=S(p*y),x=k.BASE.multiplyAndAddUnsafe(a,g,w)?.toAffine();return!!x&&S(x.x)===p},ProjectivePoint:k,Signature:j,utils:{isValidPrivateKey(e){try{return O(e),!0}catch(e){return!1}},normPrivateKeyToScalar:O,randomPrivateKey:()=>{let e=(0,s.Tp)(r.n);return(0,s.qy)(r.randomBytes(e),r.n)},precompute:(e=8,t=k.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,...{hash:t,hmac:(e,...r)=>a(t,e,(0,n.Id)(...r)),randomBytes:n.po}});return{...r(t),create:r}}},33618:(e,t,r)=>{"use strict";r.d(t,{E:()=>n});let n=1},33828:(e,t,r)=>{"use strict";r.d(t,{x:()=>s});var n=r(96002),i=r(84428),a=r(43748);async function s(e,{blockHash:t,blockNumber:r,blockTag:o,hash:u,index:l,sender:c,nonce:f}){let d=o||"latest",p=void 0!==r?(0,i.cK)(r):void 0,h=null;if(u?h=await e.request({method:"eth_getTransactionByHash",params:[u]},{dedupe:!0}):t?h=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,i.cK)(l)]},{dedupe:!0}):(p||d)&&"number"==typeof l?h=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[p||d,(0,i.cK)(l)]},{dedupe:!!p}):c&&"number"==typeof f&&(h=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[c,(0,i.cK)(f)]},{dedupe:!0})),!h)throw new n.Kz({blockHash:t,blockNumber:r,blockTag:d,hash:u,index:l});return(e.chain?.formatters?.transaction?.format||a.uP)(h,"getTransaction")}},33881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(5773);t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")}},34156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950);t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,a="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`${r}.length ${a} ${i}`)}}},34554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950);t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,n._)`{format: ${e}}`},code(e,t){let r,i,a,s,o,u,{gen:l,data:c,$data:f,schema:d,schemaCode:p,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:b}=h;m.validateFormats&&(f?(r=l.scopeValue("formats",{ref:b.formats,code:m.code.formats}),i=l.const("fDef",(0,n._)`${r}[${p}]`),a=l.let("fType"),s=l.let("format"),l.if((0,n._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>l.assign(a,(0,n._)`${i}.type || "string"`).assign(s,(0,n._)`${i}.validate`),()=>l.assign(a,(0,n._)`"string"`).assign(s,i)),e.fail$data((0,n.or)(!1===m.strictSchema?n.nil:(0,n._)`${p} && !${s}`,(o=g.$async?(0,n._)`(${i}.async ? await ${s}(${c}) : ${s}(${c}))`:(0,n._)`${s}(${c})`,u=(0,n._)`(typeof ${s} == "function" ? ${o} : ${s}.test(${c}
9))`,(0,n._)`${s} && ${s} !== true && ${a} === ${t} && !${u}`)))):function(){var r;let i,a,s=b.formats[d];if(!s){if(!1===m.strictSchema)return b.logger.warn(o());throw Error(o());function o(){return`unknown format "${d}" ignored in schema at path "${y}"`}}if(!0===s)return;let[u,f,p]=(i=(r=s)instanceof RegExp?(0,n.regexpCode)(r):m.code.formats?(0,n._)`${m.code.formats}${(0,n.getProperty)(d)}`:void 0,a=l.scopeValue("formats",{key:d,ref:r,code:i}),"object"!=typeof r||r instanceof RegExp?["string",r,a]:[r.type||"string",r.validate,(0,n._)`${a}.validate`]);u===t&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!g.$async)throw Error("async format in sync schema");return(0,n._)`await ${p}(${c})`}return"function"==typeof f?(0,n._)`${p}(${c})`:(0,n._)`${p}.test(${c})`}())}())}}},34651:(e,t,r)=>{"use strict";r.d(t,{Bm:()=>d,HT:()=>c,J$:()=>h,_7:()=>m,aD:()=>u,el:()=>g,gX:()=>f,nj:()=>p,o6:()=>l,vA:()=>o});var n=r(75228),i=r(56184),a=r(67221),s=r(70234);function o(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new w({signature:e});if(e.r<0n||e.r>s.Ao)throw new v({value:e.r});if(e.s<0n||e.s>s.Ao)throw new x({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new $({value:e.yParity})}function u(e){if(130!==e.length&&132!==e.length)throw new b({signature:e});let t=BigInt(i.di(e,0,32)),r=BigInt(i.di(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return y(t)}catch{throw new $({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}function l(e){if(void 0!==e.r&&void 0!==e.s)return c(e)}function c(e){let t=(()=>{var t;if("string"==typeof e)return u(e);if(e instanceof Uint8Array)return u(i.uK(e));return"string"==typeof e.r?f(e):e.v?{r:(t=e).r,s:t.s,yParity:y(t.v)}:{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}}})();return o(t),t}function f(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=y(t)),"number"!=typeof r)throw new $({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function d(e){let[t,r,n]=e;return c({r:"0x"===r?0n:BigInt(r),s:"0x"===n?0n:BigInt(n),yParity:"0x"===t?0:Number(t)})}function p(e){o(e);let t=e.r,r=e.s;return i.xW(i.oB(t,{size:32}),i.oB(r,{size:32}),"number"==typeof e.yParity?i.oB(g(e.yParity),{size:1}):"0x")}function h(e){let{r:t,s:r,yParity:n}=e;return{r:i.oB(t,{size:32}),s:i.oB(r,{size:32}),yParity:0===n?"0x0":"0x1"}}function m(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",0n===t?"0x":i.Mr(i.oB(t)),0n===r?"0x":i.Mr(i.oB(r))]}function y(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return+(e%2==0);throw new E({value:e})}function g(e){if(0===e)return 27;if(1===e)return 28;throw new $({value:e})}class b extends n.C{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${i.Ej(i.HT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class w extends n.C{constructor({signature:e}){super(`Signature \`${a.As(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class v extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class x extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class $ extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class E extends n.C{constructor({value:e}){super(`Value \`${e}
9\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}},35895:(e,t,r)=>{"use strict";r.d(t,{H4:()=>g,v8:()=>m,$$:()=>y});var n=r(80044),i=r(71386),a=r(91497),s=r(66568);class o extends s.C{constructor({domain:e}){super(`Invalid domain "${(0,a.A)(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class u extends s.C{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class l extends s.C{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}class c extends s.C{constructor({type:e}){const t=e.replace(/^(u?int)/,"$&256");super(`Type "${e}" is not a valid EIP-712 type.`,{metaMessages:[`Use "${t}" instead.`],name:"InvalidTypedDataTypeError"})}}var f=r(80339),d=r(45696),p=r(84428),h=r(99015);function m(e){let{domain:t,message:r,primaryType:n,types:i}=e,s=(e,t)=>{let r={...t};for(let t of e){let{name:e,type:n}=t;"address"===n&&(r[e]=r[e].toLowerCase())}return r},o=i.EIP712Domain&&t?s(i.EIP712Domain,t):{},u=(()=>{if("EIP712Domain"!==n)return s(i[n],r)})();return(0,a.A)({domain:o,message:u,primaryType:n,types:i})}function y(e){let{domain:t,message:r,primaryType:a,types:s}=e,m=(e,t)=>{for(let r of e){let{name:e,type:a}=r,o=t[e],u=a.replace(/(\[[0-9]*\])+$/,"");if("int"===u||"uint"===u)throw new c({type:a});let y=a.match(h.Ge);if(y&&("number"==typeof o||"bigint"==typeof o)){let[e,t,r]=y;(0,p.cK)(o,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===a&&"string"==typeof o&&!(0,f.P)(o))throw new i.M({address:o});let g=a.match(h.BD);if(g){let[e,t]=g;if(t&&(0,d.E)(o)!==Number.parseInt(t,10))throw new n.BI({expectedSize:Number.parseInt(t,10),givenSize:(0,d.E)(o)})}let b=s[a];b&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new l({type:e})}(a),m(b,o))}};if(s.EIP712Domain&&t){if("object"!=typeof t)throw new o({domain:t});m(s.EIP712Domain,t)}if("EIP712Domain"!==a)if(s[a])m(s[a],r);else throw new u({primaryType:a,types:s})}function g({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}},36952:(e,t,r)=>{"use strict";let n,i,a,s;r.d(t,{DU:()=>lV,FB:()=>fP,vI:()=>cp,GN:()=>l1,Xk:()=>fp,aR:()=>fb,Vh:()=>fA,CJ:()=>f_,DW:()=>lF,sD:()=>fq,gx:()=>lT,UF:()=>lK,yf:()=>lG,Z$:()=>cF,Lz:()=>lH,zC:()=>fu,So:()=>fF,hl:()=>ff,tH:()=>cS,LY:()=>fd,xz:()=>fe,YR:()=>c7,PM:()=>cm,c7:()=>cb,eF:()=>cZ,AF:()=>cE,Y5:()=>cW,DO:()=>cn,JX:()=>l6,qW:()=>c3,mV:()=>ci,g6:()=>cN,Iv:()=>c6,IP:()=>fi,Gf:()=>ca,C9:()=>l8,m3:()=>l3,YC:()=>l4,Kl:()=>cw,DB:()=>co,gd:()=>lB,Eo:()=>lj,yJ:()=>lM,i:()=>lN,J6:()=>cI,wL:()=>fn,ep:()=>cg,Bq:()=>fr,X4:()=>c2,Hs:()=>lq,qc:()=>lL,DX:()=>c1,HZ:()=>cP,Ex:()=>c_,ol:()=>lU,LE:()=>cB,ZK:()=>lR,Xj:()=>cl,pU:()=>cA,YM:()=>ft,Yj:()=>fl,VV:()=>fc,ZJ:()=>lD,oc:()=>lX});var o,u,l,c,f,d=r(38708);
9class p extends Error{static setStaticOptions(e){p.prototype.docsOrigin=e.docsOrigin,p.prototype.showVersion=e.showVersion,p.prototype.version=e.version}constructor(e,t={}){const r=(()=>{if(t.cause instanceof p){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),n=t.cause instanceof p&&t.cause.docsPath||t.docsPath,i=t.docsOrigin??p.prototype.docsOrigin,a=`${i}${n??""}`,s=!!(t.version??p.prototype.showVersion),o=t.version??p.prototype.version;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||n||s?["",r?`Details: ${r}`:void 0,n?`See: ${a}`:void 0,s?`Version: ${o}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=r,this.docs=a,this.docsOrigin=i,this.docsPath=n,this.shortMessage=e,this.showVersion=s,this.version=o}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}function h(e,t){if(e.length>t)throw new G({givenSize:e.length,maxSize:t})}Object.defineProperty(p,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:"[email protected]"}}),p.setStaticOptions(p.defaultStaticOptions);function m(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function y(e,t){if(k(e)>t)throw new R({givenSize:k(e),maxSize:t})}function g(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;let i=e.replace("0x","");if(i.length>2*n)throw new L({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i["right"===r?"padEnd":"padStart"](2*n,"0")}`}function b(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}let w=new TextEncoder,v=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function x(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function $(e){return e instanceof Uint8Array?P(e):Array.isArray(e)?P(new Uint8Array(e)):e}function E(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(y(r,t.size),I(r,t.size)):r}function P(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=v[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(y(n,t.size),S(n,t.size)):n}function _(e,t={}){let r,{signed:n,size:i}=t,a=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&a>r||a<s){let t="bigint"==typeof e?"n":"";throw new B({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=(n&&a<0?BigInt.asUintN(8*i,BigInt(a)):a).toString(16),u=`0x${o}`;return i?I(u,i):u}function A(e,t={}){return P(w.encode(e),t)}function I(e,t){return g(e,{dir:"left",size:t})}function S(e,t){return g(e,{dir:"right",size:t})}function z(e,t,r,n={}){let{strict:i}=n;if("number"==typeof t&&t>0&&t>k(e)-1)throw new U({offset:t,position:"start",size:k(e)});let a=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return i&&function(e,t,r){if("number"==typeof t&&"number"==typeof r&&k(e)!==r-t)throw new U({offset:r,position:"end",size:k(e)})}(a,t,r),a}function k(e){return Math.ceil((e.length-2)/2)}function O(e,t={}){let{signed:r}=t;t.size&&y(e,t.size);let n=BigInt(e);if(!r)return n;let i=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=i>>1n?n:n-i-1n}function C(e,t={}){return W(e,t)}function T(e,t={}){let{signed:r,size:n}=t;return r||n?Number(O(e,t)):Number(e)}class B extends p{constructor({max:e,min:t,signed:r,size:n,value:i}
9){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class j extends p{constructor(e){super(`Value \`${"object"==typeof e?b(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class N extends p{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class M extends p{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}class R extends p{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class U extends p{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class L extends p{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}let D=new TextDecoder,q=new TextEncoder;function F(e){var t;return e instanceof Uint8Array?e:"string"==typeof e?W(e):(t=e)instanceof Uint8Array?t:new Uint8Array(t)}function W(e,t={}){let{size:r}=t,n=e;r&&(y(e,r),n=S(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,s=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let r=m(i.charCodeAt(t++)),n=m(i.charCodeAt(t++));if(void 0===r||void 0===n)throw new p(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);s[e]=r<<4|n}return s}function H(e,t={}){let{size:r}=t,n=q.encode(e);return"number"==typeof r?(h(n,r),function(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;if(e.length>n)throw new Z({size:e.length,targetSize:n,type:"Bytes"});let i=new Uint8Array(n);for(let t=0;t<n;t++){let a="right"===r;i[a?t:n-t-1]=e[a?t:e.length-t-1]}return i}(n,{dir:"right",size:r})):n}function V(e){return function(e,t={}){let{dir:r="left"}=t,n=e,i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"left"===r?n.slice(i):n.slice(0,n.length-i)}(e,{dir:"right"})}class K extends p{constructor(e){super(`Value \`${"object"==typeof e?b(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class G extends p{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class Z extends p{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}let J="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function Y(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function Q(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function X(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function ee(e,t){Q(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function et(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function er(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function en(e,t){return e<<32-t|e>>>t}let ei=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function ea(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),Q(e),e}class es{}function eo(e){let t=t=>e().update(ea(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function eu(e=32){if(J&&"function"==typeof J.getRandomValues)return J.getRandomValues(new Uint8Array(e));if(J&&"function"==typeof J.randomBytes)return Uint8Array.from(J.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}class el extends es{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");Y(e.outputLen),Y(e.blockLen)}(e);const r=ea(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),et(i)}update(e){return X(this),this.iHash.update(e),this}digestInto(e){X(this),Q(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:a,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=a,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let ec=(e,t,r)=>new el(e,t).update(r).digest();ec.create=(e,t)=>
9new el(e,t);let ef=BigInt(0x100000000-1),ed=BigInt(32);function ep(e,t=!1){let r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let a=0;a<r;a++){let{h:r,l:s}=function(e,t=!1){return t?{h:Number(e&ef),l:Number(e>>ed&ef)}:{h:0|Number(e>>ed&ef),l:0|Number(e&ef)}}(e[a],t);[n[a],i[a]]=[r,s]}return[n,i]}let eh=BigInt(0),em=BigInt(1),ey=BigInt(2),eg=BigInt(7),eb=BigInt(256),ew=BigInt(113),ev=[],ex=[],e$=[];for(let e=0,t=em,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],ev.push(2*(5*n+r)),ex.push((e+1)*(e+2)/2%64);let i=eh;for(let e=0;e<7;e++)(t=(t<<em^(t>>eg)*ew)%eb)&ey&&(i^=em<<(em<<BigInt(e))-em);e$.push(i)}let eE=ep(e$,!0),eP=eE[0],e_=eE[1],eA=(e,t,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r,eI=(e,t,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r;class eS extends es{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,Y(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){ei(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,a=r[i],s=r[i+1],o=eA(a,s,1)^r[n],u=eI(a,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=u}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=ex[r],a=eA(t,i,n),s=eI(t,i,n),o=ev[r];t=e[o],i=e[o+1],e[o]=a,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=eP[n],e[1]^=e_[n]}et(r)}(this.state32,this.rounds),ei(this.state32),this.posOut=0,this.pos=0}update(e){X(this),Q(e=ea(e));let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let a=Math.min(t-this.pos,n-i);for(let t=0;t<a;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){X(this,!1),Q(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Y(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ee(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,et(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return e||(e=new eS(t,r,n,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=a,e.destroyed=this.destroyed,e}}let ez=eo(()=>new eS(136,1,32));class ek extends es{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=er(this.buffer)}update(e){X(this),Q(e=ea(e));let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let a=0;a<i;){let s=Math.min(n-this.pos,i-a);if(s===n){let t=er(e);for(;n<=i-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){X(this),ee(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:a}=this;t[a++]=128,et(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),a=BigInt(0xffffffff),s=Number(r>>i&a),o=Number(r&a),u=4*!!n,l=4*!n;e.setUint32(t+u,s,n),e.setUint32(t+l,o,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=er(e),o=this.outputLen;if(o%4)throw Error("_sha2: outputLen should be aligned to 32bit");let u=o/4,l=this.get();if(u>l.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)s.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}
9let eO=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),eC=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),eT=new Uint32Array(64);class eB extends ek{constructor(e=32){super(64,e,8,!1),this.A=0|eO[0],this.B=0|eO[1],this.C=0|eO[2],this.D=0|eO[3],this.E=0|eO[4],this.F=0|eO[5],this.G=0|eO[6],this.H=0|eO[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:a,G:s,H:o}=this;return[e,t,r,n,i,a,s,o]}set(e,t,r,n,i,a,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|a,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)eT[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=eT[e-15],r=eT[e-2],n=en(t,7)^en(t,18)^t>>>3,i=en(r,17)^en(r,19)^r>>>10;eT[e]=i+eT[e-7]+n+eT[e-16]|0}let{A:r,B:n,C:i,D:a,E:s,F:o,G:u,H:l}=this;for(let e=0;e<64;e++){var c,f,d,p;let t=l+(en(s,6)^en(s,11)^en(s,25))+((c=s)&o^~c&u)+eC[e]+eT[e]|0,h=(en(r,2)^en(r,13)^en(r,22))+((f=r)&(d=n)^f&(p=i)^d&p)|0;l=u,u=o,o=s,s=a+t|0,a=i,i=n,n=r,r=t+h|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,o=o+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,n,i,a,s,o,u,l)}roundClean(){et(eT)}destroy(){this.set(0,0,0,0,0,0,0,0),et(this.buffer)}}ep(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
95771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e)));let ej=eo(()=>new eB);function eN(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,n=ez(F(e));return"Bytes"===r?n:P(n)}let eM=new TextEncoder,eR=new TextDecoder,eU=Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[t,e.charCodeAt(0)])),eL={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[e.charCodeAt(0),t])),61:0,45:62,95:63};function eD(e,t={}){let{pad:r=!0,url:n=!1}=t,i=new Uint8Array(4*Math.ceil(e.length/3));for(let t=0,r=0;r<e.length;t+=4,r+=3){let n=(e[r]<<16)+(e[r+1]<<8)+(0|e[r+2]);i[t]=eU[n>>18],i[t+1]=eU[n>>12&63],i[t+2]=eU[n>>6&63],i[t+3]=eU[63&n]}let a=e.length%3,s=4*Math.floor(e.length/3)+(a&&a+1),o=eR.decode(new Uint8Array(i.buffer,0,s));return r&&1===a&&(o+="=="),r&&2===a&&(o+="="),n&&(o=o.replaceAll("+","-").replaceAll("/","_")),o}
9function eq(e,t={}){return eD(H(e),t)}function eF(e){return function(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(h(n,r),n=V(n)),D.decode(n)}(function(e){let t=e.replace(/=+$/,""),r=t.length,n=new Uint8Array(r+3);eM.encodeInto(t+"===",n);for(let e=0,r=0;e<t.length;e+=4,r+=3){let t=(eL[n[e]]<<18)+(eL[n[e+1]]<<12)+(eL[n[e+2]]<<6)+eL[n[e+3]];n[r]=t>>16,n[r+1]=t>>8&255,n[r+2]=255&t}return new Uint8Array(n.buffer,0,(r>>2)*3+(r%4&&r%4-1))}(e))}function eW(e){return JSON.parse(eF(e))}function eH(e){return eq(function e(t){if(null===t||"boolean"==typeof t||"string"==typeof t)return JSON.stringify(t);if("number"==typeof t){if(!Number.isFinite(t))throw TypeError("Cannot canonicalize non-finite number");return Object.is(t,-0)?"0":JSON.stringify(t)}if("bigint"==typeof t)throw TypeError("Cannot canonicalize bigint");if(Array.isArray(t))return`[${t.map(t=>e(t)).join(",")}]`;if("object"==typeof t){let r=Object.keys(t).sort().reduce((r,n)=>{let i=t[n];return void 0!==i&&r.push(`${JSON.stringify(n)}:${e(i)}`),r},[]);return`{${r.join(",")}}`}}(e),{pad:!1,url:!0})}var eV=r(55503),eK=r(38324),eG=r(68056),eZ=r(65880),eJ=r(55711);let eY=eV.xI("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");eK.W4.init(e,t),e.def=t,e.type=t.type,e.parse=(t,r)=>eJ.qg(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>eJ.xL(e,t,r),e.parseAsync=async(t,r)=>eJ.EJ(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>eJ.bp(e,t,r),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,r)=>eG.clone(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.apply=t=>t(e)}),eQ=eV.xI("ZodMiniString",(e,t)=>{eK.$v.init(e,t),eY.init(e,t)});function eX(e){return eZ.Rl(eQ,e)}let e0=eV.xI("ZodMiniNumber",(e,t)=>{eK.vz.init(e,t),eY.init(e,t)});function e1(e){return eZ.F7(e0,e)}let e2=eV.xI("ZodMiniBoolean",(e,t)=>{eK.sF.init(e,t),eY.init(e,t)}),e6=eV.xI("ZodMiniUnknown",(e,t)=>{eK.GP.init(e,t),eY.init(e,t)}),e5=eV.xI("ZodMiniArray",(e,t)=>{eK.$p.init(e,t),eY.init(e,t)}),e8=eV.xI("ZodMiniObject",(e,t)=>{eK.L8.init(e,t),eY.init(e,t),eG.defineLazy(e,"shape",()=>t.shape)});function e3(e,t){return new e8({type:"object",shape:e??{},...eG.normalizeParams(t)})}let e4=eV.xI("ZodMiniUnion",(e,t)=>{eK.cu.init(e,t),eY.init(e,t)});function e9(e,t){return new e4({type:"union",options:e,...eG.normalizeParams(t)})}let e7=eV.xI("ZodMiniDiscriminatedUnion",(e,t)=>{eK.P0.init(e,t),eY.init(e,t)});function te(e,t,r){return new e7({type:"union",options:t,discriminator:e,...eG.normalizeParams(r)})}let tt=eV.xI("ZodMiniRecord",(e,t)=>{eK.h.init(e,t),eY.init(e,t)});function tr(e,t,r){return new tt(t&&t._zod?{type:"record",keyType:e,valueType:t,...eG.normalizeParams(r)}:{type:"record",keyType:eX(),valueType:e,...eG.normalizeParams(t)})}let tn=eV.xI("ZodMiniEnum",(e,t)=>{eK.VO.init(e,t),eY.init(e,t),e.options=Object.values(t.entries)});function ti(e,t){return new tn({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eG.normalizeParams(t)})}let ta=eV.xI("ZodMiniLiteral",(e,t)=>{eK.nu.init(e,t),eY.init(e,t)});function ts(e,t){return new ta({type:"literal",values:Array.isArray(e)?e:[e],...eG.normalizeParams(t)})}let to=eV.xI("ZodMiniTransform",(e,t)=>{eK.Wc.init(e,t),eY.init(e,t)});function tu(e){return new to({type:"transform",transform:e})}let tl=eV.xI("ZodMiniOptional",(e,t)=>{eK.ig.init(e,t),eY.init(e,t)});function tc(e){return new tl({type:"optional",innerType:e})}let tf=eV.xI("ZodMiniPipe",(e,t)=>{eK._m.init(e,t),eY.init(e,t)});function td(e,t){return new tf({type:"pipe",in:e,out:t})}let tp=eV.xI("ZodMiniCustom",(e,t)=>{eK.b0.init(e,t),eY.init(e,t)});function th(e,t){return eZ.FO(tp,e??(()=>!0),t)}function tm(){return eX().check(eZ.Fk(/^\d+(\.\d+)?$/,"Invalid amount"))}function ty(){return eX().check(eZ.Fk(/^0x[0-9a-fA-F]{64}$/,"Invalid hash"))}function tg(){return eX().check(eZ.Fk(/^0x[0-9a-fA-F]+$/,"Invalid signature"))}eZ.q0,eZ.mI;let tb=e3({description:tc(eX()),digest:tc(eX().check(eZ.Fk(/^sha-256=/,"Invalid digest format"))),expires:tc(eX().check(eZ.Fk(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,"Invalid ISO 8601 datetime"))),id:eX(),intent:eX(),method:eX(),opaque:tc(tr(eX(),eX())),realm:eX(),request:tr(eX(),eZ.em(e6))});function tw(e,t){let r=function(e){let t="Payment",r=!1,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(r){n?n=!1:"\\"===a?n=!0:'"'===a&&(r=!1);continue}if('"'===a){r=!0;continue}if(!function(e,t,r){if(!e.slice(t).toLowerCase().startsWith(r.toLowerCase()))return!1;let n=e[t+r.length];return!!(n&&/\s/.test(n))}(e,i,t))continue;let s=e.slice(0,i);if(s.trim()&&!s.trimEnd().endsWith(","))continue;let o=i+t.length;for(;o<e.length&&/\s/.test(e[o]??"");)o++;return e.slice(o)}return null}(e);if(!r)throw Error("Missing Payment scheme.");let{request:n,opaque:i,...a}=function(e){let t={},r=0;for(;r<e.length;){for(;r<e.length&&/[\s,]/.test(e[r]??"");)r++;if(r>=e.length)break;let n=r;for(;r<e.length&&/[A-Za-z0-9_-]/.test(e[r]??"");)r++;let i=e.slice(n,r);if(!i)throw Error("Malformed auth-param.");for(;r<e.length&&/\s/.test(e[r]??"");)r++;if("="!==e[r])break;for(r++;r<e.length&&/\s/.test(e[r]??"");)r++;let[a,s]=function(e,t){if('"'===e[t])return function(e,t){let r=t,n="",i=!1;for(;r<e.length;){let t=e[r];if(r++,i){n+=t,i=!1;continue}if("\\"===t){i=!0;continue}if('"'===t)return[n,r];n+=t}throw Error("Unterminated quoted-string.")}(e,t+1);let r=t;for(;r<e.length&&","!==e[r];)r++;return[e.slice(t,r).trim(),r]}(e,r);if(r=s,i in t)throw Error(`Duplicate parameter: ${i}`);t[i]=a}return t}(r);if(!n)throw Error("Missing request parameter.");if(a.method&&!/^[a-z][a-z0-9:_-]*$/.test(a.method))throw Error(`Invalid method: "${a.method}
9". Must be lowercase per spec.`);return function(e){var t,r;let n,{description:i,digest:a,meta:s,method:o,intent:u,realm:l,request:c,secretKey:f}=e,d=e.expires,p=f?(t={...e,expires:d,...s&&{opaque:s}},r={secretKey:f},n=[t.realm,t.method,t.intent,eH(t.request),t.expires??"",t.digest??"",t.opaque?eH(t.opaque):""].join("|"),eD(function(e,t,r={}){let{as:n="string"==typeof t?"Hex":"Bytes"}=r,i=ec(ej,F(e),F(t));return"Bytes"===n?i:P(i)}(H(r.secretKey),H(n),{as:"Bytes"}),{url:!0,pad:!1})):e.id;return tb.parse({id:p,realm:l,method:o,intent:u,request:c,...i&&{description:i},...a&&{digest:a},...d&&{expires:d},...s&&{opaque:s}})}({...a,request:eW(n),...i&&{meta:eW(i)}})}let tv=Symbol.for("mppx.fetch.wrapper");function tx(e){let{fetch:t=globalThis.fetch,methods:r,onChallenge:n}=e,i=function(e){let t=e;for(;t[tv];)t=t[tv];return t}(t),a=async(e,t)=>{let a,s,o=await i(e,t);if(402!==o.status)return o;let u=t?.context,{context:l,...c}=t??{},f=function(e){if(402!==e.status)throw Error("Response status is not 402.");return function(e,t){let r=e.get("WWW-Authenticate");if(!r)throw Error("Missing WWW-Authenticate header.");var n=r,i=t;let a=[];for(let e of n.matchAll(/Payment\s+/gi))a.push(e.index);if(0===a.length)throw Error("No Payment schemes found.");return a.map((e,t)=>{let r=t+1<a.length?a[t+1]:n.length;return tw(n.slice(e,r).replace(/,\s*$/,""),i)})}(e.headers,void 0)}(o);for(let e of r){let t=f.find(t=>t.method===e.name&&t.intent===e.intent);if(t){a=t,s=e;break}}if(!a||!s)throw Error(`No method found for challenges: ${f.map(e=>`${e.method}.${e.intent}`).join(", ")}. Available: ${r.map(e=>`${e.name}.${e.intent}`).join(", ")}`);let d=(n?await n(a,{createCredential:async e=>tE(a,s,e??u)}):void 0)??await tE(a,s,u);return function(e){if(!e.trim())throw Error("Credential header value must be non-empty");if(e.includes("\r")||e.includes("\n"))throw Error("Credential header value contains illegal newline characters")}(d),i(e,{...c,headers:function(e,t){let r=t$(e);for(let e of Object.keys(r))"authorization"===e.toLowerCase()&&delete r[e];return r.Authorization=t,r}(c.headers,d)})};return a[tv]=i,a}function t$(e){if(!e)return{};if(e instanceof Headers){let t={};return e.forEach((e,r)=>{t[r]=e}),t}return Array.isArray(e)?Object.fromEntries(e):e}async function tE(e,t,r){let n=t.context&&void 0!==r?t.context.parse(r):void 0;return t.createCredential(void 0!==n?{challenge:e,context:n}:{challenge:e})}var tP=r(49586),t_=r(75255),tA=r(3974);async function tI(e,t){let{chain:r=e.chain}=t,n=t.timeout??Math.max((r?.blockTime??0)*3,5e3),i=await (0,tP.T)(e,t_.yM,"sendCalls")(t);return await (0,tP.T)(e,tA.c,"waitForCallsStatus")({...t,id:i.id,timeout:n})}var tS=r(29562),tz=r(51011),tk=r(6593),tO=r(81278),tC=r(84428),tT=r(58637),tB=r(97948),tj=r(69960);async function tN(e,t){let{account:r=e.account,chain:n=e.chain,...i}=t;if(!r)throw new tk.T({docsPath:"/docs/actions/wallet/signTransaction"});let a=(0,tz.J)(r);(0,tB.c)({account:a,...t});let s=await (0,tP.T)(e,tj.T,"getChainId")({});null!==n&&(0,tO.v)({currentChainId:s,chain:n});let o=n?.formatters||e.chain?.formatters,u=o?.transactionRequest?.format||tT.Bv;return a.signTransaction?a.signTransaction({...i,account:a,chainId:s},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...u({...i,account:a},"signTransaction"),chainId:(0,tC.cK)(s),from:a.address}]},{retryCount:0})}var tM=r(56184),tR=r(30837),tU=r(75228),tL=r(6871),tD=r(3028),tq=r(94734),tF=r(46089);function tW(e){var t;let r,n;return t=e,r="Hex",n=(()=>{if("string"==typeof t){if(t.length>3&&t.length%2!=0)throw new tM.o4(t);return tq.aD(t)}return t})(),function e(t,r="Hex"){if(0===t.bytes.length)return"Hex"===r?tM.uK(t.bytes):t.bytes;let n=t.readByte();if(n<128&&t.decrementPosition(1),n<192){let e=tH(t,n,128),i=t.readBytes(e);return"Hex"===r?tM.uK(i):i}let i=tH(t,n,192);var a=t,s=i,o=r;let u=a.position,l=[];for(;a.position-u<s;)l.push(e(a,o));return l}(tF.vt(n,{recursiveReadLimit:1/0}),r)}function tH(e,t,r){if(128===r&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new tU.C("Invalid RLP prefix")}function tV(e,t={}){let{as:r="Hex"}=t;return function(e,t){let{as:r}=t,n=function e(t){var r,n;let i,a,s,o;return Array.isArray(t)?(a=tK(i=(r=t.map(t=>e(t))).reduce((e,t)=>
9e+t.length,0)),{length:i<=55?1+i:1+a+i,encode(e){for(let{encode:t}of(i<=55?e.pushByte(192+i):(e.pushByte(247+a),1===a?e.pushUint8(i):2===a?e.pushUint16(i):3===a?e.pushUint24(i):e.pushUint32(i)),r))t(e)}}):(o=tK((s="string"==typeof(n=t)?tq.aD(n):n).length),{length:1===s.length&&s[0]<128?1:s.length<=55?1+s.length:1+o+s.length,encode(e){1===s.length&&s[0]<128||(s.length<=55?e.pushByte(128+s.length):(e.pushByte(183+o),1===o?e.pushUint8(s.length):2===o?e.pushUint16(s.length):3===o?e.pushUint24(s.length):e.pushUint32(s.length))),e.pushBytes(s)}})}(e),i=tF.vt(new Uint8Array(n.length));return(n.encode(i),"Hex"===r)?tM.uK(i.bytes):i.bytes}(e,{as:r})}function tK(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=0xffffff)return 3;if(e<=0xffffffff)return 4;throw new tU.C("Length is too large.")}var tG=r(67221),tZ=r(16100),tJ=r(33438),tY=r(429);let tQ=(0,tY.D0)(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),tX=tQ.create(BigInt("-3")),t0=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),t1=(0,tJ.s)({a:tX,b:t0,Fp:tQ,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},tZ.sc),t2=(0,tY.D0)(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff")),t6=t2.create(BigInt("-3")),t5=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");(0,tJ.s)({a:t6,b:t5,Fp:t2,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},tZ.qt);let t8=(0,tY.D0)(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),t3=t8.create(BigInt("-3")),t4=BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");(0,tJ.s)({a:t3,b:t4,Fp:t8,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},tZ.Zf);var t9=r(48409);function t7(e){let{hash:t,payload:r,publicKey:n,signature:i}=e;return t1.verify(i,r instanceof Uint8Array?r:tq.aD(r),t9.nj(n).substring(2),{lowS:!0,...t?{prehash:!0}:{}})}tU.C,tq.sH("ox.p256.fromSeed.v1");var re=r(25274);function rt(e){let{payload:t,signature:r}=e,{r:n,s:i,yParity:a}=r,s=new re.secp256k1.Signature(BigInt(n),BigInt(i)).addRecoveryBit(a).recoverPublicKey(tM.HT(t).substring(2));return t9.HT(s)}tU.C,tq.sH("ox.secp256k1.fromSeed.v1");var rr=r(34651);let rn=new TextEncoder;Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[t,e.charCodeAt(0)]);let ri={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[e.charCodeAt(0),t])),61:0,45:62,95:63};class ra extends tU.C{constructor({majorType:e}){super(`Invalid CBOR major type: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidMajorTypeError"})}}class rs extends tU.C{constructor({additionalInfo:e}){super(`Invalid CBOR additional info: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidAdditionalInfoError"})}}class ro extends tU.C{constructor(){super("64-bit integers are not supported in CBOR decoding."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.Unsupported64BitIntegerError"})}}class ru extends tU.C{constructor({tag:e}){super(`CBOR tagged data (tag ${e}) is not yet supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnsupportedTagError"})}}class rl extends tU.C{constructor({type:e}){super(`Invalid chunk type in indefinite-length ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidIndefiniteLengthChunkError"})}}class rc extends tU.C{constructor({value:e}){super(`Invalid CBOR simple value: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidSimpleValueError"})}}class rf extends tU.C{constructor(){super("BigInt values are not supported in CBOR encoding."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnsupportedBigIntError"})}}class rd extends tU.C{constructor({token:e}){super(`Unexpected token: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnexpectedTokenError"})}}class rp extends tU.C{constructor({number:e}){super(`Number exceeds maximum safe integer (${Number.MAX_SAFE_INTEGER}): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.NumberTooLargeError"})}}class rh extends tU.C{constructor({size:e}){super(`String length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.StringTooLargeError"})}}class rm extends tU.C{constructor({size:e}){super(`Array length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ArrayTooLargeError"})}}class ry extends tU.C{constructor({size:e}){super(`Object size exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ObjectTooLargeError"})}}class rg extends tU.C{constructor({size:e}){super(`Byte string length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ByteStringTooLargeError"})}}function rb(e){if(void 0===e)return{length:1,encode:e=>e.pushUint8(247)};if(null===e)return{length:1,encode:e=>e.pushUint8(246)};if("boolean"==typeof e)return{length:1,encode:t=>t.pushUint8(e?245:244)};if("number"==typeof e)return rb.number(e);if("bigint"==typeof e)throw new rf;if("string"==typeof e)return rb.string(e);if(Array.isArray(e))return rb.array(e);if(e instanceof Uint8Array)return rb.byteString(e);if(e instanceof ArrayBuffer)return rb.byteString(new Uint8Array(e));if(ArrayBuffer.isView(e))return rb.byteString(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));if(e instanceof Map)return rb.map(e);if("object"==typeof e)return rb.object(e);throw new rd({token:String(e)})}function rw(e){let t=e.readUint8(),r=t>>5,n=31&t;switch(r){case 0:return rw.readUnsignedInteger(e,n);case 1:return rw.readNegativeInteger(e,n);case 2:return rw.readByteString(e,n);case 3:return rw.readTextString(e,n);case 4:return rw.readArray(e,n);case 5:return rw.readMap(e,n);case 6:throw new ru({tag:n});case 7:return rw.readSimpleOrFloat(e,n);default:throw new ra({majorType:r})}}(o=rb||(rb={})).number=function(e){if(!Number.isSafeInteger(e)){let t=Math.fround(e);return Number.isNaN(e)||e===t?{length:5,encode(t){t.pushUint8(250),t.dataView.setFloat32(t.position,e,!1),t.position+=4}}:{length:9,encode(t){t.pushUint8(251),t.dataView.setFloat64(t.position,e,!1),t.position+=8}}}if(e>=0){if(e<=23)return{length:1,encode:t=>t.pushUint8(e)};if(e<=255)return{length:2,encode:t=>{t.pushUint8(24),t.pushUint8(e)}};if(e<=65535)return{length:3,encode:t=>{t.pushUint8(25),t.pushUint16(e)}};if(e<=0xffffffff)return{length:5,encode:t=>{t.pushUint8(26),t.pushUint32(e)}};throw new rp({number:e.toString(10)})}let t=-1-e;if(e>=-24)return{length:1,encode:e=>e.pushUint8(32+t)};if(t<=255)return{length:2,encode:e=>{e.pushUint8(56),e.pushUint8(t)}};if(t<=65535)return{length:3,encode:e=>{e.pushUint8(57),e.pushUint16(t)}};if(t<=0xffffffff)return{length:5,encode:e=>{e.pushUint8(58),e.pushUint32(t)}};throw new rp({number:e.toString(10)})},o.string=function(e){let t=tq.sH(e),r=t.length;if(r<=23)return{length:1+r,encode(e){e.pushUint8(96+r),r>0&&e.pushBytes(t)}};if(r<=255)return{length:2+r,encode(e){e.pushUint8(120),e.pushUint8(r),e.pushBytes(t)}};if(r<=65535)return{length:3+r,encode(e){e.pushUint8(121),e.pushUint16(r),e.pushBytes(t)}};if(r<=0xffffffff)return{length:5+r,encode(e){e.pushUint8(122),e.pushUint32(r),e.pushBytes(t)}};throw new rh({size:r})},o.array=function(e){let t=e.map(e=>o(e)),r=t.reduce((e,t)=>
9e+t.length,0),n=e.length;if(n<=23)return{length:1+r,encode(e){for(let r of(e.pushUint8(128+n),t))r.encode(e)}};if(n<=255)return{length:2+r,encode(e){for(let r of(e.pushUint8(152),e.pushUint8(n),t))r.encode(e)}};if(n<=65535)return{length:3+r,encode(e){for(let r of(e.pushUint8(153),e.pushUint16(n),t))r.encode(e)}};if(n<=0xffffffff)return{length:5+r,encode(e){for(let r of(e.pushUint8(154),e.pushUint32(n),t))r.encode(e)}};throw new rm({size:n})},o.byteString=function(e){let t=e.byteLength;if(t<=23)return{length:1+t,encode(r){r.pushUint8(64+t),r.pushBytes(e)}};if(t<=255)return{length:2+t,encode(r){r.pushUint8(88),r.pushUint8(t),r.pushBytes(e)}};if(t<=65535)return{length:3+t,encode(r){r.pushUint8(89),r.pushUint16(t),r.pushBytes(e)}};if(t<=0xffffffff)return{length:5+t,encode(r){r.pushUint8(90),r.pushUint32(t),r.pushBytes(e)}};throw new rg({size:t})},o.object=function(e){let t=Object.keys(e),r=t.map(t=>({key:o(t),value:o(e[t])})),n=r.reduce((e,t)=>e+t.key.length+t.value.length,0),i=t.length;if(i<=23)return{length:1+n,encode(e){for(let t of(e.pushUint8(160+i),r))t.key.encode(e),t.value.encode(e)}};if(i<=255)return{length:2+n,encode(e){for(let t of(e.pushUint8(184),e.pushUint8(i),r))t.key.encode(e),t.value.encode(e)}};if(i<=65535)return{length:3+n,encode(e){for(let t of(e.pushUint8(185),e.pushUint16(i),r))t.key.encode(e),t.value.encode(e)}};if(i<=0xffffffff)return{length:5+n,encode(e){for(let t of(e.pushUint8(186),e.pushUint32(i),r))t.key.encode(e),t.value.encode(e)}};throw new ry({size:i})},o.map=function(e){let t=[];for(let[r,n]of e)t.push({key:o(r),value:o(n)});let r=t.reduce((e,t)=>e+t.key.length+t.value.length,0),n=e.size;if(n<=23)return{length:1+r,encode(e){for(let r of(e.pushUint8(160+n),t))r.key.encode(e),r.value.encode(e)}};if(n<=255)return{length:2+r,encode(e){for(let r of(e.pushUint8(184),e.pushUint8(n),t))r.key.encode(e),r.value.encode(e)}};if(n<=65535)return{length:3+r,encode(e){for(let r of(e.pushUint8(185),e.pushUint16(n),t))r.key.encode(e),r.value.encode(e)}};if(n<=0xffffffff)return{length:5+r,encode(e){for(let r of(e.pushUint8(186),e.pushUint32(n),t))r.key.encode(e),r.value.encode(e)}};throw new ry({size:n})};var rv=rw||(rw={});function rx(e,t){if(t<24)return t;if(24===t)return e.readUint8();if(25===t)return e.readUint16();if(26===t)return e.readUint32();if(27===t)throw new ro;throw new rs({additionalInfo:t})}rv.readUnsignedInteger=function(e,t){return rx(e,t)},rv.readNegativeInteger=function(e,t){return -1-rx(e,t)},rv.readByteString=function(e,t){if(31===t){let t=[],r=0;for(;;){if(255===e.inspectUint8()){e.readUint8();break}let n=rv(e);if(!(n instanceof Uint8Array))throw new rl({type:"byte string"});t.push(n),r+=n.length}let n=new Uint8Array(r),i=0;for(let e of t)n.set(e,i),i+=e.length;return n}let r=rx(e,t);return e.readBytes(r)},rv.readTextString=function(e,t){if(31===t){let t=[];for(;;){if(255===e.inspectUint8()){e.readUint8();break}let r=rv(e);if("string"!=typeof r)throw new rl({type:"text string"});t.push(r)}return t.join("")}let r=rx(e,t),n=e.readBytes(r);return tq.dI(n)},rv.readArray=function(e,t){if(31===t){let t=[];for(;;){if(255===e.inspectUint8()){e.readUint8();break}t.push(rv(e))}return t}let r=rx(e,t),n=[];for(let t=0;t<r;t++)n.push(rv(e));return n},rv.readMap=function(e,t){if(31===t){let t={};for(;;){if(255===e.inspectUint8()){e.readUint8();break}let r=rv(e),n="string"==typeof r?r:String(r),i=rv(e);t[n]=i}return t}let r=rx(e,t),n={};for(let t=0;t<r;t++){let t=rv(e),r="string"==typeof t?t:String(t),i=rv(e);n[r]=i}return n},rv.readSimpleOrFloat=function(e,t){if(20===t)return!1;if(21===t)return!0;if(22===t)return null;if(23!==t){if(25===t)return function(e){let t=e>>15&1,r=e>>10&31,n=1023&e;if(0===r){if(0===n)return t?-0:0;let e=n/1024*6103515625e-14;return t?-e:e}if(31===r)return 0===n?t?-1/0:1/0:NaN;let i=2**(r-15)*(1+n/1024);return t?-i:i}(e.readUint16());if(26===t){let t=e.dataView.getFloat32(e.position,!1);return e.position+=4,t}if(27===t){let t=e.dataView.getFloat64(e.position,!1);return e.position+=8,t}if(24===t){let t=e.readUint8();if(t<32)throw new rc({value:t});return}throw new rs({additionalInfo:t})}},tU.C,tU.C,Uint8Array.from([105,171,180,181,160,222,75,198,42,42,32,31,141,37,186,233]),tU.C,tU.C;let r$=2n**64n-1n,rE=`0x${"00".repeat(32)}`;function rP(e){let t,{owners:r,salt:n,threshold:i,version:a=0n}=e;if(void 0!==n&&32!==tM.Ej(n))throw new rz({reason:"salt must be 32 bytes"});if(rk(a),0===r.length)throw new rz({reason:"owners cannot be empty"});if(r.length>48)throw new rz({reason:"too many owners"});if(!Number.isInteger(Number(i)))throw new rz({reason:"threshold must be an integer"});if(1>Number(i))throw new rz({reason:"threshold cannot be zero"});if(Number(i)>8)throw new rz({reason:"threshold exceeds max threshold"});let s=0,o=[];for(let e of r){if(!tR.tf(e.owner)||0n===tM.Dg(e.owner))throw new rz({reason:"owner cannot be zero"});if(!Number.isInteger(Number(e.weight)))throw new rz({reason:"owner weight must be an integer"});if(1>Number(e.weight))throw new rz({reason:"owner weight cannot be zero"});let r=tM.Dg(e.owner);if(void 0!==t&&t>=r)throw new rz({reason:"owners must be strictly ascending"});t=r;let n=Number(e.weight);s+=n,o.push(n)}if(s>255)throw new rz({reason:"total owner weight exceeds u8 max"});if(Number(i)>s)throw new rz({reason:"threshold exceeds total owner weight"});let u=o.sort((e,t)=>
9t-e).slice(0,8).reduce((e,t)=>e+t,0);if(Number(i)>u)throw new rz({reason:"threshold exceeds weight reachable by 8 owner signatures"})}function r_(e){let t=e.version??0n;rk(t);let r={owners:[...e.owners].sort((e,t)=>tM.Dg(e.owner)<tM.Dg(t.owner)?-1:1),salt:e.salt?tM.Ho(e.salt,32):rE,threshold:e.threshold,version:BigInt(t)};return rP(r),r}function rA(e){return r_({...e,version:tM.Dg(e.version)})}function rI(e){let{account:t,config:r,payload:n}=e;if(rk(r.version),tR.vA(t),32!==tM.Ej(tM.HT(n)))throw new rz({reason:"payload must be 32 bytes"});return tL.So(tM.xW(tM.sH("tempo:multisig:signature"),tM.HT(n),t,tM.oB(r.version??0n,{size:8})))}function rS(e){rP(e);let t=e.owners.map(e=>[e.owner,tM.oB(e.weight)]),r=e.salt?tM.Ho(e.salt,32):rE,n=BigInt(e.version??0);return[r,0n===n?"0x":tM.oB(n),tM.oB(e.threshold),t]}class rz extends tU.C{constructor({reason:e}){super(`Invalid native multisig config: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigConfig.InvalidConfigError"})}}function rk(e){if("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&!Number.isSafeInteger(e)||0n>BigInt(e)||BigInt(e)>r$)throw new rz({reason:"version must be an unsigned 64-bit integer"})}let rO="0x01",rC="0x02",rT="0x03",rB="0x04",rj="0x05",rN="0x7777777777777777777777777777777777777777777777777777777777777777";function rM(e){let t=rW(e);if("secp256k1"===t)return void rr.vA(e.signature);if("p256"===t){let t=[];if("bigint"!=typeof e.signature?.r&&t.push("signature.r"),"bigint"!=typeof e.signature?.s&&t.push("signature.s"),"boolean"!=typeof e.prehash&&t.push("prehash"),e.publicKey?("bigint"!=typeof e.publicKey.x&&t.push("publicKey.x"),"bigint"!=typeof e.publicKey.y&&t.push("publicKey.y")):t.push("publicKey"),t.length>0)throw new rJ({envelope:e,missing:t,type:"p256"});return}if("webAuthn"===t){let t=[];if("bigint"!=typeof e.signature?.r&&t.push("signature.r"),"bigint"!=typeof e.signature?.s&&t.push("signature.s"),e.metadata?(e.metadata.authenticatorData||t.push("metadata.authenticatorData"),e.metadata.clientDataJSON||t.push("metadata.clientDataJSON")):t.push("metadata"),e.publicKey?("bigint"!=typeof e.publicKey.x&&t.push("publicKey.x"),"bigint"!=typeof e.publicKey.y&&t.push("publicKey.y")):t.push("publicKey"),t.length>0)throw new rJ({envelope:e,missing:t,type:"webAuthn"});return}if("keychain"===t){rR(e),rM(e.inner);return}if("multisig"===t)return void rU(e)}function rR(e){if("v1"!==e.version)return;let t=e.inner;for(;"keychain"===rW(t);)t=t.inner;if("multisig"===rW(t))throw new rQ({reason:"multisig access keys require keychain V2"})}function rU(e){let t=[];if(e.account||t.push("account"),e.config||t.push("config"),Array.isArray(e.signatures)||t.push("signatures"),t.length>0)throw new rJ({envelope:e,missing:t,type:"multisig"});if(!tR.tf(e.account))throw new rQ({reason:"multisig account is invalid"});if(0n===tM.Dg(e.account))throw new rQ({reason:"multisig account cannot be zero"});if(0===e.signatures.length)throw new rQ({reason:"multisig signatures cannot be empty"});if(e.signatures.length>8)throw new rQ({reason:"multisig signatures exceed 8"});if(rP(e.config),(e.config.version??0n)===0n&&e.config.owners.some(t=>tR.n4(t.owner,e.account)))throw new rQ({reason:"initial account cannot be an owner"});for(let t of e.signatures){let e=rW(t);if("keychain"===e||"multisig"===e)throw new rQ({reason:"owner approvals must be primitive signatures"});if(rM(t),tM.Ej(rH(t))>2049)throw new rQ({reason:"multisig owner signature exceeds 2049 bytes"})}}function rL(e){let{signature:t,root:r}=e;return"keychain"===t.type?r?t.userAddress:rL({...e,signature:t.inner}):"multisig"===t.type?t.account:tR.bI(function e(t){let{payload:r,signature:n}=t;switch(n.type){case"secp256k1":return rt({payload:r,signature:n.signature});case"p256":case"webAuthn":return n.publicKey;case"keychain":return e({payload:r,signature:n.inner});case"multisig":throw new rZ({envelope:n})}}(e))}function rD(e){let t=e.endsWith(rN.slice(2))?tM.di(e,0,-tM.Ej(rN)):e;if(65===tM.Ej(t)){let e=rr.aD(t);return rr.vA(e),{signature:e,type:"secp256k1"}}let r=tM.di(t,0,1),n=tM.di(t,1),i=tM.Ej(n);if(r===rO){if(129!==i)throw new rY({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${i} bytes`,serialized:t});return{publicKey:{prefix:4,x:tM.Dg(tM.di(n,64,96)),y:tM.Dg(tM.di(n,96,128))},prehash:0!==tM.Ro(tM.di(n,128,129)),signature:{r:tM.Dg(tM.di(n,0,32)),s:tM.Dg(tM.di(n,32,64))},type:"p256"}}if(r===rC){let e,r;if(i<128)throw new rY({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${i} bytes`,serialized:t});let a=i-128,s=tM.di(n,0,a);for(let t=37;t<a;t++){let n=tM.dI(tM.di(s,t));if(n.startsWith("{")&&n.endsWith("}"))try{JSON.parse(n),e=tM.di(s,0,t),r=n;break}catch{}}if(!e||!r)throw new rY({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:t});return{publicKey:{prefix:4,x:tM.Dg(tM.di(n,a+64,a+96)),y:tM.Dg(tM.di(n,a+96,a+128))},metadata:{authenticatorData:e,clientDataJSON:r},signature:{r:tM.Dg(tM.di(n,a,a+32)),s:tM.Dg(tM.di(n,a+32,a+64))},type:"webAuthn"}}if(r===rT||r===rB){let e={userAddress:tM.di(n,0,20),inner:rD(tM.di(n,20)),type:"keychain",version:r===rB?"v2":"v1"};return rM(e),e}if(r===rj){let e=tW(n);if(!Array.isArray(e)||3!==e.length)throw new rY({reason:"invalid multisig wire shape: expected exactly three fields",serialized:t});let[r,i,a]=e;if("string"!=typeof r||!tR.tf(r))throw new rY({reason:"invalid multisig account",serialized:t});if(!Array.isArray(i))throw new rY({reason:"invalid multisig config",serialized:t});if(!Array.isArray(a)||0===a.length||a.length>8)throw new rY({reason:"invalid multisig signatures list",serialized:t});let s={type:"multisig",account:r,config:function(e){let[t,r,n,i]=e;if(4!==e.length||"string"!=typeof t||32!==tM.Ej(t)||"string"!=typeof r||tM.Ej(r)>8||r.startsWith("0x00")||"string"!=typeof n||tM.Ej(n)>1||n.startsWith("0x00")||!Array.isArray(i)||i.some(e=>!Array.isArray(e)||2!==e.length||"string"!=typeof e[0]||!tR.tf(e[0])||"string"!=typeof e[1]||tM.Ej(e[1])>1||e[1].startsWith("0x00")))throw new rz({reason:"invalid config RLP tuple"});let a={salt:t&&"0x"!==t?tM.Ho(t,32):rE,version:"0x"===r?0n:tM.Dg(r),threshold:"0x"===n?0:tM.Ro(n),owners:i.map(e=>{let[t,r]=e;return{owner:t,weight:r&&"0x"!==r?tM.Ro(r):0}})};return rP(a),a}(i),signatures:a.map(e=>{if(!tM.tf(e)||tM.Ej(e)>2049)throw new rY({reason:"invalid multisig owner signature",serialized:t});if(65!==tM.Ej(e)&&!["0x01","0x02"].includes(tM.di(e,0,1)))throw new rY({reason:"owner approvals must be primitive signatures",serialized:t});return rD(e)})};return rU(s),s}throw new rY({reason:`Unknown signature type identifier: ${r}
9. Expected ${rO} (P256), ${rC} (WebAuthn), ${rT} (Keychain V1), ${rB} (Keychain V2), or ${rj} (Multisig)`,serialized:t})}function rq(e,t){let r;if("string"==typeof e)return rD(e);if("object"==typeof e&&null!==e&&"r"in e&&"s"in e&&"yParity"in e)return{signature:e,type:"secp256k1"};let n=rW(e);return"multisig"===n?{...e,config:r_(e.config),signatures:e.signatures.map(e=>rq(e)),type:n}:{...e,..."p256"===n?{prehash:e.prehash}:{},..."keychain"===n?{...!("object"==typeof e&&null!==e&&"version"in e&&e.version)?{version:"v2"}:{},...!("object"==typeof e&&"keyId"in e&&e.keyId)?"p256"===(r=e.inner).type||"webAuthn"===r.type?{keyId:tR.bI(r.publicKey)}:"secp256k1"===r.type&&t?.payload?{keyId:tR.bI(rt({payload:t.payload,signature:r.signature}))}:{}:{}}:{},type:n}}function rF(e){if("string"==typeof e){let t=rD(tM.xW(rj,e));if("multisig"!==t.type)throw new rZ({envelope:e});return t}if("secp256k1"===e.type)return{signature:rr.gX(e),type:"secp256k1"};if("p256"===e.type)return{prehash:e.preHash,publicKey:{prefix:4,x:tM.Dg(e.pubKeyX),y:tM.Dg(e.pubKeyY)},signature:{r:tM.Dg(e.r),s:tM.Dg(e.s)},type:"p256"};if("webAuthn"===e.type){let t,r,n=e.webauthnData,i=tM.Ej(n);for(let e=37;e<i;e++){let i=tM.dI(tM.di(n,e));if(i.startsWith("{")&&i.endsWith("}"))try{JSON.parse(i),t=tM.di(n,0,e),r=i;break}catch{}}if(!t||!r)throw new rY({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:n});return{metadata:{authenticatorData:t,clientDataJSON:r},publicKey:{prefix:4,x:tM.Dg(e.pubKeyX),y:tM.Dg(e.pubKeyY)},signature:{r:tM.Dg(e.r),s:tM.Dg(e.s)},type:"webAuthn"}}if("keychain"===e.type||"userAddress"in e&&"signature"in e){let t={type:"keychain",userAddress:e.userAddress,inner:rF(e.signature),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}};return rM(t),t}throw new rZ({envelope:e})}function rW(e){if("object"!=typeof e||null===e)throw new rZ({envelope:e});if("type"in e&&e.type)return e.type;if("signature"in e&&!("publicKey"in e)&&"object"==typeof e.signature&&null!==e.signature&&"r"in e.signature&&"s"in e.signature&&"yParity"in e.signature||"r"in e&&"s"in e&&"yParity"in e)return"secp256k1";if("signature"in e&&"prehash"in e&&"publicKey"in e&&"boolean"==typeof e.prehash)return"p256";if("signature"in e&&"metadata"in e&&"publicKey"in e)return"webAuthn";if("userAddress"in e&&"inner"in e)return"keychain";if("account"in e&&"config"in e&&"signatures"in e)return"multisig";throw new rZ({envelope:e})}function rH(e,t={}){let r=rW(e);if("secp256k1"===r)return tM.xW(rr.nj(e.signature),t.magic?rN:"0x");if("p256"===r)return tM.xW(rO,tM.oB(e.signature.r,{size:32}),tM.oB(e.signature.s,{size:32}),tM.oB(e.publicKey.x,{size:32}),tM.oB(e.publicKey.y,{size:32}),tM.oB(+!!e.prehash,{size:1}),t.magic?rN:"0x");if("webAuthn"===r){let r=tM.xW(e.metadata.authenticatorData,tM.sH(e.metadata.clientDataJSON));return tM.xW(rC,r,tM.oB(e.signature.r,{size:32}),tM.oB(e.signature.s,{size:32}),tM.oB(e.publicKey.x,{size:32}),tM.oB(e.publicKey.y,{size:32}),t.magic?rN:"0x")}if("keychain"===r){rM(e);let r="v1"===e.version?rT:rB;return tM.xW(r,e.userAddress,rH(e.inner),t.magic?rN:"0x")}if("multisig"===r)return rM(e),tM.xW(rj,tV([e.account,rS(e.config),e.signatures.map(e=>rH(e))]),t.magic?rN:"0x");throw new rZ({envelope:e})}function rV(e){let{signatures:t}=e,r=rI(e);return t.map(e=>({key:tM.Dg(rL({payload:r,signature:e})),signature:e})).sort((e,t)=>e.key<t.key?-1:+(e.key>t.key)).map(e=>e.signature)}function rK(e){let t=rW(e);if("secp256k1"===t)return{...rr.J$(e.signature),type:"secp256k1"};if("p256"===t)return{preHash:e.prehash,pubKeyX:tM.oB(e.publicKey.x,{size:32}),pubKeyY:tM.oB(e.publicKey.y,{size:32}),r:tM.oB(e.signature.r,{size:32}),s:tM.oB(e.signature.s,{size:32}),type:"p256"};if("webAuthn"===t){let t=tM.xW(e.metadata.authenticatorData,tM.sH(e.metadata.clientDataJSON));return{pubKeyX:tM.oB(e.publicKey.x,{size:32}),pubKeyY:tM.oB(e.publicKey.y,{size:32}),r:tM.oB(e.signature.r,{size:32}),s:tM.oB(e.signature.s,{size:32}),type:"webAuthn",webauthnData:t}}if("keychain"===t)return rR(e),{type:"keychain",userAddress:e.userAddress,signature:rK(e.inner),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}};if("multisig"===t)return tM.di(rH(e),1);throw new rZ({envelope:e})}function rG(e,t){let{payload:r}=t,n=t.address?t.address:t.publicKey?tR.bI(t.publicKey):void 0;if(!n)return!1;let i=rq(e);
9if("secp256k1"===i.type)return!!n&&function(e){let{hash:t,payload:r}=e;if(e.address){var n;return tR.n4(e.address,(n={payload:r,signature:e.signature},tR.bI(rt(n))))}return re.secp256k1.verify(e.signature,tq.HT(r),t9.ZJ(e.publicKey),...t?[{prehash:!0,lowS:!0}]:[])}({address:n,payload:r,signature:i.signature});if("p256"===i.type){let e=tR.bI(i.publicKey);return!!tR.n4(e,n)&&t7({hash:i.prehash,publicKey:i.publicKey,payload:r,signature:i.signature})}if("webAuthn"===i.type){let e=tR.bI(i.publicKey);return!!tR.n4(e,n)&&function(e){let{challenge:t,metadata:r,origin:n,publicKey:i,rpId:a,signature:s}=e,{authenticatorData:o,clientDataJSON:u,userVerificationRequired:l}=r,c=tq.aD(o);if(c.length<37)return!1;if(void 0!==a){let e=c.slice(0,32),t=tL.sc(tM.sH(a),{as:"Bytes"});if(!tq.n4(e,t))return!1}let f=c[32];if((1&f)!=1||l&&(4&f)!=4||(8&f)!=8&&(16&f)==16)return!1;let d=JSON.parse(u);if("webauthn.get"!==d.type||!d.challenge||tM.uK(function(e){let t=e.replace(/=+$/,""),r=t.length,n=new Uint8Array(r+3);rn.encodeInto(t+"===",n);for(let e=0,r=0;e<t.length;e+=4,r+=3){let t=(ri[n[e]]<<18)+(ri[n[e+1]]<<12)+(ri[n[e+2]]<<6)+ri[n[e+3]];n[r]=t>>16,n[r+1]=t>>8&255,n[r+2]=255&t}return new Uint8Array(n.buffer,0,(r>>2)*3+(r%4&&r%4-1))}(d.challenge))!==t||void 0!==n&&!(Array.isArray(n)?n:[n]).includes(d.origin))return!1;let p=tL.sc(tq.sH(u),{as:"Bytes"});return t7({hash:!0,payload:tq.xW(c,p),publicKey:i,signature:s})}({challenge:tM.HT(r),metadata:i.metadata,publicKey:i.publicKey,signature:i.signature})}throw new rX(`Unable to verify signature envelope of type "${i.type}".`)}class rZ extends tU.C{constructor({envelope:e}){super(`Unable to coerce value (\`${tG.As(e)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}class rJ extends tU.C{constructor({envelope:e,missing:t,type:r}){super(`Signature envelope of type "${r}" is missing required properties: ${t.map(e=>`\`${e}\``).join(", ")}.
10
11Provided: ${tG.As(e)}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.MissingPropertiesError"})}}class rY extends tU.C{constructor({reason:e,serialized:t}){super(`Unable to deserialize signature envelope: ${e}`,{metaMessages:[`Serialized: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}}class rQ extends tU.C{constructor({reason:e}){super(`Invalid native multisig owner approval: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidMultisigApprovalError"})}}class rX extends tU.C{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.VerificationError"})}}function r0(e){return e.startsWith("tempo")?function(e){if(!e.startsWith("tempox"))throw new r1({address:e});let t=e.slice(6);return tM.vA(t,{strict:!0}),{address:tR.cM(t)}}(e).address:e}class r1 extends tU.C{constructor({address:e}){super(`Tempo address "${e}" has an invalid prefix. Expected "tempox".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TempoAddress.InvalidPrefixError"})}}function r2(e,t={}){if("keyId"in e)return r6(e);nr(e.type,e.account),void 0!==e.witness&&nn(e.witness),e.signature&&ni(e.signature);let r={...e,...void 0!==e.account?{account:r0(e.account)}:{},address:r0(e.address),...e.limits?{limits:e.limits.map(e=>({...e,token:r0(e.token)}))}:{},...e.scopes?{scopes:e.scopes.map(e=>({...e,address:r0(e.address),selector:nt(e.selector),...e.recipients?{recipients:e.recipients.map(e=>r0(e))}:{}}))}:{}};if(t.signature){let e=rq(t.signature);return ni(e),{...r,signature:e}}return r}function r6(e){let{allowedCalls:t,chainId:r,keyId:n,expiry:i,limits:a,keyType:s}=e,o=e.witness??void 0,u=e.isAdmin??void 0,l=e.account??void 0;nr(s,l);let c=rF(e.signature);ni(c),void 0!==o&&nn(o);let f=t?t.flatMap(e=>e.selectorRules&&0!==e.selectorRules.length?e.selectorRules.map(t=>{var r;return{address:e.target,selector:"string"==typeof(r=t.selector)?r:Array.isArray(r)?tM.uK(new Uint8Array(r)):r,...t.recipients&&t.recipients.length>0?{recipients:t.recipients}:{}}
11}):[{address:e.target}]):void 0;return{address:n,chainId:"0x"===r?0n:tM.Dg(r),...null!=i?{expiry:Number(i)}:{},limits:a?.map(e=>({token:e.token,limit:BigInt(e.limit),...e.period&&ne(e.period)>0?{period:ne(e.period)}:{}})),...f?{scopes:f}:{},signature:c,..."multisig"===s?{account:l,type:s}:{type:s},...void 0!==o?{witness:o}:{},...void 0!==l?{account:l}:{},...u?{isAdmin:!0}:{}}}function r5(e){let[t,r]=e,[n,i,a,...s]=t,o=(()=>{switch(i){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";case"0x03":return"multisig";default:throw Error(`Invalid key type: ${i}`)}})(),[u,l,c,f,d,p]=s,h=na(u)?void 0:ne(u)||void 0,m=Array.isArray(l)&&l.length>0?l.map(e=>{var t;let[r,n,i]=e;return{token:r,limit:"0x"===(t=n)?0n:BigInt(t),...void 0!==i?{period:ne(i)}:{}}}):void 0,y=Array.isArray(c)?c.flatMap(e=>{let[t,r]=e;return Array.isArray(r)&&0!==r.length?r.map(e=>{let[r,n]=e;return{address:t,selector:r,...Array.isArray(n)&&n.length>0?{recipients:n}:{}}}):[{address:t}]}):void 0,g=na(f)?void 0:f;void 0!==g&&nn(g);let b=(()=>{if(!na(d)){if("0x01"!==d)throw new no(d);return!0}})(),w=na(p)?void 0:p;nr(o,w);let v={address:a,chainId:"0x"===n?0n:tM.Dg(n),..."multisig"===o?{account:w,type:o}:{type:o},...void 0!==h?{expiry:h}:{},...void 0!==m?{limits:m}:{},...void 0!==y?{scopes:y}:{},...void 0!==g?{witness:g}:{},...void 0!==w?{account:w}:{},...b?{isAdmin:!0}:{}};if(r){let e=rD(r);ni(e),v.signature=e}return r2(v)}function r8(e){let[t]=r4(e),r=tV(t);return tL.So(r)}function r3(e){nr(e.type,e.account);let{address:t,scopes:r,chainId:n,expiry:i,limits:a,type:s,signature:o,witness:u,isAdmin:l,account:c}=e;ni(o),void 0!==u&&nn(u);let f=(()=>{if(!r)return;let e=new Map;for(let t of r){let r=t.address;e.has(r)||e.set(r,[]),t.selector&&e.get(r).push({selector:nt(t.selector),...t.recipients&&t.recipients.length>0?{recipients:t.recipients}:{}}
11)}return[...e.entries()].map(([e,t])=>({target:e,...t.length>0?{selectorRules:t}:{}}))})();return{chainId:0n===n?"0x":tM.oB(n),expiry:"number"==typeof i?tM.oB(i):null,keyId:r0(t),..."multisig"===s?{account:c,keyType:s}:{keyType:s},limits:a?.map(({token:e,limit:t,period:r})=>({token:e,limit:tM.oB(t),...r?{period:r7(r)}:{}})),signature:rK(o),...f?{allowedCalls:f}:{},...void 0!==u?{witness:u}:{},...l?{isAdmin:!0}:{},...void 0!==c?{account:c}:{}}}function r4(e){nr(e.type,e.account);let{address:t,chainId:r,scopes:n,expiry:i,limits:a,witness:s,isAdmin:o,account:u}=e;void 0!==s&&nn(s);let l=(()=>{if(e.signature)return ni(e.signature),rH(e.signature)})(),c=e.type,f=(()=>{switch(c){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";case"multisig":return"0x03";default:throw Error(`Invalid key type: ${c}`)}})(),d=a?.map(e=>{let t=[e.token,r9(e.limit)];return e.period&&e.period>0&&t.push(r7(e.period)),t}),p=(()=>{if(!n)return;let e=new Map;for(let t of n){let r=t.address;e.has(r)||e.set(r,[]),t.selector&&e.get(r).push([nt(t.selector),t.recipients??[]])}return[...e.entries()].map(([e,t])=>[e,t.map(([e,t])=>[e,t])])})(),h=void 0!==s||o||void 0!==u,m=[{value:null!=i&&0!==i?r7(i):void 0,placeholder:"0x"},{value:d,placeholder:h?"0x":[]},{value:p,placeholder:"0x"},{value:s,placeholder:"0x"},{value:o?"0x01":void 0,placeholder:"0x"},{value:u,placeholder:"0x"}],y=-1;for(let e=m.length-1;e>=0;e--)if(void 0!==m[e].value){y=e;break}let g=m.slice(0,y+1).map(({value:e,placeholder:t})=>e??t);return[[r9(r),f,t,...g],...l?[l]:[]]}function r9(e){return 0n===e?"0x":tM.oB(e)}function r7(e){return 0===e?"0x":tM.oB(e)}function ne(e){return"0x"===e?0:tM.Ro(e)}function nt(e){if(e)return e.startsWith("0x")?e:tD.go(e)}function nr(e,t){if("multisig"===e&&null==t)throw new nl}function nn(e){if(32!==tM.Ej(e))throw new ns(e)}function ni(e){if("keychain"===e.type)throw new nu(e.type)}function na(e){return void 0===e||"0x"===e}
11class ns extends Error{constructor(e){super(`Witness \`${e}\` must be exactly 32 bytes (got ${tM.Ej(e)} bytes).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidWitnessSizeError"})}}class no extends Error{constructor(e){super(`Admin marker \`${e}\` is invalid; expected \`0x01\` (TIP-1049).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidAdminMarkerError"})}}class nu extends Error{constructor(e){super(`Signature type \`${e}\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, \`webAuthn\`, or \`multisig\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidSignatureTypeError"})}}class nl extends Error{constructor(){super("Multisig key grants require a parent account binding."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.MissingAccountError"})}}class nc extends tU.C{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${tM.Ej(e)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}let nf={wei:0,gwei:9,szabo:12,finney:15,ether:18};function nd(e,t="wei"){return function(e,t=0){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,a]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${a?`.${a}`:""}`}(e,nf.gwei-nf[t])}tU.C;class np extends tU.C{constructor({feeCap:e}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${e?` = ${nd(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}tU.C;class nh extends tU.C{constructor({chainId:e}){super(void 0!==e?`Chain ID "${e}
11" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class nm extends tU.C{constructor({attributes:e,serialized:t,type:r}){const n=Object.entries(e).map(([e,t])=>void 0===t?e:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${r}" was provided.`,{metaMessages:[`Serialized Transaction: "${t}"`,n.length>0?`Missing Attributes: ${n.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class ny extends tU.C{constructor({maxPriorityFeePerGas:e,maxFeePerGas:t}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${nd(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${t?` = ${nd(t)} gwei`:""}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function ng(e){let{address:t,chainId:r,nonce:n}=e,i=rF(e.signature);return{address:t,chainId:Number(r),nonce:BigInt(n),signature:i}}function nb(e){if("string"==typeof e){let t=r0(e);return tR.vA(t),t}let t=tM.oB(e,{size:18});return tM.xW("0x20c0",t)}let nw="0x78",nv="tempo";function nx(e){let{calls:t,chainId:r,maxFeePerGas:n,maxPriorityFeePerGas:i,validBefore:a,validAfter:s}=e;if(!t||0===t.length)throw new nA;if("number"==typeof a&&"number"==typeof s&&a<=s)throw new nI({validBefore:a,validAfter:s});if(t)for(let e of t)e.to&&tR.vA(e.to,{strict:!1});if(r<=0)throw new nh({chainId:r});if(n&&BigInt(n)>2n**256n-1n)throw new np({feeCap:n});if(i&&n&&i>n)throw new ny({maxFeePerGas:n,maxPriorityFeePerGas:i})}function n$(e){let t=tW(tM.di(e,1)),[r,n,i,a,s,o,u,l,c,f,d,p,h,m,y]=t,g=Array.isArray(m)?m:void 0,b=g?y:m;if(13!==t.length&&14!==t.length&&15!==t.length)throw new nm({attributes:{authorizationList:h,chainId:r,maxPriorityFeePerGas:n,maxFeePerGas:i,gas:a,calls:s,accessList:o,keyAuthorization:g,nonceKey:u,nonce:l,validBefore:c,validAfter:f,feeToken:d,feePayerSignatureOrSender:p,...t.length>12?{signature:b}:{}},serialized:e,type:nv});let w={chainId:Number(r),type:nv};tM.tf(a)&&"0x"!==a&&(w.gas=BigInt(a)),tM.tf(l)&&(w.nonce="0x"===l?0n:BigInt(l)),tM.tf(i)&&"0x"!==i&&(w.maxFeePerGas=BigInt(i)),tM.tf(n)&&"0x"!==n&&(w.maxPriorityFeePerGas=BigInt(n)),tM.tf(u)&&(w.nonceKey="0x"===u?0n:BigInt(u)),tM.tf(c)&&"0x"!==c&&(w.validBefore=Number(c)),tM.tf(f)&&"0x"!==f&&(w.validAfter=Number(f)),tM.tf(d)&&"0x"!==d&&(w.feeToken=d),s&&"0x"!==s&&(w.calls=s.map(e=>{let[t,r,n]=e,i={};return t&&"0x"!==t&&(i.to=t),r&&"0x"!==r&&(i.value=BigInt(r)),n&&"0x"!==n&&(i.data=n),i})),o?.length!==0&&"0x"!==o&&(w.accessList=function(e){let t=[];for(let r=0;r<e.length;r++){let[n,i]=e[r];n&&tR.vA(n,{strict:!1}),t.push({address:n,storageKeys:i.map(e=>tL.tf(e)?e:tM.Mr(e))})}return t}(o)),h?.length!==0&&"0x"!==h&&(w.authorizationList=function(e){let t=[];for(let r of e)t.push(function(e){let[t,r,n,i]=e,a={address:r,chainId:"0x"===t?0:Number(t),nonce:"0x"===n?0n:BigInt(n)};return i&&(a.signature=rD(i)),function(e,t={}){if("string"==typeof e.chainId)return ng(e);let r={...e,address:r0(e.address)};return t.signature?{...r,signature:t.signature}:r}(a)}(r));return t}(h)),"0x"!==p&&void 0!==p&&("0x00"===p||tR.tf(p)?(w.feePayerSignature=null,tR.tf(p)&&(w.from=p)):w.feePayerSignature=rr.Bm(p)),g&&(w.keyAuthorization=r5(g));let v=b?rD(b):void 0;if(v&&(w={...w,signature:v}),!w.from&&v)try{w.from=rL({payload:n_(nE(w)),signature:v,root:!0})}catch{}return nx(w),w}function nE(e,t={}){let{feePayerSignature:r,signature:n}=t,i="string"==typeof e?n$(e):e;return i.from&&(i.from=r0(i.from)),i.calls&&(i.calls=i.calls.map(e=>({...e,...e.to?{to:r0(e.to)}:{}}))),nx(i),{...i,...n?{signature:rq(n)}:{},...r?{feePayerSignature:rr.HT(r)}:{},type:"tempo"}}function nP(e,t={}){let{accessList:r,authorizationList:n,calls:i,chainId:a,feeToken:s,gas:o,keyAuthorization:u,nonce:l,nonceKey:c,maxFeePerGas:f,maxPriorityFeePerGas:d,validBefore:p,validAfter:h}=e;nx(e);let m=function(e){if(!e||0===e.length)return[];let t=[];for(let{address:r,storageKeys:n}of e){for(let e=0;e<n.length;e++)if(32!==tM.Ej(n[e]))throw new nc({storageKey:n[e]});
11r&&tR.vA(r,{strict:!1}),t.push([r,n])}return t}(r),y=t.signature||e.signature,g=function(e){if(!e||0===e.length)return[];let t=[];for(let r of e)t.push(function(e){let{address:t,chainId:r,nonce:n}=e,i=e.signature?rH(e.signature):void 0;return[r?tM.oB(r):"0x",t,n?tM.oB(n):"0x",...i?[i]:[]]}(r));return t}(n),b=i.map(e=>[e.to?r0(e.to):"0x",e.value?tM.oB(e.value):"0x",e.data??"0x"]),w=!1,v=(()=>{if(t.sender)return t.sender;if("feePayer"===t.format&&y){let t=rq(y);if("keychain"===t.type)return t.userAddress;if("p256"===t.type||"webAuthn"===t.type)return tR.bI(t.publicKey);if("secp256k1"===t.type){var r;return r={payload:n_(nE(e)),signature:t.signature},tR.bI(rt(r))}}let n=void 0!==t.feePayerSignature?t.feePayerSignature:e.feePayerSignature;return null===n?(w=!0,"0x00"):n?rr._7(n):"0x"})(),x=[tM.oB(a),d?tM.oB(d):"0x",f?tM.oB(f):"0x",o?tM.oB(o):"0x",b,m,c?tM.oB(c):"0x",l?tM.oB(l):"0x","number"==typeof p?tM.oB(p):"0x","number"==typeof h?tM.oB(h):"0x",w||"bigint"!=typeof s&&"string"!=typeof s?"0x":nb(s),v,g,...u?[r4(u)]:[],...y?[rH(rq(y))]:[]];return tM.xW("feePayer"===t.format?nw:"0x76",tV(x))}function n_(e,t={}){let r=function(e,t={}){let r=t.presign?nP({...e,signature:void 0,...void 0!==e.feePayerSignature?{feePayerSignature:null}:{}}):nP(e);return tL.So(r)}(e,{presign:!0});return t.from?tL.So(tM.xW("0x04",r,r0(t.from))):r}class nA extends tU.C{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class nI extends tU.C{constructor({validBefore:e,validAfter:t}){super(`validBefore (${e}) must be greater than validAfter (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}async function nS(e){let{account:t,approvals:r,hash:n}=e;if(!tR.tf(t)||0n===tM.Dg(t))throw new nN({reason:"account is invalid"});if(!tL.tf(n))throw new nN({reason:"hash is invalid"});return nk({account:t,approvals:r,config:r_(e.config),hash:n})}function nz(e){try{let n=e.config?.version;if("string"!=typeof n||!tM.tf(n))throw new nM({reason:"config.version must be a hexadecimal quantity"});let i=tM.Dg(n);if(tM.oB(i)!==n)throw new nM({reason:"config.version must use canonical quantity encoding"});var t={...e,config:rA(e.config)};try{let e=r_(t.config);if("number"!=typeof e.threshold||e.owners.some(e=>"number"!=typeof e.weight))throw new nM({reason:"config threshold and owner weights must be numbers"});let n={...t,config:e};if(function(e,t){if(!tR.tf(e.account))throw new nM({reason:"account is invalid"});if(0n===tM.Dg(e.account))throw new nM({reason:"account cannot be zero"});if(!tL.tf(e.hash))throw new nM({reason:"hash is invalid"});if(nj(e.createdAt,"createdAt"),nj(e.updatedAt,"updatedAt"),e.updatedAt<e.createdAt)throw new nM({reason:"updatedAt cannot precede createdAt"});if(nj(e.signatureCount,"signatureCount"),nj(e.threshold,"threshold"),nj(e.weight,"weight"),e.threshold!==Number(t.threshold))throw new nM({reason:"threshold must equal config.threshold"});if(e.weight>255)throw new nM({reason:"weight exceeds u8 max"});if(e.signatureCount>8)throw new nM({reason:"too many selected signatures"});if(!Array.isArray(e.approvals))throw new nM({reason:"approvals must be an array"});if(e.approvals.length>t.owners.length)throw new nM({reason:"too many retained approvals"});if(e.signatureCount>e.approvals.length)throw new nM({reason:"signatureCount exceeds retained approvals"});if(0===e.signatureCount!=(0===e.weight))throw new nM({reason:"signatureCount and weight must both be zero or nonzero"});let r=new Map(t.owners.map(e=>[e.owner.toLowerCase(),Number(e.weight)])),n=[],i=new Set;for(let a of e.approvals){if("string"!=typeof a||!tM.tf(a,{strict:!0}))throw new nM({reason:"approval is invalid"});let s=nT(e.account,a,t),o=rL({payload:e.hash,signature:s}).toLowerCase(),u=r.get(o);if(void 0===u)throw new nM({reason:"approval is from a non-owner"});if(i.has(o))throw new nM({reason:"keyAuthorization"===e.type?"key authorization contains duplicate owner approvals":"duplicate owner approval"});i.add(o),n.push(u)}if(!function(e,t,r){let n=Array.from({length:t+1},()=>new Set);for(let r of(n[0].add(0),e))for(let e=t;e>0;e--)for(let t of n[e-1])n[e].add(t+r);return n[t].has(r)}(n,e.signatureCount,e.weight))throw new nM({reason:"weight is not reachable by signatureCount retained owner approvals"})}(n,e),"transaction"===n.type){var r=n;if("keyAuthorization"in r&&void 0!==r.keyAuthorization)throw new nM({reason:"transaction operations cannot contain keyAuthorization"});let e=r.expiresAt,t=r.submissionId,i=r.transactionHash;if("pending"===r.status){if(void 0!==e||void 0!==t||void 0!==i)throw new nM({reason:"pending transactions cannot contain submission fields"})}
11else if("submitting"===r.status){if(nj(e,"expiresAt"),!tL.tf(t??""))throw new nM({reason:"submissionId is invalid"});if(t.toLowerCase()===r.hash.toLowerCase())throw new nM({reason:"submissionId must differ from the operation hash"});if(void 0!==i)throw new nM({reason:"submitting transactions cannot contain transactionHash"})}else if("success"===r.status){if(!tL.tf(i??""))throw new nM({reason:"transactionHash is invalid"});if(void 0!==e||void 0!==t)throw new nM({reason:"successful transactions cannot contain submission fields"})}else throw new nM({reason:"invalid transaction status"});if("pending"!==r.status&&(r.weight<r.threshold||0===r.signatureCount))throw new nM({reason:"submitted transactions must have quorum"});if("string"!=typeof r.transaction)throw new nM({reason:"transaction is invalid"});let a=n$(r.transaction);if(a.signature)throw new nM({reason:"transaction must not contain an outer sender signature"});if(a.from&&a.from.toLowerCase()!==r.account.toLowerCase())throw new nM({reason:"transaction sender does not match the operation account"});if(nB(r,n_(a)),nP(a,r.transaction.startsWith(nw)?a.from?{format:"feePayer",sender:a.from}:{format:"feePayer"}:{}).toLowerCase()!==r.transaction.toLowerCase())throw new nM({reason:"transaction is not canonically serialized"})}else if("keyAuthorization"===n.type)!function(e,t){if(void 0!==e.expiresAt||void 0!==e.submissionId||void 0!==e.transaction||void 0!==e.transactionHash)throw new nM({reason:"key authorization operations cannot contain transaction fields"});if("pending"!==e.status&&"success"!==e.status)throw new nM({reason:"invalid key authorization status"});if("success"===e.status&&(e.weight<e.threshold||0===e.signatureCount))throw new nM({reason:"successful key authorizations must have quorum"});if("pending"===e.status&&e.weight>=e.threshold)throw new nM({reason:"pending key authorizations cannot have quorum"});if("string"!=typeof e.keyAuthorization)throw new nM({reason:"keyAuthorization is invalid"});let r=r5(tW(e.keyAuthorization));if(!r.account||r.account.toLowerCase()!==e.account.toLowerCase())throw new nM({reason:"key authorization account does not match the operation account"});let n=r.signature;if("pending"===e.status&&n)throw new nM({reason:"pending key authorizations must be unsigned"});if("success"===e.status){var i,a;let s,o;if(n?.type!=="multisig")throw new nM({reason:"successful key authorizations require a multisig signature"});if(n.account.toLowerCase()!==e.account.toLowerCase())throw new nM({reason:"key authorization signature account does not match"});if(n.signatures.length!==e.signatureCount)throw new nM({reason:"key authorization signatureCount does not match its signature"});if(function(e,t,r){let n=e.approvals.map(e=>rD(e));for(let e of t){let t=n.findIndex(t=>rH(t).toLowerCase()===rH(e).toLowerCase());if(-1===t)throw new nM({reason:"key authorization signature is not a retained approval"});n.splice(t,1)}let i=rI({account:e.account,config:e.config,payload:r8(r)}),a=t.map(e=>rL({payload:i,signature:e}));for(let e=1;e<a.length;e++){let t=tM.Dg(a[e-1]),r=tM.Dg(a[e]);if(t===r)throw new nM({reason:"key authorization contains duplicate owner approvals"});if(t>r)throw new nM({reason:"key authorization approvals are not canonically ordered"})}}(e,n.signatures,r),i=n.config,a=t,s=r_(i),o=r_(a),!(tM.n4(s.salt??rE,o.salt??rE)&&s.threshold===o.threshold&&s.version===o.version&&s.owners.length===o.owners.length&&s.owners.every((e,t)=>{let r=o.owners[t];return tR.n4(e.owner,r.owner)&&e.weight===r.weight})))throw new nM({reason:"key authorization config does not match"})}if(nB(e,r8(r)),tV(r4(r)).toLowerCase()!==e.keyAuthorization.toLowerCase())throw new nM({reason:"keyAuthorization is not canonically serialized"})}(n,e);else throw new nM({reason:"unknown operation type"});return n}catch(e){if(e instanceof nM)throw e;throw new nM({cause:e})}}catch(e){if(e instanceof nM)throw e;throw new nM({cause:e})}}async function nk(e){let t=new Map(e.config.owners.map(e=>[e.owner.toLowerCase(),{address:e.owner,weight:Number(e.weight)}])),r=new Map;for(let n of e.approvals){let i=rq(n);
11if("keychain"===i.type||"multisig"===i.type)throw new nN({reason:"only primitive signatures can approve a multisig operation"});let a=rL({payload:e.hash,signature:i}),s=t.get(a.toLowerCase());if(!s)throw new nN({reason:`signature is from non-owner ${a}`});let o=a.toLowerCase(),u=r.get(o);u?u.signatures.push(i):r.set(o,{address:s.address,signatures:[i],weight:s.weight})}let n=[],i=[];for(let t of r.values()){let r=t.signatures.map(r=>{if(!rG(r,{address:t.address,payload:e.hash}))throw new nN({reason:`signature from owner ${t.address} is invalid`});return rH(r)}).sort(nC)[0];n.push({address:t.address,signature:r,weight:t.weight}),i.push({address:t.address,signature:r})}let a=n.sort((e,t)=>t.weight-e.weight||nO(e,t)),s=[],o=0;for(let t of a.slice(0,8)){if(o>=Number(e.config.threshold))break;s.push(t),o+=t.weight}return s.sort(nO),{approvals:i.sort(nO).map(e=>e.signature),selectedApprovals:s.map(e=>e.signature),signatureCount:s.length,threshold:Number(e.config.threshold),weight:o}}function nO(e,t){let r=tM.Dg(e.address),n=tM.Dg(t.address);return r<n?-1:+(r>n)}function nC(e,t){let r=e.toLowerCase(),n=t.toLowerCase();return r<n?-1:+(r>n)}function nT(e,t,r){let n=rD(t);if("keychain"===n.type||"multisig"===n.type)throw new nM({reason:"only primitive owner approvals are allowed"});if(rM({account:e,config:r,signatures:[n],type:"multisig"}),rH(n).toLowerCase()!==t.toLowerCase())throw new nM({reason:"approval is not canonical"});return n}function nB(e,t){if(rI({account:e.account,config:e.config,payload:t}).toLowerCase()!==e.hash.toLowerCase())throw new nM({reason:"hash does not match the operation payload"})}function nj(e,t){if("number"!=typeof e||!Number.isSafeInteger(e)||e<0)throw new nM({reason:`${t} must be a nonnegative safe integer`})}class nN extends tU.C{constructor(e={}){super(e.reason?`Invalid multisig approval: ${e.reason}.`:"Invalid multisig approval.",{cause:e.cause}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigOperation.InvalidApprovalError"})}}class nM extends tU.C{constructor(e={}){super(e.reason?`Invalid multisig operation: ${e.reason}.`:"Invalid multisig operation.",{cause:e.cause}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigOperation.InvalidOperationError"})}}var nR=r(74833),nU=r(33828),nL=r(18231),nD=r(28285),nq=r(53385),nF=r(39606),nW=r(43748),nH=r(73260),nV=r(18860),nK=r(27854),nG=r(27426),nZ=r(4181),nJ=r(4016);async function nY(e,t){return nY.internal(e,nG.v,"sendTransaction",t)}(nY||(nY={})).internal=async function(e,t,r,n){let{abi:i,account:a=e.account,address:s,args:o,functionName:u,...l}=n;if(void 0===a)throw new tk.T({docsPath:"/docs/contract/writeContract"});let c=a?(0,tz.J)(a):null,f=(0,nZ.p)({abi:i,args:o,functionName:u});try{return await (0,tP.T)(e,t,r)({data:f,to:s,account:c,...l})}catch(e){throw(0,nJ.j)(e,{abi:i,address:s,args:o,docsPath:"/docs/contract/writeContract",functionName:u,sender:c?.address})}};var nQ=r(71605),nX=r(93629);let n0={4217:{base:4217e5,range:100261e4},42431:{base:142431e4,range:0x2b1ac110}};function n1(e,t=4217){let{base:r,range:n}=function(e){if(4217===e||42431===e)return n0[e];throw new n2({sourceId:e})}(t);return r+e%n}n0[4217].base;class n2 extends tU.C{constructor({sourceId:e}){super(`Source chain ID "${e}" is not supported.`,{metaMessages:["Supported source chain IDs: 4217, 42431."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ZoneId.UnsupportedSourceIdError"})}}n1(0),n1(0,42431);let n6="0xaAAAaaAA00000000000000000000000000000000",n5="0xAACC000000000000000000000000000000000000",n8="0xdec0000000000000000000000000000000000000";function n3(e){let t=rq(e);if("multisig"===t.type||"keychain"===t.type)throw Error("Multisig owners must use primitive signatures.");return t}var n4=r(72401),n9=r(71386),n7=r(96002),ie=r(80339),it=r(57723),ir=r(89762),ii=r(89950),ia=r(12581),is=r(94747),io=r(66568),iu=r(66347),il=r(14870),ic=r(22106);function id(e,t="hex"){let r=(()=>{if("string"==typeof e){if(e.length>3&&e.length%2!=0)throw new iu.G6(e);return(0,ic.aT)(e)}return e})(),n=(0,il.l)(r,{recursiveReadLimit:1/0}),i=function e(t,r="hex",n=0){if(n>=1024)throw new iu.u7({limit:1024});if(0===t.bytes.length)return"hex"===r?(0,tC.My)(t.bytes):t.bytes;let i=t.readByte();if(i<128&&t.decrementPosition(1),i<192){let e=ip(t,i,128),n=t.readBytes(e);return"hex"===r?(0,tC.My)(n):n}let a=ip(t,i,192);var s=t,o=a,u=r,l=n+1;let c=s.position,f=[];for(;s.position-c<o;)f.push(e(s,u,l));if(s.position-c!==o)throw new iu.IN({consumed:s.position-c,declared:o});return f}(n,t);if(n.position<n.bytes.length)throw new iu.ah({count:n.bytes.length-n.position});return i}function ip(e,t,r){if(128===r&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();
11throw new io.C("Invalid RLP prefix")}var ih=r(66113),im=r(81693);function iy(e){return id(`0x${e.slice(4)}`,"hex")}function ig(e){let t=[];for(let r=0;r<e.length;r++){let[n,i]=e[r];if(!(0,ie.P)(n,{strict:!1}))throw new n9.M({address:n});t.push({address:n,storageKeys:i.map(e=>(0,ir.q)(e)&&66===e.length?e:(0,ia.B)(e))})}return t}function ib(e){let t=e.slice(-3),r="0x"===t[0]?0n:(0,is.uU)(t[0]);if(0n!==r&&1n!==r)throw new n7.kb({yParity:r});let n=0n===r?27n:28n;return{r:(0,ii.db)(t[1],{size:32}),s:(0,ii.db)(t[2],{size:32}),v:n,yParity:+(27n!==n)}}var iw=r(88207);function iv(e){let t=e.account;return t?.keyType&&"secp256k1"!==t.keyType||t?.source==="accessKey"||t?.source==="multisig"||void 0!==e.calls||void 0!==e.feePayer||void 0!==e.feePayerSignature||void 0!==e.feeToken||void 0!==e.keyAuthorization||void 0!==e.multisigSimulation||void 0!==e.nonceKey||void 0!==e.owner||void 0!==e.signature||void 0!==e.signatures||void 0!==e.validBefore||void 0!==e.validAfter?"tempo":e.type?e.type:(0,n4.L)(e)}function ix(e){try{let t=iv(e);return"tempo"===t}catch{return!1}}function i$(e){let t,r=tM.di(e,0,1);return"0x76"===r||"0x78"===r?function(e){let{feePayerSignature:t,nonce:r,...n}=n$(e);return{...n,nonce:Number(r??0n),feePayerSignature:t?{r:tM.oB(t.r,{size:32}),s:tM.oB(t.s,{size:32}),yParity:t.yParity}:t}}(e):"eip1559"===(t=function(e){let t=(0,im.iN)(e,0,1);if("0x04"===t)return"eip7702";if("0x03"===t)return"eip4844";if("0x02"===t)return"eip1559";if("0x01"===t)return"eip2930";if("0x"!==t&&(0,is.ME)(t)>=192)return"legacy";throw new n7.gr({serializedType:t})}(e))?function(e){let t=iy(e),[r,n,i,a,s,o,u,l,c,f,d,p]=t;if(9!==t.length&&12!==t.length)throw new n7.UD({attributes:{chainId:r,nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:a,gas:s,to:o,value:u,data:l,accessList:c,...t.length>9?{v:f,r:d,s:p}:{}},serializedTransaction:e,type:"eip1559"});let h={chainId:(0,is.ME)(r),type:"eip1559"};return(0,ir.q)(o)&&"0x"!==o&&(h.to=o),(0,ir.q)(s)&&"0x"!==s&&(h.gas=(0,is.uU)(s)),(0,ir.q)(l)&&"0x"!==l&&(h.data=l),(0,ir.q)(n)&&(h.nonce="0x"===n?0:(0,is.ME)(n)),(0,ir.q)(u)&&"0x"!==u&&(h.value=(0,is.uU)(u)),(0,ir.q)(a)&&"0x"!==a&&(h.maxFeePerGas=(0,is.uU)(a)),(0,ir.q)(i)&&"0x"!==i&&(h.maxPriorityFeePerGas=(0,is.uU)(i)),0!==c.length&&"0x"!==c&&(h.accessList=ig(c)),(0,ih.xO)(h),{...12===t.length?ib(t):void 0,...h}}(e):"eip2930"===t?function(e){let t=iy(e),[r,n,i,a,s,o,u,l,c,f,d]=t;if(8!==t.length&&11!==t.length)throw new n7.UD({attributes:{chainId:r,nonce:n,gasPrice:i,gas:a,to:s,value:o,data:u,accessList:l,...t.length>8?{v:c,r:f,s:d}:{}},serializedTransaction:e,type:"eip2930"});let p={chainId:(0,is.ME)(r),type:"eip2930"};return(0,ir.q)(s)&&"0x"!==s&&(p.to=s),(0,ir.q)(a)&&"0x"!==a&&(p.gas=(0,is.uU)(a)),(0,ir.q)(u)&&"0x"!==u&&(p.data=u),(0,ir.q)(n)&&(p.nonce="0x"===n?0:(0,is.ME)(n)),(0,ir.q)(o)&&"0x"!==o&&(p.value=(0,is.uU)(o)),(0,ir.q)(i)&&"0x"!==i&&(p.gasPrice=(0,is.uU)(i)),0!==l.length&&"0x"!==l&&(p.accessList=ig(l)),(0,ih.p$)(p),{...11===t.length?ib(t):void 0,...p}}(e):"eip4844"===t?function(e){let t=iy(e),r=4===t.length,n=r?t[0]:t,i=r?t.slice(1):[],[a,s,o,u,l,c,f,d,p,h,m,y,g,b]=n,[w,v,x]=i;if(11!==n.length&&14!==n.length)throw new n7.UD({attributes:{chainId:a,nonce:s,maxPriorityFeePerGas:o,maxFeePerGas:u,gas:l,to:c,value:f,data:d,accessList:p,...n.length>9?{v:y,r:g,s:b}:{}},serializedTransaction:e,type:"eip4844"});let $={blobVersionedHashes:m,chainId:(0,is.ME)(a),to:c,type:"eip4844"};return(0,ir.q)(l)&&"0x"!==l&&($.gas=(0,is.uU)(l)),(0,ir.q)(d)&&"0x"!==d&&($.data=d),(0,ir.q)(s)&&($.nonce="0x"===s?0:(0,is.ME)(s)),(0,ir.q)(f)&&"0x"!==f&&($.value=(0,is.uU)(f)),(0,ir.q)(h)&&"0x"!==h&&($.maxFeePerBlobGas=(0,is.uU)(h)),(0,ir.q)(u)&&"0x"!==u&&($.maxFeePerGas=(0,is.uU)(u)),(0,ir.q)(o)&&"0x"!==o&&($.maxPriorityFeePerGas=(0,is.uU)(o)),0!==p.length&&"0x"!==p&&($.accessList=ig(p)),w&&v&&x&&($.sidecars=(0,it.T)({blobs:w,commitments:v,proofs:x})),(0,ih.zv)($),{...14===n.length?ib(n):void 0,...$}}(e):"eip7702"===t?function(e){let t=iy(e),[r,n,i,a,s,o,u,l,c,f,d,p,h]=t;if(10!==t.length&&13!==t.length)throw new n7.UD({attributes:{chainId:r,nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:a,gas:s,to:o,value:u,data:l,accessList:c,authorizationList:f,...t.length>9?{v:d,r:p,s:h}:{}},serializedTransaction:e,type:"eip7702"});let m={chainId:(0,is.ME)(r),type:"eip7702"};return(0,ir.q)(o)&&"0x"!==o&&(m.to=o),(0,ir.q)(s)&&"0x"!==s&&(m.gas=(0,is.uU)(s)),(0,ir.q)(l)&&"0x"!==l&&(m.data=l),(0,ir.q)(n)&&(m.nonce="0x"===n?0:(0,is.ME)(n)),(0,ir.q)(u)&&"0x"!==u&&(m.value=(0,is.uU)(u)),(0,ir.q)(a)&&"0x"!==a&&(m.maxFeePerGas=(0,is.uU)(a)),(0,ir.q)(i)&&"0x"!==i&&(m.maxPriorityFeePerGas=(0,is.uU)(i)),0!==c.length&&"0x"!==c&&(m.accessList=ig(c)),0!==f.length&&"0x"!==f&&(m.authorizationList=function(e){let t=[];for(let r=0;r<e.length;r++){let[n,i,a,s,o,u]=e[r];t.push({address:i,chainId:"0x"===n?0:(0,is.ME)(n),nonce:"0x"===a?0:(0,is.ME)(a),...ib([s,o,u])})}return t}
11(f)),(0,ih.dc)(m),{...13===t.length?ib(t):void 0,...m}}(e):function(e){let t=id(e,"hex"),[r,n,i,a,s,o,u,l,c]=t;if(6!==t.length&&9!==t.length)throw new n7.UD({attributes:{nonce:r,gasPrice:n,gas:i,to:a,value:s,data:o,...t.length>6?{v:u,r:l,s:c}:{}},serializedTransaction:e,type:"legacy"});let f={type:"legacy"};if((0,ir.q)(a)&&"0x"!==a&&(f.to=a),(0,ir.q)(i)&&"0x"!==i&&(f.gas=(0,is.uU)(i)),(0,ir.q)(o)&&"0x"!==o&&(f.data=o),(0,ir.q)(r)&&(f.nonce="0x"===r?0:(0,is.ME)(r)),(0,ir.q)(s)&&"0x"!==s&&(f.value=(0,is.uU)(s)),(0,ir.q)(n)&&"0x"!==n&&(f.gasPrice=(0,is.uU)(n)),(0,ih.og)(f),6===t.length)return f;let d=(0,ir.q)(u)&&"0x"!==u?(0,is.uU)(u):0n;if("0x"===c&&"0x"===l)return d>0&&(f.chainId=Number(d)),f;let p=Number((d-35n)/2n);if(p>0)f.chainId=p;else if(27n!==d&&28n!==d)throw new n7.zW({v:d});return f.v=d,f.s=c,f.r=l,f.yParity=+(d%2n===0n),f}(e)}async function iE(e,t){if(!ix(e)){if(t&&"type"in t&&"secp256k1"!==t.type)throw Error("Unsupported signature type. Expected `secp256k1` but got `"+t.type+"`.");if(t&&"type"in t){let{r,s:n,yParity:i}=t?.signature;return(0,iw.b)(e,{r:tM.oB(r,{size:32}),s:tM.oB(n,{size:32}),yParity:i})}return(0,iw.b)(e,t)}if("tempo"===iv(e))return iP(e,t);throw Error("Unsupported transaction type")}async function iP(e,t){let r,n=e.signature?e.signature:t&&"type"in t?t:t?rq({r:BigInt(t.r),s:BigInt(t.s),yParity:Number(t.yParity)}):void 0,{chainId:i,feePayer:a,multisigSimulation:s,nonce:o,owner:u,...l}=e,c=(r=e.feePayerSignature)?{r:BigInt(r.r),s:BigInt(r.s),yParity:Number(r.yParity)}:null===r||a?null:void 0,f=void 0!==e.feePayerSignature&&null!==e.feePayerSignature,d=void 0!==n||!!(s&&e.signatures),p={...l,calls:l.calls?.length?l.calls:[{to:l.to||(l.data&&"0x"!==l.data?void 0:"0x0000000000000000000000000000000000000000"),value:l.value,data:l.data}],chainId:Number(i),feePayerSignature:c,type:"tempo",...o?{nonce:BigInt(o)}:{}},h={...p};(!0!==a||d&&c)&&("object"!=typeof a||d)&&(d||!f)||delete h.feeToken;let m=(()=>{if(n)return n;if(!s||!e.signatures)return;let t=n_(nE(h)),r=e.signatures.map(e=>n3(e)),i=r_(s.config),a=e.from;if(!a)throw Error("A multisig sender is required for signing.");let o=rV({account:a,config:i,payload:t,signatures:r});return rq({account:a,config:i,signatures:o})})();if(m&&"object"==typeof e.feePayer){let t,r,n=nE(p,{signature:m}),i=e.from??rL({payload:n_(n),root:!0,signature:m}),a=(t=r0({sender:i}.sender),r=nP({...n,signature:void 0},{sender:t,format:"feePayer"}),tL.So(r)),s=await e.feePayer.sign({hash:a});return nP(n,{feePayerSignature:rr.HT(s)})}return!0===a||!m&&f?m&&c?nP(h,{signature:m}):m?nP(h,{format:"feePayer",sender:e.from,signature:m}):nP(h,{feePayerSignature:null}):nP(h,{feePayerSignature:void 0,signature:m})}function i_(e){let t=(()=>{if("string"==typeof e)return;let{address:t,...r}=e;return r})(),r=(()=>{if(!t)return;let e=t.owners.map(e=>"string"==typeof e||"address"in e?{owner:e,weight:1}:e);return r_({...t,owners:e.map(({owner:e,weight:t})=>({owner:"string"==typeof e?e:e.address,weight:t})),threshold:t.threshold??1})})();if("string"!=typeof e){if((void 0===e.address||"infer"===e.address)&&0n!==r.version)throw Error("An initial multisig config must have version zero.");if(void 0!==e.address&&"infer"!==e.address&&0n===r.version)throw Error("A current multisig config must have a version.")}let n=tR.cM("string"==typeof e?e:void 0===e.address||"infer"===e.address?function(e,t){var r;let n,i,a;if(tR.vA(t.factory),rP(e),0n!==BigInt(e.version??0))throw new rz({reason:"account address requires version zero"});let s=tL.So(tM.xW(tM.sH("tempo:multisig:account"),tM.Ho(e.salt??rE,32),tM.oB(e.threshold,{size:1}),tM.oB(e.owners.length,{size:1}),...e.owners.flatMap(e=>[e.owner,tM.oB(e.weight,{size:1})]))),o=(r={bytecodeHash:"0x583cc63a2e37f645b43eac911b1a6d6de08b83abdc308c61364edda8cfc3bd37",from:t.factory,salt:s},n=tq.aD(tR.HT(r.from)),i=tq.Ho(tq.tf(r.salt)?r.salt:tq.aD(r.salt),32),a="bytecodeHash"in r?tq.tf(r.bytecodeHash)?r.bytecodeHash:tq.aD(r.bytecodeHash):tL.So(r.bytecode,{as:"Bytes"}),tR.HT(tM.di(tL.So(tq.xW(tq.aD("0xff"),n,i,a),{as:"Hex"}),12)));if(0n===tM.Dg(o))throw new rz({reason:"derived account cannot be zero"});if(e.owners.some(e=>tR.n4(e.owner,o)))throw new rz({reason:"derived account cannot be an owner"});return o}(r,{factory:"0x7171717171717171717171717171717171717171"}):e.address),i=t?t.owners.flatMap(e=>{let t="string"==typeof e||"address"in e?e:e.owner;return"string"==typeof t?[]:[(0,tz.J)(t)]}):[];if(i.some(e=>"multisig"===e.source||iS(e)))throw Error("Multisig owners must use primitive signatures.");let a=r?.owners.flatMap(({owner:e})=>{let t=i.find(t=>tR.n4(t.address,e));return t?[t]:[]})??[],s={address:n,config:r,owners:a,publicKey:"0x",source:"multisig",type:"local",sign:async({hash:e})=>rH(await iI(s,{payload:e})),async signMessage(){throw Error("`signMessage` is not supported for multisig accounts.")},async signTransaction(e,t){let{serializer:r=iE}=t??{};if(e.owner){let r=(0,tz.J)(e.owner);if("local"!==r.type)throw Error("A local owner account is required to approve a multisig transaction.");
11if("root"!==r.source)throw Error("A Tempo owner account is required to approve a multisig transaction.");let{owner:n,...i}=e;return await r.signTransaction(i,t)}if(0===a.length)return await r(e);let i={...e,signatures:void 0,...void 0===e.feePayerSignature?{}:{feePayerSignature:null}},o=(0,nV.S)(await r(i)),u=e.multisigSimulation;if(e.from&&!tR.n4(e.from,n))throw Error("Multisig account does not match the transaction sender.");let l=await iI(s,{config:u?.config,payload:o,signatures:e.signatures?.map(e=>n3(e))});return await r(e,l)},async signTypedData(){throw Error("`signTypedData` is not supported for multisig accounts.")}};return s}function iA(e){return"multisig"===e.source}async function iI(e,t){let{config:r,payload:n,signatures:i=[]}=t,a=r??e.config;if(!a)throw Error("A current multisig config is required for local signing.");let s=rI({account:e.address,config:a,payload:n}),o=[...i],u=new Set,l=0;for(let e of i){let t=rL({payload:s,signature:e}).toLowerCase(),r=a.owners.find(e=>tR.n4(e.owner,t));!r||u.has(t)||(u.add(t),l+=Number(r.weight))}for(let t of[...a.owners].sort((e,t)=>Number(t.weight)-Number(e.weight)||e.owner.toLowerCase().localeCompare(t.owner.toLowerCase()))){if(l>=Number(a.threshold))break;let r=t.owner.toLowerCase();if(u.has(r))continue;let n=e.owners.find(e=>tR.n4(e.address,t.owner));if(n){if(!n.sign)throw Error("Multisig owner account cannot sign.");if(o.push(n3(await n.sign({hash:s}))),u.add(r),(l+=Number(t.weight))>=Number(a.threshold))break}}if(l<Number(a.threshold))throw Error("Local multisig owners do not meet the threshold.");return rq({account:e.address,config:a,signatures:rV({account:e.address,config:a,payload:n,signatures:o})})}function iS(e){return"accessKey"===e.source&&"accessKeyAddress"in e}function iz(e,t){let{admin:r,chainId:n,expiry:i,key:a,limits:s,scopes:o,witness:u}=t,{accessKeyAddress:l,keyType:c}=iO(a),f=iS(e)||iA(e)?{account:e.address}:{};return r8({address:l,chainId:n,type:c,witness:u,...r?{isAdmin:!0}:{},...f,...r?{}:{expiry:i,limits:s,scopes:o}})}async function ik(e,t){let{admin:r,chainId:n,expiry:i,key:a,limits:s,multisig:o,scopes:u,signatures:l,witness:c}=t,{accessKeyAddress:f,keyType:d}=iO(a),p=iS(e),h=iA(e),m=p||h?{account:e.address}:{},y=iz(e,t);return r2({address:f,chainId:n,signature:rq(await (async()=>{if(p)return e.sign({hash:y,raw:!0});if(h){if(!o)throw Error("Multisig state is required to sign a key authorization.");return rH(await iI(e,{config:o.config,payload:y,signatures:l?.map(e=>n3(e))}))}return e.sign({hash:y})})()),type:d,...c?{witness:c}:{},...r?{isAdmin:!0}:{},...m,...r?{}:{expiry:i,limits:s,scopes:u}})}function iO(e){return"accessKeyAddress"in e?{accessKeyAddress:e.accessKeyAddress,keyType:e.keyType}:"publicKey"in e&&e.publicKey?{accessKeyAddress:tR.bI(t9.aD(e.publicKey)),keyType:e.type}:{accessKeyAddress:e.address,keyType:e.type}}let iC=["genesis","t0","t1","t1a","t1b","t1c","t2","t3","t4","t5","t6"];function iT(e,t){let{decimals:r,token:n}=t;if(e&&"string"==typeof n){let t=function(e,t){let r=e.tokens,n=e.chain?.id;if(!r||void 0===n)return;let i=t.toLowerCase();for(let e of r)if(e.symbol?.toLowerCase()===i)return iB(e,n)}(e,n);if(t)return{address:t.address,decimals:r??t.decimals}}let i=nb(n);return{address:i,decimals:r??(e?function(e,t){let r=e.tokens,n=e.chain?.id;if(r&&void 0!==n)for(let e of r){let r=iB(e,n);if(r&&(0,nq.h)(r.address,t))return r.decimals}}(e,i):void 0)}}function iB(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}async function ij(e,t){let{address:r,decimals:n}=iT(e,t);return void 0!==n?{address:r,decimals:n}:{address:r,decimals:await (0,nK.J)(e,{abi:nX.gJ,address:r,functionName:"decimals"})}}function iN(e){let{account:t,chain:r,feePayer:n,feeToken:i,gas:a,keyAuthorization:s,maxFeePerGas:o,maxPriorityFeePerGas:u,nonce:l,nonceKey:c,owner:f,validAfter:d,validBefore:p}=e;return{account:t,chain:r,feePayer:n,feeToken:i,gas:a,keyAuthorization:s,maxFeePerGas:o,maxPriorityFeePerGas:u,nonce:l,nonceKey:c,owner:f,validAfter:d,validBefore:p}}function iM(e){return 2===e.length?e:[void 0,e[0]]}function iR(e){return{...e,data:(0,nZ.p)(e),to:e.address}}async function iU(e,t){let r=await e.request({method:"multisig_getConfig",params:[{address:t.address}]});return r?rA(r):null}async function iL(e,t){let{account:r,...n}=t;return(0,nK.J)(e,{...n,...iL.call({account:r})})}async function iD(e,t){return iD.inner(nY,e,t)}(iL||(iL={})).call=function(e){return iR({address:n5,abi:nX.cZ,args:[e.account],functionName:"getConfigCommitment"})};var iq=iD||(iD={});async function iF(e,t,r){let{account:n,currentConfig:i,nextConfig:a,...s}=r,o=n??t.account,u=(()=>
11{if("object"==typeof o&&"multisig"===o.source)return o})(),l=i||(u?.config?u.config:void 0),c=u?u.address:"string"==typeof o?o:o?o.address:void 0,f=await (async()=>{if(l)return r_(l);if(!c)throw Error("A multisig account address or current config is required.");let e=await iU(t,{address:c});if(!e)throw Error(`No current multisig config is cached for account ${c}. Provide the current config.`);return e})(),d=u?{...u,config:f}:"object"==typeof o?o:c?i_({address:c,...f}):void 0;return await e(t,{...s,...d?{account:d}:{},...iq.call({currentConfig:f,nextConfig:a})})}iq.inner=iF,iq.call=function(e){let t=r_(e.currentConfig),r=r_({owners:e.nextConfig.owners,salt:t.salt,threshold:e.nextConfig.threshold,version:t.version+1n});return iR({address:n5,abi:nX.cZ,args:[t,r.threshold,r.owners],functionName:"updateConfig"})},iq.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.cZ,logs:e,eventName:"MultisigConfigUpdated",strict:!0});if(!t)throw Error("`MultisigConfigUpdated` event not found.");return t};let iW={0:"secp256k1",1:"p256",2:"webAuthn"}
11,iH={true:"limited",false:"unlimited"};async function iV(e,t){return iV.inner(nG.v,e,t)}async function iK(e,t){return iK.inner(nY,e,t)}(u=iV||(iV={})).inner=async function(e,t,r){let{accessKey:n,admin:i,chainId:a=t.chain?.id,expiry:s,limits:o,scopes:u,witness:l,...c}=r,f=c.account??t.account;if(!f)throw Error("account is required.");if(!a)throw Error("chainId is required.");let d=await i5(t,{account:f,accessKey:n,chainId:a,admin:i,expiry:s,limits:o,scopes:u,witness:l});return await e(t,{...c,keyAuthorization:d})},u.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX._Y,logs:e,eventName:"KeyAuthorized",strict:!0});if(!t)throw Error("`KeyAuthorized` event not found.");return t};var iG=iK||(iK={});async function iZ(e,t,r){let{witness:n,...i}=r,a=iG.call({witness:n});return await e(t,{...i,...a})}async function iJ(e,t){let{account:r=e.account,accessKey:n,...i}=t;if(!r)throw Error("account is required.");let a=(0,tz.J)(r),s=await (0,nK.J)(e,{...i,account:null,...iJ.call({account:a.address,accessKey:n})});return{address:s.keyId,keyType:iW[s.signatureType]??"secp256k1",expiry:s.expiry,spendPolicy:iH[`${s.enforceLimits}`],isRevoked:s.isRevoked}}async function iY(e,t){let{account:r=e.account,accessKey:n,token:i,...a}=t;if(!r)throw Error("account is required.");let s=(0,tz.J)(r),o=e.chain?.hardfork;if(o&&iC.indexOf(o)<iC.indexOf("t3"))return{remaining:await (0,nK.J)(e,{...a,...iY.call({account:s.address,accessKey:n,token:i})}),periodEnd:void 0};let[u,l]=await (0,nK.J)(e,{...a,...iY.callWithPeriod({account:s.address,accessKey:n,token:i})});return{remaining:u,periodEnd:l}}async function iQ(e,t){let{account:r=e.account,accessKey:n,...i}=t;if(!r)throw Error("account is required.");let a=(0,tz.J)(r);return(0,nK.J)(e,{...i,account:null,...iQ.call({account:a.address,accessKey:n})})}async function iX(e,t){let{account:r=e.account,witness:n,...i}=t;if(!r)throw Error("account is required.");let a=(0,tz.J)(r);return(0,nK.J)(e,{...i,account:null,...iX.call({account:a.address,witness:n})})}async function i0(e,t){return i0.inner(nY,e,t)}iG.inner=iZ,iG.call=function(e){let{witness:t}=e;return iR({address:n6,abi:nX._Y,functionName:"burnKeyAuthorizationWitness",args:[t]})},iG.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX._Y,logs:e,eventName:"KeyAuthorizationWitnessBurned",strict:!0});if(!t)throw Error("`KeyAuthorizationWitnessBurned` event not found.");return t},(iJ||(iJ={})).call=function(e){let{account:t,accessKey:r}=e;return iR({address:n6,abi:nX._Y,functionName:"getKey",args:[t,i7(r)]})},(l=iY||(iY={})).call=function(e){let{account:t,accessKey:r,token:n}=e;return iR({address:n6,abi:nX._Y,functionName:"getRemainingLimit",args:[t,i7(r),n]})},l.callWithPeriod=function(e){let{account:t,accessKey:r,token:n}=e;return iR({address:n6,abi:nX._Y,functionName:"getRemainingLimitWithPeriod",args:[t,i7(r),n]})},(iQ||(iQ={})).call=function(e){let{account:t,accessKey:r}=e;return iR({address:n6,abi:nX._Y,functionName:"isAdminKey",args:[t,i7(r)]})},(iX||(iX={})).call=function(e){let{account:t,witness:r}=e;return iR({address:n6,abi:nX._Y,functionName:"isKeyAuthorizationWitnessBurned",args:[t,r]})};var i1=i0||(i0={});async function i2(e,t,r){let{accessKey:n,...i}=r,a=i1.call({accessKey:n});return await e(t,{...i,...a})}async function i6(e,t){let{chainId:r=e.chain?.id}=t,n=t.account??e.account;if(!n)throw Error("account is required.");if(!r)throw Error("chainId is required.");let i=(0,tz.J)(n),a=await (async()=>{if("multisig"in t)return t.multisig;if("multisig"===i.source){if(!i.config)throw Error("A multisig config is required to prepare a key authorization.");return{config:i.config}}})(),s=iz(i,{...t,chainId:BigInt(r),key:t.accessKey}),o="multisig"===i.source&&a?rI({account:i.address,config:a.config,payload:s}):s;return{...t,account:i,chainId:r,multisig:a,signPayload:o}}async function i5(e,t){if("hash"in t&&t.hash||"owner"in t&&t.owner){var r;let n=t.owner;if(!n||"string"==typeof n)throw Error("A local owner account is required to approve a multisig key authorization.");let i=(0,tz.J)(n).sign;if(!i)throw Error("A local owner account is required to approve a multisig key authorization.");let a=await (async()=>
11{if("hash"in t&&t.hash){let e=rH(rq(await i({hash:t.hash})));return{hash:t.hash,signature:e}}let{account:r,owner:n,...a}=t,s="string"==typeof r?r:r.address,o=await (async()=>{if("string"!=typeof r&&r.config)return r.config;let t=await iU(e,{address:s});if(t)return t;throw Error(`No current multisig config is cached for account ${s}. Provide the current config.`)})(),u=(()=>{if(0n!==o.version)return i_({address:s,...o});let{version:e,...t}=o;return i_({address:"infer",...t})})();if(!(0,nq.h)(u.address,s))throw Error("Initial multisig config does not match the account.");let l=await i6(e,{...a,account:u}),c=rH(rq(await i({hash:l.signPayload}))),{accessKey:f,admin:d,chainId:p,expiry:h,limits:m,scopes:y,witness:g}=l,{accessKeyAddress:b,keyType:w}=iO(f),v=r2({account:u.address,address:b,chainId:BigInt(p),signature:rq({account:u.address,config:o,signatures:[n3(c)]}),type:w,...g?{witness:g}:{},...d?{isAdmin:!0}:{expiry:h,limits:m,scopes:y}});return{keyAuthorization:r3(v)}})(),s=nz(await e.request({method:"multisig_approveKeyAuthorization",params:[a]})),o=(r=await (async()=>{if("success"===s.status)return s.keyAuthorization;let e=await nS({account:s.account,approvals:s.approvals,config:s.config,hash:s.hash});return function(e,t){let r=r5(tW(e));if(r.signature)throw new nM({reason:"keyAuthorization must not contain a signature"});if(tV(r4(r)).toLowerCase()!==e.toLowerCase())throw new nM({reason:"keyAuthorization is not canonically serialized"});let n=r_(t.config),i=rV({account:t.account,config:n,payload:r8(r),signatures:t.approvals.map(e=>nT(t.account,e,n))});return tV(r4(r2(r,{signature:rq({account:t.account,config:n,signatures:i})})))}(s.keyAuthorization,{account:s.account,approvals:e.selectedApprovals.length>0?e.selectedApprovals:e.approvals.slice(0,1),config:s.config})})(),r5(tW(r)));if(!o.signature)throw Error("Expected a signed multisig key authorization.");return{...o,hash:s.hash,multisig:s,status:s.status}}let{accessKey:n,account:i,chainId:a,multisig:s,signPayload:o,...u}="signPayload"in t?t:await i6(e,t);return ik(i,{chainId:BigInt(a),key:n,multisig:s,...u})}async function i8(e,t){return i8.inner(nY,e,t)}i1.inner=i2,i1.call=function(e){let{accessKey:t}=e;return iR({address:n6,abi:nX._Y,functionName:"revokeKey",args:[i7(t)]})},i1.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX._Y,logs:e,eventName:"KeyRevoked",strict:!0});if(!t)throw Error("`KeyRevoked` event not found.");return t};
11var i3=i8||(i8={});async function i4(e,t,r){let{accessKey:n,token:i,limit:a,...s}=r,o=i3.call({accessKey:n,token:i,limit:a});return await e(t,{...s,...o})}async function i9(e,t){let{account:r,admin:n,hash:i,signature:a,...s}=t;return(0,nK.J)(e,{...s,...i9.call({account:r,admin:n,hash:i,signature:a})})}function i7(e){return"string"==typeof e?e:e.accessKeyAddress}i3.inner=i4,i3.call=function(e){let{accessKey:t,token:r,limit:n}=e;return iR({address:n6,abi:nX._Y,functionName:"updateSpendingLimit",args:[i7(t),r,n]})},i3.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX._Y,logs:e,eventName:"SpendingLimitUpdated",strict:!0});if(!t)throw Error("`SpendingLimitUpdated` event not found.");return t},(i9||(i9={})).call=function(e){let{account:t,admin:r=!0,hash:n,signature:i}=e;return iR({address:"0x5165300000000000000000000000000000000000",abi:nX.tf,functionName:r?"verifyKeychainAdmin":"verifyKeychain",args:[t,n,i]})};var ae=r(98908);let at={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},ar={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"},an={...at,tempo:"0x76"},ai={...ar,"0x76":"tempo"};function aa(e){let{approvals:t,config:r}=e;return function(e){if(e.some(e=>"object"!=typeof e||null===e||"spec"in e||"type"in e))throw new as({reason:"only untagged primitive owner approvals are allowed"});if(e.length>8)throw new as({reason:"approval count exceeds 8"})}(t),{approvals:t.map(({keyData:e,keyType:t,owner:r})=>{var n;let i;return{...void 0!==e?{keyData:(n=e,(i=tM.Ej(n))<=4?n:tM.oB(i,{size:2}))}:{},...void 0!==t?{keyType:t}:{},owner:r}}),config:tV(rS(r))}}class as extends tU.C{constructor(e){super(`Invalid multisig simulation: ${e.reason}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigSimulation.InvalidSimulationError"})}}function ao(e){if(!e)return;let t=nz(e);if("transaction"!==t.type)throw Error("Expected a multisig transaction operation.");return t}function au(e){if(!e)return e;let t=(e.length-2)/2;return t<=4?e:tM.oB(t,{size:2})}let al=new Map;async function ac(e){al.set(e,(al.get(e)??0)+1),await Promise.resolve();let t=(al.get(e)??0)>1;return queueMicrotask(()=>{let t=al.get(e)??0;t<=1?al.delete(e):al.set(e,t-1)}),t}let af=(e,t)=>iE(e,t),ad={blockTime:1e3,extendSchema:(0,nF.i)(),formatters:{transaction:(0,nW.gU)({exclude:["aaAuthorizationList"],format:function(e){if(!ix(e))return(0,nW.uP)(e);let t=null==e.blockTimestamp?void 0:BigInt(e.blockTimestamp),r=e.multisig,{feePayerSignature:n,gasPrice:i,nonce:a,...s}=function(e,t={}){if(!e)return null;let r=function(e,t={}){if(!e)return null;let r=rr.o6(e),n={...e,...r};return n.blockNumber=e.blockNumber?BigInt(e.blockNumber):null,"blockTimestamp"in e&&(n.blockTimestamp=e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0),n.data=e.input,n.gas=BigInt(e.gas??0n),n.nonce=BigInt(e.nonce??0n),n.transactionIndex=e.transactionIndex?Number(e.transactionIndex):null,n.value=BigInt(e.value??0n),e.authorizationList&&(n.authorizationList=ae.G_(e.authorizationList)),e.chainId&&(n.chainId=Number(e.chainId)),e.gasPrice&&(n.gasPrice=BigInt(e.gasPrice)),e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=BigInt(e.maxFeePerBlobGas)),e.maxFeePerGas&&(n.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.type&&(n.type=ar[e.type]??e.type),r&&(n.v=rr.el(r.yParity)),n}(e);return r.type=ai[e.type],e.aaAuthorizationList&&(r.authorizationList=e.aaAuthorizationList.map(e=>ng(e)),delete r.aaAuthorizationList),e.calls&&(r.calls=e.calls.map(e=>({to:e.to,value:e.value&&"0x"!==e.value?BigInt(e.value):void 0,data:e.input||e.data||"0x"}))),e.feeToken&&(r.feeToken=e.feeToken),e.nonceKey&&(r.nonceKey=BigInt(e.nonceKey)),e.signature&&(r.signature=rF(e.signature)),e.validAfter&&(r.validAfter=Number(e.validAfter)),e.validBefore&&(r.validBefore=Number(e.validBefore)),e.keyAuthorization&&(r.keyAuthorization=r6(e.keyAuthorization)),e.feePayerSignature&&(r.feePayerSignature=rr.gX(e.feePayerSignature),r.feePayerSignature.v=rr.el(r.feePayerSignature.yParity)),r}(e);return{...s,accessList:s.accessList,...void 0!==t&&{blockTimestamp:t},feePayerSignature:n?{r:tM.oB(n.r,{size:32}),s:tM.oB(n.s,{size:32}),v:BigInt(n.v??27),yParity:n.yParity}:void 0,multisig:ao(r),nonce:Number(a),typeHex:an[s.type],type:s.type}}}),transactionReceipt:(0,nH.WB)({format:function(e){return{...(0,nH.uL)(e),multisig:ao(e.multisig),..."pending"===e.status?{status:"pending",type:"tempo"}:{}}}}),transactionRequest:(0,tT.bm)({format:function(e,t){var r,n;let i,a,s,o,u=e.account?(0,tz.J)(e.account):void 0,l=e.owner?(0,tz.J)(e.owner):void 0;if(l?.type==="json-rpc")throw Error("A local owner account is required to approve a multisig transaction.");
11if(!ix(e))return(0,tT.Bv)(e,t);t&&(e.calls=e.calls??[{to:e.to||(e.data&&"0x"!==e.data?void 0:"0x0000000000000000000000000000000000000000"),value:e.value,data:e.data}]),!0!==e.feePayer||e.feePayerSignature||delete e.feeToken;let{owner:c,signatures:f,...d}=e,p=(a=(n={...r={...d,type:"tempo"},authorizationList:void 0},i={},void 0!==n.accessList&&(i.accessList=n.accessList),void 0!==n.authorizationList&&(i.authorizationList=ae.lh(n.authorizationList)),void 0!==n.blobVersionedHashes&&(i.blobVersionedHashes=n.blobVersionedHashes),void 0!==n.blobs&&(i.blobs=n.blobs),void 0!==n.chainId&&(i.chainId=tM.oB(n.chainId)),void 0!==n.data?(i.data=n.data,i.input=n.data):void 0!==n.input&&(i.data=n.input,i.input=n.input),void 0!==n.from&&(i.from=n.from),void 0!==n.gas&&(i.gas=tM.oB(n.gas)),void 0!==n.gasPrice&&(i.gasPrice=tM.oB(n.gasPrice)),void 0!==n.maxFeePerBlobGas&&(i.maxFeePerBlobGas=tM.oB(n.maxFeePerBlobGas)),void 0!==n.maxFeePerGas&&(i.maxFeePerGas=tM.oB(n.maxFeePerGas)),void 0!==n.maxPriorityFeePerGas&&(i.maxPriorityFeePerGas=tM.oB(n.maxPriorityFeePerGas)),void 0!==n.maxPriorityFeePerGas&&(i.maxPriorityFeePerGas=tM.oB(n.maxPriorityFeePerGas)),void 0!==n.nonce&&(i.nonce=tM.oB(n.nonce)),void 0!==n.to&&(i.to=n.to),void 0!==n.type&&(i.type=at[n.type]||n.type),void 0!==n.value&&(i.value=tM.oB(n.value)),i),r.authorizationList&&(a.authorizationList=r.authorizationList.map(e=>(function(e){let{address:t,chainId:r,nonce:n,signature:i}=e;return{address:t,chainId:tM.oB(r),nonce:tM.oB(n),signature:rK(i)}})(e))),r.calls?a.calls=r.calls.map(e=>({to:e.to?r0(e.to):e.to,value:e.value?tM.oB(e.value):"0x",data:e.data??"0x"})):(r.to||r.data||r.value)&&(a.calls=[{to:r.to?r0(r.to):void 0,value:r.value?tM.oB(r.value):"0x",data:r.data??"0x"}]),void 0!==r.feeToken&&(a.feeToken=nb(r.feeToken)),r.keyAuthorization&&(a.keyAuthorization=r3(r.keyAuthorization)),r.keyAuthorizationSimulation&&(a.keyAuthorizationSimulation=aa(r.keyAuthorizationSimulation)),r.multisigSimulation&&(a.multisigSimulation=aa(r.multisigSimulation)),void 0!==r.validBefore&&(a.validBefore=tM.oB(r.validBefore)),void 0!==r.validAfter&&(a.validAfter=tM.oB(r.validAfter)),(s="random"===r.nonceKey?tM.yT(6):"bigint"==typeof r.nonceKey?tM.oB(r.nonceKey):void 0)&&(a.nonceKey=s),(void 0!==r.calls||void 0!==r.feePayer||void 0!==r.feeToken||void 0!==r.keyAuthorization||void 0!==r.multisigSimulation||void 0!==r.nonceKey||void 0!==r.validBefore||void 0!==r.validAfter||"tempo"===r.type)&&(a.type=an.tempo,delete a.data,delete a.input,delete a.to,delete a.value),a);"estimateGas"===t&&(p.maxFeePerGas=void 0,p.maxPriorityFeePerGas=void 0),p.to=void 0,p.data=void 0,p.value=void 0;let h=l??u,[m,y]=(o=h&&"keyType"in h?h.keyType:h?.source)?"webAuthn"===o?["webAuthn","0x0578"]:["p256","secp256k1"].includes(o)?[o,void 0]:[e.keyType,au(e.keyData)]:[e.keyType,au(e.keyData)],g=h&&"accessKeyAddress"in h?h.accessKeyAddress:e.keyId;return u&&(p.from=u.address),{...p,...e.capabilities?{capabilities:e.capabilities}:{},...y?{keyData:y}:{},...g?{keyId:g}:{},...m?{keyType:m}:{},...e.owner?{owner:void 0}:{},...void 0!==e.feePayer?{feePayer:"object"==typeof e.feePayer?(0,tz.J)(e.feePayer):e.feePayer}:{},..."feePayerSignature"in e&&void 0!==e.feePayerSignature?{feePayerSignature:e.feePayerSignature}:{}}}})},prepareTransactionRequest:[async(e,{client:t,phase:r})=>{let n;if(e.hash){if(!e.account||"string"==typeof e.account||"multisig"!==e.account.source)throw Error("A local multisig account is required to approve a stored multisig transaction.");if(!e.owner||"string"==typeof e.owner)throw Error("A local owner account is required to approve a stored multisig transaction.");if("root"!==e.owner.source)throw Error("A Tempo owner account is required to approve a stored multisig transaction.");let r=await (0,tP.T)(t,nU.x,"getTransaction")({hash:e.hash}),n="multisig"in r?r.multisig:void 0;if(!n)throw Error("Expected a multisig operation transaction.");if(!(0,nq.h)(n.account,e.account.address))throw Error("Multisig operation account does not match the requested account.");let i=i$(n.transaction);if((function(e){let{account:t,config:r}=e;return rI({account:t,config:r,payload:"transaction"===e.type?n_(n$(e.transaction)):r8(r5(tW(e.keyAuthorization)))})})({account:n.account,config:n.config,transaction:n.transaction,type:"transaction"}).toLowerCase()!==e.hash.toLowerCase())throw Error("Multisig operation hash does not match transaction.");return{...i,account:e.account,from:n.account,multisigSimulation:ap({config:n.config,local:e.account}),owner:e.owner}}if("afterFillParameters"===r)return void 0!==e.gas&&e.feePayer&&!e.feePayerSignature&&(e.keyAuthorization?.signature.type==="webAuthn"?e.gas=(e.gas??0n)+20000n:e.account?.source==="accessKey"&&(e.gas=(e.gas??0n)+10000n)),e;let i=(()=>
11{if(e.account?.source==="multisig")return{account:e.account.address,config:e.account.config,local:e.account}})();if(e.owner&&!i)throw Error("A multisig account is required when an owner is provided.");if(e.owner&&"string"==typeof e.owner)throw Error("A local owner account is required to approve a multisig transaction.");if(e.owner&&"root"!==e.owner.source)throw Error("A Tempo owner account is required to approve a multisig transaction.");let a=!!i&&!!e.owner&&!0===t.transport.multisig;if(i){let{account:r,local:n}=i;if(!r)throw Error("A multisig account address is required with a current config.");let s=await (async()=>{if(i.config)return i.config;if(!a)return;let e=await (0,tP.T)(t,iU,"getConfig")({address:r});if(!e)throw Error(`No current multisig config is cached for account ${r}. Provide the current config.`);return e})();if(!s)throw Error("A multisig config is required to prepare a transaction.");e.from=r,e.multisigSimulation=ap({config:s,local:n})}let s=await (async()=>{if("expiring"===e.nonceKey||e.nonceKey===nD.Ao)return!0;if(void 0!==e.nonceKey||i)return!1;if(e.feePayer&&void 0===e.nonceKey)return!0;let t=e.account,r="string"==typeof t?t:t?.address;return!!r&&void 0===e.nonceKey&&await ac(r.toLowerCase())})();if(a&&void 0===e.nonceKey?(e.nonceKey=tM.Dg(tM.yT(31))+1n,e.nonce=0):s?(e.nonceKey=nD.Ao,e.nonce=0,void 0===e.validAfter&&(e.validAfter=(n=BigInt(Math.floor(Date.now()/1e3))-60n)<=0n?0:Number(BigInt(tM.yT(8))%n)),void 0===e.validBefore&&(e.validBefore=Math.floor(Date.now()/1e3)+25)):void 0!==e.nonceKey&&(e.nonce="number"==typeof e.nonce?e.nonce:0),!e.keyAuthorization&&e.account?.source==="accessKey"){let r=e.account.keyAuthorizationManager;if(r){let n=e.chainId??e.chain?.id;if(void 0!==n){let i=e.account.address,a=e.account.accessKeyAddress,s={address:i,accessKey:a,chainId:n},o=await r.get(s);if(o){let n=BigInt(Math.floor(Date.now()/1e3));if(null!=o.expiry&&BigInt(o.expiry)<=n)await r.remove(s);else{let u=await (0,tP.T)(t,iJ,"getMetadata")({account:i,accessKey:a});(0,nq.h)(u.address,a)&&!u.isRevoked&&u.expiry>n?await r.remove(s):e.keyAuthorization=o}}}}}return!e.feeToken&&e.chain?.feeToken&&(e.feeToken=e.chain.feeToken),e},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:af,async transactionEnvelope({serializedTransaction:e,transaction:t}){if(!t.multisigSimulation)return e;try{rD(e)}catch{let t=i$(e);if(t.signature?.type==="multisig")return e;throw Error("A Tempo owner account is required to approve a multisig transaction.")}return await af({...t,signatures:[...t.signatures??[],e]})}},async verifyHash(e,t){let{address:r,hash:n,signature:i,mode:a}=t,s=(()=>{if("string"==typeof i)try{return rD(i)}catch{return}})();if(s){if(s?.type==="keychain"&&"allowAccessKey"===a){let i="v2"===s.version?(0,nV.S)(tM.xW("0x04",n,r)):n,a=(()=>{try{return rL({payload:i,signature:s.inner})}catch{return}})();if(!a)return!1;let o=await iJ(e,{account:r,accessKey:a,blockHash:t.blockHash,blockNumber:t.blockNumber,blockTag:t.blockTag,requireCanonical:t.requireCanonical});return!(o.isRevoked||o.expiry<=BigInt(Math.floor(Date.now()/1e3)))&&rG(s.inner,{address:a,payload:i})}if("p256"===s.type||"webAuthn"===s.type){let i=await (0,nR.Q)(e,{address:r,blockHash:t.blockHash,blockNumber:t.blockNumber,blockTag:t.blockTag,requireCanonical:t.requireCanonical});if(!i||"0xef01007702c00000000000000000000000000000000000"===i)return rG(s,{address:r,payload:n})}}return await (0,tP.T)(e,nL.KK,"verifyHash")({...t,chain:null})}};function ap(e){let{config:t,local:r}=e;return{approvals:(function(e){let t=[...e.owners].sort((e,t)=>Number(t.weight)-Number(e.weight)||e.owner.toLowerCase().localeCompare(t.owner.toLowerCase())),r=[],n=0;for(let i of t.slice(0,8)){if(n>=Number(e.threshold))break;r.push(i),n+=Number(i.weight)}return r.sort((e,t)=>e.owner.toLowerCase().localeCompare(t.owner.toLowerCase()))})(t).map(e=>{var t;let n;return{...(t=r?.owners.find(t=>(0,nq.h)(t.address,e.owner)),(n=(()=>
11{if(t&&"object"==typeof t&&"keyType"in t&&"string"==typeof t.keyType)return t.keyType})())&&"webAuthn"!==n&&("p256"===n||"secp256k1"===n)?{keyType:n}:{keyData:"0x0578",keyType:"webAuthn"}),owner:e.owner}}),config:t}}let ah=(0,nF.x)({...ad,id:4217,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},contracts:{earnFactory:{address:"0xb5889A96114014d4C032ebD76772c10bF3b97137"},erc4626EngineFactory:{address:"0xd43D00981222a8db444A528E69f19E3cE5A7D2Ff"}},name:"Tempo Mainnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.tempo.xyz"],webSocket:["wss://rpc.tempo.xyz"]}}}),am={defaultAdmin:"DEFAULT_ADMIN_ROLE",pause:"PAUSE_ROLE",unpause:"UNPAUSE_ROLE",issuer:"ISSUER_ROLE",burnBlocked:"BURN_BLOCKED_ROLE"};function ay(e){return"defaultAdmin"===e?"0x0000000000000000000000000000000000000000000000000000000000000000":tL.So(tM.sH(am[e]??e))}var ag=r(65725),ab=r(8356),aw=r(98900);async function av(e,t){return av.inner(nY,e,t)}async function ax(e,t){return ax.inner(nY,e,t)}!function(e){async function t(t,r,n){return await t(r,{...n,...e.call(r,n)})}async function r(t,r){return(0,ag.W)(t,{...iN(r),...e.call(t,r)})}async function n(t,r){return(0,ab.v)(t,{...iN(r),...e.call(t,r)})}e.inner=t,e.call=function(...e){let[t,r]=iM(e),{amount:n,spender:i,token:a}=r,{address:s,decimals:o}=iT(t,{token:a});return iR({address:s,abi:nX.gJ,functionName:"approve",args:[i,aw.Yr(n,o)]})},e.estimateGas=r,e.simulate=n,e.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"Approval"});if(!t)throw Error("`Approval` event not found.");return t}}(av||(av={}));var a$=ax||(ax={});async function aE(e,t,r){let{amount:n,from:i,token:a,...s}=r,o=a$.call(t,{amount:n,from:i,token:a});return await e(t,{...s,...o})}async function aP(e,t){return aP.inner(nY,e,t)}a$.inner=aE,a$.call=function(...e){let[t,r]=iM(e),{from:n,amount:i,token:a}=r,{address:s,decimals:o}=iT(t,{token:a});return iR({address:s,abi:nX.gJ,functionName:"burnBlocked",args:[n,aw.Yr(i,o)]})},a$.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"BurnBlocked"});if(!t)throw Error("`BurnBlocked` event not found.");return t};var a_=aP||(aP={});async function aA(e,t,r){let{amount:n,memo:i,token:a,...s}=r,o=a_.call(t,{amount:n,memo:i,token:a});return await e(t,{...s,...o})}async function aI(e,t){return aI.inner(nY,e,t)}a_.inner=aA,a_.call=function(...e){let[t,r]=iM(e),{amount:n,memo:i,token:a}=r,{address:s,decimals:o}=iT(t,{token:a}),u=aw.Yr(n,o),l=i?{functionName:"burnWithMemo",args:[u,tM.Ho(i,32)]}:{functionName:"burn",args:[u]};return iR({address:s,abi:nX.gJ,...l})},a_.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"Burn"});if(!t)throw Error("`Burn` event not found.");return t};var aS=aI||(aI={});async function az(e,t,r){let{policyId:n,token:i,...a}=r,s=aS.call(t,{policyId:n,token:i});return await e(t,{...a,...s})}async function ak(e,t){return ak.inner(nY,e,t)}aS.inner=az,aS.call=function(...e){let[t,r]=iM(e),{token:n,policyId:i}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"changeTransferPolicyId",args:[i]})},aS.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"TransferPolicyUpdate"});if(!t)throw Error("`TransferPolicyUpdate` event not found.");return t};var aO=ak||(ak={});async function aC(e,t,r){let{account:n=t.account,admin:i=t.account,chain:a=t.chain,...s}=r,o=i?(0,tz.J)(i):void 0;if(!o)throw Error("admin is required.");let u=aO.call(t,{...s,admin:o.address});return await e(t,{...r,account:n,chain:a,...u})}async function aT(e,t){let{account:r,decimals:n,spender:i,token:a,...s}=t,[o,{decimals:u}]=await Promise.all([(0,nK.J)(e,{...s,...aT.call(e,{account:r,spender:i,token:a})}),ij(e,{decimals:n,token:a})]);return aw.cP(o,u)}async function aB(e,t){let{account:r=e.account,decimals:n,token:i,...a}=t;if(!r)throw new tk.T;let s=(0,tz.J)(r).address,[o,{decimals:u}]=await Promise.all([(0,nK.J)(e,{...a,...aB.call(e,{account:s,token:i})}),ij(e,{decimals:n,token:i})]);return aw.cP(o,u)}async function aj(e,t){let{decimals:r,token:n,...i}=t,[a,{decimals:s}]=await Promise.all([(0,nK.J)(e,{...i,...aj.call(e,{token:n})}),ij(e,{decimals:r,token:n})]);return aw.cP(a,s)}async function aN(e,t){return(0,nK.J)(e,{...t,...aN.call(e,t)})}async function aM(e,t){let{account:r=e.account}=t,n=r?(0,tz.J)(r).address:void 0;if(!n)throw Error("account is required.");return(0,nK.J)(e,{...t,...aM.call(e,{...t,account:n})})}async function aR(e,t){return aR.inner(nG.v,e,t)}aO.inner=aC,aO.call=function(...e){let[t,r]=iM(e),{name:n,symbol:i,currency:a,logoURI:s,quoteToken:o="0x20c0000000000000000000000000000000000000",admin:u,salt:l=tM.yT(32)}=r;return iR({address:"0x20fc000000000000000000000000000000000000",abi:nX.Cz,args:"string"==typeof s?[n,i,a,iT(t,{token:o}).address,u,l,s]:[n,i,a,iT(t,{token:o}
11).address,u,l],functionName:"createToken"})},aO.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.Cz,logs:e,eventName:"TokenCreated",strict:!0});if(!t)throw Error("`TokenCreated` event not found.");return t},(aT||(aT={})).call=function(...e){let[t,r]=iM(e);return iR({address:iT(t,r).address,abi:nX.gJ,functionName:"allowance",args:[r.account,r.spender]})},(aB||(aB={})).call=function(...e){let[t,r]=iM(e),n=r.account??t?.account;if(!n)throw new tk.T;let i=(0,tz.J)(n).address;return iR({address:iT(t,r).address,abi:nX.gJ,functionName:"balanceOf",args:[i]})},(aj||(aj={})).call=function(...e){let[t,r]=iM(e);return iR({address:iT(t,r).address,abi:nX.gJ,args:[],functionName:"totalSupply"})},(aN||(aN={})).call=function(...e){let[t,r]=iM(e),{role:n,token:i}=r;return iR({address:iT(t,{token:i}).address,abi:nX.gJ,functionName:"getRoleAdmin",args:[ay(n)]})},(aM||(aM={})).call=function(...e){let[t,r]=iM(e),{account:n,role:i,token:a}=r;return iR({address:iT(t,{token:a}).address,abi:nX.gJ,functionName:"hasRole",args:[n,ay(i)]})};var aU=aR||(aR={});async function aL(e,t,r){return await e(t,{...r,calls:r.roles.map(e=>{let n=aU.call(t,{...r,role:e});return{...n,data:(0,nZ.p)(n)}})})}async function aD(e,t){return aD.inner(nY,e,t)}aU.inner=aL,aU.call=function(...e){let[t,r]=iM(e),{token:n,to:i,role:a}=r,s=ay(a);return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"grantRole",args:[s,i]})},aU.extractEvents=function(e){let t=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"RoleMembershipUpdated"});if(0===t.length)throw Error("`RoleMembershipUpdated` events not found.");return t};var aq=aD||(aD={});async function aF(e,t,r){let{amount:n,memo:i,to:a,token:s,...o}=r,u=aq.call(t,{amount:n,memo:i,to:a,token:s});return await e(t,{...o,...u})}async function aW(e,t){return aW.inner(nY,e,t)}aq.inner=aF,aq.call=function(...e){let[t,r]=iM(e),{to:n,amount:i,memo:a,token:s}=r,{address:o,decimals:u}=iT(t,{token:s}),l=aw.Yr(i,u),c=a?{functionName:"mintWithMemo",args:[n,l,tM.Ho(a,32)]}:{functionName:"mint",args:[n,l]};return iR({address:o,abi:nX.gJ,...c})},aq.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"Mint"});if(!t)throw Error("`Mint` event not found.");return t};var aH=aW||(aW={});async function aV(e,t,r){let{token:n,...i}=r,a=aH.call(t,{token:n});return await e(t,{...i,...a})}async function aK(e,t){return aK.inner(nG.v,e,t)}aH.inner=aV,aH.call=function(...e){let[t,r]=iM(e),{token:n}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"pause",args:[]})},aH.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"PauseStateUpdate"});if(!t)throw Error("`PauseStateUpdate` event not found.");return t};var aG=aK||(aK={});async function aZ(e,t,r){return await e(t,{...r,calls:r.roles.map(e=>{let n=aG.call(t,{...r,role:e});return{...n,data:(0,nZ.p)(n)}})})}async function aJ(e,t){return aJ.inner(nG.v,e,t)}aG.inner=aZ,aG.call=function(...e){let[t,r]=iM(e),{token:n,role:i}=r,a=ay(i);return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"renounceRole",args:[a]})},aG.extractEvents=function(e){let t=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"RoleMembershipUpdated"});if(0===t.length)throw Error("`RoleMembershipUpdated` events not found.");return t};var aY=aJ||(aJ={});async function aQ(e,t,r){let{from:n,...i}=r;return await e(t,{...i,calls:r.roles.map(e=>{let n=aY.call(t,{...r,role:e});return{...n,data:(0,nZ.p)(n)}})})}async function aX(e,t){return aX.inner(nY,e,t)}aY.inner=aQ,aY.call=function(...e){let[t,r]=iM(e),{token:n,from:i,role:a}=r,s=ay(a);return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"revokeRole",args:[s,i]})},aY.extractEvents=function(e){let t=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"RoleMembershipUpdated"});if(0===t.length)throw Error("`RoleMembershipUpdated` events not found.");return t};var a0=aX||(aX={});async function a1(e,t,r){let{supplyCap:n,token:i,...a}=r,s=a0.call(t,{supplyCap:n,token:i});return await e(t,{...a,...s})}async function a2(e,t){return a2.inner(nY,e,t)}a0.inner=a1,a0.call=function(...e){let[t,r]=iM(e),{token:n,supplyCap:i}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"setSupplyCap",args:[i]})},a0.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"SupplyCapUpdate"});if(!t)throw Error("`SupplyCapUpdate` event not found.");return t};var a6=a2||(a2={});async function a5(e,t,r){let{adminRole:n,role:i,token:a,...s}=r,o=a6.call(t,{adminRole:n,role:i,token:a});return await e(t,{...s,...o})}async function a8(e,t){return a8.inner(nY,e,t)}async function a3(e,t){return a3.inner(nY,e,t)}
11a6.inner=a5,a6.call=function(...e){let[t,r]=iM(e),{token:n,role:i,adminRole:a}=r,s=ay(i),o=ay(a);return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"setRoleAdmin",args:[s,o]})},a6.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"RoleAdminUpdated"});if(!t)throw Error("`RoleAdminUpdated` event not found.");return t},function(e){async function t(t,r,n){return await t(r,{...n,...e.call(r,n)})}async function r(t,r){return(0,ag.W)(t,{...iN(r),...e.call(t,r)})}async function n(t,r){return(0,ab.v)(t,{...iN(r),...e.call(t,r)})}e.inner=t,e.call=function(...e){let[t,r]=iM(e),{from:n,memo:i,to:a,token:s}=r,{address:o,decimals:u}=iT(t,{token:s}),l=aw.Yr(r.amount,u),c=i&&n?{functionName:"transferFromWithMemo",args:[n,a,l,tM.Ho(i,32)]}:i?{functionName:"transferWithMemo",args:[a,l,tM.Ho(i,32)]}:n?{functionName:"transferFrom",args:[n,a,l]}:{functionName:"transfer",args:[a,l]};return iR({address:o,abi:nX.gJ,...c})},e.estimateGas=r,e.simulate=n,e.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"Transfer"});if(!t)throw Error("`Transfer` event not found.");return t}}(a8||(a8={}));var a4=a3||(a3={});async function a9(e,t,r){let{token:n,...i}=r,a=a4.call(t,{token:n});return await e(t,{...i,...a})}async function a7(e,t){return a7.inner(nY,e,t)}a4.inner=a9,a4.call=function(...e){let[t,r]=iM(e),{token:n}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"unpause",args:[]})},a4.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"PauseStateUpdate"});if(!t)throw Error("`PauseStateUpdate` event not found.");return t};var se=a7||(a7={});async function st(e,t,r){let{quoteToken:n,token:i,...a}=r,s=se.call(t,{quoteToken:n,token:i});return await e(t,{...a,...s})}async function sr(e,t){return sr.inner(nY,e,t)}se.inner=st,se.call=function(...e){let[t,r]=iM(e),{token:n,quoteToken:i}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"setNextQuoteToken",args:[iT(t,{token:i}).address]})},se.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"NextQuoteTokenSet"});if(!t)throw Error("`NextQuoteTokenSet` event not found.");return t};var sn=sr||(sr={});async function si(e,t,r){let{token:n,...i}=r,a=sn.call(t,{token:n});return await e(t,{...i,...a})}function sa(e){let t=eq(JSON.stringify({challenge:{...e.challenge,request:eH(e.challenge.request)},payload:e.payload,...e.source&&{source:e.source}}),{pad:!1,url:!0});return`Payment ${t}`}function ss(e,t){let{context:r,createCredential:n}=t;return{...e,context:r,createCredential:n}}function so(e={}){let{account:t}=e;return(e,{account:r}={})=>{let n=r??t;if(!n){if(!e.account)throw Error("No `account` provided. Pass `account` to parameters or context.");return e.account}return(0,tz.J)(n)}}sn.inner=si,sn.call=function(...e){let[t,r]=iM(e),{token:n}=r;return iR({address:iT(t,{token:n}).address,abi:nX.gJ,functionName:"completeQuoteTokenUpdate",args:[]})},sn.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.gJ,logs:e,eventName:"QuoteTokenUpdate"});if(!t)throw Error("`QuoteTokenUpdateCompleted` event not found.");return t};var su=r(74696),sl=r(68170),sc=r(85177);function sf(e,t,r){let{policy:n="sign-only"}=r??{};return r=>{let i=e(r),a=t(r);return(0,sc.o)({key:sf.type,name:"Relay Proxy",async request({method:e,params:t},r){if("eth_fillTransaction"===e){let n=t?.[0];if(n&&"object"==typeof n&&"feePayer"in n&&!0===n.feePayer)return a.request({method:e,params:t},r)}if("eth_sendRawTransactionSync"===e||"eth_sendRawTransaction"===e){let s=t[0];if(null===i$(s).feePayerSignature){if("sign-and-broadcast"===n)return a.request({method:e,params:t},r);{let t=await a.request({method:"eth_signRawTransaction",params:[s]},r);return i.request({method:e,params:[t]},r)}}}return await i.request({method:e,params:t},r)},type:sf.type})}}function sd(e){let{chain:t,feePayerUrl:r,getClient:n,rpcUrl:i}=e;return n?t?.serializers||r?async e=>{let i=await n(e);if(r&&"feePayer"!==i.transport.key){let e=i.transport.url;if(e){let t=(0,su.UU)({chain:i.chain,transport:sf((0,sl.L)(e),(0,sl.L)(r))});Object.assign(i,{transport:t.transport,request:t.request})}}return!t?.serializers||i.chain?.serializers?.transaction?i:Object.assign({},i,{chain:{...t,...i.chain,formatters:i.chain?.formatters??t.formatters,prepareTransactionRequest:i.chain?.prepareTransactionRequest??t.prepareTransactionRequest,serializers:i.chain?.serializers?.transaction?i.chain.serializers:t.serializers}})}:n:({chainId:e})=>
11{if(!i)throw Error("No `rpcUrl` provided.");let n=e||Number(Object.keys(i)[0]),a=i[n];if(!a)throw Error(`No \`rpcUrl\` configured for \`chainId\` (${n}).`);let s=r?sf((0,sl.L)(a),(0,sl.L)(r)):(0,sl.L)(a);return(0,su.UU)({chain:{...t,id:n},transport:s})}}let sp=z(eN(H("mpp"),{as:"Hex"}),0,4);function sh(e){return C(z(eN(H(e),{as:"Hex"}),0,10))}async function sm(e,t){return sm.inner(nY,e,t)}var sy=sm||(sm={});async function sg(e,t,r){let{tokenIn:n,tokenOut:i,amountOut:a,maxAmountIn:s,...o}=r,u=sy.call({tokenIn:n,tokenOut:i,amountOut:a,maxAmountIn:s});return await e(t,{...o,...u})}async function sb(e,t){return sb.inner(nY,e,t)}sy.inner=sg,sy.call=function(e){let{tokenIn:t,tokenOut:r,amountOut:n,maxAmountIn:i}=e;return iR({address:n8,abi:nX.IJ,functionName:"swapExactAmountOut",args:[t,r,n,i]})};var sw=sb||(sb={});async function sv(e,t,r){let{orderId:n,...i}=r,a=sw.call({orderId:n});return await e(t,{...i,...a})}async function sx(e,t){return sx.inner(nY,e,t)}sw.inner=sv,sw.call=function(e){let{orderId:t}=e;return iR({address:n8,abi:nX.IJ,functionName:"cancel",args:[t]})},sw.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.IJ,logs:e,eventName:"OrderCancelled",strict:!0});if(!t)throw Error("`OrderCancelled` event not found.");return t};var s$=sx||(sx={});async function sE(e,t,r){let{orderId:n,...i}=r,a=s$.call({orderId:n});return await e(t,{...i,...a})}async function sP(e,t){return sP.inner(nY,e,t)}s$.inner=sE,s$.call=function(e){let{orderId:t}=e;return iR({address:n8,abi:nX.IJ,functionName:"cancelStaleOrder",args:[t]})},s$.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.IJ,logs:e,eventName:"OrderCancelled",strict:!0});if(!t)throw Error("`OrderCancelled` event not found.");return t};var s_=sP||(sP={});async function sA(e,t,r){let{base:n,...i}=r,a=s_.call({base:n});return await e(t,{...i,...a})}async function sI(e,t){let{account:r=e.account,token:n,...i}=t,a=r?(0,tz.J)(r).address:void 0;if(!a)throw Error("account is required.");return(0,nK.J)(e,{...i,...sI.call({account:a,token:n})})}async function sS(e,t){let{tokenIn:r,tokenOut:n,amountOut:i,...a}=t;return(0,nK.J)(e,{...a,...sS.call({tokenIn:r,tokenOut:n,amountOut:i})})}async function sz(e,t){let{orderId:r,...n}=t;return(0,nK.J)(e,{...n,...sz.call({orderId:r})})}async function sk(e,t){let{base:r,quote:n,...i}=t;return(0,nK.J)(e,{...i,...sk.call({base:r,quote:n})})}async function sO(e,t){let{base:r,tick:n,isBid:i,...a}=t,[s,o,u]=await (0,nK.J)(e,{...a,...sO.call({base:r,tick:n,isBid:i})});return{head:s,tail:o,totalLiquidity:u}}async function sC(e,t){let{tokenIn:r,tokenOut:n,amountIn:i,...a}=t;return(0,nK.J)(e,{...a,...sC.call({tokenIn:r,tokenOut:n,amountIn:i})})}async function sT(e,t){return sT.inner(nY,e,t)}s_.inner=sA,s_.call=function(e){let{base:t}=e;return iR({address:n8,abi:nX.IJ,functionName:"createPair",args:[t]})},s_.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.IJ,logs:e,eventName:"PairCreated",strict:!0});if(!t)throw Error("`PairCreated` event not found.");return t},(sI||(sI={})).call=function(e){let{account:t,token:r}=e;return iR({address:n8,abi:nX.IJ,args:[t,r],functionName:"balanceOf"})},(sS||(sS={})).call=function(e){let{tokenIn:t,tokenOut:r,amountOut:n}=e;return iR({address:n8,abi:nX.IJ,args:[t,r,n],functionName:"quoteSwapExactAmountOut"})},(sz||(sz={})).call=function(e){let{orderId:t}=e;return iR({address:n8,abi:nX.IJ,args:[t],functionName:"getOrder"})},(sk||(sk={})).call=function(e){var t,r;let{base:n,quote:i}=e,a=(t=n,r=i,tL.So(tM.xW(t,r)));return iR({address:n8,abi:nX.IJ,args:[a],functionName:"books"})},(sO||(sO={})).call=function(e){let{base:t,tick:r,isBid:n}=e;return iR({address:n8,abi:nX.IJ,args:[t,r,n],functionName:"getTickLevel"})},(sC||(sC={})).call=function(e){let{tokenIn:t,tokenOut:r,amountIn:n}=e;return iR({address:n8,abi:nX.IJ,args:[t,r,n],functionName:"quoteSwapExactAmountIn"})};var sB=sT||(sT={});async function sj(e,t,r){let{amount:n,token:i,type:a,tick:s,...o}=r,u=sB.call({amount:n,token:i,type:a,tick:s});return await e(t,{...o,...u})}async function sN(e,t){return sN.inner(nY,e,t)}sB.inner=sj,sB.call=function(e){let{token:t,amount:r,type:n,tick:i}=e;return iR({address:n8,abi:nX.IJ,functionName:"place",args:[t,r,"buy"===n,i]})},sB.extractEvent=function(e){let[t]=(0,nQ.p)({abi:nX.IJ,logs:e,eventName:"OrderPlaced",strict:!0});if(!t)throw Error("`OrderPlaced` event not found.");return t};var sM=sN||(sN={});async function sR(e,t,r){let{amount:n,flipTick:i,tick:a,token:s,type:o,...u}=r,l=sM.call({amount:n,flipTick:i,tick:a,token:s,type:o});return await e(t,{...u,...l})}async function sU(e,t){return sU.inner(nY,e,t)}sM.inner=sR,sM.call=function(e){let{token:t,amount:r,type:n,tick:i,flipTick:a}=e;return iR({address:n8,abi:nX.IJ,functionName:"placeFlip",args:[t,r,"buy"===n,i,a]})},sM.extractEvent=function(e){let t=(0,nQ.p)({abi:nX.IJ,logs:e,eventName:"OrderPlaced",strict:!0}).find(e=>e.args.isFlipOrder);if(!t)throw Error("`OrderPlaced` event (flip order) not found.");return t};var sL=sU||(sU={});async function sD(e,t,r){let{tokenIn:n,tokenOut:i,amountIn:a,minAmountOut:s,...o}=r,u=sL.call({tokenIn:n,tokenOut:i,amountIn:a,minAmountOut:s});return await e(t,{...o,...u})}async function sq(e,t){return sq.inner(nY,e,t)}sL.inner=sD,sL.call=function(e){let{tokenIn:t,tokenOut:r,amountIn:n,minAmountOut:i}=e;return iR({address:n8,abi:nX.IJ,functionName:"swapExactAmountIn",args:[t,r,n,i]})};var sF=sq||(sq={});async function sW(e,t,r){let{token:n,amount:i,...a}=r,s=sF.call({token:n,amount:i});return await e(t,{...a,...s})}function sH(e,t){return e.toLowerCase()===t.toLowerCase()}
11sF.inner=sW,sF.call=function(e){let{token:t,amount:r}=e;return iR({address:n8,abi:nX.IJ,functionName:"withdraw",args:[t,r]})};let sV={4217:"0x33b901018174DDabE4841042ab76ba85D4e24f25",42431:"0xe1c4d3dce17bc111181ddf716f75bae49e61a336"},sK={4217:"https://rpc.tempo.xyz",42431:"https://rpc.moderato.tempo.xyz"},sG=["0x20c0000000000000000000000000000000000000","0x20C000000000000000000000b9537d11c60E8b50"];async function sZ(e,t){let{account:r,amountOut:n,tokenOut:i,tokenIn:a,slippage:s}=t,o=a.filter(e=>!sH(e,i)),u=await Promise.allSettled([(0,nK.J)(e,aB.call({account:r,token:i})),...o.map(t=>(0,nK.J)(e,aB.call({account:r,token:t})))]),l=u[0];if("fulfilled"!==l.status||!(l.value>=n)){for(let t=0;t<o.length;t++){let r=u[t+1];if("fulfilled"!==r.status)continue;let a=r.value;if(a<=0n)continue;let l=o[t];try{let t=await sS(e,{tokenIn:l,tokenOut:i,amountOut:n});if(a>=t){let e=t+t*BigInt(Math.round(100*s))/10000n;return[av.call({token:l,spender:n8,amount:e}),sm.call({tokenIn:l,tokenOut:i,amountOut:n,maxAmountIn:e})]}}catch{}}throw new sJ({currency:i})}}class sJ extends Error{name="InsufficientFundsError";constructor({currency:e}){super(`Insufficient funds: no balance in ${e} and no viable swap route from fallback currencies.`)}}var sY=r(66981);let sQ=e3({amount:tm(),memo:tc(ty()),recipient:td(eX(),tu(e=>e))}),sX={name:"tempo",intent:"charge",schema:{credential:{payload:te("type",[e3({hash:ty(),type:ts("hash")}),e3({signature:tg(),type:ts("transaction")})])},request:td(e3({amount:tm(),chainId:tc(e1()),currency:eX(),decimals:e1(),description:tc(eX()),externalId:tc(eX()),feePayer:tc(td(e9([eZ._L(e2,void 0),th()]),tu(e=>"object"==typeof e||e))),memo:tc(ty()),recipient:tc(eX()),splits:tc(new e5({type:"array",element:sQ,...eG.normalizeParams(void 0)}).check(eZ.m9(1),eZ.Eb(10)))}).check(function(e,t={}){return eZ.fU(tp,e,t)}(({amount:e,decimals:t,splits:r})=>{if(!r)return!0;let n=(0,sY.X)(e,t),i=r.reduce((e,r)=>e+(0,sY.X)(r.amount,t),0n);return r.every(e=>(0,sY.X)(e.amount,t)>0n)&&i<n},"Invalid splits")),tu(({amount:e,chainId:t,decimals:r,feePayer:n,memo:i,splits:a,...s})=>({...s,amount:(0,sY.X)(e,r).toString(),...void 0!==t||void 0!==n||void 0!==i||void 0!==a?{methodDetails:{...void 0!==t&&{chainId:t},...void 0!==n&&{feePayer:n},...void 0!==i&&{memo:i},...void 0!==a&&{splits:a.map(e=>({...e,amount:(0,sY.X)(e.amount,r).toString()}))}}}:{}})))}},s0={name:"tempo",intent:"session",schema:{credential:{payload:te("action",[e3({action:ts("open"),authorizedSigner:tc(eX()),channelId:ty(),cumulativeAmount:tm(),signature:tg(),transaction:tg(),type:ts("transaction")}),e3({action:ts("topUp"),additionalDeposit:tm(),channelId:ty(),transaction:tg(),type:ts("transaction")}),e3({action:ts("voucher"),channelId:ty(),cumulativeAmount:tm(),signature:tg()}),e3({action:ts("close"),channelId:ty(),cumulativeAmount:tm(),signature:tg()})])},request:td(e3({amount:tm(),chainId:tc(e1()),channelId:tc(ty()),currency:eX(),decimals:e1(),escrowContract:tc(eX()),feePayer:tc(td(e9([eZ._L(e2,void 0),th()]),tu(e=>"object"==typeof e||e))),minVoucherDelta:tc(tm()),recipient:tc(eX()),suggestedDeposit:tc(tm()),unitType:eX()}),tu(({amount:e,chainId:t,channelId:r,decimals:n,escrowContract:i,feePayer:a,minVoucherDelta:s,suggestedDeposit:o,...u})=>({...u,amount:(0,sY.X)(e,n).toString(),...o?{suggestedDeposit:(0,sY.X)(o,n).toString()}:{},methodDetails:{escrowContract:i,...void 0!==r&&{channelId:r},...void 0!==s&&{minVoucherDelta:(0,sY.X)(s,n).toString()},...void 0!==t&&{chainId:t},...void 0!==a&&{feePayer:a}}})))}};function s1(e={}){let{clientId:t}=e,r=sd({chain:ah,getClient:e.getClient,rpcUrl:sK}),n=so({account:e.account});return ss(sX,{context:e3({account:tc(th()),autoSwap:tc(th()),mode:tc(ti(["push","pull"]))}),async createCredential({challenge:i,context:a}){var s;let o,u=i.request.methodDetails?.chainId,l=await r({chainId:u}),c=n(l,a),f=a?.mode??e.mode??("json-rpc"===c.type?"push":"pull"),{request:d}=i,{amount:p,methodDetails:h}=d,m=d.currency;
11if(e.expectedRecipients){let t=new Set(e.expectedRecipients.map(e=>e.toLowerCase())),r=h?.splits;if(r){for(let e of r)if(!t.has(e.recipient.toLowerCase()))throw Error(`Unexpected split recipient: ${e.recipient}`)}}let y=h?.memo?h.memo:function(e){let{serverId:t,clientId:r}=e,n=new Uint8Array(32);n.set(C(sp),0),n[4]=1,n.set(sh(t),5),r&&n.set(sh(r),15);let i=crypto.getRandomValues(new Uint8Array(7));return n.set(i,25),P(n)}({serverId:i.realm,clientId:t}),g=(function(e){let t=BigInt(e.amount),r=e.methodDetails?.splits??[],n=r.reduce((e,t)=>e+BigInt(t.amount),0n);if(n>=t)throw Error("Invalid charge request: split total must be less than total amount.");let i=t-n;if(i<=0n)throw Error("Invalid charge request: primary transfer amount must be positive.");return[{amount:i.toString(),memo:e.methodDetails?.memo,recipient:e.recipient},...r.map(e=>({amount:e.amount,memo:e.memo,recipient:e.recipient}))]})({amount:p,methodDetails:{...h,memo:y},recipient:d.recipient}).map(e=>a8.call({amount:BigInt(e.amount),...e.memo&&{memo:e.memo},to:e.recipient,token:m})),b=(s=a?.autoSwap??e.autoSwap,!!s&&(!0===s?{tokenIn:sG,slippage:1}:{tokenIn:s.tokenIn?[...s.tokenIn,...sG.filter(e=>!s.tokenIn.some(t=>sH(t,e)))]:sG,slippage:s.slippage??1})),w=[...(b?await sZ(l,{account:c.address,amountOut:BigInt(p),tokenOut:m,tokenIn:b.tokenIn,slippage:b.slippage}):void 0)??[],...g],v=(o=Math.floor(Date.now()/1e3)+25,i.expires?Math.min(o,Math.floor(new Date(i.expires).getTime()/1e3)):o);if("push"===f){let{receipts:e}=await tI(l,{account:c,calls:w,experimental_fallback:!0}),t=e?.[0]?.transactionHash;if(!t)throw Error("No transaction receipt returned.");return sa({challenge:i,payload:{hash:t,type:"hash"},source:`did:pkh:eip155:${u}:${c.address}`})}let x=await (0,tS.ft)(l,{account:c,calls:w,...h?.feePayer&&{feePayer:!0},nonceKey:"expiring",validBefore:v});return x.gas=x.gas+5000n,sa({challenge:i,payload:{signature:await tN(l,x),type:"transaction"},source:`did:pkh:eip155:${u}:${c.address}`})}})}let s2=/^(.*)\[([0-9]*)\]$/,s6=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s5=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s8=2n**256n-1n;function s3(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new s9({signature:e});if(e.r<0n||e.r>s8)throw new s7({value:e.r});if(e.s<0n||e.s>s8)throw new oe({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new ot({value:e.yParity})}class s4 extends p{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${k($(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class s9 extends p{constructor({signature:e}){super(`Signature \`${b(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class s7 extends p{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class oe extends p{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class ot extends p{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class or extends p{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}class on extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let oi={checksum:new on(8192)}.checksum;function oa(e,t={}){let{compressed:r}=t,{prefix:n,x:i,y:a}=e;if(!1===r||"bigint"==typeof i&&"bigint"==typeof a){if(4!==n)throw new ou({prefix:n,cause:new oc});return}if(!0===r||"bigint"==typeof i&&void 0===a){if(3!==n&&2!==n)throw new ou({prefix:n,cause:new ol});return}throw new oo({publicKey:e})}function os(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new of({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(z(e,0,32)),y:BigInt(z(e,32,64))};if(132===e.length){let t=Number(z(e,0,1));return{prefix:t,x:BigInt(z(e,1,33)),y:BigInt(z(e,33,65))}}return{prefix:Number(z(e,0,1)),x:BigInt(z(e,1,33))}}class oo extends p{constructor({publicKey:e}){super(`Value \`${b(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class ou extends p{constructor({prefix:e,cause:t}){super(`Prefix "${e}
11" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class ol extends p{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class oc extends p{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class of extends p{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${k($(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}let od=/^0x[a-fA-F0-9]{40}$/;function op(e,t={}){let{strict:r=!0}=t;if(!od.test(e))throw new og({address:e,cause:new ob});if(r){if(e.toLowerCase()===e)return;if(oh(e)!==e)throw new og({address:e,cause:new ow})}}function oh(e){if(oi.has(e))return oi.get(e);op(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=eN(H(t),{as:"Bytes"}),n=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&n[e]&&(n[e]=n[e].toUpperCase()),(15&r[e>>1])>=8&&n[e+1]&&(n[e+1]=n[e+1].toUpperCase());let i=`0x${n.join("")}`;return oi.set(e,i),i}function om(e,t={}){let{checksum:r=!1}=t;return(op(e),r)?oh(e):e}function oy(e,t={}){let r=eN(`0x${(function(e,t={}){oa(e);let{prefix:r,x:n,y:i}=e,{includePrefix:a=!0}=t;return x(a?_(r,{size:1}):"0x",_(n,{size:32}),"bigint"==typeof i?_(i,{size:32}):"0x")})(e).slice(4)}`).substring(26);return om(`0x${r}`,t)}class og extends p{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class ob extends p{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class ow extends p{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}let ov={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new oE({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new o$({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ox({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ox({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};class ox extends p{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class o$ extends p{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class oE extends p{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function oP(e,t,r){if(128===r&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new p("Invalid RLP prefix")}
vendor: 23,665 bytes, line 11
11let o_=BigInt(0),oA=BigInt(1);function oI(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function oS(e){if(!oI(e))throw Error("Uint8Array expected")}function oz(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function ok(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function oO(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?o_:BigInt("0x"+e)}let oC="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,oT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function oB(e){if(oS(e),oC)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=oT[e[r]];return t}function oj(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function oN(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(oC)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=oj(e.charCodeAt(i)),a=oj(e.charCodeAt(i+1));if(void 0===r||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+a}return n}function oM(e){return oO(oB(e))}function oR(e){return oS(e),oO(oB(Uint8Array.from(e).reverse()))}function oU(e,t){return oN(e.toString(16).padStart(2*t,"0"))}function oL(e,t){return oU(e,t).reverse()}function oD(e,t,r){let n;if("string"==typeof t)try{n=oN(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(oI(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function oq(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];oS(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let oF=e=>"bigint"==typeof e&&o_<=e;function oW(e,t,r){return oF(e)&&oF(t)&&oF(r)&&t<=e&&e<r}function oH(e,t,r,n){if(!oW(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let oV=e=>(oA<<BigInt(e))-oA,oK=e=>new Uint8Array(e),oG={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||oI(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function oZ(e,t,r={}){let n=(t,r,n)=>{let i=oG[r];if("function"!=typeof i)throw Error("invalid validator function");let a=e[t];if((!n||void 0!==a)&&!i(a,e))throw Error("param "+String(t)+" is invalid. Expected "+r+", got "+a)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function oJ(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let a=e(r,...n);return t.set(r,a),a}}let oY=BigInt(0),oQ=BigInt(1),oX=BigInt(2),o0=BigInt(3),o1=BigInt(4),o2=BigInt(5),o6=BigInt(8);function o5(e,t){let r=e%t;return r>=oY?r:t+r}function o8(e,t,r){let n=e;for(;t-- >oY;)n*=n,n%=r;return n}function o3(e,t){if(e===oY)throw Error("invert: expected non-zero number");if(t<=oY)throw Error("invert: expected positive modulus, got "+t);let r=o5(e,t),n=t,i=oY,a=oQ,s=oQ,o=oY;for(;r!==oY;){let e=n/r,t=n%r,u=i-s*e,l=a-o*e;n=r,r=t,i=s,a=o,s=u,o=l}if(n!==oQ)throw Error("invert: does not exist");return o5(i,t)}function o4(e,t){let r=(e.ORDER+oQ)/o1,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function o9(e,t){let r=(e.ORDER-o2)/o6,n=e.mul(t,oX),i=e.pow(n,r),a=e.mul(t,i),s=e.mul(e.mul(a,oX),i),o=e.mul(a,e.sub(s,e.ONE));if(!e.eql(e.sqr(o),t))throw Error("Cannot find square root");return o}let o7=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ue(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),a=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),a),n}function ut(e,t){let r=(e.ORDER-oQ)/oX,n=e.pow(t,r),i=e.eql(n,e.ONE),a=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!i&&!a&&!s)throw Error("invalid Legendre symbol result");return i?1:a?0:-1}function ur(e,t){void 0!==t&&Y(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function un(e,t,r=!1,n={}){let i;if(e<=oY)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:a,nByteLength:s}=ur(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let o=Object.freeze({ORDER:e,isLE:r,BITS:a,BYTES:s,MASK:oV(a),ZERO:oY,ONE:oQ,create:t=>o5(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return oY<=t&&t<e},is0:e=>e===oY,isOdd:e=>(e&oQ)===oQ,neg:t=>o5(-t,e),eql:(e,t)=>e===t,sqr:t=>o5(t*t,e),add:(t,r)=>o5(t+r,e),sub:(t,r)=>o5(t-r,e),mul:(t,r)=>o5(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<oY)throw Error("invalid exponent, negatives unsupported");if(r===oY)return e.ONE;if(r===oQ)return t;let n=e.ONE,i=t;for(;r>oY;)r&oQ&&(n=e.mul(n,i)),i=e.sqr(i),r>>=oQ;return n})(o,e,t),div:(t,r)=>o5(t*o3(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>o3(t,e),sqrt:n.sqrt||(t=>(i||(i=e%o1===o0?o4:e%o6===o2?o9:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-oQ,r=0;for(;t%oX===oY;)t/=oX,r++;let n=oX,i=un(e);for(;1===ut(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return o4;let a=i.pow(n,t),s=(t+oQ)/oX;return function(e,n){if(e.is0(n))return n;if(1!==ut(e,n))throw Error("Cannot find square root");let i=r,o=e.mul(e.ONE,a),u=e.pow(n,t),l=e.pow(n,s);for(;!e.eql(u,e.ONE);){if(e.is0(u))return e.ZERO;let t=1,r=e.sqr(u);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=oQ<<BigInt(i-t-1),a=e.pow(o,n);i=t,o=e.sqr(a),u=e.mul(u,o),l=e.mul(l,a)}return l}}(e)),i(o,t))),toBytes:e=>r?oL(e,s):oU(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?oR(e):oM(e)},invertBatch:e=>ue(o,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(o)}function ui(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function ua(e){let t=ui(e);return t+Math.ceil(t/2)}let us=BigInt(0),uo=BigInt(1);function uu(e,t){let r=t.negate();return e?r:t}function ul(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function uc(e,t){ul(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:oV(e),maxNumber:i,shiftBy:BigInt(e)}}function uf(e,t,r){let{windowSize:n,mask:i,maxNumber:a,shiftBy:s}=r,o=Number(e&i),u=e>>s;o>n&&(o-=a,u+=uo);let l=t*n,c=l+Math.abs(o)-1,f=0===o;return{nextN:u,offset:c,isZero:f,isNeg:o<0,isNegF:t%2!=0,offsetF:l}}let ud=new WeakMap,up=new WeakMap;function uh(e){return up.get(e)||1}function um(e){return oZ(e.Fp,o7.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),oZ(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ur(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function uy(e){void 0!==e.lowS&&oz("lowS",e.lowS),void 0!==e.prehash&&oz("prehash",e.prehash)}class ug extends Error{constructor(e=""){super(e)}}let ub={Err:ug,_tlv:{encode:(e,t)=>{let{Err:r}=ub;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=ok(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let a=n>127?ok(i.length/2|128):"";return ok(e)+a+i+t},decode(e,t){let{Err:r}=ub,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],a=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)a=a<<8|e;if(n+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=i;let s=t.subarray(n,n+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+a)}}},_int:{encode(e){let{Err:t}=ub;if(e<uw)throw new t("integer: negative integers are not allowed");let r=ok(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=ub;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return oM(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=ub,i=oD("signature",e),{v:a,l:s}=n.decode(48,i);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:u}=n.decode(2,a),{v:l,l:c}=n.decode(2,u);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=ub,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},uw=BigInt(0),uv=BigInt(1),ux=(BigInt(2),BigInt(3)),u$=BigInt(4),uE=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),uP=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u_=BigInt(0),uA=BigInt(1),uI=BigInt(2),uS=(e,t)=>(e+t/uI)/t,uz=un(uE,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),o=BigInt(88),u=e*e*e%uE,l=u*u*e%uE,c=o8(l,t,uE)*l%uE,f=o8(c,t,uE)*l%uE,d=o8(f,uI,uE)*u%uE,p=o8(d,n,uE)*d%uE,h=o8(p,i,uE)*p%uE,m=o8(h,s,uE)*h%uE,y=o8(m,o,uE)*m%uE,g=o8(y,s,uE)*h%uE,b=o8(g,t,uE)*l%uE,w=o8(b,a,uE)*p%uE,v=o8(w,r,uE)*u%uE,x=o8(v,uI,uE);if(!uz.eql(uz.sqr(x),e))throw Error("Cannot find square root");return x}}),uk=(c={a:u_,b:BigInt(7),Fp:uz,n:uP,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-uA*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),a=uS(t*e,uP),s=uS(-r*e,uP),o=o5(e-a*t-s*n,uP),u=o5(-a*r-s*t,uP),l=o>i,c=u>i;if(l&&(o=uP-o),c&&(u=uP-u),o>i||u>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:o,k2neg:c,k2:u}}}},{...(i=e=>(function(e){let t,r=(oZ(t=um(e),{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})),{Fp:n,n:i,nByteLength:a,nBitLength:s}=r,o=n.BYTES+1,u=2*n.BYTES+1;function l(e){return o5(e,i)}let{ProjectivePoint:c,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:p}=function(e){var t;let r=function(e){let t=um(e);oZ(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=un(r.n,r.nBitLength),a=r.toBytes||((e,t,r)=>{let i=t.toAffine();return oq(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),s=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){let{a:t,b:i}=r,a=n.sqr(e),s=n.mul(a,e);return n.add(n.add(s,n.mul(e,t)),i)}function u(e,t){let r=n.sqr(t),i=o(e);return n.eql(r,i)}if(!u(r.Gx,r.Gy))throw Error("bad curve params: generator point");let l=n.mul(n.pow(r.a,ux),u$),c=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(l,c)))throw Error("bad curve params: a or b");function f(e){let t,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:a,n:s}=r;if(n&&"bigint"!=typeof e){if(oI(e)&&(e=oB(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:oM(oD("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return a&&(t=o5(t,s)),oH("private key",t,uv,s),t}function d(e){if(!(e instanceof m))throw Error("ProjectivePoint expected")}let p=oJ((e,t)=>{let{px:r,py:i,pz:a}=e;if(n.eql(a,n.ONE))return{x:r,y:i};let s=e.is0();null==t&&(t=s?n.ONE:n.inv(a));let o=n.mul(r,t),u=n.mul(i,t),l=n.mul(a,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error("invZ was invalid");return{x:o,y:u}}),h=oJ(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!u(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class m{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof m)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?m.ZERO:new m(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=ue(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(m.fromAffine)}static fromHex(e){let t=m.fromAffine(s(oD("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return m.BASE.multiply(f(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let i=r.length,a=n.length;if(i!==a)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,o=function(e){let t;for(t=0;e>o_;e>>=oA,t+=1);return t}(BigInt(i)),u=1;o>12?u=o-3:o>4?u=o-2:o>0&&(u=2);let l=oV(u),c=Array(Number(l)+1).fill(s),f=Math.floor((t.BITS-1)/u)*u,d=s;for(let e=f;e>=0;e-=u){c.fill(s);for(let t=0;t<a;t++){let i=Number(n[t]>>BigInt(e)&l);c[i]=c[i].add(r[t])}let t=s;for(let e=c.length-1,r=s;e>0;e--)r=r.add(c[e]),t=t.add(r);if(d=d.add(t),0!==e)for(let e=0;e<u;e++)d=d.double()}return d}(m,i,e,t)}_setWindowSize(e){b.setWindowSize(this,e)}assertValidity(){h(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){d(e);let{px:t,py:r,pz:i}=this,{px:a,py:s,pz:o}=e,u=n.eql(n.mul(t,o),n.mul(a,i)),l=n.eql(n.mul(r,o),n.mul(s,i));return u&&l}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,ux),{px:a,py:s,pz:o}=this,u=n.ZERO,l=n.ZERO,c=n.ZERO,f=n.mul(a,a),d=n.mul(s,s),p=n.mul(o,o),h=n.mul(a,s);return h=n.add(h,h),c=n.mul(a,o),c=n.add(c,c),u=n.mul(e,c),l=n.mul(i,p),l=n.add(u,l),u=n.sub(d,l),l=n.add(d,l),l=n.mul(u,l),u=n.mul(h,u),c=n.mul(i,c),p=n.mul(e,p),h=n.sub(f,p),h=n.mul(e,h),h=n.add(h,c),c=n.add(f,f),f=n.add(c,f),f=n.add(f,p),f=n.mul(f,h),l=n.add(l,f),p=n.mul(s,o),p=n.add(p,p),f=n.mul(p,h),u=n.sub(u,f),c=n.mul(p,d),c=n.add(c,c),new m(u,l,c=n.add(c,c))}add(e){d(e);let{px:t,py:i,pz:a}=this,{px:s,py:o,pz:u}=e,l=n.ZERO,c=n.ZERO,f=n.ZERO,p=r.a,h=n.mul(r.b,ux),y=n.mul(t,s),g=n.mul(i,o),b=n.mul(a,u),w=n.add(t,i),v=n.add(s,o);w=n.mul(w,v),v=n.add(y,g),w=n.sub(w,v),v=n.add(t,a);let x=n.add(s,u);return v=n.mul(v,x),x=n.add(y,b),v=n.sub(v,x),x=n.add(i,a),l=n.add(o,u),x=n.mul(x,l),l=n.add(g,b),x=n.sub(x,l),f=n.mul(p,v),l=n.mul(h,b),f=n.add(l,f),l=n.sub(g,f),f=n.add(g,f),c=n.mul(l,f),g=n.add(y,y),g=n.add(g,y),b=n.mul(p,b),v=n.mul(h,v),g=n.add(g,b),b=n.sub(y,b),b=n.mul(p,b),v=n.add(v,b),y=n.mul(g,v),c=n.add(c,y),y=n.mul(x,v),l=n.mul(w,l),l=n.sub(l,y),y=n.mul(w,g),f=n.mul(x,f),new m(l,c,f=n.add(f,y))}subtract(e){return this.add(e.negate())}is0(){return this.equals(m.ZERO)}wNAF(e){return b.wNAFCached(this,e,m.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;oH("scalar",e,uw,i);let a=m.ZERO;if(e===uw)return a;if(this.is0()||e===uv)return this;if(!t||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,e,m.normalizeZ);let{k1neg:s,k1:o,k2neg:u,k2:l}=t.splitScalar(e),c=a,f=a,d=this;for(;o>uw||l>uw;)o&uv&&(c=c.add(d)),l&uv&&(f=f.add(d)),d=d.double(),o>>=uv,l>>=uv;return s&&(c=c.negate()),u&&(f=f.negate()),f=new m(n.mul(f.px,t.beta),f.py,f.pz),c.add(f)}multiply(e){let t,i,{endo:a,n:s}=r;if(oH("scalar",e,uv,s),a){let{k1neg:r,k1:s,k2neg:o,k2:u}=a.splitScalar(e),{p:l,f:c}=this.wNAF(s),{p:f,f:d}=this.wNAF(u);l=b.constTimeNegate(r,l),f=b.constTimeNegate(o,f),f=new m(n.mul(f.px,a.beta),f.py,f.pz),t=l.add(f),i=c.add(d)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return m.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=m.BASE,i=(e,t)=>t!==uw&&t!==uv&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),a=i(this,t).add(i(e,r));return a.is0()?void 0:a}toAffine(e){return p(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===uv)return!0;if(t)return t(m,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===uv?this:t?t(m,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return oz("isCompressed",e),this.assertValidity(),a(m,this,e)}toHex(e=!0){return oz("isCompressed",e),oB(this.toRawBytes(e))}}m.BASE=new m(r.Gx,r.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);let{endo:y,nBitLength:g}=r,b=(t=y?Math.ceil(g/2):g,{constTimeNegate:uu,hasPrecomputes:e=>1!==uh(e),unsafeLadder(e,t,r=m.ZERO){let n=e;for(;t>us;)t&uo&&(r=r.add(n)),n=n.double(),t>>=uo;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=uc(r,t),a=[],s=e,o=s;for(let e=0;e<n;e++){o=s,a.push(o);for(let e=1;e<i;e++)o=o.add(s),a.push(o);s=o.double()}return a},wNAF(e,r,n){let i=m.ZERO,a=m.BASE,s=uc(e,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:o,isZero:u,isNeg:l,isNegF:c,offsetF:f}=uf(n,e,s);n=t,u?a=a.add(uu(c,r[f])):i=i.add(uu(l,r[o]))}return{p:i,f:a}},wNAFUnsafe(e,r,n,i=m.ZERO){let a=uc(e,t);for(let e=0;e<a.windows&&n!==us;e++){let{nextN:t,offset:s,isZero:o,isNeg:u}=uf(n,e,a);if(n=t,!o){let e=r[s];i=i.add(u?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=ud.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&ud.set(t,r(n))),n},wNAFCached(e,t,r){let n=uh(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=uh(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){ul(r,t),up.set(e,r),ud.delete(e)}});return{CURVE:r,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:o,isWithinCurveOrder:function(e){return oW(e,uv,r.n)}}}({...r,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x);return(oz("isCompressed",r),r)?oq(Uint8Array.from([t.hasEvenY()?2:3]),a):oq(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],i=e.subarray(1);if(t===o&&(2===r||3===r)){let e,t=oM(i);if(!oW(t,uv,n.ORDER))throw Error("Point is not on curve");let a=d(t);try{e=n.sqrt(a)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&r)==1!=((e&uv)===uv)&&(e=n.neg(e)),{x:t,y:e}}if(t===u&&4===r)return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))};throw Error("invalid Point, expected length of "+o+", or uncompressed "+u+", got "+t)}}),h=(e,t,r)=>oM(e.slice(t,r));class m{constructor(e,t,r){oH("r",e,uv,i),oH("s",t,uv,i),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new m(h(e=oD("compactSignature",e,2*a),0,a),h(e,a,2*a))}static fromDER(e){let{r:t,s:r}=ub.toSig(oD("DER",e));return new m(t,r)}assertValidity(){}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:a,recovery:s}=this,o=b(oD("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let u=2===s||3===s?t+r.n:t;if(u>=n.ORDER)throw Error("recovery id 2 or 3 invalid");let f=(1&s)==0?"02":"03",d=c.fromHex(f+oB(oU(u,n.BYTES))),p=o3(u,i),h=l(-o*p),m=l(a*p),y=c.BASE.multiplyAndAddUnsafe(d,h,m);if(!y)throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>i>>uv}normalizeS(){return this.hasHighS()?new m(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return oN(this.toDERHex())}toDERHex(){return ub.hexFromSig(this)}toCompactRawBytes(){return oN(this.toCompactHex())}toCompactHex(){return oB(oU(this.r,a))+oB(oU(this.s,a))}}function y(e){if("bigint"==typeof e)return!1;if(e instanceof c)return!0;let t=oD("key",e).length,i=n.BYTES,s=i+1;if(!r.allowedPrivateKeyLengths&&a!==s)return t===s||t===2*i+1}let g=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=oM(e),r=8*e.length-s;return r>0?t>>BigInt(r):t},b=r.bits2int_modN||function(e){return l(g(e))},w=oV(s);function v(e){return oH("num < 2^"+s,e,uw,w),oU(e,a)}let x={lowS:r.lowS,prehash:!1},$={lowS:r.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===y(e))throw Error("first arg must be private key");if(!1===y(t))throw Error("second arg must be public key");return c.fromHex(t).multiply(f(e)).toRawBytes(r)},sign:function(e,t,a=x){let{seed:s,k2sig:o}=function(e,t,a=x){if(["recovered","canonical"].some(e=>e in a))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:o}=r,{lowS:u,prehash:d,extraEntropy:h}=a;null==u&&(u=!0),e=oD("msgHash",e),uy(a),d&&(e=oD("prehashed msgHash",s(e)));let y=b(e),w=f(t),$=[v(w),v(y)];if(null!=h&&!1!==h){let e=!0===h?o(n.BYTES):h;$.push(oD("extraEntropy",e))}return{seed:oq(...$),k2sig:function(e){var t;let r=g(e);if(!p(r))return;let n=o3(r,i),a=c.BASE.multiply(r).toAffine(),s=l(a.x);if(s===uw)return;let o=l(n*l(y+s*w));if(o===uw)return;let f=2*(a.x!==s)|Number(a.y&uv),d=o;return u&&o>i>>uv&&(d=(t=o)>i>>uv?l(-t):t,f^=1),new m(s,d,f)}}}(e,t,a);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=oK(e),i=oK(e),a=0,s=()=>{n.fill(1),i.fill(0),a=0},o=(...e)=>r(i,n,...e),u=(e=oK(0))=>{let t;if(i=o((t=[0],Uint8Array.from(t)),e),n=o(),0!==e.length){let t;i=o((t=[1],Uint8Array.from(t)),e),n=o()}},l=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return oq(...r)};return(e,t)=>{let r;for(s(),u(e);!(r=t(l()));)u();return s(),r}})(r.hash.outputLen,r.nByteLength,r.hmac)(s,o)},verify:function(e,t,n,a=$){let s,o;t=oD("msgHash",t),n=oD("publicKey",n);let{lowS:u,prehash:f,format:d}=a;if(uy(a),"strict"in a)throw Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw Error("format must be compact or der");
11let p="string"==typeof e||oI(e),h=!p&&!d&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!p&&!h)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(h&&(o=new m(e.r,e.s)),p){try{"compact"!==d&&(o=m.fromDER(e))}catch(e){if(!(e instanceof ub.Err))throw e}o||"der"===d||(o=m.fromCompact(e))}s=c.fromHex(n)}catch(e){return!1}if(!o||u&&o.hasHighS())return!1;f&&(t=r.hash(t));let{r:y,s:g}=o,w=b(t),v=o3(g,i),x=l(w*v),E=l(y*v),P=c.BASE.multiplyAndAddUnsafe(s,x,E)?.toAffine();return!!P&&l(P.x)===y},ProjectivePoint:c,Signature:m,utils:{isValidPrivateKey(e){try{return f(e),!0}catch(e){return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let e=ua(r.n);return function(e,t,r=!1){let n=e.length,i=ui(t),a=ua(t);if(n<16||n<a||n>1024)throw Error("expected "+a+"-1024 bytes of input, got "+n);let s=o5(r?oR(e):oM(e),t-oQ)+oQ;return r?oL(s,i):oU(s,i)}(r.randomBytes(e),r.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...c,hash:e,hmac:(t,...r)=>ec(e,t,function(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];Q(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}(...r)),randomBytes:eu}))(ej),create:i}),uO=`0x${"00".repeat(32)}`;function uC(e){let t,{salt:r,threshold:n,owners:i}=e;if(void 0!==r&&32!==k(r))throw new uB({reason:"salt must be 32 bytes"});if(0===i.length)throw new uB({reason:"owners cannot be empty"});if(i.length>10)throw new uB({reason:"too many owners"});if(1>Number(n))throw new uB({reason:"threshold cannot be zero"});let a=0;for(let e of i){if(!function(e,t={}){let{strict:r=!0}=t??{};try{return op(e,{strict:r}),!0}catch{return!1}}(e.owner)||0n===O(e.owner))throw new uB({reason:"owner cannot be zero"});if(1>Number(e.weight))throw new uB({reason:"owner weight cannot be zero"});let r=O(e.owner);if(void 0!==t&&t>=r)throw new uB({reason:"owners must be strictly ascending"});t=r,a+=Number(e.weight)}if(a>0xffffffff)throw new uB({reason:"total owner weight exceeds u32 max"});if(Number(n)>a)throw new uB({reason:"threshold exceeds total owner weight"})}function uT(e){uC(e);let t=eN(x(A("tempo:multisig:config"),I(e.salt??uO,32),_(e.threshold,{size:4}),_(e.owners.length,{size:4}),...e.owners.flatMap(e=>[e.owner,_(e.weight,{size:4})])));if(0n===O(t))throw new uB({reason:"config ID cannot be zero"});return t}class uB extends p{constructor({reason:e}){super(`Invalid native multisig config: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigConfig.InvalidConfigError"})}}let uj="0x01",uN="0x02",uM="0x03",uR="0x04",uU="0x05",uL="0x7777777777777777777777777777777777777777777777777777777777777777";class uD extends p{constructor({envelope:e}){super(`Unable to coerce value (\`${b(e)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}class uq extends p{constructor({reason:e,serialized:t}){super(`Unable to deserialize signature envelope: ${e}`,{metaMessages:[`Serialized: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}}var uF=r(35895);async function uW(e,t){let{account:r=e.account,domain:n,message:i,primaryType:a}=t;if(!r)throw new tk.T({docsPath:"/docs/actions/wallet/signTypedData"});let s=(0,tz.J)(r),o={EIP712Domain:(0,uF.H4)({domain:n}),...t.types};if((0,uF.$$)({domain:n,message:i,primaryType:a,types:o}),s.signTypedData)return s.signTypedData({domain:n,message:i,primaryType:a,types:o});let u=(0,uF.v8)({domain:n,message:i,primaryType:a,types:o});return e.request({method:"eth_signTypedData_v4",params:[s.address,u]},{retryCount:0})}let uH={Voucher:[{name:"channelId",type:"bytes32"},{name:"cumulativeAmount",type:"uint128"}]};async function uV(e,t,r,n,i,a){var s;let o=await uW(e,{account:t,domain:{name:"Tempo Stream Channel",version:"1",chainId:i,verifyingContract:n},types:uH,primaryType:"Voucher",message:{channelId:r.channelId,cumulativeAmount:r.cumulativeAmount}});if(a)try{let e=function e(t,r){let n;if("string"==typeof t)return function e(t){let r=t.endsWith(uL.slice(2))?z(t,0,-k(uL)):t;if(65===k(r)){let e=function(e){if(130!==e.length&&132!==e.length)throw new s4({signature:e});let t=BigInt(z(e,0,32)),r=BigInt(z(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{var r=t;if(0===r||27===r)return 0;if(1===r||28===r)return 1;if(r>=35)return+(r%2==0);throw new or({value:r})}catch{throw new ot({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}(r);return s3(e),{signature:e,type:"secp256k1"}}let n=z(r,0,1),i=z(r,1),a=k(i);if(n===uj){if(129!==a)throw new uq({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${a} bytes`,serialized:r});
11return{publicKey:{prefix:4,x:O(z(i,64,96)),y:O(z(i,96,128))},prehash:0!==T(z(i,128,129)),signature:{r:O(z(i,0,32)),s:O(z(i,32,64))},type:"p256"}}if(n===uN){let e,t;if(a<128)throw new uq({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${a} bytes`,serialized:r});let n=a-128,s=z(i,0,n);for(let r=37;r<n;r++){let n=function(e,t={}){let{size:r}=t,n=W(e);return r&&(h(n,r),n=V(n)),new TextDecoder().decode(n)}(z(s,r));if(n.startsWith("{")&&n.endsWith("}"))try{JSON.parse(n),e=z(s,0,r),t=n;break}catch{}}if(!e||!t)throw new uq({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:r});return{publicKey:{prefix:4,x:O(z(i,n+64,n+96)),y:O(z(i,n+96,n+128))},metadata:{authenticatorData:e,clientDataJSON:t},signature:{r:O(z(i,n,n+32)),s:O(z(i,n+32,n+64))},type:"webAuthn"}}if(n===uM||n===uR)return{userAddress:z(i,0,20),inner:e(z(i,20)),type:"keychain",version:n===uR?"v2":"v1"};if(n===uU){var s;let t,[r,n,a,o]=(s=i,t="Hex",function e(t,r="Hex"){if(0===t.bytes.length)return"Hex"===r?P(t.bytes):t.bytes;let n=t.readByte();if(n<128&&t.decrementPosition(1),n<192){let e=oP(t,n,128),i=t.readBytes(e);return"Hex"===r?P(i):i}let i=oP(t,n,192);var a=t,s=i,o=r;let u=a.position,l=[];for(;a.position-u<s;)l.push(e(a,o));return l}(function(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(ov);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}((()=>{if("string"==typeof s){if(s.length>3&&s.length%2!=0)throw new M(s);return W(s)}return s})(),{recursiveReadLimit:1/0}),t));return{type:"multisig",account:r,genesisConfigId:n,signatures:a.map(t=>e(t)),...o&&"0x"!==o?{init:function(e){let[t,r,n]=e;return{salt:t&&"0x"!==t?I(t,32):uO,threshold:"0x"===r?0:T(r),owners:n.map(e=>{let[t,r]=e;return{owner:t,weight:r&&"0x"!==r?T(r):0}})}}(o)}:{}}}throw new uq({reason:`Unknown signature type identifier: ${n}. Expected ${uj} (P256), ${uN} (WebAuthn), ${uM} (Keychain V1), ${uR} (Keychain V2), or ${uU} (Multisig)`,serialized:r})}(t);if("object"==typeof t&&null!==t&&"r"in t&&"s"in t&&"yParity"in t)return{signature:t,type:"secp256k1"};let i=function(e){if("object"!=typeof e||null===e)throw new uD({envelope:e});if("type"in e&&e.type)return e.type;if("signature"in e&&!("publicKey"in e)&&"object"==typeof e.signature&&null!==e.signature&&"r"in e.signature&&"s"in e.signature&&"yParity"in e.signature||"r"in e&&"s"in e&&"yParity"in e)return"secp256k1";if("signature"in e&&"prehash"in e&&"publicKey"in e&&"boolean"==typeof e.prehash)return"p256";if("signature"in e&&"metadata"in e&&"publicKey"in e)return"webAuthn";if("userAddress"in e&&"inner"in e)return"keychain";if(("account"in e&&"genesisConfigId"in e||"genesisConfig"in e)&&"signatures"in e)return"multisig";throw new uD({envelope:e})}(t);if("multisig"===i){let r,n,{genesisConfig:a,init:s,...o}=t,u=(()=>{if(o.account)return o.account;if(a){let e;return e="object"==typeof a&&"genesisConfigId"in a?a.genesisConfigId:uT(a),om(z(eN(x(A("tempo:multisig:account"),e)),12,32))}return o.account})(),l=o.genesisConfigId?o.genesisConfigId:a?uT(a):o.genesisConfigId,c=!0===s?a:s||void 0;return{...o,account:u,genesisConfigId:l,signatures:o.signatures.map(t=>e(t)),...c?{init:(r=[...c.owners].sort((e,t)=>O(e.owner)<O(t.owner)?-1:1),n={salt:c.salt?I(c.salt,32):uO,threshold:c.threshold,owners:r},uC(n),n)}:{},type:i}}return{...t,..."p256"===i?{prehash:t.prehash}:{},..."keychain"===i?{...!("object"==typeof t&&null!==t&&"version"in t&&t.version)?{version:"v2"}:{}
11,...!("object"==typeof t&&"keyId"in t&&t.keyId)?(n=t.inner,"p256"===n.type||"webAuthn"===n.type?{keyId:oy(n.publicKey)}:"secp256k1"===n.type&&r?.payload?{keyId:oy(function(e){var t;let r,{payload:n,signature:i}=e,{r:a,s,yParity:o}=i;return t=new uk.Signature(BigInt(a),BigInt(s)).addRecoveryBit(o).recoverPublicKey($(n).substring(2)),r=(()=>{if(function(e,t={}){let{strict:r=!1}=t;try{return!function(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new j(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new N(e)}(e,{strict:r}),!0}catch{return!1}}(t))return os(t);if(function(e){try{if(!(e instanceof Uint8Array)&&(!e||"object"!=typeof e||!("BYTES_PER_ELEMENT"in e)||1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name))throw new K(e);return!0}catch{return!1}}(t)){var e;return e=t,os(P(e))}let{prefix:r,x:n,y:i}=t;return"bigint"==typeof n&&"bigint"==typeof i?{prefix:r??4,x:n,y:i}:{prefix:r,x:n}})(),oa(r),r}({payload:r.payload,signature:n.signature}))}:{}):{}}:{},type:i}}(o);if("keychain"===e.type&&"secp256k1"===e.inner.type){let t,r;return s=e.inner.signature,s3(s),t=s.r,r=s.s,x(_(t,{size:32}),_(r,{size:32}),"number"==typeof s.yParity?_(function(e){if(0===e)return 27;if(1===e)return 28;throw new ot({value:e})}(s.yParity),{size:1}):"0x")}}catch{}return o}let uK=[{type:"function",name:"CLOSE_GRACE_PERIOD",inputs:[],outputs:[{name:"",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"VOUCHER_TYPEHASH",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"channels",inputs:[{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"finalized",type:"bool",internalType:"bool"},{name:"closeRequestedAt",type:"uint64",internalType:"uint64"},{name:"payer",type:"address",internalType:"address"},{name:"payee",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"authorizedSigner",type:"address",internalType:"address"},{name:"deposit",type:"uint128",internalType:"uint128"},{name:"settled",type:"uint128",internalType:"uint128"}],stateMutability:"view"},{type:"function",name:"close",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"},{name:"cumulativeAmount",type:"uint128",internalType:"uint128"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"computeChannelId",inputs:[{name:"payer",type:"address",internalType:"address"},{name:"payee",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"authorizedSigner",type:"address",internalType:"address"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"domainSeparator",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"getChannel",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"tuple",internalType:"struct TempoStreamChannel.Channel",components:[{name:"finalized",type:"bool",internalType:"bool"},{name:"closeRequestedAt",type:"uint64",internalType:"uint64"},{name:"payer",type:"address",internalType:"address"},{name:"payee",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"authorizedSigner",type:"address",internalType:"address"},{name:"deposit",type:"uint128",internalType:"uint128"},{name:"settled",type:"uint128",internalType:"uint128"}]}],stateMutability:"view"},{type:"function",name:"getChannelsBatch",inputs:[{name:"channelIds",type:"bytes32[]",internalType:"bytes32[]"}],outputs:[{name:"channelStates",type:"tuple[]",internalType:"struct TempoStreamChannel.Channel[]",components:[{name:"finalized",type:"bool",internalType:"bool"},{name:"closeRequestedAt",type:"uint64",internalType:"uint64"},{name:"payer",type:"address",internalType:"address"},{name:"payee",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"authorizedSigner",type:"address",internalType:"address"},{name:"deposit",type:"uint128",internalType:"uint128"},{name:"settled",type:"uint128",internalType:"uint128"}]}],stateMutability:"view"},{type:"function",name:"getVoucherDigest",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"},{name:"cumulativeAmount",type:"uint128",internalType:"uint128"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"open",inputs:[{name:"payee",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"deposit",type:"uint128",internalType:"uint128"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"authorizedSigner",type:"address",internalType:"address"}],outputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"}],stateMutability:"nonpayable"}
11,{type:"function",name:"requestClose",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"settle",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"},{name:"cumulativeAmount",type:"uint128",internalType:"uint128"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"topUp",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"},{name:"additionalDeposit",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdraw",inputs:[{name:"channelId",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"event",name:"ChannelClosed",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"},{name:"settledToPayee",type:"uint256",indexed:!1,internalType:"uint256"},{name:"refundedToPayer",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ChannelExpired",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ChannelOpened",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"},{name:"token",type:"address",indexed:!1,internalType:"address"},{name:"authorizedSigner",type:"address",indexed:!1,internalType:"address"},{name:"salt",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"deposit",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"CloseRequestCancelled",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"CloseRequested",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"},{name:"closeGraceEnd",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Settled",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"},{name:"cumulativeAmount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"deltaPaid",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newSettled",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"TopUp",inputs:[{name:"channelId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"payee",type:"address",indexed:!0,internalType:"address"},{name:"additionalDeposit",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newDeposit",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AmountExceedsDeposit",inputs:[]},{type:"error",name:"AmountNotIncreasing",inputs:[]},{type:"error",name:"ChannelAlreadyExists",inputs:[]},{type:"error",name:"ChannelFinalized",inputs:[]},{type:"error",name:"ChannelNotFound",inputs:[]},{type:"error",name:"CloseNotReady",inputs:[]},{type:"error",name:"DepositOverflow",inputs:[]},{type:"error",name:"InvalidPayee",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"NotPayee",inputs:[]},{type:"error",name:"NotPayer",inputs:[]},{type:"error",name:"TransferFailed",inputs:[]}];r(56213);var uG=r(42330);async function uZ(e,t,r){return(0,nK.J)(e,{address:t,abi:uK,functionName:"getChannel",args:[r]})}(0,uG.iY)({abi:uK,name:"open"}),(0,uG.iY)({abi:uK,name:"topUp"});
vendor: 9,263 bytes, line 11
11class uJ extends Error{constructor(e,t={}){const r=t.cause instanceof uJ?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof uJ&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}class uY extends uJ{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class uQ extends uJ{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class uX extends uJ{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class u0 extends uJ{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class u1 extends uJ{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class u2 extends uJ{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}function u6(e,t){let r=e.exec(t);return r?.groups}let u5=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,u8=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,u3=/^\(.+?\).*?$/,u4=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/,u9=new Set(["memory","indexed","storage","calldata"]),u7=new Set(["calldata","memory","storage"]);class le extends uJ{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class lt extends uJ{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class lr extends uJ{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class ln extends uJ{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class li extends uJ{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class la extends uJ{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let ls=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),lo=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,lu=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ll=/^u?int$/;function lc(e,t){var r,n;let i,a=function(e,t,r){let n="";if(r)for(let e of Object.entries(r)){if(!e)continue;let t="";for(let r of e[1])t+=`[${r.type}${r.name?`:${r.name}`:""}]`;n+=`(${e[0]}{${t}})`}return t?`${t}:${e}${n}`:`${e}${n}`}(e,t?.type,t?.structs);if(ls.has(a))return ls.get(a);let s=u3.test(e),o=u6(s?lu:lo,e);if(!o)throw new uQ({param:e});if(o.name&&("address"===(r=o.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||u5.test(r)||u8.test(r)||lp.test(r)))throw new uX({param:e,name:o.name});let u=o.name?{name:o.name}:{},l="indexed"===o.modifier?{indexed:!0}:{},c=t?.structs??{},f={};if(s){i="tuple";let e=lf(o.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(lc(e[n],{structs:c}));f={components:t}}else if(o.type in c)i="tuple",f={components:c[o.type]};else if(ll.test(o.type))i=`${o.type}256`;else if("address payable"===o.type)i="address";else if(i=o.type,t?.type!=="struct"&&!ld(i))throw new lt({type:i});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new u0({param:e,type:t?.type,modifier:o.modifier});if(u7.has(o.modifier)&&(n=i,!o.array&&"bytes"!==n&&"string"!==n&&"tuple"!==n))throw new u1({param:e,type:t?.type,modifier:o.modifier})}let d={type:`${i}${o.array??""}`,...u,...l,...f};return ls.set(a,d),d}function lf(e,t=[],r="",n=0){let i=e.trim().length;for(let a=0;a<i;a++){let i=e[a],s=e.slice(a+1);switch(i){case",":return 0===n?lf(s,[...t,r.trim()]):lf(s,t,`${r}${i}`,n);case"(":return lf(s,t,`${r}${i}`,n+1);case")":return lf(s,t,`${r}${i}`,n-1);default:return lf(s,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new la({current:r,depth:n});return t.push(r.trim()),t}function ld(e){return"address"===e||"bool"===e||"function"===e||"string"===e||u5.test(e)||u8.test(e)}let lp=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/,lh=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function lm(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=k(i)}let r=[],n=[],i=0;for(let a=0;a<e.length;a++){let{dynamic:s,encoded:o}=e[a];s?(r.push(_(t+i,{size:32})),n.push(o),i+=k(o)):r.push(o)}return x(...r,...n)}function ly(e,t){if(e.length!==t.length)throw new lw({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n];
11r.push(ly.encode(i,a))}return x(...r)}(ly||(ly={})).encode=function e(t,r,n=!1){if("address"===t)return op(r),I(r.toLowerCase(),32*!!n);if("string"===t)return A(r);if("bytes"===t)return r;if("bool"===t)return I(E(r),n?32:1);let i=t.match(s5);if(i){let[e,t,a="256"]=i,s=Number.parseInt(a,10)/8;return _(r,{size:n?32:s,signed:"int"===t})}let a=t.match(s6);if(a){let[e,t]=a;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new lb({expectedSize:Number.parseInt(t,10),value:r});return S(r,32*!!n)}let s=t.match(s2);if(s&&Array.isArray(r)){let[t,n]=s,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":x(...i)}throw new lx(t)};class lg extends p{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class lb extends p{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${k(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class lw extends p{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
12Expected length (parameters): ${e}
13Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class lv extends p{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class lx extends p{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function l$(e,t,r,n){return sa({challenge:e,payload:t,source:`did:pkh:eip155:${r}:${n.address}`})}async function lE(e,t,r,n,i,a,s){let o=await uV(e,t,{channelId:r,cumulativeAmount:n},i,a,s);return{action:"voucher",channelId:r,cumulativeAmount:n.toString(),signature:o}}async function lP(e,t,r){var n,i;let{escrowContract:a,payee:s,currency:o,deposit:u,initialAmount:l,chainId:c,feePayer:f}=r,d=r.authorizedSigner??t.address,h=P(crypto.getRandomValues(new Uint8Array(32))),m=(n={authorizedSigner:d,chainId:c,escrowContract:a,payee:s,payer:t.address,salt:h,token:o},eN(function(e,t){let{checksumAddress:r=!1}=(void 0)??{};if(e.length!==t.length)throw new lw({expectedLength:e.length,givenLength:t.length});let n=lm(function({checksumAddress:e,parameters:t,values:r}){let n=[];for(let i=0;i<t.length;i++)n.push(function e({checksumAddress:t=!1,parameter:r,value:n}){let i,a=(i=r.type.match(/^(.*)\[(\d+)?\]$/))?[i[2]?Number(i[2]):null,i[1]]:void 0;if(a){let[i,s]=a;return function(t,r){let{checksumAddress:n,length:i,parameter:a}=r,s=null===i;if(!Array.isArray(t))throw new lv(t);if(!s&&t.length!==i)throw new lg({expectedLength:i,givenLength:t.length,type:`${a.type}[${i}]`});let o=!1,u=[];for(let r=0;r<t.length;r++){let i=e({checksumAddress:n,parameter:a,value:t[r]});i.dynamic&&(o=!0),u.push(i)}if(s||o){let e=lm(u);if(s){let t=_(u.length,{size:32});return{dynamic:!0,encoded:u.length>0?x(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:x(...u.map(({encoded:e})=>e))}}(n,{checksumAddress:t,length:i,parameter:{...r,type:s}})}if("tuple"===r.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,a=!1,s=[];for(let r=0;r<i.components.length;r++){let o=i.components[r],u=Array.isArray(t)?r:o.name,l=e({checksumAddress:n,parameter:o,value:t[u]});s.push(l),l.dynamic&&(a=!0)}return{dynamic:a,encoded:a?lm(s):x(...s.map(({encoded:e})=>e))}}(n,{checksumAddress:t,parameter:r});if("address"===r.type)return function(e,t){let{checksum:r=!1}=t;return op(e,{strict:r}),{dynamic:!1,encoded:I(e.toLowerCase())}}(n,{checksum:t});if("bool"===r.type){var s=n;if("boolean"!=typeof s)throw new p(`Invalid boolean value: "${s}" (type: ${typeof s}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:I(E(s))}}if(r.type.startsWith("uint")||r.type.startsWith("int")){let e=r.type.startsWith("int"),[,,t="256"]=s5.exec(r.type)??[];return function(e,{signed:t,size:r}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new B({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:_(e,{size:32,signed:t})}}(n,{signed:e,size:Number(t)})}if(r.type.startsWith("bytes"))return function(e,{type:t}){let[,r]=t.split("bytes"),n=k(e);if(!r){let t=e;return n%32!=0&&(t=S(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:x(I(_(n,{size:32})),t)}}if(n!==Number.parseInt(r,10))throw new lb({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:S(e)}}(n,{type:r.type});if("string"===r.type){var o=n;let e=A(o),t=Math.ceil(k(e)/32),r=[];for(let n=0;n<t;n++)r.push(S(z(e,32*n,(n+1)*32)));return{dynamic:!0,encoded:x(S(_(k(e),{size:32})),...r)}}throw new lx(r.type)}({checksumAddress:e,parameter:t[i],value:r[i]}));return n}({checksumAddress:r,parameters:e,values:t}));return 0===n.length?"0x":n}(Array.isArray(i=["address payer","address payee","address token","bytes32 salt","address authorizedSigner","address escrowContract","uint256 chainId"])&&"string"==typeof i[0]?function(e){let t=[];if("string"==typeof e){let r=lf(e),n=r.length;for(let e=0;e<n;e++)t.push(lc(r[e],{modifiers:u9}))}else{let r=function(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!u4.test(r))continue;let i=u6(u4,r);if(!i)throw new lr({signature:r,type:"struct"});let a=i.properties.split(";"),s=[],o=a.length;for(let e=0;e<o;e++){let t=a[e].trim();if(!t)continue;let r=lc(t,{type:"struct"});s.push(r)}if(!s.length)throw new ln({signature:r});t[i.name]=s}let n={},i=Object.entries(t),a=i.length;for(let e=0;e<a;e++){let[r,a]=i[e];n[r]=function e(t=[],r={},n=new Set){let i=[],a=t.length;for(let s=0;s<a;s++){let a=t[s];if(u3.test(a.type))i.push(a);else{let t=u6(lh,a.type);if(!t?.type)throw new u2({abiParameter:a});let{array:s,type:o}=t;if(o in r){if(n.has(o))throw new li({type:o});i.push({...a,type:`tuple${s??""}`,components:e(r[o],r,new Set([...n,o]))})}else if(ld(o))i.push(a);else throw new le({type:o})}}return i}(a,t)}return n}(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if(u4.test(n))continue;let a=lf(n),s=a.length;for(let e=0;e<s;e++)t.push(lc(a[e],{modifiers:u9,structs:r}))}}if(0===t.length)throw new uY({params:e});return t}(i):i,[n.payer,n.payee,n.token,n.salt,n.authorizedSigner,n.escrowContract,BigInt(n.chainId)]))),y=(0,nZ.p)({abi:nX.gJ,functionName:"approve",args:[a,u]}),g=(0,nZ.p)({abi:uK,functionName:"open",args:[s,o,u,h,d]}),b=await (0,tS.ft)(e,{account:t,calls:[{to:o,data:y},{to:a,data:g}],...f&&{feePayer:!0},feeToken:o});b.gas=b.gas+5000n;let w=await tN(e,b),v=await uV(e,t,{channelId:m,cumulativeAmount:l},a,c,r.authorizedSigner);return{entry:{channelId:m,salt:h,cumulativeAmount:l,escrowContract:a,chainId:c,opened:!0},payload:{action:"open",type:"transaction",channelId:m,transaction:w,authorizedSigner:d,cumulativeAmount:l.toString(),signature:v}}}async function l_(e,t,r,n){try{let i=await uZ(e,t,r);if(i.deposit>0n&&!i.finalized)return{channelId:r,salt:"0x",cumulativeAmount:i.settled,escrowContract:t,chainId:n,opened:!0}}catch{}}let lA=e3({account:tc(th()),action:tc(ti(["open","topUp","voucher","close"])),channelId:tc(eX()),cumulativeAmount:tc(tm()),cumulativeAmountRaw:tc(eX()),transaction:tc(eX()),authorizedSigner:tc(eX()),additionalDeposit:tc(tm()),additionalDepositRaw:tc(eX()),depositRaw:tc(eX())});function lI(e={}){let{decimals:t=6}=e,r=sd({chain:ah,getClient:e.getClient,rpcUrl:sK}),n=so({account:e.account}),i=void 0!==e.maxDeposit?(0,sY.X)(e.maxDeposit,t):void 0,a=new Map,s=new Map,o=new Map;function u(t){e.onChannelUpdate?.(t)}function l(t,r,n){if(n){let e=a.get(n);if(e)return e}var i=e.escrowContract;let s=t.request.methodDetails?.escrowContract??i??sV[r];if(!s)throw Error("No `escrowContract` available. Provide it in parameters or ensure the server challenge includes it.");return s}async function c(n,c,f){let d,p=n.request.methodDetails,h=p?.chainId??0,m=await r({chainId:h}),y=l(n,h),g=n.request.recipient,b=n.request.currency,w=BigInt(n.request.amount),v=n.request.suggestedDeposit,x=v?BigInt(v):void 0,$=(()=>
13{if(f?.depositRaw)return BigInt(f.depositRaw);if(void 0!==x&&void 0!==i)return x<i?x:i;if(void 0!==x)return x;if(void 0!==i)return i;if(void 0!==e.deposit)return(0,sY.X)(e.deposit,t);throw Error("No deposit amount available. Set `deposit`, `maxDeposit`, or ensure the server challenge includes `suggestedDeposit`.")})(),E=e.authorizedSigner??c.accessKeyAddress,P=`${g.toLowerCase()}:${b.toLowerCase()}:${y.toLowerCase()}`,_=s.get(P);if(!_){let e=f?.channelId??p?.channelId;if(e){let r=await l_(m,y,e,h);if(r){let e=f?.cumulativeAmountRaw?BigInt(f.cumulativeAmountRaw):f?.cumulativeAmount?(0,sY.X)(f.cumulativeAmount,t):void 0;void 0!==e&&(r.cumulativeAmount=e),s.set(P,r),o.set(r.channelId,P),a.set(r.channelId,y),u(_=r)}else if(f?.channelId)throw Error(`Channel ${f.channelId} cannot be reused (closed or not found on-chain).`)}}if(_?.opened)_.cumulativeAmount+=w,d=await lE(m,c,_.channelId,_.cumulativeAmount,y,h,E),u(_);else{let e=await lP(m,c,{authorizedSigner:E,escrowContract:y,payee:g,currency:b,deposit:$,initialAmount:w,chainId:h,feePayer:p?.feePayer});s.set(P,e.entry),o.set(e.entry.channelId,P),a.set(e.entry.channelId,y),d=e.payload,u(e.entry)}return l$(n,d,h,c)}async function f(n,i,c){let f,d=n.request.methodDetails,p=d?.chainId??0,h=await r({chainId:p}),m=c.action,{channelId:y,transaction:g,authorizedSigner:b}=c,w=b??e.authorizedSigner??i.accessKeyAddress,v=c.cumulativeAmountRaw?BigInt(c.cumulativeAmountRaw):c.cumulativeAmount?(0,sY.X)(c.cumulativeAmount,t):void 0,x=c.additionalDepositRaw?BigInt(c.additionalDepositRaw):c.additionalDeposit?(0,sY.X)(c.additionalDeposit,t):void 0,$=l(n,p,y);switch(a.set(y,$),m){case"open":{if(!g)throw Error("transaction required for open action");if(void 0===v)throw Error("cumulativeAmount required for open action");let e=await uV(h,i,{channelId:y,cumulativeAmount:v},$,p,w);f={action:"open",type:"transaction",channelId:y,transaction:g,authorizedSigner:w??i.address,cumulativeAmount:v.toString(),signature:e};break}case"topUp":if(!g)throw Error("transaction required for topUp action");if(void 0===x)throw Error("additionalDeposit required for topUp action");f={action:"topUp",type:"transaction",channelId:y,transaction:g,additionalDeposit:x.toString()};break;case"voucher":{if(void 0===v)throw Error("cumulativeAmount required for voucher action");f=await lE(h,i,y,v,$,p,w);let e=o.get(y);if(e){let t=s.get(e);t&&(t.cumulativeAmount=t.cumulativeAmount>v?t.cumulativeAmount:v,u(t))}break}case"close":{if(void 0===v)throw Error("cumulativeAmount required for close action");let e=await uV(h,i,{channelId:y,cumulativeAmount:v},$,p,w);f={action:"close",channelId:y,cumulativeAmount:v.toString(),signature:e};let t=o.get(y);if(t){let e=s.get(t);e&&(e.opened=!1,e.cumulativeAmount=e.cumulativeAmount>v?e.cumulativeAmount:v,u(e))}}}return l$(n,f,p,i)}return ss(s0,{context:lA,async createCredential({challenge:t,context:a}){let s=t.request.methodDetails?.chainId??0,o=n(await r({chainId:s}),a);if(!a?.action&&(void 0!==e.deposit||void 0!==i))return c(t,o,a);if(a?.action)return f(t,o,a);throw Error("No `action` in context and no `deposit` or `maxDeposit` configured. Either provide context with action/channelId/cumulativeAmount, or configure `deposit`/`maxDeposit` for auto-management.")}})}function lS(e){return JSON.parse(eF(e))}function lz(e={}){return[s1(e),lI(e)]}(f=lz||(lz={})).charge=s1,f.session=function(e){let t=e.fetch??globalThis.fetch,r=null,n=null,i=null,a=0n,s=lI({account:e.account,authorizedSigner:e.authorizedSigner,getClient:e.client?()=>e.client:e.getClient,escrowContract:e.escrowContract,decimals:e.decimals,maxDeposit:e.maxDeposit,onChannelUpdate(e){e.channelId!==r?.channelId&&(a=0n),r=e}}),o=tx({fetch:t,methods:[s],onChallenge:async(e,t)=>{n=e}});function u(e){if(!e||e.channelId!==r?.channelId)return;let t=BigInt(e.spent);a=a>t?a:t}async function l(e,t){var a;let s,l;return i=e,u(l=(s=(a=await o(e,t)).headers.get("Payment-Receipt"))?lS(s):null),Object.assign(a,{receipt:l,challenge:n,channelId:r?.channelId??null,cumulative:r?.cumulativeAmount??0n})}return{get channelId(){return r?.channelId},get cumulative(){return r?.cumulativeAmount??0n},get opened(){return r?.opened??!1},async open(e){if(r?.opened)return;if(!n)throw Error("No challenge available. Make a request first to receive a 402 challenge, or pass a challenge via .fetch()/.sse().");let a=e?.deposit,o=await s.createCredential({challenge:n,context:{...void 0!==a&&{depositRaw:a.toString()}}});if(!i)throw Error("No URL available — call fetch() or sse() before open().");let u=await t(i,{method:"POST",headers:{Authorization:o}});if(!u.ok){let e=await u.text().catch(()=>""),t=u.headers.get("WWW-Authenticate")??"";throw Error(`Open request failed with status ${u.status}${e?`: ${e}`:""}${t?` [WWW-Authenticate: ${t}]`:""}`)}}
13,fetch:l,async sse(e,i){let{onReceipt:a,signal:o,...c}=i??{},f={...c,headers:{...t$(c.headers),Accept:"text/event-stream"},...o?{signal:o}:{}},d=await l(e,f),p=n;if(!d.body)throw Error("Response has no body.");let h=d.body.getReader(),m=new TextDecoder;return async function*(){let n="";try{for(;!o?.aborted;){let{done:i,value:o}=await h.read();if(i)break;let l=(n+=m.decode(o,{stream:!0})).split("\n\n");for(let i of(n=l.pop(),l)){if(!i.trim())continue;let n=function(e){let t="message",r=[];for(let n of e.split("\n"))n.startsWith("event: ")?t=n.slice(7).trim():n.startsWith("data: ")?r.push(n.slice(6)):"data:"===n&&r.push("");if(0===r.length)return null;let n=r.join("\n");switch(t){case"message":default:return{type:"message",data:n};case"payment-need-voucher":return{type:"payment-need-voucher",data:JSON.parse(n)};case"payment-receipt":return{type:"payment-receipt",data:JSON.parse(n)}}}(i);if(n)switch(n.type){case"message":yield n.data;break;case"payment-need-voucher":{if(!r||!p)break;let i=BigInt(n.data.requiredCumulative);r.cumulativeAmount=r.cumulativeAmount>i?r.cumulativeAmount:i;let a=await s.createCredential({challenge:p,context:{action:"voucher",channelId:r.channelId,cumulativeAmountRaw:r.cumulativeAmount.toString()}}),o=await t(e,{method:"POST",headers:{Authorization:a}});if(!o.ok)throw Error(`Voucher POST failed with status ${o.status}`);break}case"payment-receipt":u(n.data),a?.(n.data)}}}}finally{h.releaseLock()}}()},async close(){let e;if(!r?.opened||!n)return;let o=await s.createCredential({challenge:n,context:{action:"close",channelId:r.channelId,cumulativeAmountRaw:a.toString()}});if(i){let r=(await t(i,{method:"POST",headers:{Authorization:o}})).headers.get("Payment-Receipt");r&&(e=lS(r))}return e}}};var lk=r(76209),lO=r(87358);r(49304).Buffer;var lC=class{constructor(e){this.adapter=e}async getByAlias(e,t){try{let{registryInfo:r,brand:n}=await this.adapter.registry.getInfoByAlias(e,t);if(!r)return null;let i=await this.adapter.builder().createFromTransactionHash(r.hash,t);return i?{warp:i,brand:n,registryInfo:r}:null}catch{return null}}async getByHash(e,t){try{let r=await this.adapter.builder().createFromTransactionHash(e,t);if(!r)return null;let{registryInfo:n,brand:i}=await this.adapter.registry.getInfoByHash(e,t);return{warp:r,brand:i,registryInfo:n}}catch{return null}}},lT=class{constructor(e){this.resolvers=e}async getByAlias(e,t){for(let r of this.resolvers){let n=await r.getByAlias(e,t);if(n)return n}return null}async getByHash(e,t){for(let r of this.resolvers){let n=await r.getByHash(e,t);if(n)return n}return null}},lB=e=>e?"string"==typeof e?e:e.address:null,lj=(e,t)=>lB(e.user?.wallets?.[t]||null),lN=(e,t)=>{let r;return((r=e.user?.wallets?.[t]||null)?"string"==typeof r?r:r.privateKey||null:null)?.trim()||null},lM=(e,t)=>{let r;return((r=e.user?.wallets?.[t]||null)?"string"==typeof r?r:r.mnemonic||null:null)?.trim()||null},lR=(e,t,r)=>{e.user||(e.user={}),e.user.wallets||(e.user.wallets={}),e.user.wallets[t]=r},lU=(e,t)=>{e.user?.wallets&&delete e.user.wallets[t]},lL=e=>{if(!e)throw Error("Mnemonic is required");return"string"==typeof e?e.trim():String(e).trim()},lD=(e,t=24)=>{let r=e.split(/\s+/).filter(e=>e.length>0);if(r.length!==t)throw Error(`Mnemonic must be ${t} words. Got ${r.length} words`)},lq=(e,t=24)=>{let r=lL(e);return lD(r,t),r},lF=((a=lF||{}).Multiversx="multiversx",a.Claws="claws",a.Sui="sui",a.Ethereum="ethereum",a.Base="base",a.Arbitrum="arbitrum",a.Polygon="polygon",a.Somnia="somnia",a.Tempo="tempo",a.Fastset="fastset",a.Solana="solana",a.Near="near",a),lW=((s=lW||{}).Macos="macos",s.Linux="linux",s.Windows="windows",s),lH=Object.values(lW),lV=["coinbase","privy","gaupa"],lK={HttpProtocolPrefix:"https://",IdentifierParamName:"warp",IdentifierParamSeparator:":",IdentifierType:{Alias:"alias",Hash:"hash"},IdentifierAliasMarker:"@",Globals:{UserWallet:{Placeholder:"USER_WALLET",Accessor:e=>lj(e.config,e.adapter.chainInfo.name)},UserWalletPublicKey:{Placeholder:"USER_WALLET_PUBLICKEY",Accessor:e=>{if(!e.adapter.wallet)return null;try{return e.adapter.wallet.getPublicKey()||null}catch{return null}}},ChainApiUrl:{Placeholder:"CHAIN_API",Accessor:e=>e.adapter.chainInfo.defaultApiUrl},ChainAddressHrp:{Placeholder:"CHAIN_ADDRESS_HRP",Accessor:e=>e.adapter.chainInfo.addressHrp}},Vars:{Query:"query",Env:"env"},ArgParamsSeparator:":",ArgCompositeSeparator:"|",ArgListSeparator:",",ArgStructSeparator:";",Append:{Prefix:"append:"},Transform:{Prefix:"transform:"},Source:{UserWallet:"user:wallet"},Position:{Payload:"payload:"}},lG={Option:"option",Vector:"vector",Tuple:"tuple",Struct:"struct",String:"string",Uint8:"uint8",Uint16:"uint16",Uint32:"uint32",Uint64:"uint64",Uint128:"uint128",Uint256:"uint256",Biguint:"biguint",Bool:"bool",Address:"address",Asset:"asset",Hex:"hex",Datetime:"datetime",Email:"email",Textarea:"textarea",File:"file",Json:"json"},lZ="u">typeof window?window:{open:()=>{}},lJ="3.0.0",lY="0.2.0",lQ={LatestWarpSchemaUrl:`https://raw.githubusercontent.com/JoAiHQ/warps-specs/refs/heads/main/schemas/v${lJ}.schema.json`,LatestBrandSchemaUrl:`https://raw.githubusercontent.com/JoAiHQ/warps-specs/refs/heads/main/schemas/brand/v${lY}.schema.json`,DefaultClientUrl:e=>"devnet"===e?"https://devnet.joai.ai":"testnet"===e?"https://testnet.joai.ai":"https://joai.ai",SuperClientUrls:["https://joai.ai","https://devnet.joai.ai","https://testnet.joai.ai","https://usewarp.to","https://testnet.usewarp.to","https://devnet.usewarp.to"],AvailableActionInputSources:["field","query",lK.Source.UserWallet,"hidden"],AvailableActionInputTypes:["string","string[]","json","uint8","uint16","uint32","uint64","biguint","boolean","address"],AvailableActionInputPositions:["receiver","value","transfer","arg:1","arg:2","arg:3","arg:4","arg:5","arg:6","arg:7","arg:8","arg:9","arg:10","data","ignore"]},lX=(e,t)=>(r,n)=>{let i=t(r,n);return e(r,i)},l0="https://raw.githubusercontent.com/JoAiHQ/assets/refs/heads/main",l1={baseUrl:l0,chainLogo:e=>`${l0}/chains/logos/${e}`,tokenLogo:e=>`${l0}/tokens/logos/${e}`,walletLogo:e=>`${l0}/wallets/logos/${e}`},l2={ethereum:{light:l1.chainLogo("ethereum-white.svg"),dark:l1.chainLogo("ethereum-black.svg")},base:{light:l1.chainLogo("base-white.svg"),dark:l1.chainLogo("base-black.svg")},arbitrum:l1.chainLogo("arbitrum.svg"),polygon:l1.chainLogo("polygon.svg"),somnia:l1.chainLogo("somnia.png"),tempo:{light:l1.chainLogo("tempo-white.svg"),dark:l1.chainLogo("tempo-black.svg")},multiversx:l1.chainLogo("multiversx.svg"),claws:l1.chainLogo("claws.png"),sui:l1.chainLogo("sui.svg"),solana:l1.chainLogo("solana.svg"),near:{light:l1.chainLogo("near-white.svg"),dark:l1.chainLogo("near-black.svg")},fastset:{light:l1.chainLogo("fastset-white.svg"),dark:l1.chainLogo("fastset-black.svg")}},l6=(e,t="dark")=>{let r=l2[e];return"string"==typeof r?r:"dark"===t?r.light:r.dark},l5=(e,t)=>e[t]??e.default??Object.values(e)[0],l8=(e,t)=>
13{let r=t?.preferences?.theme??"light";return"string"==typeof e.logo?e.logo:l5(e.logo,r)},l3=(e,t)=>{if(!e.logoUrl)return null;if("string"==typeof e.logoUrl)return e.logoUrl;let r=t?.preferences?.theme??"light";return l5(e.logoUrl,r)},l4=(e,t)=>{if("string"==typeof e.logoUrl)return e.logoUrl;let r=t?.preferences?.theme??"light";return l5(e.logoUrl,r)},l9=class{async getRandomBytes(e){if(typeof window>"u"||!window.crypto)throw Error("Web Crypto API not available");let t=new Uint8Array(e);return window.crypto.getRandomValues(t),t}},l7=class{async getRandomBytes(e){if(typeof lO>"u"||!lO.versions?.node)throw Error("Node.js environment not detected");try{let t=await Promise.all([r.e(19268),r.e(52171)]).then(r.t.bind(r,34015,19));return new Uint8Array(t.randomBytes(e))}catch(e){throw Error(`Node.js crypto not available: ${e instanceof Error?e.message:"Unknown error"}`)}}},ce=null;async function ct(e,t){if(e<=0||!Number.isInteger(e))throw Error("Size must be a positive integer");return(t||function(){if(ce)return ce;if("u">typeof window&&window.crypto)return ce=new l9;if("u">typeof lO&&lO.versions?.node)return ce=new l7;throw Error("No compatible crypto provider found. Please provide a crypto provider using setCryptoProvider() or ensure Web Crypto API is available.")}()).getRandomBytes(e)}async function cr(e,t){if(e<=0||e%2!=0)throw Error("Length must be a positive even number");var r=await ct(e/2,t);if(!(r instanceof Uint8Array))throw Error("Input must be a Uint8Array");let n=Array(2*r.length);for(let e=0;e<r.length;e++){let t=r[e];n[2*e]=(t>>>4).toString(16),n[2*e+1]=(15&t).toString(16)}return n.join("")}var cn=(e,t)=>{let r=t.find(t=>t.chainInfo.name.toLowerCase()===e.toLowerCase());if(!r)throw Error(`Adapter not found for chain: ${e}`);return r},ci=e=>{if("warp"===e)return`warp:${lJ}`;if("brand"===e)return`brand:${lY}`;if("abi"===e)return"abi:0.1.0";throw Error(`getLatestProtocolIdentifier: Invalid protocol name: ${e}`)},ca=(e,t)=>e?.actions[t-1],cs=["state","mount","unmount","loop"],co=e=>{if(0===e.actions.length)throw Error(`Warp has no actions: ${e.meta?.identifier}`);let t=e.actions.find(e=>!cs.includes(e.type));return t?{action:t,index:e.actions.indexOf(t)}:{action:e.actions[0],index:0}},cu=e=>!1!==e.auto&&("link"!==e.type||!0===e.auto),cl=(e,t)=>{let r=e.toString(),[n,i=""]=r.split("."),a=Math.abs(t);if(t>0)return BigInt(n+i.padEnd(a,"0"));if(!(t<0))return r.includes(".")?BigInt(r.split(".")[0]):BigInt(r);{let e=n+i;return a>=e.length?0n:BigInt(e.slice(0,-a)||"0")}},cc=(e,t,r=!1)=>e.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{if(!Object.prototype.hasOwnProperty.call(t,n))return r?e:"";let i=t[n];return null==i?"":"object"==typeof i&&null!==i?JSON.stringify(i):String(i)}),cf=(e,t)=>e.replace(/\{\{([^}]+)\}\}/g,(e,r)=>{let n=t[r];return null==n?"":"string"==typeof n?`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`:"object"==typeof n&&null!==n?`'${JSON.stringify(n).replace(/'/g,"\\'")}'`:String(n)}),cd=e=>{if(!e||"string"!=typeof e)return!0;try{return!!Function(`return ${e}`)()}catch(t){if(t instanceof SyntaxError)return!1;throw Error(`Failed to evaluate 'when' condition: ${e}. Error: ${t}`)}},cp={de:"German",en:"English",es:"Spanish",fr:"French",it:"Italian",pt:"Portuguese",ru:"Russian",zh:"Chinese",ja:"Japanese",ko:"Korean",ar:"Arabic",hi:"Hindi",nl:"Dutch",sv:"Swedish",da:"Danish",no:"Norwegian",fi:"Finnish",pl:"Polish",tr:"Turkish",el:"Greek",he:"Hebrew",th:"Thai",vi:"Vietnamese",id:"Indonesian",ms:"Malay",tl:"Tagalog"},ch=(e,t)=>{let r=t?.preferences?.locale||"en";if("string"==typeof e)return e;if("object"==typeof e&&null!==e){if(r in e)return e[r];if("en"in e)return e.en;let t=Object.keys(e);if(t.length>0)return e[t[0]]}return""},cm=e=>e.startsWith(lK.IdentifierAliasMarker)?e.replace(lK.IdentifierAliasMarker,""):e,cy=e=>{let t=e.indexOf("?");return -1===t?e:e.slice(0,t)},cg=(e,t)=>!!e&&!!t&&cy(cm(e))===cy(cm(t)),cb=(e,t,r)=>{let n=cm(r);if(t===lK.IdentifierType.Alias)return lK.IdentifierAliasMarker+n;if(!e)throw Error("Chain is required for hash warp identifiers");return e+lK.IdentifierParamSeparator+t+lK.IdentifierParamSeparator+n},cw=e=>{let t=cm(decodeURIComponent(e).trim()),r=t.split("?")[0],n=c$(r);if(64===r.length&&/^[a-fA-F0-9]+$/.test(r))return{chain:null,type:lK.IdentifierType.Hash,identifier:t,identifierBase:r};if(2===n.length&&/^[a-zA-Z0-9]{62}$/.test(n[0])&&/^[a-zA-Z0-9]{2}$/.test(n[1]))return null;if(3===n.length){let[e,r,i]=n;if(r===lK.IdentifierType.Alias||r===lK.IdentifierType.Hash)return{chain:e,type:r,identifier:t.includes("?")?i+t.substring(t.indexOf("?")):i,identifierBase:i}}if(2===n.length){let[e,r]=n;if(e===lK.IdentifierType.Alias||e===lK.IdentifierType.Hash)return{chain:null,type:e,identifier:t.includes("?")?r+t.substring(t.indexOf("?")):r,identifierBase:r}}if(2===n.length){let[e,r]=n;if(e!==lK.IdentifierType.Alias&&e!==lK.IdentifierType.Hash){let n=t.includes("?")?r+t.substring(t.indexOf("?")):r,i=cx(r,e)?lK.IdentifierType.Hash:lK.IdentifierType.Alias;return{chain:e,type:i,identifier:n,identifierBase:r}}}return{chain:null,type:lK.IdentifierType.Alias,identifier:t,identifierBase:r}},cv=e=>{let t=new URL(e),r=t.searchParams.get(lK.IdentifierParamName);return(r||(r=t.pathname.split("/")[1]),r)?cw(decodeURIComponent(r)):null},cx=(e,t)=>/^[a-fA-F0-9]+$/.test(e)&&e.length>32,c$=e=>{let t,r,n=(t=lK.IdentifierParamSeparator,-1!==(r=e.indexOf(t))?{separator:t,index:r}:null);if(!n)return[e];let{separator:i,index:a}=n;return[e.substring(0,a),...c$(e.substring(a+i.length))]},cE=e=>{let t=e.indexOf("?");if(-1===t||t===e.length-1)return null;let r=e.substring(t+1);return r.length>0?r:null},cP=e=>{if(!e)return{};let t=e.startsWith("?")?e.slice(1):e;if(!t)return{};let r=new URLSearchParams(t),n={};return r.forEach((e,t)=>{n[t]=e}),n},c_=e=>{let t=cw(e);return(t?t.identifierBase:cm(e)).trim()},cA=e=>{let[t,...r]=e.split(/:(.*)/,2);return[t,r[0]||""]},cI=e=>{if("string"!=typeof e)return!1;let t=new Set(Object.values(lG));if(!e.includes(lK.ArgParamsSeparator))return!1;let r=cA(e)[0],n=r.endsWith("[]")?r.slice(0,-2):r;return t.has(n)},cS=(e,t,r)=>cz(e.messages,t,r),cz=(e,t,r)=>e?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,cc(ch(n,r),t)])):{},ck=class{constructor(e,t){this.config=e,this.adapters=t}isValid(e){return!!e.startsWith(lK.HttpProtocolPrefix)&&!!cv(e)}build(e,t,r){let n=this.config.clientUrl||lQ.DefaultClientUrl(this.config.env),i=cn(e,this.adapters),a=t===lK.IdentifierType.Alias?r:t+lK.IdentifierParamSeparator+r,s=encodeURIComponent(i.chainInfo.name+lK.IdentifierParamSeparator+a);return lQ.SuperClientUrls.includes(n)?`${n}/${s}`:`${n}?${lK.IdentifierParamName}=${s}`}buildFromPrefixedIdentifier(e){let t=cw(e);if(!t)return null;if(!t.chain){let e=this.config.clientUrl||lQ.DefaultClientUrl(this.config.env),r=lK.IdentifierAliasMarker+t.identifierBase;return lQ.SuperClientUrls.includes(e)?`${e}/${encodeURIComponent(r)}`:`${e}?${lK.IdentifierParamName}=${encodeURIComponent(r)}`}let r=cn(t.chain,this.adapters);return r?this.build(r.chainInfo.name,t.type,t.identifierBase):null}generateQrCode(e,t,r,n=512,i="white",a="black",s="#23F7DD"){let o=cn(e,this.adapters);return new d({type:"svg",width:n,height:n,data:String(this.build(o.chainInfo.name,t,r)),margin:16,qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q"},backgroundOptions:{color:i},dotsOptions:{type:"extra-rounded",color:a},cornersSquareOptions:{type:"extra-rounded",color:a},cornersDotOptions:{type:"square",color:a}
13,imageOptions:{hideBackgroundDots:!0,imageSize:.4,margin:8},image:`data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 100 100" fill="${encodeURIComponent(s)}" xmlns="http://www.w3.org/2000/svg"><path d="M54.8383 50.0242L95 28.8232L88.2456 16L51.4717 30.6974C50.5241 31.0764 49.4759 31.0764 48.5283 30.6974L11.7544 16L5 28.8232L45.1616 50.0242L5 71.2255L11.7544 84.0488L48.5283 69.351C49.4759 68.9724 50.5241 68.9724 51.4717 69.351L88.2456 84.0488L95 71.2255L54.8383 50.0242Z"/></svg>`})}},cO=(e,t,r)=>{let n={};for(let t of e??[]){let e=t.input.as||t.input.name;if(!e||!t.value)continue;let i=t.value;try{i=r.stringToNative(t.value)[1]}catch{}n[e]=i}for(let[e,r]of Object.entries(t))null!=r&&(n[e]=r);return n},cC=(e,t)=>"string"==typeof e?e:e.when&&t&&!cd(cf(e.when,t))?null:e.identifier,cT=(e,t,r)=>{let n;if(!e)return null;if("string"==typeof e)n="success"===t?[e]:[];else if(Array.isArray(e))n="success"===t?e:[];else if("object"!=typeof e||Array.isArray(e)||"identifier"in e)n="success"===t?[e]:[];else{let r=e[t];n=r?Array.isArray(r)?r:[r]:[]}if(0===n.length)return null;let i=[];for(let e of n){let t=cC(e,r);null!==t&&i.push(t)}return i.length>0?i:null},cB=(e,t,r)=>cT(e,t,r)?.[0]??null,cj=(e,t,r,n,i)=>{if(n.startsWith("https://"))return[{identifier:null,url:n}];let[a,s]=n.split("?");if(!s){let n=cc(a,{...r.vars,...i});return[{identifier:n,url:cR(t,n,e)}]}let o=s.match(/{{([^}]+)\[\](\.[^}]+)?}}/g)||[];if(0===o.length){let n=cc(s,{...r.vars,...i}),o=n?`${a}?${n}`:a;return[{identifier:o,url:cR(t,o,e)}]}let u=o[0];if(!u)return[];let l=u.match(/{{([^[]+)\[\]/),c=l?l[1]:null;if(!c||void 0===i[c])return[];let f=Array.isArray(i[c])?i[c]:[i[c]];if(0===f.length)return[];let d=o.filter(e=>e.includes(`{{${c}[]`)).map(e=>{let t=e.match(/\[\](\.[^}]+)?}}/),r=t&&t[1]||"";return{placeholder:e,field:r?r.slice(1):"",regex:RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g")}});return f.map(r=>{let n=s;for(let{regex:e,field:t}of d){let i=t?cU(r,t):r;if(null==i)return null;n=n.replace(e,i)}if(n.includes("{{")||n.includes("}}"))return null;let i=n?`${a}?${n}`:a;return{identifier:i,url:cR(t,i,e)}}).filter(e=>null!==e)},cN=(e,t,r,n,i)=>{let a=cT(ca(r,n)?.next||r.next||null,"success",i);if(!a)return null;let s=a.flatMap(n=>cj(e,t,r,n,i));return s.length>0?s:null},cM=(e,t,r,n,i,a)=>{let s=cT(ca(r,n)?.next||r.next||null,"error"===a?"error":"success",i);if(!s)return null;let o=s.flatMap(n=>cj(e,t,r,n,i));return o.length>0?o:null},cR=(e,t,r)=>
13{let[n,i]=t.split("?"),a=new ck(r,e).buildFromPrefixedIdentifier(n);if(!a)throw Error(`Cannot build URL for identifier: ${n}`);if(!i)return a;let s=new URL(a);return new URLSearchParams(i).forEach((e,t)=>s.searchParams.set(t,e)),s.toString().replace(/\/\?/,"?")},cU=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e),cL={debug:0,info:1,warning:2,error:3},cD="error",cq=class e{static setLevel(e){cD=e}static shouldLog(e){return cL[e]>=cL[cD]}static debug(...t){!e.isTestEnv&&e.shouldLog("debug")&&console.debug(...t)}static info(...t){!e.isTestEnv&&e.shouldLog("info")&&console.info(...t)}static warn(...t){!e.isTestEnv&&e.shouldLog("warning")&&console.warn(...t)}static error(...t){!e.isTestEnv&&e.shouldLog("error")&&console.error(...t)}};cq.isTestEnv="u">typeof lO&&void 0!==lO.env.JEST_WORKER_ID;var cF=cq;function cW(e){return e.map(e=>e.value).filter(e=>null!=e&&""!==e)}function cH(e,t){let r={};return e.forEach(e=>{if("local"===e.input.position)return;let n=e.input.as||e.input.name,i=function(e,t){if(!e.value)return null;let r=t.stringToNative(e.value)[1];if("biguint"===e.input.type)return r.toString();if("asset"===e.input.type){let{identifier:e,amount:t}=r;return{identifier:e,amount:t.toString()}}if("json"!==e.input.type||"string"!=typeof r)return r;try{return JSON.parse(r)}catch{return r}}(e,t);if(e.input.position&&"string"==typeof e.input.position&&e.input.position.startsWith(lK.Position.Payload)){var a;let t=(a=e.input.position,a.startsWith(lK.Position.Payload)?a.slice(lK.Position.Payload.length).split(".").reduceRight((e,t,r,a)=>r===a.length-1&&t===n?{[t]:i}:r===a.length-1?{[t]:{[n]:i}}:{[t]:e},{}):{[n]:i});r=function e(t,r){if(!t)return{...r};if(!r)return{...t};let n={...t};return Object.keys(r).forEach(t=>{n[t]&&"object"==typeof n[t]&&"object"==typeof r[t]?n[t]=e(n[t],r[t]):n[t]=r[t]}),n}(r,t)}else r[n]=i}),r}function cV(e,t,r,n){let i={},a=void 0!==r?r:e.length,s=e=>{if(!e)return;let r=e.input.as||e.input.name;if(i[r]=null,!e.value)return;let[,n]=t.stringToNative(e.value);if((i[r]=n,"asset"===e.input.type&&"object"==typeof n&&null!==n)&&"identifier"in n&&"amount"in n){let e=String(n.identifier);i[`${r}.token`]=e,i[`${r}.identifier`]=e,i[`${r}.amount`]=String(n.amount)}};for(let t=0;t<a;t++)s(e[t]);return s(n),i}var cK=(e,t,r)=>{let n=[],i=[],a={};if(e.output)for(let[s,o]of Object.entries(e.output)){if(o.startsWith(lK.Transform.Prefix))continue;let e=c1(o);if(null!==e&&e!==t){a[s]=null;continue}let[u,...l]=o.split(".");if("out"===u||u.startsWith("out[")||"$"===u){let e=r(l);n.push(String(e)),i.push(e),a[s]=e}else a[s]=o}return{stringValues:n,nativeValues:i,output:a}},cG=async(e,t,r,n,i,a)=>{let{stringValues:s,nativeValues:o,output:u}=cK(e,r,e=>0===e.length?t:e.reduce((e,t)=>e&&void 0!==e[t]?e[t]:null,t)),l=cH(n,i);for(let e of n)if("local"===e.input.position){let t=e.input.as||e.input.name;if(t&&e.value){let[,r]=i.stringToNative(e.value);l[t]=r}}return{values:{string:s,native:o,mapped:l},output:await cZ(e,u,t,r,n,i,a)}},cZ=async(e,t,r,n,i,a,s)=>{if(!e.output)return t;let o={...t};return o=cJ(o,e,n,i,a),o=await cY(e,o,r,i,a,s.transform?.runner||null)},cJ=(e,t,r,n,i)=>{let a={...e},s=ca(t,r)?.inputs||[];for(let[e,t]of Object.entries(a))if("string"==typeof t&&t.startsWith("in.")){let r=t.split(".")[1],o=s.findIndex(e=>e.as===r||e.name===r),u=-1!==o?n[o]?.value:null;a[e]=u?i.stringToNative(u)[1]:null}return a},cY=async(e,t,r,n,i,a)=>{if(!e.output)return t;let s={...t},o=Object.entries(e.output).filter(([,e])=>e.startsWith(lK.Transform.Prefix)).map(([e,t])=>({key:e,code:t.substring(lK.Transform.Prefix.length)}));if(o.length>0&&(!a||"function"!=typeof a.run))throw Error("Transform output is defined but no transform runner is configured. Provide a runner via config.transform.runner.");let u={...s,out:cQ(r),inputs:cV(n,i)};for(let{key:t,code:r}of o)try{s[t]=await a.run(r,[u]),u[t]=s[t]}catch(r){cF.error(`Transform error for Warp '${e.name}' with output '${t}':`,r),s[t]=null,u[t]=null}return s},cQ=e=>{if(!e||"object"!=typeof e||Array.isArray(e)||!Array.isArray(e.data))return e;let t=[...e.data];return t.data=e.data,t},cX=async(e,t,r,n,i,a)=>{let{stringValues:s,nativeValues:o,output:u}=cK(e,r,e=>0===e.length?t:null),l=await cZ(e,u,t,r,n,i,a);return"PROMPT"in l||(l.PROMPT=t),{values:{string:s,native:o,mapped:cH(n,i)},output:l}},c0=(e,t)=>{let r=e.split(".");return"out"!==r[0]?e:1===r.length?t:r.slice(1).reduce((e,t)=>
13e&&void 0!==e[t]?e[t]:null,t)},c1=e=>{if("out"===e)return 1;let t=e.match(/^out\[(\d+)\]/);return t?parseInt(t[1],10):(e.startsWith("out.")||e.startsWith("event."),null)},c2=e=>!(null==e||"object"!=typeof e||Array.isArray(e))&&lH.some(t=>t in e),c6=(e,t,r,n)=>{let i=e.preferences?.providers?.[t];return i?.[r]?"string"==typeof i[r]?{url:i[r]}:i[r]:{url:n}};async function c5(e,t,r,n=5){let i=await cr(64,r),a=new Date(Date.now()+60*n*1e3).toISOString();return{message:JSON.stringify({wallet:e,nonce:i,expiresAt:a,purpose:t}),nonce:i,expiresAt:a}}async function c8(e,t,r,n){return c5(e,n||`prove-wallet-ownership for app "${t}"`,r,5)}var c3=e=>"string"==typeof e.name&&e.name.trim()?e.name.trim():"string"==typeof e.title&&e.title.trim()?e.title.trim():"generated-warp",c4=(e,t=24)=>{let r=e.normalize("NFKD").replace(/[^\w\s-]/g,"").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");return r?r.slice(0,t):"action"},c9=e=>{let t=0xdeadbeef^e.length,r=0x41c6ce57^e.length;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);t=Math.imul(t^i,0x9e3779b1),r=Math.imul(r^i,0x5f356495)}t=Math.imul(t^t>>>16,0x85ebca6b)^Math.imul(r^r>>>13,0xc2b2ae35);let n=((r=Math.imul(r^r>>>16,0x85ebca6b)^Math.imul(t^t>>>13,0xc2b2ae35))>>>0).toString(16).padStart(8,"0"),i=(t>>>0).toString(16).padStart(8,"0");return`${n}${i}`.slice(0,12)},c7=(e,t,r)=>{let n=c4((r||t||"").trim()||"action"),i=c9(`${e.type}|${(e=>{let t=(e||"").trim();if(!t)return"";try{let e=new URL(t),r=e.pathname.replace(/\/+$/,"").toLowerCase()||"/";return`${e.origin.toLowerCase()}${r}`}catch{return t.toLowerCase()}})(e.url)}|${(e.contract||"").trim().toLowerCase()}|${t.trim().toLowerCase()}`);return`private_src_${n}_${i}`},fe=e=>{let t=c3(e),r=c4(t),n=c9(t.trim().toLowerCase());return`private_gen_${r}_${n}`},ft=(e,t,r,n)=>{e.name&&e.name.trim()||!n||(e.name=n);let i=e.chain||t;e.meta={chain:i,identifier:r||fe(e),hash:e.meta?.hash||"",creator:e.meta?.creator||"",createdAt:e.meta?.createdAt||"",query:e.meta?.query||null}},fr=e=>!!e&&(e.startsWith("private_src_")||e.startsWith("private_gen_"));async function fn(e){let t={address:null,publicKey:null};if(!e)return t;try{t.address=await e.getAddress()}catch{}try{t.publicKey=await e.getPublicKey()}catch{}return t}var fi=(e,t)=>{let r=null;try{r=co(e)}catch{return[]}let n=r?.action;return n&&("contract"===n.type||"transfer"===n.type)&&(n.inputs??[]).some(e=>"value"===e.position||"transfer"===e.position||"asset"===e.type)?[t.nativeToken.identifier]:[]};async function fa(e){for(let t of e){if(!t.wallet.getMppAccount)continue;let e=await t.wallet.getMppAccount().catch(()=>null);if(e)return cF.debug("WarpExecutor: Using mppx fetch for MPP auto-payment"),function(e){let{onChallenge:t,polyfill:r=!0,transport:i={name:"http",isPaymentRequired:e=>402===e.status,getChallenge:e=>(function(e){if(402!==e.status)throw Error("Response status is not 402.");var t=e.headers,r=void 0;let n=t.get("WWW-Authenticate");if(!n)throw Error("Missing WWW-Authenticate header.");return tw(n,r)})(e),setCredential(e,t){let r=new Headers(e.headers);return r.set("Authorization",t),{...e,headers:r}}}}=e,a=e.fetch??globalThis.fetch,s=e.methods.flat(),o={...e.fetch&&{fetch:e.fetch},...t&&{onChallenge:t},methods:s},u=tx(o);return r&&function(e){let t=Object.getOwnPropertyDescriptor(globalThis,"fetch");if(!t||!t.writable&&!t.set)throw Error("globalThis.fetch is not writable");n||(n=globalThis.fetch),globalThis.fetch=tx({...e,fetch:globalThis.fetch})}(o),{fetch:u,rawFetch:a,methods:s,transport:i,async createCredential(e,t){let r=i.getChallenge(e),n=s.find(e=>e.name===r.method&&e.intent===r.intent);if(!n)throw Error(`No method found for "${r.method}.${r.intent}". Available: ${s.map(e=>`${e.name}.${e.intent}`).join(", ")}`);let a=n.context&&void 0!==t?n.context.parse(t):void 0;return n.createCredential(void 0!==a?{challenge:r,context:a}:{challenge:r})}}}({methods:[lz({account:e})],polyfill:!1}).fetch}return fetch}var fs=/^(.+)\[\]$/,fo={boolean:lG.Bool,integer:lG.Uint32,int:lG.Uint32,number:lG.Uint64,text:lG.String},fu=class{constructor(e){this.typeRegistry=e?.typeRegistry}nativeToString(e,t){if(e=fo[e]??e,fs.test(e)){let r="string"==typeof t?(e=>{try{return JSON.parse(e)}catch{return null}})(t):null;return e+lK.ArgParamsSeparator+JSON.stringify(r??t)}if(e===lG.Tuple&&Array.isArray(t)){if(0===t.length)return e+lK.ArgParamsSeparator;if(t.every(e=>"string"==typeof e&&e.includes(lK.ArgParamsSeparator))){let r=t.map(e=>this.getTypeAndValue(e)),n=r.map(([e])=>e),i=r.map(([,e])=>e);return`${e}(${n.join(lK.ArgCompositeSeparator)})${lK.ArgParamsSeparator}${i.join(lK.ArgListSeparator)}`}return e+lK.ArgParamsSeparator+t.join(lK.ArgListSeparator)}if(e===lG.Struct&&"object"==typeof t&&null!==t&&!Array.isArray(t)){if(!t._name)throw Error("Struct objects must have a _name property to specify the struct name");let r=t._name,n=Object.keys(t).filter(e=>"_name"!==e);if(0===n.length)return`${e}(${r})${lK.ArgParamsSeparator}`;let i=n.map(e=>{let[r,n]=this.getTypeAndValue(t[e]);return`(${e}${lK.ArgParamsSeparator}${r})${n}`});return`${e}(${r})${lK.ArgParamsSeparator}${i.join(lK.ArgListSeparator)}`}if(e.startsWith(lG.Vector)&&Array.isArray(t)){if(0===t.length)return`${e}${lK.ArgParamsSeparator}`;let r=e.includes(lK.IdentifierParamSeparator)?e.split(lK.IdentifierParamSeparator)[1]:"string"==typeof t[0]&&t[0].includes(lK.ArgParamsSeparator)?t[0].substring(0,t[0].indexOf(lK.ArgParamsSeparator)):null;if(!r)return e+lK.ArgParamsSeparator+t.join(lK.ArgListSeparator);let n=t.map(e=>{if("string"==typeof e&&e.includes(lK.ArgParamsSeparator)){let t=e.indexOf(lK.ArgParamsSeparator),n=e.substring(t+1);return r.startsWith(lG.Tuple)?n.replace(lK.ArgListSeparator,lK.ArgCompositeSeparator):n}return String(e)}),i=r.startsWith(lG.Struct)?lK.ArgStructSeparator:lK.ArgListSeparator;return e+lK.ArgParamsSeparator+r+lK.ArgParamsSeparator+n.join(i)}if(e===lG.Asset&&"object"==typeof t&&t&&"identifier"in t&&"amount"in t)return"decimals"in t?lG.Asset+lK.ArgParamsSeparator+t.identifier+lK.ArgCompositeSeparator+String(t.amount)+lK.ArgCompositeSeparator+String(t.decimals):lG.Asset+lK.ArgParamsSeparator+t.identifier+lK.ArgCompositeSeparator+String(t.amount);
13if(this.typeRegistry){let r=this.typeRegistry.getHandler(e);if(r)return r.nativeToString(t);let n=this.typeRegistry.resolveType(e);if(n!==e)return this.nativeToString(n,t)}if("json"===e){let r="string"==typeof t?t:JSON.stringify(t);return e+lK.ArgParamsSeparator+r}return e+lK.ArgParamsSeparator+(t?.toString()??"")}stringToNative(e){let t=e.split(lK.ArgParamsSeparator),r=fo[t[0]]??t[0],n=t.slice(1).join(lK.ArgParamsSeparator);if(fs.test(r)){if(!n)return[r,[]];try{return[r,JSON.parse(n)]}catch{return[r,n]}}if("null"===r)return[r,null];if(r===lG.Option){let[e,t]=n.split(lK.ArgParamsSeparator);return[lG.Option+lK.ArgParamsSeparator+e,t||null]}if(r===lG.Vector){let e=n.indexOf(lK.ArgParamsSeparator),t=n.substring(0,e),r=n.substring(e+1),i=t.startsWith(lG.Struct)?lK.ArgStructSeparator:lK.ArgListSeparator,a=(r?r.split(i):[]).map(e=>this.stringToNative(t+lK.ArgParamsSeparator+e)[1]);return[lG.Vector+lK.ArgParamsSeparator+t,a]}if(r.startsWith(lG.Tuple)){let e=r.match(/\(([^)]+)\)/)?.[1]?.split(lK.ArgCompositeSeparator);return[r,n.split(lK.ArgCompositeSeparator).map((t,r)=>this.stringToNative(`${e[r]}${lK.IdentifierParamSeparator}${t}`)[1])]}if(r.startsWith(lG.Struct)){let e=r.match(/\(([^)]+)\)/);if(!e)throw Error("Struct type must include a name in the format struct(Name)");let t={_name:e[1]};return n&&n.split(lK.ArgListSeparator).forEach(e=>{let r=e.match(RegExp(`^\\(([^${lK.ArgParamsSeparator}]+)${lK.ArgParamsSeparator}([^)]+)\\)(.+)$`));if(r){let[,e,n,i]=r;t[e]=this.stringToNative(`${n}${lK.IdentifierParamSeparator}${i}`)[1]}}),[r,t]}if(r===lG.String)return[r,n];if(r===lG.Uint8||r===lG.Uint16||r===lG.Uint32)return[r,Number(n)];if(r===lG.Uint64||r===lG.Uint128||r===lG.Uint256||r===lG.Biguint)return[r,BigInt(n||0)];if(r===lG.Bool)return[r,"true"===n];if(r===lG.Address||r===lG.Hex||r===lG.Datetime)return[r,n];if(r===lG.Asset){let[e,t,i]=n.split(lK.ArgCompositeSeparator),a={identifier:e,amount:BigInt(t)};return void 0!==i&&(a.decimals=Number(i)),[r,a]}if(this.typeRegistry){let e=this.typeRegistry.getHandler(r);if(e)return[r,e.stringToNative(n)];let t=this.typeRegistry.resolveType(r);if(t!==r){let[e,i]=this.stringToNative(`${t}:${n}`);return[r,i]}}if("json"===r)try{return[r,JSON.parse(n)]}catch{return[r,n]}if("chain"===r||"nft"===r||"email"===r||"textarea"===r||"file"===r||"text"===r)return[r,n];throw Error(`WarpArgSerializer (stringToNative): Unsupported input type: ${r}`)}getTypeAndValue(e){if("string"==typeof e&&e.includes(lK.ArgParamsSeparator)){let[t,r]=e.split(lK.ArgParamsSeparator);return[t,r]}return"number"==typeof e?[lG.Uint32,e]:"bigint"==typeof e?[lG.Uint64,e]:"boolean"==typeof e?[lG.Bool,e]:[typeof e,e]}},fl=e=>new fu().nativeToString(lG.String,e),fc=e=>new fu().nativeToString(lG.Uint64,e),ff=e=>new fu().nativeToString(lG.Address,e),fd=e=>new fu().nativeToString(lG.Asset,e),fp=class{constructor(e){this.pendingBrand={protocol:ci("brand"),name:"",description:"",logo:""},this.config=e}async createFromRaw(e,t=!0){let r=JSON.parse(e);return t&&await this.ensureValidSchema(r),r}setName(e){return this.pendingBrand.name=e,this}setDescription(e){return this.pendingBrand.description=e,this}setLogo(e){return this.pendingBrand.logo=e,this}setUrls(e){return this.pendingBrand.urls=e,this}setColors(e){return this.pendingBrand.colors=e,this}setCta(e){return this.pendingBrand.cta=e,this}async build(){return this.ensureWarpText(this.pendingBrand.name,"name is required"),this.ensureWarpText(this.pendingBrand.description,"description is required"),"string"==typeof this.pendingBrand.logo&&this.ensure(this.pendingBrand.logo,"logo is required"),await this.ensureValidSchema(this.pendingBrand),this.pendingBrand}ensure(e,t){if(!e)throw Error(`Warp: ${t}`)}ensureWarpText(e,t){if(!e||"object"==typeof e&&0===Object.keys(e).length)throw Error(`Warp: ${t}`)}async ensureValidSchema(e){let t=this.config.schema?.brand||lQ.LatestBrandSchemaUrl,r=await (await fetch(t)).json(),n=new lk,i=n.compile(r);if(!i(e))throw Error(`BrandBuilder: schema validation failed: ${n.errorsText(i.errors)}`)}},fh={$ref:"#/definitions/Warp",$schema:"http://json-schema.org/draft-07/schema#",definitions:{Warp:{additionalProperties:!1,properties:{actions:{items:{$ref:"#/definitions/WarpAction"},type:"array"},bot:{type:"string"},chain:{$ref:"#/definitions/WarpChainName"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},meta:{$ref:"#/definitions/WarpMeta"},name:{type:"string"},next:{$ref:"#/definitions/WarpNextConfig"},output:{additionalProperties:{$ref:"#/definitions/WarpResulutionPath"},type:"object"},preview:{type:"string"},protocol:{type:"string"},related:{items:{$ref:"#/definitions/WarpRelatedEntry"},type:"array"},schedule:{$ref:"#/definitions/WarpSchedule"},sections:{items:{$ref:"#/definitions/WarpSection"},type:"array"},title:{$ref:"#/definitions/WarpText"},trigger:{$ref:"#/definitions/WarpTrigger"},ui:{type:"string"},vars:{additionalProperties:{type:"string"},type:"object"}},required:["protocol","name","title","description","actions"],type:"object"},WarpAction:{anyOf:[{$ref:"#/definitions/WarpTransferAction"},{$ref:"#/definitions/WarpContractAction"},{$ref:"#/definitions/WarpQueryAction"},{$ref:"#/definitions/WarpCollectAction"},{$ref:"#/definitions/WarpComputeAction"},{$ref:"#/definitions/WarpLinkAction"},{$ref:"#/definitions/WarpMcpAction"},{$ref:"#/definitions/WarpPromptAction"},{$ref:"#/definitions/WarpStateAction"},{$ref:"#/definitions/WarpMountAction"},{$ref:"#/definitions/WarpUnmountAction"},{$ref:"#/definitions/WarpLoopAction"},{$ref:"#/definitions/WarpInlineAction"}]},WarpActionInput:{additionalProperties:!1,properties:{accept:{items:{type:"string"},type:"array"},as:{type:"string"},bot:{type:"string"},default:{type:["string","number","boolean"]},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},label:{$ref:"#/definitions/WarpText"},max:{anyOf:[{type:"number"},{$ref:"#/definitions/WarpVarPlaceholder"}]},min:{anyOf:[{type:"number"},{$ref:"#/definitions/WarpVarPlaceholder"}]},modifier:{type:"string"},name:{type:"string"},options:{anyOf:[{items:{type:"string"},type:"array"},{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"}]},pattern:{type:"string"},patternDescription:{$ref:"#/definitions/WarpText"},position:{$ref:"#/definitions/WarpActionInputPosition"},required:{type:"boolean"},source:{$ref:"#/definitions/WarpActionInputSource"},type:{$ref:"#/definitions/WarpActionInputType"}},required:["name","type","source"],type:"object"},WarpActionInputPosition:{anyOf:[{const:"receiver",type:"string"},{const:"value",type:"string"},{const:"transfer",type:"string"},{const:"arg:1",type:"string"},{const:"arg:2",type:"string"},{const:"arg:3",type:"string"},{const:"arg:4",type:"string"},{const:"arg:5",type:"string"},{const:"arg:6",type:"string"},{const:"arg:7",type:"string"},{const:"arg:8",type:"string"},{const:"arg:9",type:"string"},{const:"arg:10",type:"string"},{const:"data",type:"string"},{const:"chain",type:"string"},{type:"string"},{const:"destination",type:"string"},{const:"local",type:"string"},{$ref:"#/definitions/WarpActionInputPositionAssetObject"}]},WarpActionInputPositionAssetObject:{additionalProperties:!1,properties:{amount:{type:"string"},token:{type:"string"}},required:["token","amount"],type:"object"},WarpActionInputSource:{enum:["field","query","user:wallet","hidden"],type:"string"},WarpActionInputType:{type:"string"},WarpActionType:{enum:["transfer","contract","query","collect","compute","link","mcp","prompt","state","mount","unmount","loop","inline"],type:"string"},WarpChainName:{enum:["multiversx","claws","sui","ethereum","base","arbitrum","polygon","somnia","tempo","fastset","solana","near"],type:"string"},WarpCollectAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},destination:{$ref:"#/definitions/WarpCollectDestination"},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{$ref:"#/definitions/WarpActionType"},when:{type:"string"}},required:["type","label"],type:"object"},WarpCollectDestination:{anyOf:[{$ref:"#/definitions/WarpCollectDestinationHttp"},{type:"string"}]},WarpCollectDestinationHttp:{additionalProperties:!1,properties:{headers:{additionalProperties:{type:"string"},type:"object"},method:{enum:["GET","POST","PUT","DELETE"],type:"string"},url:{type:"string"}},required:["url"],type:"object"},WarpComputeAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{const:"compute",type:"string"},when:{type:"string"}},required:["type","label"],type:"object"},WarpContractAction:{additionalProperties:!1,properties:{abi:{type:"string"},address:{type:"string"},args:{items:{type:"string"},type:"array"},auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},func:{type:["string","null"]},gasLimit:{type:"number"},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},transfers:{items:{type:"string"},type:"array"},type:{$ref:"#/definitions/WarpActionType"},value:{type:"string"},when:{type:"string"}},required:["type","label","gasLimit"],type:"object"},WarpI18nText:{additionalProperties:{type:"string"},type:"object"},WarpInlineAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},output:{additionalProperties:{type:"string"},type:"object"},silent:{type:"boolean"}
13,type:{const:"inline",type:"string"},warp:{type:"string"},when:{type:"string"}},required:["type","label","warp"],type:"object"},WarpLinkAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},type:{$ref:"#/definitions/WarpActionType"},url:{type:"string"},when:{type:"string"}},required:["type","label","url"],type:"object"},WarpLoopAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},delay:{type:"number"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},maxIterations:{type:"number"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{const:"loop",type:"string"},when:{type:"string"}},required:["type","label"],type:"object"},WarpMcpAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},destination:{$ref:"#/definitions/WarpMcpDestination"},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{$ref:"#/definitions/WarpActionType"},when:{type:"string"}},required:["type","label"],type:"object"},WarpMcpDestination:{additionalProperties:!1,properties:{headers:{additionalProperties:{type:"string"},type:"object"},tool:{type:"string"},url:{type:"string"}},required:["url","tool"],type:"object"},WarpMeta:{additionalProperties:!1,properties:{chain:{anyOf:[{$ref:"#/definitions/WarpChainName"},{type:"null"}]},createdAt:{type:"string"},creator:{type:"string"},hash:{type:"string"},identifier:{type:"string"},query:{anyOf:[{type:"object"},{type:"null"}]}},required:["chain","identifier","query","hash","creator","createdAt"],type:"object"},WarpMountAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{const:"mount",type:"string"},warp:{type:"string"},when:{type:"string"}},required:["type","label","warp"],type:"object"},WarpNextConfig:{anyOf:[{$ref:"#/definitions/WarpNextEntry"},{items:{$ref:"#/definitions/WarpNextEntry"},type:"array"},{additionalProperties:!1,properties:{error:{anyOf:[{$ref:"#/definitions/WarpNextEntry"},{items:{$ref:"#/definitions/WarpNextEntry"},type:"array"}]},success:{anyOf:[{$ref:"#/definitions/WarpNextEntry"},{items:{$ref:"#/definitions/WarpNextEntry"},type:"array"}]}},type:"object"}]},WarpNextEntry:{anyOf:[{type:"string"},{additionalProperties:!1,properties:{identifier:{type:"string"},when:{type:"string"}},required:["identifier"],type:"object"}]},"WarpPlatformValue<string>":{anyOf:[{type:"string"},{additionalProperties:!1,properties:{linux:{type:"string"},macos:{type:"string"},windows:{type:"string"}},type:"object"}]},WarpPromptAction:{additionalProperties:!1,properties:{as:{type:"string"},auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},expect:{anyOf:[{type:"string"},{type:"object"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},model:{type:"string"},next:{$ref:"#/definitions/WarpNextConfig"},prompt:{$ref:"#/definitions/WarpPlatformValue%3Cstring%3E"},type:{$ref:"#/definitions/WarpActionType"},when:{type:"string"}},required:["type","label","prompt"],type:"object"},WarpQueryAction:{additionalProperties:!1,properties:{abi:{type:"string"},address:{type:"string"},args:{items:{type:"string"},type:"array"},auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},func:{type:"string"},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{$ref:"#/definitions/WarpActionType"},when:{type:"string"}},required:["type","label"],type:"object"},WarpRelatedEntry:{anyOf:[{type:"string"},{additionalProperties:!1,properties:{bot:{type:"string"},identifier:{type:"string"}},required:["identifier"],type:"object"}]},WarpResulutionPath:{type:"string"},WarpSchedule:{enum:["minutely","hourly","daily","weekly","monthly","yearly"],type:"string"},WarpSection:{additionalProperties:!1,properties:{description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{type:"string"},type:"array"},title:{$ref:"#/definitions/WarpText"}},required:["title","inputs"],type:"object"},WarpStateAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},data:{type:"object"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},keys:{items:{type:"string"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},op:{enum:["read","write","clear"],type:"string"},store:{type:"string"},type:{const:"state",type:"string"},when:{type:"string"}},required:["type","label","op","store"],type:"object"},WarpText:{anyOf:[{type:"string"},{$ref:"#/definitions/WarpI18nText"}]},WarpTransferAction:{additionalProperties:!1,properties:{address:{type:"string"},auto:{type:"boolean"},data:{type:"string"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},transfers:{items:{type:"string"},type:"array"},type:{$ref:"#/definitions/WarpActionType"},value:{type:"string"},when:{type:"string"}},required:["type","label"],type:"object"},WarpTrigger:{anyOf:[{additionalProperties:!1,properties:{pattern:{type:"string"},type:{const:"message",type:"string"}},required:["type","pattern"],type:"object"},{additionalProperties:!1,properties:{body:{$ref:"#/definitions/WarpText"},inputs:{additionalProperties:{type:"string"},type:"object"},label:{$ref:"#/definitions/WarpText"},match:{additionalProperties:{type:["string","number","boolean"]},type:"object"},source:{type:"string"},subject:{$ref:"#/definitions/WarpText"},type:{const:"webhook",type:"string"}},required:["type","source"],type:"object"}]},WarpUnmountAction:{additionalProperties:!1,properties:{auto:{type:"boolean"},description:{anyOf:[{$ref:"#/definitions/WarpText"},{type:"null"}]},inputs:{items:{$ref:"#/definitions/WarpActionInput"},type:"array"},label:{$ref:"#/definitions/WarpText"},messages:{additionalProperties:{$ref:"#/definitions/WarpText"},type:"object"},next:{$ref:"#/definitions/WarpNextConfig"},type:{const:"unmount",type:"string"},warp:{type:"string"},when:{type:"string"}},required:["type","label","warp"],type:"object"},WarpVarPlaceholder:{type:"string"}}},fm=new Set(["POST","PUT","PATCH","DELETE"]),fy=/^[A-Z][A-Z0-9_]*$/,fg=class{constructor(e){this.config=e,this.config=e}async validate(e){let t=[];return t.push(...this.validateHasActions(e)),t.push(...this.validateMaxOneValuePosition(e)),t.push(...this.validateVariableNamesAndResultNamesUppercase(e)),t.push(...this.validateAbiIsSetIfApplicable(e)),t.push(...this.validateUrlPlaceholdersHaveInputs(e)),t.push(...this.validateNoArgPositionsOnHttpActions(e)),t.push(...await this.validateSchema(e)),{valid:0===t.length,errors:t}}validateHasActions(e){try{let{action:t}=co(e);return t?[]:["Warp must have at least one action"]}catch(e){return[e instanceof Error?e.message:"Warp must have at least one action"]}}validateMaxOneValuePosition(e){return e.actions.filter(e=>!!e.inputs&&e.inputs.some(e=>"value"===e.position)).length>1?["Only one value position action is allowed"]:[]}validateVariableNamesAndResultNamesUppercase(e){let t=[],r=(e,r)=>
13{e&&Object.keys(e).forEach(e=>{e!==e.toUpperCase()&&t.push(`${r} name '${e}' must be uppercase`)})};return r(e.vars,"Variable"),r(e.output,"Output"),e.trigger?.type==="webhook"&&e.trigger.inputs&&r(e.trigger.inputs,"Webhook trigger input"),t}validateAbiIsSetIfApplicable(e){let t=e.actions.some(e=>"contract"===e.type),r=e.actions.some(e=>"query"===e.type);if(!t&&!r)return[];let n=e.actions.some(e=>e.abi),i=Object.values(e.output||{}).some(e=>e.startsWith("out.")||e.startsWith("event."));return e.output&&!n&&i?["ABI is required when output is present for contract or query actions"]:[]}validateUrlPlaceholdersHaveInputs(e){let t=[],r=new Set(Object.keys(e.vars??{})),n=new Set;for(let i of e.actions){for(let e of i.inputs??[])"string"==typeof e.position&&e.position.startsWith("url:")&&n.add(e.position.slice(4));let e=i.destination;if(!e||"string"==typeof e||!e.url)continue;let a=this.extractUrlPlaceholders(e.url);if(0!==a.length)for(let i of a)r.has(i)||fy.test(i)||n.has(i)||t.push(`URL "${e.url}" contains {{${i}}} but no input has position "url:${i}" (and it is not declared in vars)`)}return t}validateNoArgPositionsOnHttpActions(e){let t=[];for(let r of e.actions){let e=r.destination;if(!e||"string"==typeof e)continue;let n=e.method?.toUpperCase();if(n&&fm.has(n)){for(let e of r.inputs??[])if(e.position?.startsWith("arg:")){let r=e.as??e.name??"(unnamed)";t.push(`Input "${r}" has position "${e.position}" on HTTP ${n} action \u2014 CLI arg positions are not sent in the JSON body. Remove the position (defaults to body) or use "payload:X" / "url:X" explicitly.`)}}}return t}extractUrlPlaceholders(e){let t=e.split("?")[0].match(/\{\{([a-zA-Z_][a-zA-Z_0-9]*)\}\}/g);return t?t.map(e=>e.slice(2,-2)):[]}async validateSchema(e){try{let t=this.config.schema?.warp?await (await fetch(this.config.schema.warp)).json():fh,r=new lk({strict:!1}),n=r.compile(t);return n(e)?[]:[`Schema validation failed: ${r.errorsText(n.errors)}`]}catch(e){return[`Schema validation failed: ${e instanceof Error?e.message:String(e)}`]}}},fb=class{constructor(e){this.config=e,this.pendingWarp={protocol:ci("warp"),name:"",title:"",description:null,preview:"",actions:[]}}async createFromRaw(e,t=!0){let r=JSON.parse(e);return t&&await this.validate(r),r}async createFromUrl(e){return await (await fetch(e)).json()}setChain(e){return this.pendingWarp.chain=e,this}setName(e){return this.pendingWarp.name=e,this}setTitle(e){return this.pendingWarp.title=e,this}setDescription(e){return this.pendingWarp.description=e,this}setPreview(e){return this.pendingWarp.preview=e,this}setActions(e){return this.pendingWarp.actions=e,this}addAction(e){return this.pendingWarp.actions.push(e),this}setOutput(e){return this.pendingWarp.output=e??void 0,this}async build(e=!0){return this.ensure(this.pendingWarp.protocol,"protocol is required"),this.ensure(this.pendingWarp.name,"name is required"),this.ensureWarpText(this.pendingWarp.title,"title is required"),this.ensure(this.pendingWarp.actions.length>0,"actions are required"),e&&await this.validate(this.pendingWarp),this.pendingWarp}getDescriptionPreview(e,t=100){return((e,t=100)=>{if(!e)return"";let r=e.replace(/<\/?(h[1-6])[^>]*>/gi," - ").replace(/<\/?(p|div|ul|ol|li|br|hr)[^>]*>/gi," ").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();return(r=r.startsWith("- ")?r.slice(2):r).length>t?r.substring(0,r.lastIndexOf(" ",t))+"...":r})(e,t)}ensure(e,t){if(!e)throw Error(t)}ensureWarpText(e,t){if(!e||"object"==typeof e&&!e.en)throw Error(t)}async validate(e){let t=await new fg(this.config).validate(e);if(!t.valid)throw Error(t.errors.join(`
14`))}},fw="$bigint:",fv=(e,t)=>"bigint"==typeof t?fw+t.toString():t,fx=(e,t)=>"string"==typeof t&&t.startsWith(fw)?BigInt(t.slice(fw.length)):t,f$=class{constructor(e,t){this.prefix="warp-cache"}getKey(e){return`${this.prefix}:${e}`}async get(e){try{let t=localStorage.getItem(this.getKey(e));if(!t)return null;let r=JSON.parse(t,fx);return null!==r.expiresAt&&Date.now()>r.expiresAt?(localStorage.removeItem(this.getKey(e)),null):r.value}catch{return null}}async set(e,t,r){let n={value:t,expiresAt:r?Date.now()+1e3*r:null};localStorage.setItem(this.getKey(e),JSON.stringify(n,fv))}async delete(e){localStorage.removeItem(this.getKey(e))}async keys(e){let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(this.prefix+":")&&t.push(r.slice(this.prefix.length+1))}if(!e)return t;
14let r=RegExp("^"+e.replace(/\*/g,".*")+"$");return t.filter(e=>r.test(e))}async clear(){for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t?.startsWith(this.prefix)&&localStorage.removeItem(t)}}},fE=class e{constructor(e,t){}async get(t){let r=e.cache.get(t);return r?null!==r.expiresAt&&Date.now()>r.expiresAt?(e.cache.delete(t),null):r.value:null}async set(t,r,n){let i=n?Date.now()+1e3*n:null;e.cache.set(t,{value:r,expiresAt:i})}async delete(t){e.cache.delete(t)}async keys(t){let r=Array.from(e.cache.keys());if(!t)return r;let n=RegExp("^"+t.replace(/\*/g,".*")+"$");return r.filter(e=>n.test(e))}async clear(){e.cache.clear()}};fE.cache=new Map;var fP={OneMinute:60,OneHour:3600,OneDay:86400,OneWeek:604800,OneMonth:2592e3,OneYear:31536e3},f_={Warp:(e,t)=>`warp:${e}:${t}`,WarpAbi:(e,t)=>`warp-abi:${e}:${t}`,WarpExecutable:(e,t,r)=>`warp-exec:${e}:${t}:${r}`,RegistryInfo:(e,t)=>`registry-info:${e}:${t}`,Brand:(e,t)=>`brand:${e}:${t}`,Asset:(e,t,r)=>`asset:${e}:${t}:${r}`,AccountNfts:(e,t,r,n,i)=>`account-nfts:${e}:${t}:${r}:${n}:${i}`},fA=class{constructor(e,t){this.strategy=function(e,t){if(t?.adapter)return t.adapter;if(t?.type==="localStorage")return new f$(e,t);if(t?.type==="memory")return new fE(e,t);if(t?.type==="static"||t?.type==="filesystem")throw Error(`WarpCache: "${t.type}" cache is only available in Node.js`);return"u">typeof window&&window.localStorage?new f$(e,t):new fE(e,t)}(e,t)}async set(e,t,r){await this.strategy.set(e,t,r)}async get(e){return await this.strategy.get(e)}async delete(e){await this.strategy.delete(e)}async keys(e){return await this.strategy.keys(e)}async clear(){await this.strategy.clear()}},fI="QUERIES",fS="PAYLOAD",fz=(e,t,r)=>{let n=e.find(e=>e.input.as===t||e.input.name===t);if(!n?.value)return null;let[,i]=r.stringToNative(n.value);return"string"==typeof i?i:JSON.stringify(i)},fk=e=>{try{return JSON.parse(e)}catch{return null}},fO=async(e,t,r,n,i,a)=>{let s=new Headers;if(s.set("Content-Type","application/json"),s.set("Accept","application/json"),a&&n){let{message:e,nonce:t,expiresAt:i}=await c8(n,`${r.chain.name}-adapter`),o=await a({message:e,chain:r.chain});o&&Object.entries({"X-Signer-Wallet":n,"X-Signer-Signature":o,"X-Signer-Nonce":t,"X-Signer-ExpiresAt":i}).forEach(([e,t])=>s.set(e,t))}let o=fz(r.resolvedInputs,"HEADERS",i);if(o){let e=fk(o);e&&"object"==typeof e&&Object.entries(e).forEach(([e,t])=>"string"==typeof t&&s.set(e,t))}else t.headers&&Object.entries(t.headers).forEach(([t,n])=>{s.set(t,e.applyInputs(n,r.resolvedInputs,i))});return s},fC=async(e,t,r,n,i,a,s,o)=>{let u=t.method||"GET",l=await fO(e,t,r,n,a,o),c=((e,t,r,n,i)=>{let a=e.applyInputs(t.url,r.resolvedInputs,i);if("GET"===n){let e=fz(r.resolvedInputs,fI,i);if(e){let t=fk(e);if(t&&"object"==typeof t){let e=new URL(a);Object.entries(t).forEach(([t,r])=>null!=r&&e.searchParams.set(t,String(r))),a=e.toString()}}}return a})(e,t,r,u,a),f=((e,t,r,n,i)=>{if("GET"===e)return;let a=fz(t.resolvedInputs,fS,n);if(a&&null!==fk(a))return a;let{[fS]:s,[fI]:o,...u}=r;return JSON.stringify({...u,...i})})(u,r,i,a,s);return{url:c,method:u,headers:l,body:f}},fT=class{constructor(e,t,r){this.config=e,this.adapter=t,this.adapters=r}async apply(e,t={}){let r=this.applyVars(e,t),n=await this.applyGlobals(r);return t.envs?this.applyEnvs(n,t.envs):n}applyEnvs(e,t){if(!t||0===Object.keys(t).length)return e;let r=JSON.stringify(e);for(let[e,n]of Object.entries(t)){if(null==n)continue;let t=JSON.stringify("object"==typeof n?JSON.stringify(n,(e,t)=>"bigint"==typeof t?t.toString():t):String(n)).slice(1,-1);r=r.replace(RegExp(`\\{\\{${fB(e)}\\}\\}`,"g"),t)}return JSON.parse(r)}async applyGlobals(e){let t={...e};return t.actions=await Promise.all((t.actions||[]).map(async e=>await this.applyActionGlobals(e))),t=await this.applyRootGlobals(t)}applyVars(e,t={}){if(!e?.vars)return e;let r=lj(this.config,this.adapter.chainInfo.name),n=JSON.stringify(e),i=(e,t)=>{n=n.replace(RegExp(`{{${e.toUpperCase()}}}`,"g"),t.toString())};return Object.entries(e.vars).forEach(([e,n])=>{if("string"!=typeof n)i(e,n);else if(n.startsWith(lK.Vars.Query+lK.ArgParamsSeparator)){let[r,a]=n.slice(lK.Vars.Query.length+1).split(lK.ArgCompositeSeparator),s=this.config.currentUrl?new URLSearchParams(this.config.currentUrl.split("?")[1]).get(r):null,o=t.queries?.[r]??null??s;null!=o&&i(e,o)}else if(n.startsWith(lK.Vars.Env+lK.ArgParamsSeparator)){let[r,a]=n.slice(lK.Vars.Env.length+1).split(lK.ArgCompositeSeparator),s={...this.config.vars,...t.envs}[r];null!=s&&i(e,s)}else n===lK.Source.UserWallet&&r?i(e,r):i(e,n)}),JSON.parse(n)}async applyRootGlobals(e){let t=JSON.stringify(e),r={config:this.config,adapter:this.adapter};
14return Object.values(lK.Globals).forEach(e=>{let n=e.Accessor(r);null!=n&&(t=t.replace(RegExp(`{{${e.Placeholder}}}`,"g"),n.toString())),t=this.replacePlaceholdersWithChain(t,e.Placeholder,r,e.Accessor)}),JSON.parse(t)}async applyActionGlobals(e){let t=JSON.stringify(e),r={config:this.config,adapter:this.adapter};return Object.values(lK.Globals).forEach(e=>{let n=e.Accessor(r);null!=n&&(t=t.replace(RegExp(`{{${e.Placeholder}}}`,"g"),n.toString())),t=this.replacePlaceholdersWithChain(t,e.Placeholder,r,e.Accessor)}),JSON.parse(t)}applyInputs(e,t,r,n={}){if(!e||"string"!=typeof e||!e.includes("{{"))return e;let i=this.applyGlobalsToText(e),a=this.buildInputBag(t,r);return n.preserveUnknown&&t.forEach(({input:e})=>{let t=e.as||e.name;Object.prototype.hasOwnProperty.call(a,t)||(a[t]="")}),cc(i,a,n.preserveUnknown??!1)}applyGlobalsToText(e){if(!Object.values(lK.Globals).map(e=>e.Placeholder).some(t=>e.includes(`{{${t}}}`)||e.includes(`{{${t}:`)))return e;let t={config:this.config,adapter:this.adapter},r=e;return Object.values(lK.Globals).forEach(e=>{let n=e.Accessor(t);null!=n&&(r=r.replace(RegExp(`{{${e.Placeholder}}}`,"g"),n.toString())),r=this.replacePlaceholdersWithChain(r,e.Placeholder,t,e.Accessor)}),r}replacePlaceholdersWithChain(e,t,r,n){let i=RegExp(`\\{\\{${t}:([^}]+)\\}\\}`,"g");return e.replace(i,(e,t)=>{let r=t.trim().toLowerCase();if(!this.adapters)return e;try{let t=cn(r,this.adapters),i={config:this.config,adapter:t},a=n(i);return null!=a?a.toString():e}catch{return e}})}buildInputBag(e,t){let r={};return e.forEach(e=>{if(!e.value)return;let n=e.input.as||e.input.name,[,i]=t.stringToNative(e.value);r[n]=String(i)}),r}},fB=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fj=["collect","compute","mcp","state","mount","unmount"],fN=class{constructor(e,t){if(this.config=e,this.adapters=t,!e.currentUrl)throw Error("WarpFactory: currentUrl config not set");this.url=new URL(e.currentUrl),this.serializer=new fu,this.cache=new fA(e.env,e.cache)}getSerializer(){return this.serializer}getCache(){return this.cache}async getResolvedInputsFromCache(e,t,r){return cW(await this.cache.get(f_.WarpExecutable(e,t||"",r))||[])}async getRawResolvedInputsFromCache(e,t,r){return await this.cache.get(f_.WarpExecutable(e,t||"",r))||[]}async createExecutable(e,t,r,n={}){let i=ca(e,t);if(!i)throw Error("WarpFactory: Action not found");let a=await this.getChainInfoForWarp(e,r),s=cn(a.name,this.adapters),o=new fT(this.config,s,this.adapters),u=await o.apply(e,n),l=ca(u,t),{action:c,index:f}=co(u),d=[],p=[];if(f===t-1){let e=this.getStringTypedInputs(c,r);d=await this.getResolvedInputs(a.name,c,e,o,n.queries),p=await this.getModifiedInputs(d)}else l.inputs&&l.inputs.length>0&&(d=await this.resolveActionInputs(a.name,l,r,o,n.queries),p=await this.getModifiedInputs(d));let h=p.find(e=>"receiver"===e.input.position||"destination"===e.input.position)?.value,m=this.getDestinationFromAction(l),y=h?this.serializer.stringToNative(h)[1]:m;if(y&&(y=o.applyInputs(y,p,this.serializer)),!y&&!fj.includes(i.type))throw Error("WarpActionExecutor: Destination/Receiver not provided");let g=this.getPreparedArgs(l,p);g=g.map(e=>o.applyInputs(e,p,this.serializer));let b=p.find(e=>"value"===e.input.position)?.value||null,w="value"in l?l.value:null,v=b?.split(lK.ArgParamsSeparator)[1]||w||"0",x=BigInt(o.applyInputs(v,p,this.serializer)),$=p.filter(e=>"transfer"===e.input.position&&e.value).map(e=>e.value),E=[...("transfers"in l?l.transfers:[])||[],...$||[]].map(e=>{let t=o.applyInputs(e,p,this.serializer),r=t.startsWith(`asset${lK.ArgParamsSeparator}`)?t:`asset${lK.ArgParamsSeparator}${t}`;return this.serializer.stringToNative(r)[1]}),P=p.find(e=>"data"===e.input.position)?.value,_="data"in l?l.data||"":null,A=P||_||null,I={adapter:s,warp:u,chain:a,action:t,destination:y,args:g,value:x,transfers:E,data:A?o.applyInputs(A,p,this.serializer):null,resolvedInputs:p};return await this.cache.set(f_.WarpExecutable(this.config.env,u.meta?.hash||"",t),I.resolvedInputs,fP.OneWeek),I}async getChainInfoForWarp(e,t){if(e.chain)return cn(e.chain,this.adapters).chainInfo;if(t){let r=await this.tryGetChainFromInputs(e,t);if(r)return r}return this.adapters[0].chainInfo}
14getStringTypedInputs(e,t){let r=e.inputs||[];return t.map((e,t)=>{let n=r[t];return n?this.toTypedInput(n.type,e):e})}async getResolvedInputs(e,t,r,n,i){let a=t.inputs||[],s=r.map(e=>n.applyInputs(e,[],this.serializer,{preserveUnknown:!0})),o=await Promise.all(s.map(t=>this.preprocessInput(e,t))),u=(t,r)=>{if(t.source===lK.Source.UserWallet){let t=lj(this.config,e);return t?this.toTypedInput("address",t):null}if("hidden"===t.source){if(void 0===t.default)return null;let e=n?n.applyInputs(String(t.default),[],this.serializer,{preserveUnknown:!0}):String(t.default);return this.toTypedInput(t.type,e)}if(o[r])return o[r];let a=t.as||t.name,s=i?.[a],u=this.url.searchParams.get(a),l=s||u;return l?this.toTypedInput(t.type,String(l)):null};return a.map((e,t)=>{let r=u(e,t),i=void 0!==e.default?n?n.applyInputs(String(e.default),[],this.serializer,{preserveUnknown:!0}):String(e.default):void 0;return{input:e,value:r||(void 0!==i?this.toTypedInput(e.type,i):null)}})}toTypedInput(e,t){return cI(t)?t:this.serializer.nativeToString(e,t)}async resolveInputsFromQuery(e,t,r){let n=ca(e,t);if(!n||!n.inputs?.length)return[];let i=await this.getChainInfoForWarp(e),a=cn(i.name,this.adapters),s=new fT(this.config,a,this.adapters);return this.getResolvedInputs(i.name,n,[],s,r)}requiresPayloadInputs(e){return e.inputs?.some(e=>"string"==typeof e.position&&e.position.startsWith("payload:"))??!1}async resolveActionInputs(e,t,r,n,i){let a=this.getStringTypedInputs(t,r);return await this.getResolvedInputs(e,t,a,n,i)}async getModifiedInputs(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];if(n.input.modifier?.startsWith("scale:")){let[,r]=n.input.modifier.split(":");if(isNaN(Number(r))){let i=Number(e.find(e=>e.input.name===r)?.value?.split(":")[1]);if(!i)throw Error(`WarpActionExecutor: Exponent value not found for input ${r}`);let a=n.value?.split(":")[1];if(!a)throw Error("WarpActionExecutor: Scalable value not found");let s=cl(a,+i);t.push({...n,value:`${n.input.type}:${s}`})}else{let e=n.value?.split(":")[1];if(!e)throw Error("WarpActionExecutor: Scalable value not found");let i=cl(e,+r);t.push({...n,value:`${n.input.type}:${i}`})}}else if(n.input.modifier?.startsWith(lK.Transform.Prefix)){let r=n.input.modifier.substring(lK.Transform.Prefix.length),i=this.config.transform?.runner;if(!i||"function"!=typeof i.run)throw Error("Transform modifier is defined but no transform runner is configured. Provide a runner via config.transform.runner.");let a=cV(e,this.serializer),s=n.value?this.serializer.stringToNative(n.value)[1]:null,o=await i.run(r,[s,a]);if(null==o)t.push(n);else{let e=this.serializer.nativeToString(n.input.type,o);t.push({...n,value:e})}}else if(n.input.modifier?.startsWith("crypto:")){let[,r,i]=n.input.modifier.split(":"),a="sha256"===r&&i?e.find(e=>(e.input.as||e.input.name)===i):null,s=a?.value?this.serializer.stringToNative(a.value)[1]??null:null;if(s){let e=await (await fetch(s)).arrayBuffer(),r=Array.from(new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",e))).map(e=>e.toString(16).padStart(2,"0")).join("");t.push({...n,value:this.serializer.nativeToString("string",r)})}else t.push(n)}else t.push(n)}return t}async preprocessInput(e,t){try{let[r,n]=cA(t),i=cn(e,this.adapters);if("asset"!==r)return t;{let[e,r,a]=n.split(lK.ArgCompositeSeparator);if(a)return t;let s=await i.dataLoader.getAsset(e);if(!s)throw Error(`WarpFactory: Asset not found for asset ${e}`);if("number"!=typeof s.decimals)throw Error(`WarpFactory: Decimals not found for asset ${e}`);let o=cl(r,s.decimals);return fd({...s,amount:o})}}catch(e){throw cF.warn("WarpFactory: Preprocess input failed",e),e}}getDestinationFromAction(e){if("address"in e&&e.address)return e.address;if("destination"in e&&e.destination){if("string"==typeof e.destination)return e.destination;if("object"==typeof e.destination&&"url"in e.destination)return e.destination.url}return null}getPreparedArgs(e,t){let r="args"in e&&e.args||[],n=[];return t.forEach(({input:e,value:t})=>{if(!(!t||!e.position)){if("object"==typeof e.position){if("asset"!==e.type)throw Error(`WarpFactory: Object position is only supported for asset type. Input "${e.name}" has type "${e.type}"`);if(!e.position.token?.startsWith("arg:")||!e.position.amount?.startsWith("arg:"))throw Error(`WarpFactory: Object position must have token and amount as arg:N. Input "${e.name}"`);let[r,i]=this.serializer.stringToNative(t);if(!i||"object"!=typeof i||!("identifier"in i)||!("amount"in i))throw Error(`WarpFactory: Invalid asset value for input "${e.name}"`);let a=Number(e.position.token.split(":")[1])-1,s=Number(e.position.amount.split(":")[1])-1;n.push({index:a,value:this.serializer.nativeToString("address",i.identifier)}),n.push({index:s,value:this.serializer.nativeToString("uint256",i.amount)})}else if(e.position.startsWith("arg:")){let r=Number(e.position.split(":")[1])-1;n.push({index:r,value:t})}}}
14),n.forEach(({index:e,value:t})=>{for(;r.length<=e;)r.push(void 0);r[e]=t}),r.filter(e=>void 0!==e)}async tryGetChainFromInputs(e,t){let r=e.actions.find(e=>e.inputs?.some(e=>"chain"===e.position));if(!r)return null;let n=r.inputs?.findIndex(e=>"chain"===e.position);if(-1===n||void 0===n)return null;let i=t[n];if(!i)throw Error("Chain input not found");return cn(this.serializer.stringToNative(i)[1],this.adapters).chainInfo}},fM=class{constructor(e,t,r){this.config=e,this.adapters=t,this.handlers=r,this.loopIterations=new Map,this.active=!0,this.warpResolver=null,this._checkpointIndex=null,this.handlers=r,this.factory=new fN(e,t),e.logLevel&&cF.setLevel(e.logLevel)}setWarpResolver(e){this.warpResolver=e}stop(){this.active=!1,this.loopIterations.clear()}async execute(e,t,r={}){let n=[],i=null,a=[],s=[],o={...e.meta?.query??{},...r.queries},u={...r,queries:o},l={},c=r.scope||"default",f=e.meta?.identifier||"",d=`warp-checkpoint:${c}:${f}`,p=await this.factory.getCache().get(d),h=p?.identifier===f?p:void 0;if(h&&Object.assign(l,h.outputs),e.vars)try{let t=this.adapters?.find(t=>t.chainInfo.name===(e.chain||this.adapters[0]?.chainInfo?.name));if(t){let r=await new fT(this.config,t,this.adapters).apply(e,u);r?.actions&&(e.actions=r.actions),r?.meta&&(e.meta=r.meta)}}catch{}let{index:m}=co(e);for(let r=1;r<=e.actions.length;r++){let o=ca(e,r);if(!cu(o))continue;if(h&&r<=h.actionIndex){cF.debug(`[WarpExecutor] skipping action ${r} (checkpoint resume)`);continue}let c=Object.keys(l).length>0?{...u,envs:{...u.envs,...l}}:u;cF.debug(`[WarpExecutor] action ${r}/${e.actions.length}:`,{type:o.type,label:o.label||o.as||"",when:o.when||null}),this._checkpointIndex=null;let{tx:p,chain:y,immediateExecution:g,executable:b}=await this.executeAction(e,r,t,c);if(null!==this._checkpointIndex){let e={identifier:f,actionIndex:this._checkpointIndex,outputs:{...l}};return await this.factory.getCache().set(d,e),{txs:n,chain:i,immediateExecutions:a,resolvedInputs:s,outputs:{...l},checkpoint:e}}if(g?.output){let{_DATA:e,...t}=g.output,n=Object.keys(t);cF.debug(`[WarpExecutor] action ${r} output keys:`,n.length>0?n:"(empty)"),Object.assign(l,t)}else cF.debug(`[WarpExecutor] action ${r}: no output`);if(g?.values?.mapped){let e=Object.keys(g.values.mapped);cF.debug(`[WarpExecutor] action ${r} mapped keys:`,e),Object.assign(l,g.values.mapped)}if(b?.resolvedInputs){let e=b.resolvedInputs.filter(e=>e.input.as).map(e=>[e.input.as,e.value]);for(let t of(cF.debug(`[WarpExecutor] action ${r}
14 resolved inputs:`,Object.fromEntries(e)),b.resolvedInputs)){let e=t.input.as;if(e&&null!==t.value&&void 0!==t.value){let[,r]=this.factory.getSerializer().stringToNative(t.value);l[e]=r??t.value,"asset"===t.input.type&&"object"==typeof r&&null!==r&&"identifier"in r&&"amount"in r&&(l[`${e}.token`]=r.identifier,l[`${e}.identifier`]=r.identifier,l[`${e}.amount`]=String(r.amount))}}}cF.debug(`[WarpExecutor] action ${r} outputBag keys:`,Object.keys(l)),g&&(g.envs={...c.envs,...l},a.push(g)),p&&n.push(p),y&&(i=y),b&&r===m+1&&b.resolvedInputs&&(s=cW(b.resolvedInputs))}if(!i&&n.length>0)throw Error(`WarpExecutor: Chain not found for ${n.length} transactions`);if(0===n.length&&a.length>0){let e=a[a.length-1];await this.callHandler(()=>this.handlers?.onExecuted?.(e))}return this.scheduleLoops(e,t,u,l),h&&(await this.factory.getCache().get(d))?.identifier===f&&await this.factory.getCache().delete(d),{txs:n,chain:i,immediateExecutions:a,resolvedInputs:s,outputs:{...l}}}async executeAction(e,t,r,n={}){let i=ca(e,t);if("link"===i.type)return i.when&&!await this.evaluateWhenCondition(e,i,r,n)||await this.callHandler(async()=>{let e=i.url;this.config.interceptors?.openLink?await this.config.interceptors.openLink(e):lZ.open(e,"_blank")}),{tx:null,chain:null,immediateExecution:null,executable:null};if("prompt"===i.type){let a=await this.executePrompt(e,i,t,r,n);if("success"===a.status)return await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:null,execution:a,tx:null})),{tx:null,chain:null,immediateExecution:a,executable:null};{let e=a.output._DATA instanceof Error?a.output._DATA.message:JSON.stringify(a.output._DATA);return this.handlers?.onError?.({message:e,result:a}),{tx:null,chain:null,immediateExecution:a,executable:null}}}if("loop"===i.type)return{tx:null,chain:null,immediateExecution:null,executable:null};if("state"===i.type)return this.executeState(e,i,t,n);if("mount"===i.type||"unmount"===i.type){if(i.when){let e=n.envs||{};if(!cd(cf(i.when,e)))return{tx:null,chain:null,immediateExecution:null,executable:null}}return await this.handlers?.onMountAction?.({action:i,actionIndex:t,warp:e}),{tx:null,chain:null,immediateExecution:null,executable:null}}if("inline"===i.type){if(!this.warpResolver)return{tx:null,chain:null,immediateExecution:null,executable:null};if(i.when){let t=this.adapters[0]?.chainInfo.name||"";if(!await this.evaluateWhenCondition(e,i,r,n,[],t))return{tx:null,chain:null,immediateExecution:null,executable:null}}cF.debug("[WarpExecutor] resolving inline warp:",{identifier:i.warp,query:i.warp?.split("?")[1]});let a=await this.warpResolver(i.warp);if(!a)return cF.debug("[WarpExecutor] inline warp not found:",{identifier:i.warp}),{tx:null,chain:null,immediateExecution:null,executable:null};await this.callHandler(()=>this.handlers?.onActionProcessing?.(i));let s={...this.config.vars,...n.envs||{},...n.queries||{}},o={};for(let[e,t]of Object.entries(a.meta?.query||{}))o[e]=t.replace(/\{\{(.+?)\}\}/g,(e,t)=>{let r=s[t.trim()];return null==r?"":"object"==typeof r?JSON.stringify(r):String(r)});a.meta={...a.meta,query:o};let u=new Set(Object.keys(o)),l=a.actions?.flatMap(e=>e.inputs||[]).filter(e=>"field"===e.source&&e.required&&!u.has(e.as||e.name))||[];if(l.length>0&&this.handlers?.onInputRequest){let e=Object.fromEntries(Object.entries(o).map(([e,t])=>[e,String(t)]));return this._checkpointIndex=t,await this.handlers.onInputRequest(a,l,e),{tx:null,chain:null,immediateExecution:null,executable:null}}let c=this.handlers?.onActionExecuted;i.silent&&(this.handlers.onActionExecuted=void 0);let{immediateExecutions:f}=await this.execute(a,[],n);i.silent&&(this.handlers.onActionExecuted=c);let d=f[0];if(cF.debug("[WarpExecutor] inline warp result:",{identifier:i.warp,hasOutput:!!d?.output,outputKeys:d?.output?Object.keys(d.output).filter(e=>"_DATA"!==e):[],status:d?.status}),d){if(i.silent||await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:null,execution:d,tx:null})),i.output){let e=((e,t,r)=>{if(!e.output)return t.output;let n={...t.output||{},...t.values?.mapped||{}},i={};for(let[t,a]of Object.entries(e.output)){let e=a.startsWith(lK.Append.Prefix),s=c0(e?a.slice(lK.Append.Prefix.length):a,n);if(e){let e=r?.[t],n=Array.isArray(e)?e:void 0!==e?[e]:[];i[t]=[...n,s]}else i[t]=s}return{...t.output,...i}})(i,d,n.envs);return{tx:null,chain:null,immediateExecution:{...d,output:e},executable:null}}return{tx:null,chain:null,immediateExecution:d,executable:null}}return{tx:null,chain:null,immediateExecution:null,executable:null}}let a=await this.factory.createExecutable(e,t,r,n);if(i.when&&!await this.evaluateWhenCondition(e,i,r,n,a.resolvedInputs,a.chain.name))return{tx:null,chain:null,immediateExecution:null,executable:null};if("collect"===i.type){let e=await this.executeCollect(a,void 0,n.envs);if("success"===e.status)return await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:null,execution:e,tx:null})),{tx:null,chain:null,immediateExecution:e,executable:a};if("unhandled"===e.status)return await this.callHandler(()=>this.handlers?.onActionUnhandled?.({action:t,chain:null,execution:e,tx:null})),{tx:null,chain:null,immediateExecution:e,executable:a};{let t=e.output._DATA instanceof Error?e.output._DATA.message:JSON.stringify(e.output._DATA);this.handlers?.onError?.({message:t,result:e})}return{tx:null,chain:null,immediateExecution:null,executable:a}}if("compute"===i.type){let e=await this.executeCompute(a);if("success"===e.status)return await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:null,execution:e,tx:null})),{tx:null,chain:null,immediateExecution:e,executable:a};{let t=e.output._DATA instanceof Error?e.output._DATA.message:JSON.stringify(e.output._DATA);this.handlers?.onError?.({message:t,result:e})}return{tx:null,chain:null,immediateExecution:null,executable:a}}if("mcp"===i.type){let e=await this.executeMcp(a);if("success"===e.status)return await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:null,execution:e,tx:null})),{tx:null,chain:null,immediateExecution:e,executable:a};if("unhandled"===e.status)return await this.callHandler(()=>this.handlers?.onActionUnhandled?.({action:t,chain:null,execution:e,tx:null})),{tx:null,chain:null,immediateExecution:e,executable:a};{let t=e.output._DATA instanceof Error?e.output._DATA.message:JSON.stringify(e.output._DATA);return this.handlers?.onError?.({message:t,result:e}),{tx:null,chain:null,immediateExecution:e,executable:a}}}let s=cn(a.chain.name,this.adapters);if("query"===i.type){let e=await s.executor.executeQuery(a);if("success"===e.status)await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:t,chain:a.chain,execution:e,tx:null}));else{let t=e.output._DATA instanceof Error?e.output._DATA.message:JSON.stringify(e.output._DATA);this.handlers?.onError?.({message:t,result:e})}return{tx:null,chain:a.chain,immediateExecution:e,executable:a}}return{tx:await s.executor.createTransaction(a),chain:a.chain,immediateExecution:null,executable:a}}async evaluateOutput(e,t){if(0===t.length||0===e.actions.length||!this.handlers)return;let r=await this.factory.getChainInfoForWarp(e),n=cn(r.name,this.adapters),i=(await Promise.all(e.actions.map(async(i,a)=>
14{if(!cu(i)||"transfer"!==i.type&&"contract"!==i.type)return null;let s=t[a],o=a+1;if(!s){let t=await this.factory.getResolvedInputsFromCache(this.config.env,e.meta?.hash,o),n={status:"error",warp:e,action:o,user:lj(this.config,r.name),txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:{},messages:{},destination:null,resolvedInputs:t};return await this.callHandler(()=>this.handlers?.onError?.({message:`Action ${o} failed: Transaction not found`,result:n})),n}let u=await this.factory.getRawResolvedInputsFromCache(this.config.env,e.meta?.hash,o);if(0===u.length){let t=e.meta?.query;t&&Object.keys(t).length>0&&(u=await this.factory.resolveInputsFromQuery(e,o,t))}let l=await n.output.getActionExecution(e,o,s.tx,u),c=cO(u,l.output,this.factory.getSerializer());return l.next=cM(this.config,this.adapters,e,o,c,l.status),"success"===l.status?await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:o,chain:r,execution:l,tx:s})):await this.callHandler(()=>this.handlers?.onError?.({message:"Action failed: "+JSON.stringify(l.values),result:l})),l}))).filter(e=>null!==e);if(i.every(e=>"success"===e.status)){let e=i[i.length-1];await this.callHandler(()=>this.handlers?.onExecuted?.(e))}else{let e=i.find(e=>"success"!==e.status);await this.callHandler(()=>this.handlers?.onError?.({message:`Warp failed: ${JSON.stringify(i)}`,result:e}))}}async executeCollect(e,t,r){let n=lj(this.config,e.chain.name),i=ca(e.warp,e.action),a=this.factory.getSerializer(),s=cH(e.resolvedInputs,a);if(i.destination&&"object"==typeof i.destination&&"url"in i.destination)return await this.doHttpRequest(e,i.destination,n,s,t,r);let{values:o,output:u}=await cG(e.warp,s,e.action,e.resolvedInputs,a,this.config);return this.buildCollectResult(e,n,"unhandled",o,u)}async executeCompute(e){let t=lj(this.config,e.chain.name),r=this.factory.getSerializer(),n=cH(e.resolvedInputs,r),{values:i,output:a}=await cG(e.warp,n,e.action,e.resolvedInputs,r,this.config);return this.buildCollectResult(e,t,"success",i,a)}async doHttpRequest(e,t,r,n,i,a){let s=new fT(this.config,cn(e.chain.name,this.adapters),this.adapters),o=this.factory.getSerializer(),{url:u,method:l,headers:c,body:f}=await fC(s,t,e,r,n,o,i,async e=>await this.callHandler(()=>this.handlers?.onSignRequest?.(e)));if(a)for(let[e,t]of(u=cc(u,a),c.entries()))c.set(e,cc(t,a));cF.debug("WarpExecutor: Executing HTTP collect",{url:u,method:l,headers:c,body:f});try{let t=await (await fa(this.adapters))(u,{method:l,headers:c,body:f});cF.debug("Collect response status",{status:t.status});let r=await t.json();cF.debug("Collect response content",{content:r});let{values:n,output:i}=await cG(e.warp,r,e.action,e.resolvedInputs,this.factory.getSerializer(),this.config);return this.buildCollectResult(e,lj(this.config,e.chain.name),t.ok?"success":"error",n,i,r)}catch(n){cF.error("WarpActionExecutor: Error executing collect",n);let t=cW(e.resolvedInputs);return{status:"error",warp:e.warp,action:e.action,user:r,txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:{_DATA:n},messages:{},destination:this.getDestinationFromResolvedInputs(e),resolvedInputs:t}}}getDestinationFromResolvedInputs(e){return e.resolvedInputs.find(e=>"receiver"===e.input.position||"destination"===e.input.position)?.value||e.destination}async executeMcp(e,t){let n,i,a=lj(this.config,e.chain.name),s=ca(e.warp,e.action);if(!s.destination){let t=cW(e.resolvedInputs);return{status:"error",warp:e.warp,action:e.action,user:a,txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:{_DATA:Error("WarpExecutor: MCP action requires destination")},messages:{},destination:this.getDestinationFromResolvedInputs(e),resolvedInputs:t}}try{let e=await Promise.all([r.e(3546),r.e(89884),r.e(91566),r.e(79274)]).then(r.bind(r,58666));n=e.Client,i=e.StreamableHTTPClientTransport}catch{let t=cW(e.resolvedInputs);return{status:"error",warp:e.warp,action:e.action,user:a,txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:{_DATA:Error("Please install @modelcontextprotocol/client to execute MCP warps or mcp actions")},messages:{}
14,destination:this.getDestinationFromResolvedInputs(e),resolvedInputs:t}}let o=this.factory.getSerializer(),u=new fT(this.config,cn(e.chain.name,this.adapters),this.adapters),l=s.destination,c=u.applyInputs(l.url,e.resolvedInputs,this.factory.getSerializer()),f=u.applyInputs(l.tool,e.resolvedInputs,this.factory.getSerializer()),d={};l.headers&&Object.entries(l.headers).forEach(([t,r])=>{let n=u.applyInputs(r,e.resolvedInputs,this.factory.getSerializer());d[t]=n}),cF.debug("WarpExecutor: Executing MCP",{url:c,tool:f,headers:d});try{let r,s=new i(new URL(c),{requestInit:{headers:d}}),u=new n({name:"warps-mcp-client",version:"1.0.0"},{capabilities:{}});await u.connect(s);let l={};e.resolvedInputs.forEach(({input:e,value:t})=>{if(t&&e.position&&"string"==typeof e.position&&e.position.startsWith("payload:")){let r=e.position.replace("payload:",""),[n,i]=o.stringToNative(t);if("string"===n)l[r]=String(i);else if("bool"===n)l[r]=!!i;else if("uint8"===n||"uint16"===n||"uint32"===n||"uint64"===n||"uint128"===n||"uint256"===n||"biguint"===n){let e=Number(i);l[r]=(Number.isInteger(e),e)}else l[r]=i}}),t&&Object.assign(l,t);let p=await u.callTool({name:f,arguments:l});if(await u.close(),p.content&&p.content.length>0){let e=p.content[0];if("text"===e.type)try{r=JSON.parse(e.text)}catch{r=e.text}else e.type,r=e}else r=p;let{values:h,output:m}=await cG(e.warp,r,e.action,e.resolvedInputs,o,this.config);return this.buildCollectResult(e,a,"success",h,m,p)}catch(r){cF.error("WarpExecutor: Error executing MCP",r);let t=cW(e.resolvedInputs);return{status:"error",warp:e.warp,action:e.action,user:a,txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:{_DATA:r},messages:{},destination:this.getDestinationFromResolvedInputs(e),resolvedInputs:t}}}buildCollectResult(e,t,r,n,i,a){let s=cM(this.config,this.adapters,e.warp,e.action,cO(e.resolvedInputs,i,this.factory.getSerializer()),r),o=cW(e.resolvedInputs);return{status:r,warp:e.warp,action:e.action,user:t||lj(this.config,e.chain.name),txHash:null,tx:null,next:s,values:n,output:a?{...i,_DATA:a}:i,messages:cS(e.warp,{...n.mapped,...i},this.config),destination:this.getDestinationFromResolvedInputs(e),resolvedInputs:o}}async callHandler(e){if(e)return await e()}scheduleLoops(e,t,r,n){if(this.active)for(let i of e.actions){if("loop"!==i.type||!1===i.auto)continue;let a=`loop:${r.scope||"default"}:${e.meta?.identifier||e.name}`;if(i.when){let e={...r.envs,...n},t=cf(i.when,e);try{if(!cd(t)){this.loopIterations.delete(a);continue}}catch{this.loopIterations.delete(a);continue}}let s=i.maxIterations??1e4,o=(this.loopIterations.get(a)??0)+1;if(o>s){this.loopIterations.delete(a),cF.debug(`Loop maxIterations (${s}) reached for warp ${e.meta?.identifier}`);continue}if(this.loopIterations.set(a,o),!this.handlers?.onLoop)continue;let u=i.delay??0;this.handlers.onLoop({warp:e,inputs:t,meta:r,delay:u})}}async executeState(e,t,r,n){if(t.when){let e=n.envs||{};if(!cd(cf(t.when,e)))return{tx:null,chain:null,immediateExecution:null,executable:null}}let i=this.factory.getCache(),a=`state:${n.scope||"default"}:${t.store}`;if("read"===t.op){let n=await i.get(a)??{},s=t.keys??Object.keys(n),o={};for(let e of s)void 0!==n[e]&&null!==n[e]&&(o[`state.${e}`]=n[e]);let u={status:"success",warp:e,action:r,user:null,txHash:null,tx:null,next:null,values:{string:[],native:[],mapped:{}},output:o,messages:{},destination:null,resolvedInputs:[]};return await this.callHandler(()=>this.handlers?.onActionExecuted?.({action:r,chain:null,execution:u,tx:null})),{tx:null,chain:null,immediateExecution:u,executable:null}}if("write"===t.op&&t.data){let e=await i.get(a)??{},r=n.envs||{},s={};for(let[e,n]of Object.entries(t.data))if("string"==typeof n){let t=n.replace(/\{\{([^}]+)\}\}/g,(e,t)=>{let i=r[t.trim()];return null!=i?String(i):n});s[e]=fR(t)}else s[e]=n;await i.set(a,{...e,...s})}return"clear"===t.op&&await i.delete(a),{tx:null,chain:null,immediateExecution:null,executable:null}}async executePrompt(e,t,r,n,i={}){try{let a=await this.factory.getChainInfoForWarp(e,n),s=cn(a.name,this.adapters),o=new fT(this.config,s,this.adapters),u=await o.apply(e,i),l=ca(u,r),c=[];
14if(t.inputs&&t.inputs.length>0){let e=this.factory.getStringTypedInputs(t,n),r=await this.factory.getResolvedInputs(a.name,t,e,o,i.queries);c=await this.factory.getModifiedInputs(r)}else{let{action:e}=co(u),t=this.factory.getStringTypedInputs(e,n),r=await this.factory.getResolvedInputs(a.name,e,t,o,i.queries);c=await this.factory.getModifiedInputs(r)}let f=((e,t)=>{if(!c2(e))return e;if(!t)throw Error("Platform-specific value requires platform in client config");let r=e[t];if(void 0===r)throw Error(`Warp does not support platform: ${t}`);return r})(l.prompt,this.config.platform),d=o.applyInputs(f,c,this.factory.getSerializer());i.envs&&(d=cc(d,i.envs));let p=cW(c),h=lj(this.config,a.name),m=this.factory.getSerializer(),{values:y,output:g}=await cX(u,d,r,c,m,this.config);if(this.handlers?.onPromptGenerate){let e=await this.handlers.onPromptGenerate(d,l.expect,l.model);e&&(g.MESSAGE=e,l.as&&(g[l.as]=e))}let b=c.find(e=>"destination"===e.input.position)?.value||null;return{status:"success",warp:u,action:r,user:h,txHash:null,tx:null,next:cN(this.config,this.adapters,u,r,cO(c,g,this.factory.getSerializer())),values:y,output:g,messages:cS(u,{...y.mapped,...g},this.config),destination:b,resolvedInputs:p}}catch(t){return cF.error("WarpExecutor: Error executing prompt action",t),{status:"error",warp:e,action:r,user:null,txHash:null,tx:null,next:cM(this.config,this.adapters,e,r,{},"error"),values:{string:[],native:[],mapped:{}},output:{_DATA:t},messages:{},destination:null,resolvedInputs:[]}}}async evaluateWhenCondition(e,t,r,n,i,a){if(!t.when)return!0;let s=a?{name:a}:await this.factory.getChainInfoForWarp(e,r),o=cn(s.name,this.adapters),u=new fT(this.config,o,this.adapters),l;if(i)l=i;else{let e=await this.factory.getResolvedInputs(s.name,t,this.factory.getStringTypedInputs(t,r),u,n.queries);l=await this.factory.getModifiedInputs(e)}let c=u.buildInputBag(l,this.factory.getSerializer()),f={...n.envs??{},...c},d=cf(t.when,f);return cF.debug("[WarpExecutor] when condition:",{action:t.label||t.type,expression:t.when,interpolated:d,mergedBag:f}),cd(d)}},fR=e=>{if("true"===e)return!0;if("false"===e)return!1;let t=Number(e);return isNaN(t)||""===e.trim()?e:t},fU=class{constructor(e){this.config=e}async search(e,t,r){if(!this.config.index?.url)throw Error("WarpIndex: Index URL is not set");try{let n=await fetch(this.config.index?.url,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.index?.apiKey}`,...r},body:JSON.stringify({[this.config.index?.searchParamName||"search"]:e,...t})});if(!n.ok)throw Error(`WarpIndex: search failed with status ${n.status}: ${await n.text()}`);return(await n.json()).hits}catch(e){throw cF.error("WarpIndex: Error searching for warps: ",e),e}}},fL=class{constructor(e,t,r){this.config=e,this.adapters=t,this.resolver=r}isValid(e){return!!e.startsWith(lK.HttpProtocolPrefix)&&!!cv(e)}async detectFromHtml(e){if(!e.length)return{match:!1,output:[]};let t=[...e.matchAll(/https?:\/\/[^\s"'<>]+/gi)].map(e=>e[0]).filter(e=>this.isValid(e)).map(e=>this.detect(e)),r=(await Promise.all(t)).filter(e=>e.match);return{match:r.length>0,output:r.map(e=>({url:e.url,warp:e.warp}))}}async detect(e,t){let r={match:!1,url:e,warp:null,chain:null,registryInfo:null,brand:null},n=e.startsWith(lK.HttpProtocolPrefix)?cv(e):cw(e);if(!n)return r;try{let{type:i,identifierBase:a}=n,s=n.chain??this.adapters[0]?.chainInfo.name??null,o=null,u=null,l=null,c=e.startsWith(lK.HttpProtocolPrefix)?(e=>{try{let t=new URL(e),r=new URLSearchParams(t.search);return r.delete(lK.IdentifierParamName),r.toString()||null}catch{return null}})(e):cE(n.identifier);if(this.resolver){let e=null;if("hash"===i)e=await this.resolver.getByHash(a,t);else if("alias"===i){let r=`${s}:${a}`;e=await this.resolver.getByAlias(r,t)||await this.resolver.getByAlias(a,t)}e&&(o=e.warp,u=e.registryInfo,l=e.brand)}else{if(!s)throw Error(`WarpLinkDetecter: chain is required for identifier ${n.identifier}`);let e=cn(s,this.adapters);if("hash"===i){o=await e.builder().createFromTransactionHash(a,t);let r=await e.registry.getInfoByHash(a,t);u=r.registryInfo,l=r.brand}else if("alias"===i){let r=await e.registry.getInfoByAlias(a,t);u=r.registryInfo,l=r.brand,r.registryInfo&&(o=await e.builder().createFromTransactionHash(r.registryInfo.hash,t))}}if(o&&o.meta&&(fD(o,s,u,n.identifier),o.meta.query=c?cP(c):null),!o)return r;let f=o.chain||s||null,d=f?this.adapters.find(e=>e.chainInfo.name.toLowerCase()===f.toLowerCase()):null,p=d?await new fT(this.config,d,this.adapters).apply(o):o;return{match:!0,url:e,warp:p,chain:f,registryInfo:u,brand:l}}catch(e){return cF.error("Error detecting warp link",e),r}}},fD=(e,t,r,n)=>{e.meta&&(e.meta.identifier=r?.alias?cb(null,"alias",r.alias):cb(t,"hash",r?.hash??n))},fq=class{constructor(e,t){this.config=e,this.options=t,this.chains=t.chains.map(e=>e(this.config)),this.resolver=t.resolver??this.buildDefaultResolver()}buildDefaultResolver(){return new lT(this.chains.map(e=>new lC(e)))}getConfig(){return this.config}mergeVars(e){this.config={...this.config,vars:{...this.config.vars,...e}}}getResolver(){return this.resolver}createExecutor(e){let t=new fM(this.config,this.chains,e);return t.setWarpResolver(async e=>(await this.detectWarp(e)).warp??null),t}async detectWarp(e,t){return new fL(this.config,this.chains,this.resolver).detect(e,t)}async executeWarp(e,t,r,n={}){let i="object"==typeof e,a=!i&&e.startsWith("http")&&e.endsWith(".json"),s=i?e:null;if(!s&&a){let t=await fetch(e);if(!t.ok)throw Error("WarpClient: executeWarp - invalid url");s=await t.json()}if(s||(s=(await this.detectWarp(e,n.cache)).warp),!s)throw Error("Warp not found");let o=this.createExecutor(r),{txs:u,chain:l,immediateExecutions:c,resolvedInputs:f}=await o.execute(s,t,{queries:n.queries});return{txs:u,chain:l,immediateExecutions:c,evaluateOutput:async e=>{await o.evaluateOutput(s,e)},resolvedInputs:f}}async createInscriptionTransaction(e,t){return await cn(e,this.chains).builder().createInscriptionTransaction(t)}async createFromTransaction(e,t,r=!1){return cn(e,this.chains).builder().createFromTransaction(t,r)}async createFromTransactionHash(e,t){let r=cw(e);if(!r)throw Error("WarpClient: createFromTransactionHash - invalid hash");if(!r.chain)throw Error("WarpClient: createFromTransactionHash - chain is required");return cn(r.chain,this.chains).builder().createFromTransactionHash(e,t)}async signMessage(e,t){if(!lj(this.config,e))throw Error(`No wallet configured for chain ${e}`);return cn(e,this.chains).wallet.signMessage(t)}async getActions(e,t,r=!1){let n=this.getDataLoader(e);return(await Promise.all(t.map(async e=>n.getAction(e,r)))).filter(e=>null!==e)}getExplorer(e){return cn(e,this.chains).explorer}getOutput(e){return cn(e,this.chains).output}async getActionExecution(e,t,r,n){let i=n??co(t).index+1,a=await cn(e,this.chains).output.getActionExecution(t,i,r);return a.next=cN(this.config,this.chains,t,i,cO(void 0,a.output,this.factory.getSerializer())),a}async getRegistry(e){let t=cn(e,this.chains).registry;return await t.init(),t}getDataLoader(e){return cn(e,this.chains).dataLoader}getWallet(e){return cn(e,this.chains).wallet}get factory(){return new fN(this.config,this.chains)}get index(){return new fU(this.config)}get linkBuilder(){return new ck(this.config,this.chains)}createBuilder(e){return e?cn(e,this.chains).builder():new fb(this.config)}createAbiBuilder(e){return cn(e,this.chains).abiBuilder()}createBrandBuilder(e){return cn(e,this.chains).brandBuilder()}
14createSerializer(e){return cn(e,this.chains).serializer}resolveText(e){return ch(e,this.config)}},fF=class{constructor(){this.typeHandlers=new Map,this.typeAliases=new Map}registerType(e,t){this.typeHandlers.set(e,t)}registerTypeAlias(e,t){this.typeAliases.set(e,t)}hasType(e){return this.typeHandlers.has(e)||this.typeAliases.has(e)}getHandler(e){let t=this.typeAliases.get(e);return t?this.getHandler(t):this.typeHandlers.get(e)}getAlias(e){return this.typeAliases.get(e)}resolveType(e){let t=this.typeAliases.get(e);return t?this.resolveType(t):e}getRegisteredTypes(){return Array.from(new Set([...this.typeHandlers.keys(),...this.typeAliases.keys()]))}}},37295:(e,t,r)=>{"use strict";r.d(t,{u:()=>a});var n=r(45437);let i=new Map;function a({fn:e,id:t,shouldSplitBatch:r,wait:s=0,sort:o}){let u=async()=>{let t=c();l();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{o&&Array.isArray(e)&&e.sort(o);for(let r=0;r<t.length;r++){let{resolve:n}=t[r];n?.([e[r],e])}}).catch(e=>{for(let r=0;r<t.length;r++){let{reject:n}=t[r];n?.(e)}})},l=()=>i.delete(t),c=()=>i.get(t)||[],f=e=>i.set(t,[...c(),e]);return{flush:l,async schedule(e){let{promise:t,resolve:i,reject:a}=(0,n.Y)();return(r?.([...c().map(({args:e})=>e),e])&&u(),c().length>0)?f({args:e,resolve:i,reject:a}):(f({args:e,resolve:i,reject:a}),setTimeout(u,s)),t}}}},37826:(e,t,r)=>{"use strict";r.d(t,{n:()=>m});var n=r(80044),i=r(96685),a=r(14870),s=r(45696),o=r(81693),u=r(66347),l=r(12581),c=r(94747),f=r(84428);function d(e,t={}){void 0!==t.size&&(0,c.Sl)(e,{size:t.size});let r=(0,f.My)(e);return(0,c.ME)(r,t)}var p=r(22106),h=r(44497);function m(e,t){let r="string"==typeof t?(0,p.aT)(t):t,m=(0,a.l)(r);if(0===(0,s.E)(r)&&e.length>0)throw new n.O;if((0,s.E)(t)&&32>(0,s.E)(t))throw new n.Iy({data:"string"==typeof t?t:(0,f.My)(t),params:e,size:(0,s.E)(t)});let g=0,b=[];for(let t=0;t<e.length;++t){let a=e[t];g<r.length&&m.setPosition(g);let[s,p]=function e(t,r,{staticPosition:a}){let s=(0,h.k)(r.type);if(s){let[n,i]=s;return function(t,r,{length:n,staticPosition:i}){if(null===n){let n=i+d(t.readBytes(32)),a=n+32;t.setPosition(n);let s=d(t.readBytes(32)),o=y(r),u=0,l=[];for(let n=0;n<s;++n){t.setPosition(a+(o?32*n:u));let[i,s]=e(t,r,{staticPosition:a});u+=s,l.push(i),0===s&&(t.assertReadLimit(),t._touch())}return t.setPosition(i+32),[l,32]}if(y(r)){let a=i+d(t.readBytes(32)),s=[];for(let i=0;i<n;++i){t.setPosition(a+32*i);let[n]=e(t,r,{staticPosition:a});s.push(n)}return t.setPosition(i+32),[s,32]}let a=0,s=[];for(let o=0;o<n;++o){let[n,o]=e(t,r,{staticPosition:i+a});a+=o,s.push(n),0===o&&(t.assertReadLimit(),t._touch())}return[s,a]}(t,{...r,type:i},{length:n,staticPosition:a})}if("tuple"===r.type)return function(t,r,{staticPosition:n}){let i=0===r.components.length||r.components.some(({name:e})=>!e),a=i?[]:{},s=0;if(y(r)){let o=n+d(t.readBytes(32));for(let n=0;n<r.components.length;++n){let u=r.components[n];t.setPosition(o+s);let[l,c]=e(t,u,{staticPosition:o});s+=c,a[i?n:u?.name]=l}return t.setPosition(n+32),[a,32]}for(let o=0;o<r.components.length;++o){let u=r.components[o],[l,c]=e(t,u,{staticPosition:n});a[i?o:u?.name]=l,s+=c}return[a,s]}(t,r,{staticPosition:a});if("address"===r.type){let e;return e=t.readBytes(32),[(0,i.o)((0,f.My)((0,o.A1)(e,-20))),32]}if("bool"===r.type)return[function(e,t={}){let r=e;if(void 0!==t.size&&((0,c.Sl)(r,{size:t.size}),r=(0,l.B)(r)),r.length>1||r[0]>1)throw new u.xO(r);return!!r[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=d(e.readBytes(32));e.setPosition(r+t);let n=d(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[(0,f.My)(i),32]}return[(0,f.My)(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:a});if(r.type.startsWith("uint")||r.type.startsWith("int")){var p,m;let e,n,i;return p=t,e=(m=r).type.startsWith("int"),n=Number.parseInt(m.type.split("int")[1]||"256",10),i=p.readBytes(32),[n>48?function(e,t={}){void 0!==t.size&&(0,c.Sl)(e,{size:t.size});let r=(0,f.My)(e);return(0,c.uU)(r,t)}(i,{signed:e}):d(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=d(e.readBytes(32));e.setPosition(t+r);let n=d(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=function(e,t={}){let r=e;return void 0!==t.size&&((0,c.Sl)(r,{size:t.size}),r=(0,l.B)(r,{dir:"right"})),new TextDecoder().decode(r)}(e.readBytes(n,32));return e.setPosition(t+32),[i,32]}(t,{staticPosition:a});throw new n.j(r.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(m,a,{staticPosition:0});g+=p,b.push(s)}return b}function y(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;
14if("tuple"===t)return e.components?.some(y);let r=(0,h.k)(e.type);return!!(r&&y({...e,type:r[1]}))}},37942:(e,t,r)=>{"use strict";r.d(t,{Id:()=>v,My:()=>d,OG:()=>A,Ph:()=>m,Q5:()=>k,aK:()=>P,aT:()=>h,aY:()=>a,dJ:()=>_,e8:()=>o,ex:()=>x,fg:()=>S,lX:()=>y,lq:()=>g,qj:()=>w,r4:()=>E,x:()=>O,z:()=>b,zW:()=>u});let n=BigInt(0),i=BigInt(1);function a(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!a(e))throw Error("Uint8Array expected")}function o(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function u(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function l(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?n:BigInt("0x"+e)}let c="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(s(e),c)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=f[e[r]];return t}function p(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(c)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=p(e.charCodeAt(i)),a=p(e.charCodeAt(i+1));if(void 0===r||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+a}return n}function m(e){return l(d(e))}function y(e){return s(e),l(d(Uint8Array.from(e).reverse()))}function g(e,t){return h(e.toString(16).padStart(2*t,"0"))}function b(e,t){return g(e,t).reverse()}function w(e,t,r){let n;if("string"==typeof t)try{n=h(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(a(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function v(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];s(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}function x(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}let $=e=>"bigint"==typeof e&&n<=e;function E(e,t,r){return $(e)&&$(t)&&$(r)&&t<=e&&e<r}function P(e,t,r,n){if(!E(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function _(e){let t;for(t=0;e>n;e>>=i,t+=1);return t}let A=e=>(i<<BigInt(e))-i,I=e=>new Uint8Array(e);function S(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=I(e),i=I(e),a=0,s=()=>{n.fill(1),i.fill(0),a=0},o=(...e)=>r(i,n,...e),u=(e=I(0))=>{let t;if(i=o((t=[0],Uint8Array.from(t)),e),n=o(),0!==e.length){let t;i=o((t=[1],Uint8Array.from(t)),e),n=o()}},l=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return v(...r)};return(e,t)=>{let r;for(s(),u(e);!(r=t(l()));)u();return s(),r}}let z={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||a(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function k(e,t,r={}){let n=(t,r,n)=>{let i=z[r];if("function"!=typeof i)throw Error("invalid validator function");let a=e[t];if((!n||void 0!==a)&&!i(a,e))throw Error("param "+String(t)+" is invalid. Expected "+r+", got "+a)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function O(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let a=e(r,...n);return t.set(r,a),a}}},38324:(e,t,r)=>{"use strict";r.d(t,{$N:()=>I,$p:()=>et,$v:()=>f,Ax:()=>A,BN:()=>W,CI:()=>O,CQ:()=>N,CT:()=>e_,Cn:()=>C,Dq:()=>B,Dw:()=>eN,EY:()=>d,G3:()=>eh,GP:()=>J,GY:()=>E,Gb:()=>Z,I:()=>q,IT:()=>H,KX:()=>eW,Ko:()=>P,L8:()=>ea,LJ:()=>ed,Lc:()=>S,Mv:()=>K,N$:()=>eB,Oi:()=>ex,Oy:()=>M,P0:()=>ef,Py:()=>b,RL:()=>ez,Sb:()=>eH,TF:()=>$,U5:()=>V,UY:()=>T,Um:()=>Y,VF:()=>eT,VO:()=>eE,VY:()=>y,W4:()=>c,WH:()=>Q,Wc:()=>eA,YY:()=>eD,ZQ:()=>L,Zc:()=>p,Zn:()=>h,Zu:()=>v,Zy:()=>z,_A:()=>eG,_m:()=>eU,b0:()=>eY,bl:()=>w,c2:()=>R,cG:()=>g,cu:()=>eu,d:()=>eK,eb:()=>ew,g5:()=>x,h:()=>eb,h8:()=>U,hA:()=>eZ,ig:()=>eS,kU:()=>eJ,nu:()=>eP,o5:()=>X,o8:()=>u.clone,pm:()=>ec,qG:()=>m,qc:()=>ek,rO:()=>k,rv:()=>eO,sF:()=>F,t$:()=>eM,tV:()=>j,v1:()=>_,vz:()=>D,w:()=>es,x8:()=>G,zP:()=>eR});var n=r(74593),i=r(55503),a=r(98858),s=r(55711),o=r(9459),u=r(68056),l=r(83165);let c=i.xI("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=l.r;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,a=u.aborted(e);for(let s of t){if(s._zod.def.when){if(u.explicitlyAborted(e)||!s._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,o=s._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new i.GT;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(a||(a=u.aborted(e,t)))});else{if(e.issues.length===t)continue;a||(a=u.aborted(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(u.aborted(r))return r.aborted=!0,r;let o=t(a,n,s);if(o instanceof Promise){if(!1===s.async)throw new i.GT;return o.then(t=>e._zod.parse(t,s))}return e._zod.parse(o,s)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if("backward"===s.direction){let t=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,s)):r(t,a,s)}let o=e._zod.parse(a,s);if(o instanceof Promise){if(!1===s.async)throw new i.GT;return o.then(e=>t(e,n,s))}return t(o,n,s)}}u.defineLazy(e,"~standard",()=>({validate:t=>{try{let r=(0,s.xL)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,s.bp)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),f=i.xI("$ZodString",(e,t)=>{c.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.string(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),d=i.xI("$ZodStringFormat",(e,t)=>{n.ql.init(e,t),f.init(e,t)}
14),p=i.xI("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=o.guid),d.init(e,t)}),h=i.xI("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uuid(e))}else t.pattern??(t.pattern=o.uuid());d.init(e,t)}),m=i.xI("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=o.email),d.init(e,t)}),y=i.xI("$ZodURL",(e,t)=>{d.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===o.httpProtocol.source&&!/^https?:\/\//i.test(n))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),g=i.xI("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o.emoji()),d.init(e,t)}),b=i.xI("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=o.nanoid),d.init(e,t)}),w=i.xI("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=o.cuid),d.init(e,t)}),v=i.xI("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=o.cuid2),d.init(e,t)}),x=i.xI("$ZodULID",(e,t)=>{t.pattern??(t.pattern=o.ulid),d.init(e,t)}),$=i.xI("$ZodXID",(e,t)=>{t.pattern??(t.pattern=o.xid),d.init(e,t)}),E=i.xI("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=o.ksuid),d.init(e,t)}),P=i.xI("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=o.datetime(t)),d.init(e,t)}),_=i.xI("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=o.date),d.init(e,t)}),A=i.xI("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=o.time(t)),d.init(e,t)}),I=i.xI("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o.duration),d.init(e,t)}),S=i.xI("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=o.ipv4),d.init(e,t),e._zod.bag.format="ipv4"}),z=i.xI("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=o.ipv6),d.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),k=i.xI("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=o.mac(t.delimiter)),d.init(e,t),e._zod.bag.format="mac"}),O=i.xI("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=o.cidrv4),d.init(e,t)}),C=i.xI("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=o.cidrv6),d.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function T(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let B=i.xI("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=o.base64),d.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{T(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function j(e){if(!o.base64url.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return T(t.padEnd(4*Math.ceil(t.length/4),"="))}let N=i.xI("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=o.base64url),d.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{j(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),M=i.xI("$ZodE164",(e,t)=>{t.pattern??(t.pattern=o.e164),d.init(e,t)});function R(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let U=i.xI("$ZodJWT",(e,t)=>{d.init(e,t),e._zod.check=r=>{R(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),L=i.xI("$ZodCustomStringFormat",(e,t)=>{d.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),D=i.xI("$ZodNumber",(e,t)=>{c.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.number,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),q=i.xI("$ZodNumberFormat",(e,t)=>{n.KH.init(e,t),D.init(e,t)}),F=i.xI("$ZodBoolean",(e,t)=>{c.init(e,t),e._zod.pattern=o.boolean,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),W=i.xI("$ZodBigInt",(e,t)=>{c.init(e,t),e._zod.pattern=o.bigint,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),H=i.xI("$ZodBigIntFormat",(e,t)=>{n.uE.init(e,t),W.init(e,t)}),V=i.xI("$ZodSymbol",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),K=i.xI("$ZodUndefined",(e,t)=>{c.init(e,t),e._zod.pattern=o.undefined,e._zod.values=new Set([void 0]),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),G=i.xI("$ZodNull",(e,t)=>{c.init(e,t),e._zod.pattern=o.null,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),Z=i.xI("$ZodAny",(e,t)=>{c.init(e,t),e._zod.parse=e=>e}),J=i.xI("$ZodUnknown",(e,t)=>{c.init(e,t),e._zod.parse=e=>e}),Y=i.xI("$ZodNever",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Q=i.xI("$ZodVoid",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}}),X=i.xI("$ZodDate",(e,t)=>{c.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});function ee(e,t,r){e.issues.length&&t.issues.push(...u.prefixIssues(r,e.issues)),t.value[r]=e.value}let et=i.xI("$ZodArray",(e,t)=>{c.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let s=i[e],o=t.element._zod.run({value:s,issues:[]},n);o instanceof Promise?a.push(o.then(t=>ee(t,r,e))):ee(o,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function er(e,t,r,n,i,a){let s=r in n;if(e.issues.length){if(i&&a&&!s)return;t.issues.push(...u.prefixIssues(r,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function en(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=u.optionalKeys(e.shape);
14return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ei(e,t,r,n,i,a){let s=[],o=i.keySet,u=i.catchall._zod,l=u.def.type,c="optional"===u.optin,f="optional"===u.optout;for(let i in t){if("__proto__"===i||o.has(i))continue;if("never"===l){s.push(i);continue}let a=u.run({value:t[i],issues:[]},n);a instanceof Promise?e.push(a.then(e=>er(e,r,i,t,c,f))):er(a,r,i,t,c,f)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let ea=i.xI("$ZodObject",(e,t)=>{let r;c.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=u.cached(()=>en(t));u.defineLazy(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=u.isObject,s=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let o=t.value;if(!a(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};let u=[],l=r.shape;for(let e of r.keys){let r=l[e],i="optional"===r._zod.optin,a="optional"===r._zod.optout,s=r._zod.run({value:o[e],issues:[]},n);s instanceof Promise?u.push(s.then(r=>er(r,t,e,o,i,a))):er(s,t,e,o,i,a)}return s?ei(u,o,t,n,i.value,e):u.length?Promise.all(u).then(()=>t):t}}),es=i.xI("$ZodObjectJIT",(e,t)=>{let r,n;ea.init(e,t);let s=e._zod.parse,o=u.cached(()=>en(t)),l=u.isObject,c=!i.cr.jitless,f=u.allowsEval,d=c&&f.value,p=t.catchall;e._zod.parse=(i,f)=>{n??(n=o.value);let h=i.value;return l(h)?c&&d&&f?.async===!1&&!0!==f.jitless?(r||(r=(e=>{let t=new a.J(["shape","payload","ctx"]),r=o.value,n=e=>{let t=u.esc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of r.keys)i[e]=`key_${s++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=i[a],s=u.esc(a),o=e[a],l=o?._zod?.optin==="optional",c=o?._zod?.optout==="optional";t.write(`const ${r} = ${n(a)};`),l&&c?t.write(`
15        if (${r}.issues.length) {
16          if (${s} in input) {
17            payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
18              ...iss,
19              path: iss.path ? [${s}, ...iss.path] : [${s}]
20            })));
21          }
22        }
23        
24        if (${r}.value === undefined) {
25          if (${s} in input) {
26            newResult[${s}] = undefined;
27          }
28        } else {
29          newResult[${s}] = ${r}.value;
30        }
31        
32      `):l?t.write(`
33        if (${r}.issues.length) {
34          payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
35            ...iss,
36            path: iss.path ? [${s}, ...iss.path] : [${s}]
37          })));
38        }
39        
40        if (${r}.value === undefined) {
41          if (${s} in input) {
42            newResult[${s}] = undefined;
43          }
44        } else {
45          newResult[${s}] = ${r}.value;
46        }
47        
48      `):t.write(`
49        const ${r}_present = ${s} in input;
50        if (${r}.issues.length) {
51          payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
52            ...iss,
53            path: iss.path ? [${s}, ...iss.path] : [${s}]
54          })));
55        }
56        if (!${r}_present && !${r}.issues.length) {
57          payload.issues.push({
58            code: "invalid_type",
59            expected: "nonoptional",
60            input: undefined,
61            path: [${s}]
62          });
63        }
64
65        if (${r}_present) {
66          if (${r}.value === undefined) {
67            newResult[${s}] = undefined;
68          } else {
69            newResult[${s}] = ${r}.value;
70          }
71        }
72
73      `)}t.write("payload.value = newResult;"),t.write("return payload;");let l=t.compile();return(t,r)=>l(e,t,r)})(t.shape)),i=r(i,f),p)?ei([],h,i,f,n,e):i:s(i,f):(i.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),i)}});function eo(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let a=e.filter(e=>!u.aborted(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>u.finalizeIssue(e,n,i.$W())))}),t)}let eu=i.xI("$ZodUnion",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"optin",()=>t.options.some(e=>
73"optional"===e._zod.optin)?"optional":void 0),u.defineLazy(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),u.defineLazy(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),u.defineLazy(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>u.cleanRegex(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then(t=>eo(t,n,e,i)):eo(s,n,e,i)}});function el(e,t,r,n){let a=e.filter(e=>0===e.issues.length);return 1===a.length?t.value=a[0].value:0===a.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>u.finalizeIssue(e,n,i.$W())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}let ec=i.xI("$ZodXor",(e,t)=>{eu.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);t instanceof Promise?(s.push(t),a=!0):s.push(t)}return a?Promise.all(s).then(t=>el(t,n,e,i)):el(s,n,e,i)}}),ef=i.xI("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,eu.init(e,t);let r=e._zod.parse;u.defineLazy(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=u.cached(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,a)=>{let s=i.value;if(!u.isObject(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let o=n.value.get(s?.[t.discriminator]);return o?o._zod.run(i,a):t.unionFallback||"backward"===a.direction?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:s,path:[t.discriminator],inst:e}),i)}}),ed=i.xI("$ZodIntersection",(e,t)=>{c.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,r])=>ep(e,t,r)):ep(e,i,a)}});function ep(e,t,r){let n,i=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(n??(n=r),r.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let a=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&n&&e.issues.push({...n,keys:a}),u.aborted(e))return e;let s=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(u.isPlainObject(t)&&u.isPlainObject(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};a[n]=i.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let eh=i.xI("$ZodTuple",(e,t)=>{c.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],o=em(r,"optin"),u=em(r,"optout");if(!t.rest){if(a.length<o)return n.issues.push({code:"too_small",minimum:o,inclusive:!0,input:a,inst:e,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let l=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?s.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=r.length-1;for(let o of a.slice(r.length)){e++;let r=t.rest._zod.run({value:o,issues:[]},i);r instanceof Promise?s.push(r.then(t=>ey(t,n,e))):ey(r,n,e)}}return s.length?Promise.all(s).then(()=>eg(l,n,r,a,u)):eg(l,n,r,a,u)}});function em(e,t){for(let r=e.length-1;r>=0;r--)if("optional"!==e[r]._zod[t])return r+1;return 0}function ey(e,t,r){e.issues.length&&t.issues.push(...u.prefixIssues(r,e.issues)),t.value[r]=e.value}function eg(e,t,r,n,i){for(let a=0;a<r.length;a++){let r=e[a],s=a<n.length;if(r.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...u.prefixIssues(a,r.issues))}t.value[a]=r.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let eb=i.xI("$ZodRecord",(e,t)=>{c.init(e,t),e._zod.parse=(r,n)=>{let a=r.value;if(!u.isPlainObject(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;let s=[],l=t.keyType._zod.values;if(l){let o;r.value={};let c=new Set;for(let o of l)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){c.add("number"==typeof o?o.toString():o);let l=t.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>
73u.finalizeIssue(e,n,i.$W())),input:o,path:[o],inst:e});continue}let f=l.value,d=t.valueType._zod.run({value:a[o],issues:[]},n);d instanceof Promise?s.push(d.then(e=>{e.issues.length&&r.issues.push(...u.prefixIssues(o,e.issues)),r.value[f]=e.value})):(d.issues.length&&r.issues.push(...u.prefixIssues(o,d.issues)),r.value[f]=d.value)}for(let e in a)c.has(e)||(o=o??[]).push(e);o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:o})}else for(let l of(r.value={},Reflect.ownKeys(a))){if("__proto__"===l||!Object.prototype.propertyIsEnumerable.call(a,l))continue;let c=t.keyType._zod.run({value:l,issues:[]},n);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof l&&o.number.test(l)&&c.issues.length){let e=t.keyType._zod.run({value:Number(l),issues:[]},n);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(c=e)}if(c.issues.length){"loose"===t.mode?r.value[l]=a[l]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(e=>u.finalizeIssue(e,n,i.$W())),input:l,path:[l],inst:e});continue}let f=t.valueType._zod.run({value:a[l],issues:[]},n);f instanceof Promise?s.push(f.then(e=>{e.issues.length&&r.issues.push(...u.prefixIssues(l,e.issues)),r.value[c.value]=e.value})):(f.issues.length&&r.issues.push(...u.prefixIssues(l,f.issues)),r.value[c.value]=f.value)}return s.length?Promise.all(s).then(()=>r):r}}),ew=i.xI("$ZodMap",(e,t)=>{c.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let a=[];for(let[s,o]of(r.value=new Map,i)){let u=t.keyType._zod.run({value:s,issues:[]},n),l=t.valueType._zod.run({value:o,issues:[]},n);u instanceof Promise||l instanceof Promise?a.push(Promise.all([u,l]).then(([t,a])=>{ev(t,a,r,s,i,e,n)})):ev(u,l,r,s,i,e,n)}return a.length?Promise.all(a).then(()=>r):r}});function ev(e,t,r,n,a,s,o){e.issues.length&&(u.propertyKeyTypes.has(typeof n)?r.issues.push(...u.prefixIssues(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:a,inst:s,issues:e.issues.map(e=>u.finalizeIssue(e,o,i.$W()))})),t.issues.length&&(u.propertyKeyTypes.has(typeof n)?r.issues.push(...u.prefixIssues(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:a,inst:s,key:n,issues:t.issues.map(e=>u.finalizeIssue(e,o,i.$W()))})),r.value.set(e.value,t.value)}let ex=i.xI("$ZodSet",(e,t)=>{c.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];for(let e of(r.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},n);i instanceof Promise?a.push(i.then(e=>e$(e,r))):e$(i,r)}return a.length?Promise.all(a).then(()=>r):r}});function e$(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let eE=i.xI("$ZodEnum",(e,t)=>{c.init(e,t);let r=u.getEnumValues(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>u.propertyKeyTypes.has(typeof e)).map(e=>"string"==typeof e?u.escapeRegex(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),eP=i.xI("$ZodLiteral",(e,t)=>{if(c.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?u.escapeRegex(e):e?u.escapeRegex(e.toString()):String(e)).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),e_=i.xI("$ZodFile",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}}),eA=i.xI("$ZodTransform",(e,t)=>{c.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new i.cV(e.constructor.name);let a=t.transform(r.value,r);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r.fallback=!0,r));if(a instanceof Promise)throw new i.GT;return r.value=a,r.fallback=!0,r}});function eI(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let eS=i.xI("$ZodOptional",(e,t)=>{c.init(e,t),e._zod.optin="optional",e._zod.optout="optional",u.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),u.defineLazy(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u.cleanRegex(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=e.value,i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(e=>eI(e,n)):eI(i,n)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),ez=i.xI("$ZodExactOptional",(e,t)=>{eS.init(e,t),u.defineLazy(e._zod,"values",()=>t.innerType._zod.values),u.defineLazy(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),ek=i.xI("$ZodNullable",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"optin",()=>t.innerType._zod.optin),u.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),u.defineLazy(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u.cleanRegex(e.source)}|null)$`):void 0}),u.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),eO=i.xI("$ZodDefault",(e,t)=>{c.init(e,t),e._zod.optin="optional",u.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>eC(e,t)):eC(n,t)}});function eC(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let eT=i.xI("$ZodPrefault",(e,t)=>{c.init(e,t),e._zod.optin="optional",u.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),eB=i.xI("$ZodNonOptional",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>ej(t,e)):ej(i,e)}});function ej(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let eN=i.xI("$ZodSuccess",(e,t)=>{c.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new i.cV("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}}),eM=i.xI("$ZodCatch",(e,t)=>{c.init(e,t),e._zod.optin="optional",u.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),u.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>
73(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>u.finalizeIssue(e,r,i.$W()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>u.finalizeIssue(e,r,i.$W()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),eR=i.xI("$ZodNaN",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),eU=i.xI("$ZodPipe",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"values",()=>t.in._zod.values),u.defineLazy(e._zod,"optin",()=>t.in._zod.optin),u.defineLazy(e._zod,"optout",()=>t.out._zod.optout),u.defineLazy(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>eL(e,t.in,r)):eL(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>eL(e,t.out,r)):eL(n,t.out,r)}});function eL(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let eD=i.xI("$ZodCodec",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"values",()=>t.in._zod.values),u.defineLazy(e._zod,"optin",()=>t.in._zod.optin),u.defineLazy(e._zod,"optout",()=>t.out._zod.optout),u.defineLazy(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>eq(e,t,r)):eq(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>eq(e,t,r)):eq(n,t,r)}}});function eq(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>eF(e,n,t.out,r)):eF(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>eF(e,n,t.in,r)):eF(e,n,t.in,r)}}function eF(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}let eW=i.xI("$ZodPreprocess",(e,t)=>{eU.init(e,t)}),eH=i.xI("$ZodReadonly",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"propValues",()=>t.innerType._zod.propValues),u.defineLazy(e._zod,"values",()=>t.innerType._zod.values),u.defineLazy(e._zod,"optin",()=>t.innerType?._zod?.optin),u.defineLazy(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(eV):eV(n)}});function eV(e){return e.value=Object.freeze(e.value),e}let eK=i.xI("$ZodTemplateLiteral",(e,t)=>{c.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(n,i))}else if(null===e||u.primitiveTypes.has(typeof e))r.push(u.escapeRegex(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)}),eG=i.xI("$ZodFunction",(e,t)=>(c.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...r){let n=Reflect.apply(t,this,e._def.input?(0,s.qg)(e._def.input,r):r);return e._def.output?(0,s.qg)(e._def.output,n):n}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await (0,s.EJ)(e._def.input,r):r,i=await Reflect.apply(t,this,n);return e._def.output?await (0,s.EJ)(e._def.output,i):i}},e._zod.parse=(t,r)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>{let r=e.constructor;return new r(Array.isArray(t[0])?{type:"function",input:new eh({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output})},e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),eZ=i.xI("$ZodPromise",(e,t)=>{c.init(e,t),e._zod.parse=(e,r)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},r))}),eJ=i.xI("$ZodLazy",(e,t)=>{c.init(e,t),u.defineLazy(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),u.defineLazy(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),u.defineLazy(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),u.defineLazy(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),u.defineLazy(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),eY=i.xI("$ZodCustom",(e,t)=>{n.QP.init(e,t),c.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>eQ(t,r,n,e));eQ(i,r,n,e)}});function eQ(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(u.issue(e))}}},38432:e=>{"use strict";e.exports=JSON.parse('{"$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":false}')},38708:function(e,t,r){var n=r(49304).Buffer;e.exports=(()=>{var e={873:(e,t)=>{var r,n,i=function(){var e,t,r=function(e,t){var r=e,n=s[t],i=null,a=0,u=null,y=[],g={},w=function(e,t){i=function(e){for(var t=Array(e),r=0;r<e;r+=1){t[r]=Array(e);for(var n=0;n<e;n+=1)t[r][n]=null}return t}(a=4*r+17),v(0,0),v(a-7,0),v(0,a-7),$(),x(),P(e,t),r>=7&&E(e),null==u&&(u=A(r,n,y)),_(u,t)},v=function(e,t){for(var r=-1;r<=7;r+=1)if(!(e+r<=-1||a<=e+r))for(var n=-1;n<=7;n+=1)t+n<=-1||a<=t+n||(i[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},x=function(){for(var e=8;e<a-8;e+=1)null==i[e][6]&&(i[e][6]=e%2==0);for(var t=8;t<a-8;t+=1)null==i[6][t]&&(i[6][t]=t%2==0)},$=function(){for(var e=o.getPatternPosition(r),t=0;t<e.length;t+=1)for(var n=0;n<e.length;n+=1){var a=e[t],s=e[n];if(null==i[a][s])for(var u=-2;u<=2;u+=1)for(var l=-2;l<=2;l+=1)i[a+u][s+l]=-2==u||2==u||-2==l||2==l||0==u&&0==l}},E=function(e){for(var t=o.getBCHTypeNumber(r),n=0;n<18;n+=1){var s=!e&&1==(t>>n&1);i[Math.floor(n/3)][n%3+a-8-3]=s}for(n=0;n<18;n+=1)s=!e&&1==(t>>n&1),i[n%3+a-8-3][Math.floor(n/3)]=s},P=function(e,t){for(var r=n<<3|t,s=o.getBCHTypeInfo(r),u=0;u<15;u+=1){var l=!e&&1==(s>>u&1);u<6?i[u][8]=l:u<8?i[u+1][8]=l:i[a-15+u][8]=l}for(u=0;
vendor: 6,262 bytes, line 73
73u<15;u+=1)l=!e&&1==(s>>u&1),u<8?i[8][a-u-1]=l:u<9?i[8][15-u-1+1]=l:i[8][15-u-1]=l;i[a-8][8]=!e},_=function(e,t){for(var r=-1,n=a-1,s=7,u=0,l=o.getMaskFunction(t),c=a-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var f=0;f<2;f+=1)if(null==i[n][c-f]){var d=!1;u<e.length&&(d=1==(e[u]>>>s&1)),l(n,c-f)&&(d=!d),i[n][c-f]=d,-1==(s-=1)&&(u+=1,s=7)}if((n+=r)<0||a<=n){n-=r,r=-r;break}}},A=function(e,t,r){for(var n=c.getRSBlocks(e,t),i=f(),a=0;a<r.length;a+=1){var s=r[a];i.put(s.getMode(),4),i.put(s.getLength(),o.getLengthInBits(s.getMode(),e)),s.write(i)}var u=0;for(a=0;a<n.length;a+=1)u+=n[a].dataCount;if(i.getLengthInBits()>8*u)throw"code length overflow. ("+i.getLengthInBits()+">"+8*u+")";for(i.getLengthInBits()+4<=8*u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*u||(i.put(236,8),i.getLengthInBits()>=8*u));)i.put(17,8);return function(e,t){for(var r=0,n=0,i=0,a=Array(t.length),s=Array(t.length),u=0;u<t.length;u+=1){var c=t[u].dataCount,f=t[u].totalCount-c;n=Math.max(n,c),i=Math.max(i,f),a[u]=Array(c);for(var d=0;d<a[u].length;d+=1)a[u][d]=255&e.getBuffer()[d+r];r+=c;var p=o.getErrorCorrectPolynomial(f),h=l(a[u],p.getLength()-1).mod(p);for(s[u]=Array(p.getLength()-1),d=0;d<s[u].length;d+=1){var m=d+h.getLength()-s[u].length;s[u][d]=m>=0?h.getAt(m):0}}var y=0;for(d=0;d<t.length;d+=1)y+=t[d].totalCount;var g=Array(y),b=0;for(d=0;d<n;d+=1)for(u=0;u<t.length;u+=1)d<a[u].length&&(g[b]=a[u][d],b+=1);for(d=0;d<i;d+=1)for(u=0;u<t.length;u+=1)d<s[u].length&&(g[b]=s[u][d],b+=1);return g}(i,n)};g.addData=function(e,t){var r=null;switch(t=t||"Byte"){case"Numeric":r=d(e);break;case"Alphanumeric":r=p(e);break;case"Byte":r=h(e);break;case"Kanji":r=m(e);break;default:throw"mode:"+t}y.push(r),u=null},g.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+","+t;return i[e][t]},g.getModuleCount=function(){return a},g.make=function(){if(r<1){for(var e=1;e<40;e++){for(var t=c.getRSBlocks(e,n),i=f(),a=0;a<y.length;a++){var s=y[a];i.put(s.getMode(),4),i.put(s.getLength(),o.getLengthInBits(s.getMode(),e)),s.write(i)}var u=0;for(a=0;a<t.length;a++)u+=t[a].dataCount;if(i.getLengthInBits()<=8*u)break}r=e}w(!1,function(){for(var e=0,t=0,r=0;r<8;r+=1){w(!0,r);var n=o.getLostPoint(g);(0==r||e>n)&&(e=n,t=r)}return t}())},g.createTableTag=function(e,t){e=e||2;var r="";r+='<table style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: '+(t=void 0===t?4*e:t)+'px;"><tbody>';for(var n=0;n<g.getModuleCount();n+=1){r+="<tr>";for(var i=0;i<g.getModuleCount();i+=1)r+='<td style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: 0px; width: '+e+"px; height: "+e+"px; background-color: "+(g.isDark(n,i)?"#000000":"#ffffff")+';"/>';r+="</tr>"}return(r+="</tbody>")+"</table>"},g.createSvgTag=function(e,t,r,n){var i={};"object"==typeof arguments[0]&&(e=(i=arguments[0]).cellSize,t=i.margin,r=i.alt,n=i.title),e=e||2,t=void 0===t?4*e:t,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var a,s,o,u,l=g.getModuleCount()*e+2*t,c="";for(u="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",c+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',c+=i.scalable?"":' width="'+l+'px" height="'+l+'px"',c+=' viewBox="0 0 '+l+" "+l+'" ',c+=' preserveAspectRatio="xMinYMin meet"',c+=n.text||r.text?' role="img" aria-labelledby="'+I([n.id,r.id].join(" ").trim())+'"':"",c+=">",c+=n.text?'<title id="'+I(n.id)+'">'+I(n.text)+"</title>":"",c+=r.text?'<description id="'+I(r.id)+'">'+I(r.text)+"</description>":"",c+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',c+='<path d="',s=0;s<g.getModuleCount();s+=1)for(o=s*e+t,a=0;a<g.getModuleCount();a+=1)g.isDark(s,a)&&(c+="M"+(a*e+t)+","+o+u);return(c+='" stroke="transparent" fill="black"/>')+"</svg>"},g.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var r=g.getModuleCount()*e+2*t,n=t,i=r-t;return b(r,r,function(t,r){if(n<=t&&t<i&&n<=r&&r<i){var a=Math.floor((t-n)/e),s=Math.floor((r-n)/e);return+!g.isDark(s,a)}return 1})},g.createImgTag=function(e,t,r){e=e||2,t=void 0===t?4*e:t;var n=g.getModuleCount()*e+2*t,i="";return i+="<img",i+=' src="',i+=g.createDataURL(e,t),i+='"',i+=' width="',i+=n,i+='"',i+=' height="',i+=n,i+='"',r&&(i+=' alt="',i+=I(r),i+='"'),i+"/>"};var I=function(e){for(var t="",r=0;r<e.length;r+=1){var n=e.charAt(r);switch(n){case"<":t+="&lt;";break;case">":t+="&gt;";break;case"&":t+="&amp;";break;case'"':t+="&quot;";break;default:t+=n}}return t};return g.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,r,n,i,a,s=+g.getModuleCount()+2*e,o=e,u=s-e,l={"██":"█","█ ":"▀"," █":"▄","  ":" "},c={"██":"▀","█ ":"▀"," █":" ","  ":" "},f="";for(t=0;t<s;t+=2){for(n=Math.floor((t-o)/1),i=Math.floor((t+1-o)/1),r=0;r<s;r+=1)a="█",o<=r&&r<u&&o<=t&&t<u&&g.isDark(n,Math.floor((r-o)/1))&&(a=" "),o<=r&&r<u&&o<=t+1&&t+1<u&&g.isDark(i,Math.floor((r-o)/1))?a+=" ":a+="█",f+=e<1&&t+1>=u?c[a]:l[a];f+="\n"}return s%2&&e>0?f.substring(0,f.length-s-1)+Array(s+1).join("▀"):f.substring(0,f.length-1)}(t);e-=1,t=void 0===t?2*e:t;var r,n,i,a,s=g.getModuleCount()*e+2*t,o=t,u=s-t,l=Array(e+1).join("██"),c=Array(e+1).join("  "),f="",d="";for(r=0;r<s;r+=1){for(i=Math.floor((r-o)/e),d="",n=0;n<s;n+=1)a=1,o<=n&&n<u&&o<=r&&r<u&&g.isDark(i,Math.floor((n-o)/e))&&(a=0),d+=a?l:c;for(i=0;i<e;i+=1)f+=d+"\n"}return f.substring(0,f.length-1)},g.renderTo2dContext=function(e,t){t=t||2;for(var r=g.getModuleCount(),n=0;n<r;n++)for(var i=0;i<r;i++)e.fillStyle=g.isDark(n,i)?"black":"white",e.fillRect(n*t,i*t,t,t)},g};r.stringToBytes=(r.stringToBytesFuncs={default:function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t.push(255&n)}return t}}).default,r.createStringToBytes=function(e,t){var r=function(){for(var r=g(e),n=function(){var e=r.read();if(-1==e)throw"eof";return e},i=0,a={};;){var s=r.read();if(-1==s)break;var o=n(),u=n()<<8|n();a[String.fromCharCode(s<<8|o)]=u,i+=1}if(i!=t)throw i+" != "+t;return a}();return function(e){for(var t=[],n=0;n<e.length;n+=1){var i=e.charCodeAt(n);if(i<128)t.push(i);else{var a=r[e.charAt(n)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>
738),t.push(255&a)):t.push(63)}}return t}};var n,i,a,s={L:1,M:0,Q:3,H:2},o=(n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],a=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(i={}).getBCHTypeInfo=function(e){for(var t=e<<10;a(t)-a(1335)>=0;)t^=1335<<a(t)-a(1335);return 21522^(e<<10|t)},i.getBCHTypeNumber=function(e){for(var t=e<<12;a(t)-a(7973)>=0;)t^=7973<<a(t)-a(7973);return e<<12|t},i.getPatternPosition=function(e){return n[e-1]},i.getMaskFunction=function(e){switch(e){case 0:return function(e,t){return(e+t)%2==0};case 1:return function(e,t){return e%2==0};case 2:return function(e,t){return t%3==0};case 3:return function(e,t){return(e+t)%3==0};case 4:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case 5:return function(e,t){return e*t%2+e*t%3==0};case 6:return function(e,t){return(e*t%2+e*t%3)%2==0};case 7:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},i.getErrorCorrectPolynomial=function(e){for(var t=l([1],0),r=0;r<e;r+=1)t=t.multiply(l([1,u.gexp(r)],0));return t},i.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+e}if(t<27)switch(e){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+e}if(!(t<41))throw"type:"+t;switch(e){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+e}},i.getLostPoint=function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n+=1)for(var i=0;i<t;i+=1){for(var a=0,s=e.isDark(n,i),o=-1;o<=1;o+=1)if(!(n+o<0||t<=n+o))for(var u=-1;u<=1;u+=1)i+u<0||t<=i+u||0==o&&0==u||s==e.isDark(n+o,i+u)&&(a+=1);a>5&&(r+=3+a-5)}for(n=0;n<t-1;n+=1)for(i=0;i<t-1;i+=1){var l=0;e.isDark(n,i)&&(l+=1),e.isDark(n+1,i)&&(l+=1),e.isDark(n,i+1)&&(l+=1),e.isDark(n+1,i+1)&&(l+=1),0!=l&&4!=l||(r+=3)}for(n=0;n<t;n+=1)for(i=0;i<t-6;i+=1)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(i=0;i<t;i+=1)for(n=0;n<t-6;n+=1)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);var c=0;for(i=0;i<t;i+=1)for(n=0;n<t;n+=1)e.isDark(n,i)&&(c+=1);return r+Math.abs(100*c/t/t-50)/5*10},i),u=function(){for(var e=Array(256),t=Array(256),r=0;r<8;r+=1)e[r]=1<<r;for(r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(r=0;r<255;r+=1)t[e[r]]=r;return{glog:function(e){if(e<1)throw"glog("+e+")";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}}}();function l(e,t){if(void 0===e.length)throw e.length+"/"+t;var r=function(){for(var r=0;r<e.length&&0==e[r];)r+=1;for(var n=Array(e.length-r+t),i=0;i<e.length-r;i+=1)n[i]=e[i+r];return n}(),n={getAt:function(e){return r[e]},getLength:function(){return r.length},multiply:function(e){for(var t=Array(n.getLength()+e.getLength()-1),r=0;r<n.getLength();r+=1)for(var i=0;i<e.getLength();i+=1)t[r+i]^=u.gexp(u.glog(n.getAt(r))+u.glog(e.getAt(i)));return l(t,0)},mod:function(e){if(n.getLength()-e.getLength()<0)return n;for(var t=u.glog(n.getAt(0))-u.glog(e.getAt(0)),r=Array(n.getLength()),i=0;i<n.getLength();i+=1)r[i]=n.getAt(i);for(i=0;i<e.getLength();i+=1)r[i]^=u.gexp(u.glog(e.getAt(i))+t);return l(r,0).mod(e)}};return n}var c=(e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37
73],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var r={};return r.totalCount=e,r.dataCount=t,r},{getRSBlocks:function(r,n){var i=function(t,r){switch(r){case s.L:return e[4*(t-1)+0];case s.M:return e[4*(t-1)+1];case s.Q:return e[4*(t-1)+2];case s.H:return e[4*(t-1)+3];default:return}}(r,n);if(void 0===i)throw"bad rs block @ typeNumber:"+r+"/errorCorrectionLevel:"+n;for(var a=i.length/3,o=[],u=0;u<a;u+=1)for(var l=i[3*u+0],c=i[3*u+1],f=i[3*u+2],d=0;d<l;d+=1)o.push(t(c,f));return o}}),f=function(){var e=[],t=0,r={getBuffer:function(){return e},getAt:function(t){return 1==(e[Math.floor(t/8)]>>>7-t%8&1)},put:function(e,t){for(var n=0;n<t;n+=1)r.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return t},putBit:function(r){var n=Math.floor(t/8);e.length<=n&&e.push(0),r&&(e[n]|=128>>>t%8),t+=1}};return r},d=function(e){var t=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+r(e.charAt(n));return t},r=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;throw"illegal char :"+e};return{getMode:function(){return 1},getLength:function(t){return e.length},write:function(r){for(var n=0;n+2<e.length;)r.put(t(e.substring(n,n+3)),10),n+=3;n<e.length&&(e.length-n==1?r.put(t(e.substring(n,n+1)),4):e.length-n==2&&r.put(t(e.substring(n,n+2)),7))}}},p=function(e){var t=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;if("A"<=e&&e<="Z")return e.charCodeAt(0)-65+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return{getMode:function(){return 2},getLength:function(t){return e.length},write:function(r){for(var n=0;n+1<e.length;)r.put(45*t(e.charAt(n))+t(e.charAt(n+1)),11),n+=2;n<e.length&&r.put(t(e.charAt(n)),6)}}},h=function(e){var t=r.stringToBytes(e);return{getMode:function(){return 4},getLength:function(e){return t.length},write:function(e){for(var r=0;r<t.length;r+=1)e.put(t[r],8)}}},m=function(e){var t=r.stringToBytesFuncs.SJIS;if(!t)throw"sjis not supported.";var n=t("友");
73if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported.";var i=t(e);return{getMode:function(){return 8},getLength:function(e){return~~(i.length/2)},write:function(e){for(var t=0;t+1<i.length;){var r=(255&i[t])<<8|255&i[t+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(t+1)+"/"+r;r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13),t+=2}if(t<i.length)throw"illegal char at "+(t+1)}}},y=function(){var e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,r,n){r=r||0,n=n||e.length;for(var i=0;i<n;i+=1)t.writeByte(e[i+r])},writeString:function(e){for(var r=0;r<e.length;r+=1)t.writeByte(e.charCodeAt(r))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var r=0;r<e.length;r+=1)r>0&&(t+=","),t+=e[r];return t+"]"}};return t},g=function(e){var t=0,r=0,n=0,i=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return{read:function(){for(;n<8;){if(t>=e.length){if(0==n)return -1;throw"unexpected end of file./"+n}var a=e.charAt(t);if(t+=1,"="==a)return n=0,-1;a.match(/^\s$/)||(r=r<<6|i(a.charCodeAt(0)),n+=6)}var s=r>>>n-8&255;return n-=8,s}}},b=function(e,t,r){for(var n,i,a,s,o,u,l,c,f,d,p=(n=Array(e*t),i=function(e){for(var t=1<<e,r=1+(1<<e),i=e+1,s=a(),o=0;o<t;o+=1)s.add(String.fromCharCode(o));s.add(String.fromCharCode(t)),s.add(String.fromCharCode(r));var u,l,c=y(),f=(u=0,l=0,{write:function(e,t){if(e>>>t!=0)throw"length over";for(;u+t>=8;)c.writeByte(255&(e<<u|l)),t-=8-u,e>>>=8-u,l=0,u=0;l|=e<<u,u+=t},flush:function(){u>0&&c.writeByte(l)}});f.write(t,i);var d=0,p=String.fromCharCode(n[0]);for(d+=1;d<n.length;){var h=String.fromCharCode(n[d]);d+=1,s.contains(p+h)?p+=h:(f.write(s.indexOf(p),i),4095>s.size()&&(s.size()==1<<i&&(i+=1),s.add(p+h)),p=h)}return f.write(s.indexOf(p),i),f.write(r,i),f.flush(),c.toByteArray()},a=function(){var e={},t=0,r={add:function(n){if(r.contains(n))throw"dup key:"+n;e[n]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return r},{setPixel:function(t,r,i){n[r*e+t]=i},write:function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(t),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(t),r.writeByte(0);var n=i(2);r.writeByte(2);for(var a=0;n.length-a>255;)r.writeByte(255),r.writeBytes(n,a,255),a+=255;r.writeByte(n.length-a),r.writeBytes(n,a,n.length-a),r.writeByte(0),r.writeString(";")}}),h=0;h<t;h+=1)for(var m=0;m<e;m+=1)p.setPixel(m,h,r(m,h));var g=y();p.write(g);for(var b=(s=0,o=0,u=0,l="",c={},f=function(e){l+=String.fromCharCode(d(63&e))},d=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e},c.writeByte=function(e){for(s=s<<8|255&e,o+=8,u+=1;o>=6;)f(s>>>o-6),o-=6},c.flush=function(){if(o>0&&(f(s<<6-o),s=0,o=0),u%3!=0)for(var e=3-u%3,t=0;t<e;t+=1)l+="="},c.toString=function(){return l},c),w=g.toByteArray(),v=0;v<w.length;v+=1)b.writeByte(w[v]);return b.flush(),"data:image/gif;base64,"+b};return r}();i.stringToBytesFuncs["UTF-8"]=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t},void 0===(n="function"==typeof(r=function(){return i})?r.apply(t,[]):r)||(e.exports=n)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{"use strict";r.d(i,{default:()=>I});let e=e=>!!e&&"object"==typeof e&&!Array.isArray(e);function t(r,...n){if(!n.length)return r;let i=n.shift();return void 0!==i&&e(r)&&e(i)?(r=Object.assign({}
73,r),Object.keys(i).forEach(n=>{let a=r[n],s=i[n];Array.isArray(a)&&Array.isArray(s)?r[n]=s:e(a)&&e(s)?r[n]=t(Object.assign({},a),s):r[n]=s}),t(r,...n)):r}function a(e,t){let r=document.createElement("a");r.download=t,r.href=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}let s={L:.07,M:.15,Q:.25,H:.3};class o{constructor({svg:e,type:t,window:r}){this._svg=e,this._type=t,this._window=r}draw(e,t,r,n){let i;switch(this._type){case"dots":i=this._drawDot;break;case"classy":i=this._drawClassy;break;case"classy-rounded":i=this._drawClassyRounded;break;case"rounded":i=this._drawRounded;break;case"extra-rounded":i=this._drawExtraRounded;break;default:i=this._drawSquare}i.call(this,{x:e,y:t,size:r,getNeighbor:n})}_rotateFigure({x:e,y:t,size:r,rotation:n=0,draw:i}){var a;i(),null==(a=this._element)||a.setAttribute("transform",`rotate(${180*n/Math.PI},${e+r/2},${t+r/2})`)}_basicDot(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(r+t/2)),this._element.setAttribute("cy",String(n+t/2)),this._element.setAttribute("r",String(t/2))}}))}_basicSquare(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(r)),this._element.setAttribute("y",String(n)),this._element.setAttribute("width",String(t)),this._element.setAttribute("height",String(t))}}))}_basicSideRounded(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${r} ${n}v ${t}h `+t/2+`a ${t/2} ${t/2}, 0, 0, 0, 0 ${-t}`)}}))}_basicCornerRounded(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${r} ${n}v ${t}h ${t}v `+-t/2+`a ${t/2} ${t/2}, 0, 0, 0, ${-t/2} ${-t/2}`)}}))}_basicCornerExtraRounded(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${r} ${n}v ${t}h ${t}a ${t} ${t}, 0, 0, 0, ${-t} ${-t}`)}}))}_basicCornersRounded(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${r} ${n}v `+t/2+`a ${t/2} ${t/2}, 0, 0, 0, ${t/2} ${t/2}h `+t/2+"v "+-t/2+`a ${t/2} ${t/2}, 0, 0, 0, ${-t/2} ${-t/2}`)}}))}_drawDot({x:e,y:t,size:r}){this._basicDot({x:e,y:t,size:r,rotation:0})}_drawSquare({x:e,y:t,size:r}){this._basicSquare({x:e,y:t,size:r,rotation:0})}_drawRounded({x:e,y:t,size:r,getNeighbor:n}){let i=n?+n(-1,0):0,a=n?+n(1,0):0,s=n?+n(0,-1):0,o=n?+n(0,1):0,u=i+a+s+o;if(0!==u)if(u>2||i&&a||s&&o)this._basicSquare({x:e,y:t,size:r,rotation:0});else{if(2===u){let n=0;return i&&s?n=Math.PI/2:s&&a?n=Math.PI:a&&o&&(n=-Math.PI/2),void this._basicCornerRounded({x:e,y:t,size:r,rotation:n})}if(1===u){let n=0;return s?n=Math.PI/2:a?n=Math.PI:o&&(n=-Math.PI/2),void this._basicSideRounded({x:e,y:t,size:r,rotation:n})}}else this._basicDot({x:e,y:t,size:r,rotation:0})}_drawExtraRounded({x:e,y:t,size:r,getNeighbor:n}){let i=n?+n(-1,0):0,a=n?+n(1,0):0,s=n?+n(0,-1):0,o=n?+n(0,1):0,u=i+a+s+o;if(0!==u)if(u>2||i&&a||s&&o)this._basicSquare({x:e,y:t,size:r,rotation:0});else{if(2===u){let n=0;return i&&s?n=Math.PI/2:s&&a?n=Math.PI:a&&o&&(n=-Math.PI/2),void this._basicCornerExtraRounded({x:e,y:t,size:r,rotation:n})}if(1===u){let n=0;return s?n=Math.PI/2:a?n=Math.PI:o&&(n=-Math.PI/2),void this._basicSideRounded({x:e,y:t,size:r,rotation:n})}}else this._basicDot({x:e,y:t,size:r,rotation:0})}_drawClassy({x:e,y:t,size:r,getNeighbor:n}){let i=n?+n(-1,0):0,a=n?+n(1,0):0,s=n?+n(0,-1):0,o=n?+n(0,1):0;0!==i+a+s+o?i||s?a||o?this._basicSquare({x:e,y:t,size:r,rotation:0}):this._basicCornerRounded({x:e,y:t,size:r,rotation:Math.PI/2}):this._basicCornerRounded({x:e,y:t,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:e,y:t,size:r,rotation:Math.PI/2})}_drawClassyRounded({x:e,y:t,size:r,getNeighbor:n}){let i=n?+n(-1,0):0,a=n?+n(1,0):0,s=n?+n(0,-1):0,o=n?+n(0,1):0;0!==i+a+s+o?i||s?a||o?this._basicSquare({x:e,y:t,size:r,rotation:0}):this._basicCornerExtraRounded({x:e,y:t,size:r,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:e,y:t,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:e,y:t,size:r,rotation:Math.PI/2})}}let u={dot:"dot",square:"square",extraRounded:"extra-rounded"},l=Object.values(u);class c{constructor({svg:e,type:t,window:r}){this._svg=e,this._type=t,this._window=r}draw(e,t,r,n){let i;switch(this._type){case u.square:i=this._drawSquare;break;case u.extraRounded:i=this._drawExtraRounded;break;default:i=this._drawDot}i.call(this,{x:e,y:t,size:r,rotation:n})}_rotateFigure({x:e,y:t,size:r,rotation:n=0,draw:i}){var a;i(),null==(a=this._element)||a.setAttribute("transform",`rotate(${180*n/Math.PI},${e+r/2},${t+r/2})`)}_basicDot(e){let{size:t,x:r,y:n}=e,i=t/7;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${r+t/2} ${n}a ${t/2} ${t/2} 0 1 0 0.1 0zm 0 ${i}a ${t/2-i} ${t/2-i} 0 1 1 -0.1 0Z`)}}))}_basicSquare(e){let{size:t,x:r,y:n}=e,i=t/7;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${r} ${n}v ${t}h ${t}v `+-t+"z"+`M ${r+i} ${n+i}h `+(t-2*i)+"v "+(t-2*i)+"h "+(2*i-t)+"z")}}))}_basicExtraRounded(e){let{size:t,x:r,y:n}=e,i=t/7;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${r} ${n+2.5*i}v `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*i}h `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${-(2.5*i)}v `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${-(2.5*i)} ${-(2.5*i)}h `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${-(2.5*i)} ${2.5*i}`+`M ${r+2.5*i} ${n+i}h `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*i}v `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${-(1.5*i)} ${1.5*i}h `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${-(1.5*i)} ${-(1.5*i)}v `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${-(1.5*i)}`)}}))}_drawDot({x:e,y:t,size:r,rotation:n}){this._basicDot({x:e,y:t,size:r,rotation:n})}_drawSquare({x:e,y:t,size:r,rotation:n}){this._basicSquare({x:e,y:t,size:r,rotation:n})}_drawExtraRounded({x:e,y:t,size:r,rotation:n}){this._basicExtraRounded({x:e,y:t,size:r,rotation:n})}}let f={dot:"dot",square:"square"},d=Object.values(f);class p{constructor({svg:e,type:t,window:r}){this._svg=e,this._type=t,this._window=r}draw(e,t,r,n){(this._type===f.square?this._drawSquare:this._drawDot).call(this,{x:e,y:t,size:r,rotation:n})}_rotateFigure({x:e,y:t,size:r,rotation:n=0,draw:i}){var a;i(),null==(a=this._element)||a.setAttribute("transform",`rotate(${180*n/Math.PI},${e+r/2},${t+r/2})`)}_basicDot(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(r+t/2)),this._element.setAttribute("cy",String(n+t/2)),this._element.setAttribute("r",String(t/2))}}))}_basicSquare(e){let{size:t,x:r,y:n}=e;this._rotateFigure(Object.assign(Object.assign({},e),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(r)),this._element.setAttribute("y",String(n)),this._element.setAttribute("width",String(t)),this._element.setAttribute("height",String(t))}}))}_drawDot({x:e,y:t,size:r,rotation:n}){this._basicDot({x:e,y:t,size:r,rotation:n})}_drawSquare({x:e,y:t,size:r,rotation:n}){this._basicSquare({x:e,y:t,size:r,rotation:n})}}let h="circle",m=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],y=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class g{constructor(e,t){this._roundSize=e=>this._options.dotsOptions.roundSize?Math.floor(e):e,this._window=t,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(e.width)),this._element.setAttribute("height",String(e.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),e.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${e.width} ${e.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=e.image,this._instanceId=g.instanceCount++,this._options=e}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(e){let t=e.getModuleCount(),r=Math.min(this._options.width,this._options.height)-2*this._options.margin,n=this._options.shape===h?r/Math.sqrt(2):r,i=this._roundSize(n/t),a={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=e,this._options.image){if(await this.loadImage(),!this._image)return;let{imageOptions:e,qrOptions:r}=this._options,n=Math.floor(e.imageSize*s[r.errorCorrectionLevel]*t*t);a=function({originalHeight:e,originalWidth:t,maxHiddenDots:r,maxHiddenAxisDots:n,dotSize:i}){let a={x:0,y:0},s={x:0,y:0};if(e<=0||t<=0||r<=0||i<=0)return{height:0,width:0,hideYDots:0,hideXDots:0}
73;let o=e/t;return a.x=Math.floor(Math.sqrt(r/o)),a.x<=0&&(a.x=1),n&&n<a.x&&(a.x=n),a.x%2==0&&a.x--,s.x=a.x*i,a.y=1+2*Math.ceil((a.x*o-1)/2),s.y=Math.round(s.x*o),(a.y*a.x>r||n&&n<a.y)&&(n&&n<a.y?(a.y=n,a.y%2==0&&a.x--):a.y-=2,s.y=a.y*i,a.x=1+2*Math.ceil((a.y/o-1)/2),s.x=Math.round(s.y/o)),{height:s.y,width:s.x,hideYDots:a.y,hideXDots:a.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:n,maxHiddenAxisDots:t-14,dotSize:i})}this.drawBackground(),this.drawDots((e,r)=>{var n,i,s,o,u,l;return!(this._options.imageOptions.hideBackgroundDots&&e>=(t-a.hideYDots)/2&&e<(t+a.hideYDots)/2&&r>=(t-a.hideXDots)/2&&r<(t+a.hideXDots)/2||(null==(n=m[e])?void 0:n[r])||(null==(i=m[e-t+7])?void 0:i[r])||(null==(s=m[e])?void 0:s[r-t+7])||(null==(o=y[e])?void 0:o[r])||(null==(u=y[e-t+7])?void 0:u[r])||(null==(l=y[e])?void 0:l[r-t+7]))}),this.drawCorners(),this._options.image&&await this.drawImage({width:a.width,height:a.height,count:t,dotSize:i})}drawBackground(){var e,t,r;let n=this._element,i=this._options;if(n){let n=null==(e=i.backgroundOptions)?void 0:e.gradient,a=null==(t=i.backgroundOptions)?void 0:t.color,s=i.height,o=i.width;if(n||a){let e=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),(null==(r=i.backgroundOptions)?void 0:r.round)&&(s=o=Math.min(i.width,i.height),e.setAttribute("rx",String(s/2*i.backgroundOptions.round))),e.setAttribute("x",String(this._roundSize((i.width-o)/2))),e.setAttribute("y",String(this._roundSize((i.height-s)/2))),e.setAttribute("width",String(o)),e.setAttribute("height",String(s)),this._backgroundClipPath.appendChild(e),this._createColor({options:n,color:a,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(e){var t,r;if(!this._qr)throw"QR code is not defined";let n=this._options,i=this._qr.getModuleCount();if(i>n.width||i>n.height)throw"The canvas is too small.";let a=Math.min(n.width,n.height)-2*n.margin,s=n.shape===h?a/Math.sqrt(2):a,u=this._roundSize(s/i),l=this._roundSize((n.width-i*u)/2),c=this._roundSize((n.height-i*u)/2),f=new o({svg:this._element,type:n.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null==(t=n.dotsOptions)?void 0:t.gradient,color:n.dotsOptions.color,additionalRotation:0,x:0,y:0,height:n.height,width:n.width,name:`dot-color-${this._instanceId}`});for(let t=0;t<i;t++)for(let n=0;n<i;n++)e&&!e(t,n)||(null==(r=this._qr)?void 0:r.isDark(t,n))&&(f.draw(l+n*u,c+t*u,u,(r,a)=>!(n+r<0||t+a<0||n+r>=i||t+a>=i)&&!(e&&!e(t+a,n+r))&&!!this._qr&&this._qr.isDark(t+a,n+r)),f._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(f._element));if(n.shape===h){let e=this._roundSize((a/u-i)/2),t=i+2*e,r=l-e*u,n=c-e*u,s=[],o=this._roundSize(t/2);for(let r=0;r<t;r++){s[r]=[];for(let n=0;n<t;n++)r>=e-1&&r<=t-e&&n>=e-1&&n<=t-e||Math.sqrt((r-o)*(r-o)+(n-o)*(n-o))>o?s[r][n]=0:s[r][n]=+!!this._qr.isDark(n-2*e<0?n:n>=i?n-2*e:n-e,r-2*e<0?r:r>=i?r-2*e:r-e)}for(let e=0;e<t;e++)for(let i=0;i<t;i++)s[e][i]&&(f.draw(r+i*u,n+e*u,u,(t,r)=>{var n;return!!(null==(n=s[e+r])?void 0:n[i+t])}),f._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(f._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";let e=this._element,t=this._options;if(!e)throw"Element code is not defined";let r=this._qr.getModuleCount(),n=Math.min(t.width,t.height)-2*t.margin,i=t.shape===h?n/Math.sqrt(2):n,a=this._roundSize(i/r),s=7*a,u=3*a,f=this._roundSize((t.width-r*a)/2),g=this._roundSize((t.height-r*a)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([e,n,i])=>{var h,b,w,v,x,$,E,P,_,A,I,S,z,k;let O=f+e*a*(r-7),C=g+n*a*(r-7),T=this._dotsClipPath,B=this._dotsClipPath;if(((null==(h=t.cornersSquareOptions)?void 0:h.gradient)||(null==(b=t.cornersSquareOptions)?void 0:b.color))&&((T=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id",`clip-path-corners-square-color-${e}-${n}-${this._instanceId}`),this._defs.appendChild(T),this._cornersSquareClipPath=this._cornersDotClipPath=B=T,this._createColor({options:null==(w=t.cornersSquareOptions)?void 0:w.gradient,color:null==(v=t.cornersSquareOptions)?void 0:v.color,additionalRotation:i,x:O,y:C,height:s,width:s,name:`corners-square-color-${e}-${n}-${this._instanceId}`})),(null==(x=t.cornersSquareOptions)?void 0:x.type)&&l.includes(t.cornersSquareOptions.type)){let e=new c({svg:this._element,type:t.cornersSquareOptions.type,window:this._window});e.draw(O,C,s,i),e._element&&T&&T.appendChild(e._element)}else{let e=new o({svg:this._element,type:(null==($=t.cornersSquareOptions)?void 0:$.type)||t.dotsOptions.type,window:this._window});for(let t=0;t<m.length;t++)for(let r=0;r<m[t].length;r++)(null==(E=m[t])?void 0:E[r])&&(e.draw(O+r*a,C+t*a,a,(e,n)=>{var i;return!!(null==(i=m[t+n])?void 0:i[r+e])}),e._element&&T&&T.appendChild(e._element))}if(((null==(P=t.cornersDotOptions)?void 0:P.gradient)||(null==(_=t.cornersDotOptions)?void 0:_.color))&&((B=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id",`clip-path-corners-dot-color-${e}-${n}-${this._instanceId}`),this._defs.appendChild(B),this._cornersDotClipPath=B,this._createColor({options:null==(A=t.cornersDotOptions)?void 0:A.gradient,color:null==(I=t.cornersDotOptions)?void 0:I.color,additionalRotation:i,x:O+2*a,y:C+2*a,height:u,width:u,name:`corners-dot-color-${e}-${n}-${this._instanceId}`})),(null==(S=t.cornersDotOptions)?void 0:S.type)&&d.includes(t.cornersDotOptions.type)){let e=new p({svg:this._element,type:t.cornersDotOptions.type,window:this._window});e.draw(O+2*a,C+2*a,u,i),e._element&&B&&B.appendChild(e._element)}else{let e=new o({svg:this._element,type:(null==(z=t.cornersDotOptions)?void 0:z.type)||t.dotsOptions.type,window:this._window});for(let t=0;t<y.length;t++)for(let r=0;r<y[t].length;r++)(null==(k=y[t])?void 0:k[r])&&(e.draw(O+r*a,C+t*a,a,(e,n)=>{var i;return!!(null==(i=y[t+n])?void 0:i[r+e])}),e._element&&B&&B.appendChild(e._element))}})}loadImage(){return new Promise((e,t)=>
73{var r;let n=this._options;if(!n.image)return t("Image is not defined");if(null==(r=n.nodeCanvas)?void 0:r.loadImage)n.nodeCanvas.loadImage(n.image).then(t=>{var r,i;if(this._image=t,this._options.imageOptions.saveAsBlob){let e=null==(r=n.nodeCanvas)?void 0:r.createCanvas(this._image.width,this._image.height);null==(i=null==e?void 0:e.getContext("2d"))||i.drawImage(t,0,0),this._imageUri=null==e?void 0:e.toDataURL()}e()}).catch(t);else{let t=new this._window.Image;"string"==typeof n.imageOptions.crossOrigin&&(t.crossOrigin=n.imageOptions.crossOrigin),this._image=t,t.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(e,t){return new Promise(r=>{let n=new t.XMLHttpRequest;n.onload=function(){let e=new t.FileReader;e.onloadend=function(){r(e.result)},e.readAsDataURL(n.response)},n.open("GET",e),n.responseType="blob",n.send()})}(n.image||"",this._window)),e()},t.src=n.image}})}async drawImage({width:e,height:t,count:r,dotSize:n}){let i=this._options,a=this._roundSize((i.width-r*n)/2),s=this._roundSize((i.height-r*n)/2),o=a+this._roundSize(i.imageOptions.margin+(r*n-e)/2),u=s+this._roundSize(i.imageOptions.margin+(r*n-t)/2),l=e-2*i.imageOptions.margin,c=t-2*i.imageOptions.margin,f=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");f.setAttribute("href",this._imageUri||""),f.setAttribute("xlink:href",this._imageUri||""),f.setAttribute("x",String(o)),f.setAttribute("y",String(u)),f.setAttribute("width",`${l}px`),f.setAttribute("height",`${c}px`),this._element.appendChild(f)}_createColor({options:e,color:t,additionalRotation:r,x:n,y:i,height:a,width:s,name:o}){let u=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(u.setAttribute("x",String(n)),u.setAttribute("y",String(i)),u.setAttribute("height",String(a)),u.setAttribute("width",String(s)),u.setAttribute("clip-path",`url('#clip-path-${o}')`),e){let t;if("radial"===e.type)(t=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",o),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("fx",String(n+s/2)),t.setAttribute("fy",String(i+a/2)),t.setAttribute("cx",String(n+s/2)),t.setAttribute("cy",String(i+a/2)),t.setAttribute("r",String((s>a?s:a)/2));else{let u=((e.rotation||0)+r)%(2*Math.PI),l=(u+2*Math.PI)%(2*Math.PI),c=n+s/2,f=i+a/2,d=n+s/2,p=i+a/2;l>=0&&l<=.25*Math.PI||l>1.75*Math.PI&&l<=2*Math.PI?(c-=s/2,f-=a/2*Math.tan(u),d+=s/2,p+=a/2*Math.tan(u)):l>.25*Math.PI&&l<=.75*Math.PI?(f-=a/2,c-=s/2/Math.tan(u),p+=a/2,d+=s/2/Math.tan(u)):l>.75*Math.PI&&l<=1.25*Math.PI?(c+=s/2,f+=a/2*Math.tan(u),d-=s/2,p-=a/2*Math.tan(u)):l>1.25*Math.PI&&l<=1.75*Math.PI&&(f+=a/2,c+=s/2/Math.tan(u),p-=a/2,d-=s/2/Math.tan(u)),(t=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",o),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("x1",String(Math.round(c))),t.setAttribute("y1",String(Math.round(f))),t.setAttribute("x2",String(Math.round(d))),t.setAttribute("y2",String(Math.round(p)))}e.colorStops.forEach(({offset:e,color:r})=>{let n=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");n.setAttribute("offset",100*e+"%"),n.setAttribute("stop-color",r),t.appendChild(n)}),u.setAttribute("fill",`url('#${o}')`),this._defs.appendChild(t)}else t&&u.setAttribute("fill",t);this._element.appendChild(u)}}g.instanceCount=0;let b="canvas",w={};for(let e=0;e<=40;e++)w[e]=e;let v={type:b,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:w[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function x(e){let t=Object.assign({},e);if(!t.colorStops||!t.colorStops.length)throw"Field 'colorStops' is required in gradient";return t.rotation?t.rotation=Number(t.rotation):t.rotation=0,t.colorStops=t.colorStops.map(e=>Object.assign(Object.assign({},e),{offset:Number(e.offset)})),t}function $(e){let t=Object.assign({},e);return t.width=Number(t.width),t.height=Number(t.height),t.margin=Number(t.margin),t.imageOptions=Object.assign(Object.assign({}
73,t.imageOptions),{hideBackgroundDots:!!t.imageOptions.hideBackgroundDots,imageSize:Number(t.imageOptions.imageSize),margin:Number(t.imageOptions.margin)}),t.margin>Math.min(t.width,t.height)&&(t.margin=Math.min(t.width,t.height)),t.dotsOptions=Object.assign({},t.dotsOptions),t.dotsOptions.gradient&&(t.dotsOptions.gradient=x(t.dotsOptions.gradient)),t.cornersSquareOptions&&(t.cornersSquareOptions=Object.assign({},t.cornersSquareOptions),t.cornersSquareOptions.gradient&&(t.cornersSquareOptions.gradient=x(t.cornersSquareOptions.gradient))),t.cornersDotOptions&&(t.cornersDotOptions=Object.assign({},t.cornersDotOptions),t.cornersDotOptions.gradient&&(t.cornersDotOptions.gradient=x(t.cornersDotOptions.gradient))),t.backgroundOptions&&(t.backgroundOptions=Object.assign({},t.backgroundOptions),t.backgroundOptions.gradient&&(t.backgroundOptions.gradient=x(t.backgroundOptions.gradient))),t}var E=r(873),P=r.n(E);function _(e){if(!e)throw Error("Extension must be defined");"."===e[0]&&(e=e.substring(1));let t={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[e.toLowerCase()];if(!t)throw Error(`Extension "${e}" is not supported`);return t}class A{constructor(e){(null==e?void 0:e.jsdom)?this._window=new e.jsdom("",{resources:"usable"}).window:this._window=window,this._options=e?$(t(v,e)):v,this.update()}static _clearContainer(e){e&&(e.innerHTML="")}_setupSvg(){if(!this._qr)return;let e=new g(this._options,this._window);this._svg=e.getElement(),this._svgDrawingPromise=e.drawQR(this._qr).then(()=>{var t;this._svg&&(null==(t=this._extension)||t.call(this,e.getElement(),this._options))})}_setupCanvas(){var e,t;this._qr&&((null==(e=this._options.nodeCanvas)?void 0:e.createCanvas)?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=null==(t=this._svgDrawingPromise)?void 0:t.then(()=>{var e;if(!this._svg)return;let t=this._svg,r=btoa((new this._window.XMLSerializer).serializeToString(t)),n=`data:${_("svg")};base64,${r}`;if(null==(e=this._options.nodeCanvas)?void 0:e.loadImage)return this._options.nodeCanvas.loadImage(n).then(e=>{var t,r;e.width=this._options.width,e.height=this._options.height,null==(r=null==(t=this._nodeCanvas)?void 0:t.getContext("2d"))||r.drawImage(e,0,0)});{let e=new this._window.Image;return new Promise(t=>{e.onload=()=>{var r,n;null==(n=null==(r=this._domCanvas)?void 0:r.getContext("2d"))||n.drawImage(e,0,0),t()},e.src=n})}}))}async _getElement(e="png"){if(!this._qr)throw"QR code is empty";return"svg"===e.toLowerCase()?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(e){A._clearContainer(this._container),this._options=e?$(t(this._options,e)):this._options,this._options.data&&(this._qr=P()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(e){switch(!0){case/^[0-9]*$/.test(e):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(e):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===b?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(e){if(e){if("function"!=typeof e.appendChild)throw"Container should be a single DOM node";this._options.type===b?this._domCanvas&&e.appendChild(this._domCanvas):this._svg&&e.appendChild(this._svg),this._container=e}}applyExtension(e){if(!e)throw"Extension function should be defined.";this._extension=e,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(e="png"){if(!this._qr)throw"QR code is empty";let t=await this._getElement(e),r=_(e);if(!t)return null;if("svg"===e.toLowerCase()){let e=`<?xml version="1.0" standalone="no"?>\r
74${(new this._window.XMLSerializer).serializeToString(t)}`;return"u"<typeof Blob||this._options.jsdom?n.from(e):new Blob([e],{type:r})}return new Promise(e=>{if("toBuffer"in t)if("image/png"===r)e(t.toBuffer(r));else if("image/jpeg"===r)e(t.toBuffer(r));else{if("application/pdf"!==r)throw Error("Unsupported extension");e(t.toBuffer(r))}else"toBlob"in t&&t.toBlob(e,r,1)})}async download(e){if(!this._qr)throw"QR code is empty";if("u"<typeof Blob)throw"Cannot download in Node.js, call getRawData instead.";let t="png",r="qr";"string"==typeof e?(t=e,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof e&&null!==e&&(e.name&&(r=e.name),e.extension&&(t=e.extension));let n=await this._getElement(t);if(n)if("svg"===t.toLowerCase()){let e=(new XMLSerializer).serializeToString(n);e='<?xml version="1.0" standalone="no"?>\r\n'+e,a(`data:${_(t)};charset=utf-8,${encodeURIComponent(e)}`,`${r}.svg`)}else a(n.toDataURL(_(t)),`${r}.${t}`)}}let I=A})(),i.default})()},39017:(e,t,r)=>{"use strict";r.d(t,{O:()=>a});var n=r(66568),i=r(84428);function a(e){let{blockHash:t,blockNumber:r,blockTag:a,requireCanonical:s}=e;if(void 0!==s&&!t)throw new n.C("`requireCanonical` can only be provided when `blockHash` is set.");return t?s?{blockHash:t,requireCanonical:s}:{blockHash:t}:"bigint"==typeof r?(0,i.cK)(r):a??"latest"}},39606:(e,t,r)=>{"use strict";function n(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return r=>{let n="function"==typeof r?r(t):r,i={...t,...n};return Object.assign(i,{extend:e(i)})}}(t)})}function i(){return{}}r.d(t,{i:()=>i,x:()=>n})},40051:(e,t,r)=>{"use strict";let{isUUID:n}=r(99274),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function s(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function u(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let l={scheme:"http",domainHost:!0,parse:o,serialize:u},c={scheme:"https",domainHost:l.domainHost,parse:o,serialize:u},f={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=s(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}
74,serialize:function(e){if((e.port===(s(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},d={scheme:"wss",domainHost:f.domainHost,parse:f.parse,serialize:f.serialize},p={http:l,https:c,ws:f,wss:d,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(i);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=h(`${n}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=h(`${r}:${t.nid||n}`);i&&(e=i.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&n(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),e.exports={wsIsSecure:s,SCHEMES:p,isValidSchemeName:function(e){return -1!==a.indexOf(e)},getSchemeHandler:h}},40098:(e,t,r)=>{"use strict";function n(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}r.d(t,{e:()=>n})},40100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let n=r(17950),i=r(93608);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:a,schemaPath:s,errSchemaPath:o,topSchemaRef:u}){if(void 0!==t&&void 0!==a)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let a=e.schema[t];return void 0===r?{schema:a,schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==a){if(void 0===s||void 0===o||void 0===u)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:a,schemaPath:s,topSchemaRef:u,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:a,data:s,dataTypes:o,propertyName:u}){if(void 0!==s&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=t;if(void 0!==r){let{errorPath:s,dataPathArr:o,opts:u}=t;c(l.let("data",(0,n._)`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=(0,n.str)`${s}${(0,i.getErrorPath)(r,a,u.jsPropertySyntax)}`,e.parentDataProperty=(0,n._)`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(c(s instanceof n.Name?s:l.let("data",s,!0)),void 0!==u&&(e.propertyName=u)),o&&(e.dataTypes=o)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:a}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}},41568:(e,t,r)=>{"use strict";r.d(t,{B4:()=>i,SK:()=>a,hX:()=>s});var n=r(66568);class i extends n.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class a extends n.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class s extends n.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}},42073:(e,t,r)=>{"use strict";r.d(t,{g:()=>s});
74var n=r(9471),i=r(84428),a=r(89529);async function s(e,{blockHash:t,blockNumber:r,blockTag:o=e.experimental_blockTag??"latest",includeTransactions:u}={}){let l=u??!1,c=void 0!==r?(0,i.cK)(r):void 0,f=null;if(!(f=t?await e.request({method:"eth_getBlockByHash",params:[t,l]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[c||o,l]},{dedupe:!!c})))throw new n.l({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||a.$)(f,"getBlock")}},42330:(e,t,r)=>{"use strict";r.d(t,{iY:()=>u});var n=r(80044),i=r(89762),a=r(80339),s=r(8685),o=r(56213);function u(e){let t,{abi:r,args:u=[],name:l}=e,c=(0,i.q)(l,{strict:!1}),f=r.filter(e=>c?"function"===e.type?(0,o.V)(e)===l:"event"===e.type&&(0,s.h)(e)===l:"name"in e&&e.name===l);if(0!==f.length){if(1===f.length)return f[0];for(let e of f){if("inputs"in e){if(!u||0===u.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===u.length&&u.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return(0,a.P)(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,i)=>"object"===n&&e(Object.values(t)[i],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;
74if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(t&&"inputs"in t&&t.inputs){let r=function e(t,r,n){for(let i in t){let s=t[i],o=r[i];if("tuple"===s.type&&"tuple"===o.type&&"components"in s&&"components"in o)return e(s.components,o.components,n[i]);let u=[s.type,o.type];if(u.includes("address")&&u.includes("bytes20")||(u.includes("address")&&u.includes("string")||u.includes("address")&&u.includes("bytes"))&&(0,a.P)(n[i],{strict:!1}))return u}}(e.inputs,t.inputs,u);if(r)throw new n.nM({abiItem:e,type:r[0]},{abiItem:t,type:r[1]})}t=e}}}return t||f[0]}}},43570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(9269),i=r(95230),a=r(93608),s=r(59419);t.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:u,it:l}=e;"all"===l.opts.removeAdditional&&void 0===o.additionalProperties&&s.default.code(new n.KeywordCxt(l,s.default,"additionalProperties"));let c=(0,i.allSchemaProperties)(r);for(let e of c)l.definedProperties.add(e);l.opts.unevaluated&&c.length&&!0!==l.props&&(l.props=a.mergeEvaluated.props(t,(0,a.toHash)(c),l.props));let f=c.filter(e=>!(0,a.alwaysValidSchema)(l,r[e]));if(0===f.length)return;let d=t.name("valid");for(let n of f){var p;(p=n,l.opts.useDefaults&&!l.compositeRule&&void 0!==r[p].default)?h(n):(t.if((0,i.propertyInData)(t,u,n,l.opts.ownProperties)),h(n),l.allErrors||t.else().var(d,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(d)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},d)}}}},43609:(e,t,r)=>{"use strict";r.d(t,{w:()=>i});var n=r(46269);function i(e,{emitOnBegin:t,initialWaitTime:r,interval:a}){let s=!0,o=()=>s=!1;return(async()=>{let i;t&&(i=await e({unpoll:o}));let u=await r?.(i)??a;await (0,n.u)(u);let l=async()=>{s&&(await e({unpoll:o}),await (0,n.u)(a),l())};l()})(),o}},43748:(e,t,r)=>{"use strict";r.d(t,{b4:()=>a,gU:()=>o,uP:()=>s});var n=r(94747),i=r(70910);let a={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function s(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...null!=e.blockTimestamp&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?(0,n.ME)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,n.ME)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?a[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof r.v){if(0n===r.v||27n===r.v)return 0;if(1n===r.v||28n===r.v)return 1;if(r.v>=35n)return+(r.v%2n===0n)}})(),"legacy"===r.type&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),"eip2930"===r.type&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),"eip1559"===r.type&&delete r.maxFeePerBlobGas,r}let o=(0,i.q)("transaction",s)},44497:(e,t,r)=>{"use strict";r.d(t,{h:()=>h,k:()=>y});var n=r(80044),i=r(71386),a=r(66568),s=r(66347),o=r(80339),u=r(76429),l=r(89950),c=r(45696),f=r(81693),d=r(84428),p=r(99015);function h(e,t){if(e.length!==t.length)throw new n.YE({expectedLength:e.length,givenLength:t.length});return m(function({params:e,values:t}){let r=[];for(let h=0;h<e.length;h++)r.push(function e({param:t,value:r}){let h=y(t.type);if(h){let[i,a]=h;return function(t,{length:r,param:i}){let a=null===r;if(!Array.isArray(t))throw new n.dm(t);if(!a&&t.length!==r)throw new n.Nc({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let s=0===t.length&&function e(t){let{type:r}=t;if("string"===r||"bytes"===r||r.endsWith("[]"))return!0;
74if("tuple"===r)return t.components.some(e);let n=y(r);return!!n&&e({...t,type:n[1]})}(i),o=[];for(let r=0;r<t.length;r++){let n=e({param:i,value:t[r]});n.dynamic&&(s=!0),o.push(n)}if(a||s){let e=m(o);if(a){let t=(0,d.cK)(o.length,{size:32});return{dynamic:!0,encoded:(0,u.aP)([t,e])}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,u.aP)(o.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:a}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let a=0;a<r.components.length;a++){let s=r.components[a],o=Array.isArray(t)?a:s.name,u=e({param:s,value:t[o]});i.push(u),u.dynamic&&(n=!0)}return{dynamic:n,encoded:n?m(i):(0,u.aP)(i.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type){var g=r;if(!(0,o.P)(g))throw new i.M({address:g});return{dynamic:!1,encoded:(0,l.db)(g.toLowerCase())}}if("bool"===t.type){var b=r;if("boolean"!=typeof b)throw new a.C(`Invalid boolean value: "${b}" (type: ${typeof b}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,l.db)((0,d.$P)(b))}}if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=p.Ge.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new s.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,d.cK)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,c.E)(e);if(!r){let t=e;return i%32!=0&&(t=(0,l.db)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,u.aP)([(0,l.db)((0,d.cK)(i,{size:32})),t])}}if(i!==Number.parseInt(r,10))throw new n.gH({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,l.db)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type){var w=r;let e=(0,d.i3)(w),t=Math.ceil((0,c.E)(e)/32),n=[];for(let r=0;r<t;r++)n.push((0,l.db)((0,f.di)(e,32*r,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,u.aP)([(0,l.db)((0,d.cK)((0,c.E)(e),{size:32})),...n])}}throw new n.nK(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[h],value:t[h]}));return r}({params:e,values:t}))}function m(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=(0,c.E)(i)}let r=[],n=[],i=0;for(let a=0;a<e.length;a++){let{dynamic:s,encoded:o}=e[a];s?(r.push((0,d.cK)(t+i,{size:32})),n.push(o),i+=(0,c.E)(o)):r.push(o)}return(0,u.aP)([...r,...n])}function y(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},44546:(e,t,r)=>{"use strict";r.d(t,{Fl:()=>a,NV:()=>s,ii:()=>i});var n=r(66568);class i extends n.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class a extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class s extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}},44551:(e,t,r)=>{"use strict";r.d(t,{C:()=>u});var n=r(76429),i=r(22106),a=r(84428),s=r(7211),o=r(18860);function u(e){let{chainId:t,nonce:r,to:u}=e,l=e.contractAddress??e.address,c=(0,o.S)((0,n.aP)(["0x05",(0,s.EQ)([t?(0,a.cK)(t):"0x",l,r?(0,a.cK)(r):"0x"])]));return"bytes"===u?(0,i.aT)(c):c}},45089:(e,t,r)=>{"use strict";r.d(t,{sc:()=>n});let n=r(16100).sc},45312:(e,t,r)=>{"use strict";async function n(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}r.d(t,{L:()=>n})},45437:(e,t,r)=>{"use strict";function n(){let e=()=>void 0,t=()=>void 0;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}r.d(t,{Y:()=>n})},45696:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var n=r(89762);function i(e){return(0,n.q)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},46089:(e,t,r)=>{"use strict";r.d(t,{vt:()=>a});var n=r(75228);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new u({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new o({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new s({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new s({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function a(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class s extends n.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class o extends n.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class u extends n.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}},46149:(e,t,r)=>{"use strict";r.d(t,{g:()=>a});var n=r(86190),i=r(44551);async function a(e){let{authorization:t,signature:r}=e;return(0,n.x)({hash:(0,i.C)(t),signature:r??t})}},46269:(e,t,r)=>{"use strict";r.d(t,{u:()=>i});var n=r(18267);async function i(e,{signal:t}={}){return new Promise((r,i)=>{if(t?.aborted)return void i((0,n.TY)(t));let a=()=>t?.removeEventListener("abort",o),s=setTimeout(()=>{a(),r()},e),o=()=>{clearTimeout(s),a(),i((0,n.TY)(t))};t?.addEventListener("abort",o,{once:!0})})}},47347:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});
74class n extends Error{constructor(e,t={}){const r=t.cause instanceof n?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof n&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}}},47420:(e,t,r)=>{"use strict";r.d(t,{e:()=>f});var n=r(27075),i=r(17120),a=r(73614),s=r(98955),o=r(47347);class u extends o.C{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}var l=r(15163),c=r(97195);function f(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!(0,l.WL)(r))continue;let i=(0,l.FO)(r);if(!i)throw new s.s7({signature:r,type:"struct"});let a=i.properties.split(";"),o=[],u=a.length;for(let e=0;e<u;e++){let t=a[e].trim();if(!t)continue;let r=(0,c.Pj)(t,{type:"struct"});o.push(r)}if(!o.length)throw new s.X9({signature:r});t[i.name]=o}let o={},f=Object.entries(t),p=f.length;for(let e=0;e<p;e++){let[r,s]=f[e];o[r]=function e(t=[],r={},s=new Set){let o=[],l=t.length;for(let f=0;f<l;f++){let l=t[f];if(n.wj.test(l.type))o.push(l);else{let t=(0,n.Yv)(d,l.type);if(!t?.type)throw new a.nx({abiParameter:l});let{array:f,type:p}=t;if(p in r){if(s.has(p))throw new u({type:p});o.push({...l,type:`tuple${f??""}`,components:e(r[p],r,new Set([...s,p]))})}else if((0,c._o)(p))o.push(l);else throw new i.zz({type:p})}}return o}(s,t)}return o}let d=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/},48409:(e,t,r)=>{"use strict";r.d(t,{HT:()=>u,ZJ:()=>c,aD:()=>l,nj:()=>f});var n=r(94734),i=r(75228),a=r(56184),s=r(67221);function o(e,t={}){let{compressed:r}=t,{prefix:n,x:i,y:a}=e;if(!1===r||"bigint"==typeof i&&"bigint"==typeof a){if(4!==n)throw new p({prefix:n,cause:new m});return}if(!0===r||"bigint"==typeof i&&void 0===a){if(3!==n&&2!==n)throw new p({prefix:n,cause:new h});return}throw new d({publicKey:e})}function u(e){let t=(()=>{if(a.tf(e))return l(e);if(n.tf(e)){var t;return t=e,l(a.uK(t))}let{prefix:r,x:i,y:s}=e;return"bigint"==typeof i&&"bigint"==typeof s?{prefix:r??4,x:i,y:s}:{prefix:r,x:i}})();return o(t),t}function l(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new y({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(a.di(e,0,32)),y:BigInt(a.di(e,32,64))};if(132===e.length){let t=Number(a.di(e,0,1));return{prefix:t,x:BigInt(a.di(e,1,33)),y:BigInt(a.di(e,33,65))}}return{prefix:Number(a.di(e,0,1)),x:BigInt(a.di(e,1,33))}}function c(e,t={}){return n.aD(f(e,t))}function f(e,t={}){o(e);let{prefix:r,x:n,y:i}=e,{includePrefix:s=!0}=t;return a.xW(s?a.oB(r,{size:1}):"0x",a.oB(n,{size:32}),"bigint"==typeof i?a.oB(i,{size:32}):"0x")}class d extends i.C{constructor({publicKey:e}){super(`Value \`${s.As(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class p extends i.C{constructor({prefix:e,cause:t}){super(`Prefix "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class h extends i.C{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class m extends i.C{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class y extends i.C{constructor({publicKey:e}){super(`Value \`${e}
74\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${a.Ej(a.HT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}},49155:(e,t,r)=>{"use strict";r.d(t,{a:()=>h});var n=r(51011),i=r(50474),a=r(96002),s=r(70969),o=r(89649),u=r(43748),l=r(58637),c=r(49586),f=r(97948),d=r(42073),p=r(69960);async function h(e,t){let{account:r=e.account,accessList:h,authorizationList:m,chain:y=e.chain,blobVersionedHashes:g,blobs:b,data:w,gas:v,gasPrice:x,maxFeePerBlobGas:$,maxFeePerGas:E,maxPriorityFeePerGas:P,nonce:_,nonceManager:A,to:I,type:S,value:z,...k}=t,O=await (async()=>{if(!r||!A||void 0!==_)return _;let t=(0,n.J)(r),i=y?y.id:await (0,c.T)(e,p.T,"getChainId")({});return await A.consume({address:t.address,chainId:i,client:e})})();(0,f.c)(t);let C=y?.formatters?.transactionRequest?.format,T=(C||l.Bv)({...(0,o.o)(k,{format:C}),account:r?(0,n.J)(r):void 0,accessList:h,authorizationList:m,blobs:b,blobVersionedHashes:g,data:w,gas:v,gasPrice:x,maxFeePerBlobGas:$,maxFeePerGas:E,maxPriorityFeePerGas:P,nonce:O,to:I,type:S,value:z},"fillTransaction");try{let r=await e.request({method:"eth_fillTransaction",params:[T]}),n=(y?.formatters?.transaction?.format||u.uP)(r.tx);delete n.blockHash,delete n.blockNumber,delete n.r,delete n.s,delete n.transactionIndex,delete n.v,delete n.yParity,n.data=n.input;let s=void 0!==n.feePayerSignature&&null!==n.feePayerSignature;if(s&&void 0!==O&&n.nonce!==O)throw new a.dz({filledNonce:n.nonce,requestedNonce:O});if(!s){n.gas&&(n.gas=t.gas??n.gas),n.gasPrice&&(n.gasPrice=t.gasPrice??n.gasPrice),n.maxFeePerBlobGas&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas??n.maxFeePerBlobGas),n.maxFeePerGas&&(n.maxFeePerGas=t.maxFeePerGas??n.maxFeePerGas),n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas??n.maxPriorityFeePerGas),void 0!==n.nonce&&(n.nonce=t.nonce??n.nonce);let r=await (async()=>{if("function"==typeof y?.fees?.baseFeeMultiplier){let r=await (0,c.T)(e,d.g,"getBlock")({});return y.fees.baseFeeMultiplier({block:r,client:e,request:t})}return y?.fees?.baseFeeMultiplier??1.2})();if(r<1)throw new i.sM;let a=r.toString().split(".")[1]?.length??0,s=10**a,o=e=>e*BigInt(Math.round(r*s))/BigInt(s);n.maxFeePerGas&&!t.maxFeePerGas&&(n.maxFeePerGas=o(n.maxFeePerGas)),n.gasPrice&&!t.gasPrice&&(n.gasPrice=o(n.gasPrice))}return{raw:r.raw,transaction:{from:T.from,...n},...r.capabilities?{capabilities:r.capabilities}:{}}}catch(r){throw(0,s.p)(r,{...t,chain:e.chain})}}},49194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(58419),i=r(17950),a=r(93608),s=r(64989);t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,i.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,i._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:o,schema:u,parentSchema:l,schemaCode:c,it:f}=e;if(!o&&!u)return;let d=t.let("valid"),p=l.items?(0,n.getSchemaTypes)(l.items):[];e.block$data(d,function(){let o=t.let("i",(0,i._)`${r}.length`),u=t.let("j");e.setParams({i:o,j:u}),t.assign(d,!0),t.if((0,i._)`${o} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?function(a,s){let o=t.name("item"),u=(0,n.checkDataTypes)(p,o,f.opts.strictNumbers,n.DataType.Wrong),l=t.const("indices",(0,i._)`{}`);t.for((0,i._)`;${a}--;`,()=>{t.let(o,(0,i._)`${r}[${a}]`),t.if(u,(0,i._)`continue`),p.length>1&&t.if((0,i._)`typeof ${o} == "string"`,(0,i._)`${o} += "_"`),t.if((0,i._)`typeof ${l}[${o}] == "number"`,()=>{t.assign(s,(0,i._)`${l}[${o}]`),e.error(),t.assign(d,!1).break()}).code((0,i._)`${l}[${o}] = ${a}`)})}:function(n,o){let u=(0,a.useFunc)(t,s.default),l=t.name("outer");t.label(l).for((0,i._)`;${n}--;`,()=>t.for((0,i._)`${o} = ${n}; ${o}--;`,()=>t.if((0,i._)`${u}(${r}[${n}], ${r}[${o}])`,()=>{e.error(),t.assign(d,!1).break(l)})))})(o,u))},(0,i._)`${c} === false`),e.ok(d)}}},49304:(e,t,r)=>{"use strict";let n=r(26801),i=r(81852),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>
vendor: 21,161 bytes, line 74
740x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);let r=0|h(n,i),a=s(r),u=a.write(n,i);return u!==r&&(a=a.slice(0,u)),a}if(ArrayBuffer.isView(e)){var a=e;if(M(a,Uint8Array)){let e=new Uint8Array(a);return d(e.buffer,e.byteOffset,e.byteLength)}return f(a)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(M(e,ArrayBuffer)||e&&M(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(M(e,SharedArrayBuffer)||e&&M(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return o.from(u,t,r);let l=function(e){if(o.isBuffer(e)){let t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),s(e<0?0:0|p(e))}function f(e){let t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function p(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||M(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(i)return n?-1:B(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=R[e[n]];return i}(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":var a,s,o;return a=this,s=t,o=r,0===s&&o===a.length?n.fromByteArray(a):n.fromByteArray(a.slice(s,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var a;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let a,s=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,o/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(a=r;a<o;a++)if(l(e,a)===l(t,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===u)return n*s}else -1!==n&&(a-=a-n),n=-1}else for(r+u>o&&(r=o-u),a=r;a>=0;a--){let r=!0;for(let n=0;n<u;n++)if(l(e,a+n)!==l(t,n)){r=!1;break}if(r)return a}return -1}function w(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],a=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,o,u;switch(s){case 1:t<128&&(a=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(a=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(a=u);break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],(192&r)==128&&(192&n)==128&&(192&o)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o)>65535&&u<1114112&&(a=u)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}var a=n;let s=a.length;if(s<=4096)return String.fromCharCode.apply(String,a);let o="",u=0;for(;u<s;)o+=String.fromCharCode.apply(String,a.slice(u,u+=4096));return o}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function $(e,t,r,n,i){k(t,n,i,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function E(e,t,r,n,i){k(t,n,i,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function P(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function _(e,t,r,n,a){return t*=1,r>>>=0,a||P(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function A(e,t,r,n,a){return t*=1,r>>>=0,a||P(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(l(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(M(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(M(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?w(this,0,e):m.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(M(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let a=i-n,s=r-t,u=Math.min(a,s),l=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<u;++e)if(l[e]!==c[e]){a=l[e],s=c[e];break}return a<s?-1:+(s<a)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){var i,a,s,o,u,l,c,f;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;let s=t.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){var o;let n=parseInt(t.substr(2*i,2),16);if((o=n)!=o)break;e[r+i]=n}return i}(this,e,t,r);case"utf8":case"utf-8":return i=t,a=r,N(B(e,this.length-i),this,i,a);case"ascii":case"latin1":case"binary":return s=t,o=r,N(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,s,o);case"base64":return u=t,l=r,N(j(e),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,f=r,N(function(e,t){let r,n,i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,f);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=U(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&C(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=U(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&C(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=U(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&C(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),o.prototype.readBigInt64BE=U(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&C(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)}),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}let i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=U(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=U(function(e,t=0){return E(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=U(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=U(function(e,t=0){return E(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return A(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return A(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let a=o.isBuffer(e)?e:o.from(e,n),s=a.length;
74if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};let I={};function S(e,t,r){I[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function z(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function k(e,t,r,n,i,a){if(e>r||e<t){let n,i="bigint"==typeof t?"n":"";throw n=a>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(a+1)*8}${i}`:`>= -(2${i} ** ${(a+1)*8-1}${i}) and < 2 ** ${(a+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new I.ERR_OUT_OF_RANGE("value",n,e)}O(i,"offset"),(void 0===n[i]||void 0===n[i+a])&&C(i,n.length-(a+1))}function O(e,t){if("number"!=typeof e)throw new I.ERR_INVALID_ARG_TYPE(t,"number",e)}function C(e,t,r){if(Math.floor(e)!==e)throw O(e,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}S("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),S("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let T=/[^+/0-9A-Za-z-_]/g;function B(e,t){let r;t=t||1/0;let n=e.length,i=null,a=[];for(let s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function j(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function M(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let R=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function U(e){return"u"<typeof BigInt?L:e}function L(){throw Error("BigInt not supported")}},49586:(e,t,r)=>{"use strict";function n(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}r.d(t,{T:()=>n})},50474:(e,t,r)=>{"use strict";r.d(t,{RR:()=>o,pw:()=>s,sM:()=>a});var n=r(22160),i=r(66568);class a extends i.C{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class s extends i.C{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class o extends i.C{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,n.Q)(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}},51011:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{J:()=>n})},51392:(e,t,r)=>{"use strict";r.d(t,{J:()=>a});var n=r(56184);function i(e){return{address:e.address,amount:n.oB(e.amount),index:n.oB(e.index),validatorIndex:n.oB(e.validatorIndex)}}function a(e){return{..."bigint"==typeof e.baseFeePerGas&&{baseFeePerGas:n.oB(e.baseFeePerGas)},..."bigint"==typeof e.blobBaseFee&&{blobBaseFee:n.oB(e.blobBaseFee)},..."string"==typeof e.feeRecipient&&{feeRecipient:e.feeRecipient}
74,..."bigint"==typeof e.gasLimit&&{gasLimit:n.oB(e.gasLimit)},..."bigint"==typeof e.number&&{number:n.oB(e.number)},..."bigint"==typeof e.prevRandao&&{prevRandao:n.oB(e.prevRandao)},..."bigint"==typeof e.time&&{time:n.oB(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(i)}}}},52399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(67463);n.code='require("ajv/dist/runtime/uri").default',t.default=n},52856:(e,t,r)=>{"use strict";r.d(t,{W:()=>l});var n=r(95889),i=r(80044),a=r(81693),s=r(56213),o=r(37826),u=r(24029);function l(e){let{abi:t,data:r,cause:l}=e,c=(0,a.di)(r,0,4);if("0x"===c)throw new i.O({cause:l});let f=[...t||[],n.Mc,n.J9].find(e=>"error"===e.type&&c===(0,s.V)((0,u.B)(e)));if(!f)throw new i.Wq(c,{docsPath:"/docs/contract/decodeErrorResult",cause:l});return{abiItem:f,args:"inputs"in f&&f.inputs&&f.inputs.length>0?(0,o.n)(f.inputs,(0,a.di)(r,4)):void 0,errorName:f.name}}},53385:(e,t,r)=>{"use strict";r.d(t,{h:()=>a});var n=r(71386),i=r(80339);function a(e,t){if(!(0,i.P)(e,{strict:!1}))throw new n.M({address:e});if(!(0,i.P)(t,{strict:!1}))throw new n.M({address:t});return e.toLowerCase()===t.toLowerCase()}},53772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(93608);t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r))return void e.fail();let a=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}},53834:(e,t,r)=>{"use strict";r.d(t,{M:()=>a});var n=r(96685),i=r(18860);function a(e){let t=(0,i.S)(`0x${e.substring(4)}`).substring(26);return(0,n.o)(`0x${t}`)}},55503:(e,t,r)=>{"use strict";var n;r.d(t,{$W:()=>c,GT:()=>o,_e:()=>s,cV:()=>u,cr:()=>l,tm:()=>i,xI:()=>a});let i=Object.freeze({status:"aborted"});function a(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class a extends i{}function s(e){var t;let i=r?.Parent?new a:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let s=Symbol("zod_brand");class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class u extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(n=globalThis).__zod_globalConfig??(n.__zod_globalConfig={});let l=globalThis.__zod_globalConfig;function c(e){return e&&Object.assign(l,e),l}},55711:(e,t,r)=>{"use strict";r.d(t,{D4:()=>g,EJ:()=>l,EM:()=>I,GW:()=>b,Mv:()=>h,Od:()=>c,R3:()=>S,Rb:()=>u,Re:()=>x,Tj:()=>s,VS:()=>P,X$:()=>w,bp:()=>p,e2:()=>y,ex:()=>_,lF:()=>m,or:()=>v,qg:()=>o,rh:()=>$,v_:()=>A,wG:()=>d,wy:()=>E,xL:()=>f,yR:()=>z});var n=r(55503),i=r(27855),a=r(68056);let s=e=>(t,r,i,s)=>{let o=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new n.GT;if(u.issues.length){let t=new(s?.Err??e)(u.issues.map(e=>a.finalizeIssue(e,o,n.$W())));throw a.captureStackTrace(t,s?.callee),t}return u.value},o=s(i.Kd),u=e=>async(t,r,i,s)=>{let o=i?{...i,async:!0}:{async:!0},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){let t=new(s?.Err??e)(u.issues.map(e=>a.finalizeIssue(e,o,n.$W())));throw a.captureStackTrace(t,s?.callee),t}return u.value},l=u(i.Kd),c=e=>(t,r,s)=>{let o=s?{...s,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new n.GT;return u.issues.length?{success:!1,error:new(e??i.a$)(u.issues.map(e=>a.finalizeIssue(e,o,n.$W())))}:{success:!0,data:u.value}},f=c(i.Kd),d=e=>async(t,r,i)=>{let s=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>a.finalizeIssue(e,s,n.$W())))}:{success:!0,data:o.value}},p=d(i.Kd),h=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return s(e)(t,r,i)},m=h(i.Kd),y=e=>(t,r,n)=>s(e)(t,r,n),g=y(i.Kd),b=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return u(e)(t,r,i)},w=b(i.Kd),v=e=>async(t,r,n)=>u(e)(t,r,n),x=v(i.Kd),$=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return c(e)(t,r,i)},E=$(i.Kd),P=e=>(t,r,n)=>c(e)(t,r,n),_=P(i.Kd),A=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return d(e)(t,r,i)},I=A(i.Kd),S=e=>async(t,r,n)=>d(e)(t,r,n),z=S(i.Kd)},56184:(e,t,r)=>{"use strict";r.d(t,{Dg:()=>_,Ej:()=>E,Fl:()=>N,HT:()=>p,Ho:()=>w,M7:()=>v,Mr:()=>P,Ro:()=>I,Ty:()=>k,ZJ:()=>A,dI:()=>S,di:()=>$,ii:()=>j,n4:()=>b,o4:()=>T,oB:()=>y,sH:()=>g,tf:()=>z,u:()=>B,uK:()=>m,vA:()=>f,xW:()=>d,xb:()=>h,yT:()=>x});var n=r(37942),i=r(94734),a=r(75228),s=r(83646),o=r(32872),u=r(67221);let l=new TextEncoder,c=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function f(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new O(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new C(e)}function d(...e){return`0x${e.reduce((e,t)=>
74e+t.replace("0x",""),"")}`}function p(e){return e instanceof Uint8Array?m(e):Array.isArray(e)?m(new Uint8Array(e)):e}function h(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(o.Sl(r,t.size),w(r,t.size)):r}function m(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=c[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(o.Sl(n,t.size),v(n,t.size)):n}function y(e,t={}){let r,{signed:n,size:i}=t,a=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&a>r||a<s){let t="bigint"==typeof e?"n":"";throw new k({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=(n&&a<0?BigInt.asUintN(8*i,BigInt(a)):a).toString(16),u=`0x${o}`;return i?w(u,i):u}function g(e,t={}){return m(l.encode(e),t)}function b(e,t){return(0,n.ex)(i.aD(e),i.aD(t))}function w(e,t){return o.eV(e,{dir:"left",size:t})}function v(e,t){return o.eV(e,{dir:"right",size:t})}function x(e){return m(i.yT(e))}function $(e,t,r,n={}){let{strict:i}=n;o.kK(e,t);let a=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return i&&o.X(a,t,r),a}function E(e){return Math.ceil((e.length-2)/2)}function P(e){return o.Bq(e,{dir:"left"})}function _(e,t={}){let{signed:r}=t;t.size&&o.Sl(e,t.size);let n=BigInt(e);if(!r)return n;let i=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=i>>1n?n:n-i-1n}function A(e,t={}){return i.aD(e,t)}function I(e,t={}){let{signed:r,size:n}=t;return r||n?Number(_(e,t)):Number(e)}function S(e,t={}){let{size:r}=t,n=i.aD(e);return r&&(s.Sl(n,r),n=i.$T(n)),new TextDecoder().decode(n)}function z(e,t={}){let{strict:r=!1}=t;try{return f(e,{strict:r}),!0}catch{return!1}}class k extends a.C{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}a.C;class O extends a.C{constructor(e){super(`Value \`${"object"==typeof e?u.As(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class C extends a.C{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class T extends a.C{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}class B extends a.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class j extends a.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class N extends a.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}},56213:(e,t,r)=>{"use strict";r.d(t,{V:()=>a});var n=r(81693),i=r(27475);let a=e=>(0,n.di)((0,i.k)(e),0,4)},56678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608);t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,n.str)`must contain at least ${e} valid item(s)`:(0,n.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,n._)`{minContains: ${e}}`:(0,n._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:a,schema:s,parentSchema:o,data:u,it:l}=e,{minContains:c,maxContains:f}=o;l.opts.next?(t=void 0===c?1:c,r=f):t=1;let d=a.const("len",(0,n._)`${u}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,i.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');
74if(void 0!==r&&t>r){(0,i.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,i.alwaysValidSchema)(l,s)){let i=(0,n._)`${d} >= ${t}`;void 0!==r&&(i=(0,n._)`${i} && ${d} <= ${r}`),e.pass(i);return}l.items=!0;let p=a.name("valid");function h(){let e=a.name("_valid"),i=a.let("count",0);m(e,()=>a.if(e,()=>{var e;return e=i,void(a.code((0,n._)`${e}++`),void 0===r?a.if((0,n._)`${e} >= ${t}`,()=>a.assign(p,!0).break()):(a.if((0,n._)`${e} > ${r}`,()=>a.assign(p,!1).break()),1===t?a.assign(p,!0):a.if((0,n._)`${e} >= ${t}`,()=>a.assign(p,!0))))}))}function m(t,r){a.forRange("i",0,d,n=>{e.subschema({keyword:"contains",dataProp:n,dataPropType:i.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(p,()=>a.if(p,()=>a.break())):0===t?(a.let(p,!0),void 0!==r&&a.if((0,n._)`${u}.length > 0`,h)):(a.let(p,!1),h()),e.result(p,()=>e.reset())}}},57723:(e,t,r)=>{"use strict";r.d(t,{T:()=>c});var n=r(94073),i=r(77022),a=r(70005),s=r(14870),o=r(45696),u=r(22106),l=r(84428);function c(e){let{data:t,kzg:r,to:c}=e,f=e.blobs??function(e){let t=e.to??("string"==typeof e.data?"hex":"bytes"),r="string"==typeof e.data?(0,u.aT)(e.data):e.data,n=(0,o.E)(r);if(!n)throw new a.zF;if(n>761855)throw new a.iq({maxSize:761855,size:n});let i=[],c=!0,f=0;for(;c;){let e=(0,s.l)(new Uint8Array(131072)),t=0;for(;t<4096;){let n=r.slice(f,f+31);if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),c=!1;break}t++,f+=31}i.push(e)}return"bytes"===t?i.map(e=>e.bytes):i.map(e=>(0,l.My)(e.bytes))}({data:t,to:c}),d=e.commitments??(0,n.S)({blobs:f,kzg:r,to:c}),p=e.proofs??(0,i.t)({blobs:f,commitments:d,kzg:r,to:c}),h=[];for(let e=0;e<f.length;e++)h.push({blob:f[e],commitment:d[e],proof:p[e]});return h}},57995:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=r||(t.DiscrError=r={})).Tag="tag",n.Mapping="mapping"},58313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(93608);t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},58419:(e,t,r)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let a=r(75279),s=r(13452),o=r(95519),u=r(17950),l=r(93608);function c(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(a.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(i=n||(t.DataType=n={}))[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong",t.getSchemaTypes=function(e){let t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){var r,i;let{gen:a,data:o,opts:l}=e,c=(r=t,(i=l.coerceTypes)?r.filter(e=>f.has(e)||"array"===i&&"array"===e):[]),d=t.length>0&&!(0===c.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(d){let r=p(t,o,l.strictNumbers,n.Wrong);a.if(r,()=>{c.length?function(e,t,r){let{gen:n,data:i,opts:a}=e,s=n.let("dataType",(0,u._)`typeof ${i}`),o=n.let("coerced",(0,u._)`undefined`);for(let e of("array"===a.coerceTypes&&n.if((0,u._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,u._)`${i}[0]`).assign(s,(0,u._)`typeof ${i}`).if(p(t,i,a.strictNumbers),()=>n.assign(o,i))),n.if((0,u._)`${o} !== undefined`),r))(f.has(e)||"array"===e&&"array"===a.coerceTypes)&&function(e){switch(e){case"string":n.elseIf((0,u._)`${s} == "number" || ${s} == "boolean"`).assign(o,(0,u._)`"" + ${i}`).elseIf((0,u._)`${i} === null`).assign(o,(0,u._)`""`);return;case"number":n.elseIf((0,u._)`${s} == "boolean" || ${i} === null
75              || (${s} == "string" && ${i} && ${i} == +${i})`).assign(o,(0,u._)`+${i}`);return;case"integer":n.elseIf((0,u._)`${s} === "boolean" || ${i} === null
76              || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(o,(0,u._)`+${i}`);return;case"boolean":n.elseIf((0,u._)`${i}
76 === "false" || ${i} === 0 || ${i} === null`).assign(o,!1).elseIf((0,u._)`${i} === "true" || ${i} === 1`).assign(o,!0);return;case"null":n.elseIf((0,u._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(o,null);return;case"array":n.elseIf((0,u._)`${s} === "string" || ${s} === "number"
77              || ${s} === "boolean" || ${i} === null`).assign(o,(0,u._)`[${i}]`)}}(e);n.else(),m(e),n.endIf(),n.if((0,u._)`${o} !== undefined`,()=>{n.assign(i,o),function({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,u._)`${t} !== undefined`,()=>e.assign((0,u._)`${t}[${r}]`,n))}(e,o)})}(e,t,c):m(e)})}return d};let f=new Set(["string","number","integer","boolean","null"]);function d(e,t,r,i=n.Correct){let a,s=i===n.Correct?u.operators.EQ:u.operators.NEQ;switch(e){case"null":return(0,u._)`${t} ${s} null`;case"array":a=(0,u._)`Array.isArray(${t})`;break;case"object":a=(0,u._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=o((0,u._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=o();break;default:return(0,u._)`typeof ${t} ${s} ${e}`}return i===n.Correct?a:(0,u.not)(a);function o(e=u.nil){return(0,u.and)((0,u._)`typeof ${t} == "number"`,e,r?(0,u._)`isFinite(${t})`:u.nil)}}function p(e,t,r,n){let i;if(1===e.length)return d(e[0],t,r,n);let a=(0,l.toHash)(e);if(a.array&&a.object){let e=(0,u._)`typeof ${t} != "object"`;i=a.null?e:(0,u._)`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else i=u.nil;for(let e in a.number&&delete a.integer,a)i=(0,u.and)(i,d(e,t,r,n));return i}t.checkDataType=d,t.checkDataTypes=p;let h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,u._)`{type: ${e}}`:(0,u._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:n}=e,i=(0,l.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,h)}t.reportTypeError=m},58637:(e,t,r)=>{"use strict";r.d(t,{Bv:()=>s,bm:()=>o});var n=r(84428),i=r(70910);let a={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function s(e,t){let r={};return void 0!==e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?(0,n.cK)(BigInt(e.r)):e.r,s:e.s?(0,n.cK)(BigInt(e.s)):e.s,chainId:(0,n.cK)(e.chainId),nonce:(0,n.cK)(e.nonce),...void 0!==e.yParity?{yParity:(0,n.cK)(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:(0,n.cK)(e.v)}:{}}))),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?r.blobs=e.blobs.map(e=>(0,n.My)(e)):r.blobs=e.blobs),void 0!==e.data&&(r.data=e.data),e.account&&(r.from=e.account.address),void 0!==e.from&&(r.from=e.from),void 0!==e.gas&&(r.gas=(0,n.cK)(e.gas)),void 0!==e.gasPrice&&(r.gasPrice=(0,n.cK)(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(r.maxFeePerBlobGas=(0,n.cK)(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=(0,n.cK)(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=(0,n.cK)(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(r.nonce=(0,n.cK)(e.nonce)),void 0!==e.to&&(r.to=e.to),void 0!==e.type&&(r.type=a[e.type]),void 0!==e.value&&(r.value=(0,n.cK)(e.value)),r}let o=(0,i.q)("transactionRequest",s)},59419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(95230),i=r(17950),a=r(64032),s=r(93608);t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,i._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:o,data:u,errsCount:l,it:c}=e;if(!l)throw Error("ajv implementation error");let{allErrors:f,opts:d}=c;if(c.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(c,r))return;let p=(0,n.allSchemaProperties)(o.properties),h=(0,n.allSchemaProperties)(o.patternProperties);function m(e){t.code((0,i._)`delete ${u}[${e}]`)}function y(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)return void m(n);if(!1===r){e.setParams({additionalProperty:n}),e.error(),f||t.break();return}if("object"==typeof r&&!(0,s.alwaysValidSchema)(c,r)){let r=t.name("valid");"failing"===d.removeAdditional?(g(n,r,!1),t.if((0,i.not)(r),()=>{e.reset(),m(n)})):(g(n,r),f||t.if((0,i.not)(r),()=>t.break()))}}function g(t,r,n){let i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",u,r=>{p.length||h.length?t.if(function(r){let a;if(p.length>8){let e=(0,s.schemaRefOrVal)(c,o.properties,"properties");a=(0,n.isOwnProperty)(t,e,r)}else a=p.length?(0,i.or)(...p.map(e=>(0,i._)`${r} === ${e}`)):i.nil;return h.length&&(a=(0,i.or)(a,...h.map(t=>(0,i._)`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,i.not)(a)}(r),()=>y(r)):y(r)}),e.ok((0,i._)`${l} === ${a.default.errors}`)}}},59580:(e,t)=>{"use strict";
77Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},61609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let n=r(17950),i=r(93608);function a(e,t,r){let{gen:a,compositeRule:s,data:o,opts:u}=e;if(void 0===r)return;let l=(0,n._)`${o}${(0,n.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${l}`);let c=(0,n._)`${l} === undefined`;"empty"===u.useDefaults&&(c=(0,n._)`${c} || ${l} === null || ${l} === ""`),a.if(c,(0,n._)`${l} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){let{properties:r,items:n}=e.schema;if("object"===t&&r)for(let t in r)a(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>a(e,r,t.default))}},62320:(e,t,r)=>{"use strict";r.d(t,{Q:()=>a});var n=r(27075);let i=/^tuple(?<array>(\[(\d*)\])*)$/;function a(e){let t="",r=e.length;for(let a=0;a<r;a++)t+=function e(t){let r=t.type;if(i.test(t.type)&&"components"in t){r="(";let a=t.components.length;for(let n=0;n<a;n++)r+=e(t.components[n]),n<a-1&&(r+=", ");let s=(0,n.Yv)(i,t.type);return r+=`)${s?.array||""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r}
77 indexed`),t.name)?`${r} ${t.name}`:r}(e[a]),a!==r-1&&(t+=", ");return t}},62567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(75839),i=r(11475),a=r(27041),s=r(26859),o=r(23026);t.default=[n.default,i.default,(0,a.default)(),s.default,o.metadataVocabulary,o.contentVocabulary]},64032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950);t.default={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")}},64989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(68054);n.code='require("ajv/dist/runtime/equal").default',t.default=n},65261:(e,t,r)=>{"use strict";r.d(t,{CL:()=>u,D5:()=>c,Di:()=>d,G1:()=>k,Gi:()=>l,L5:()=>_,MI:()=>T,RV:()=>$,Sf:()=>x,WT:()=>A,XU:()=>o,YW:()=>m,ab:()=>y,bq:()=>f,cg:()=>S,ch:()=>P,hA:()=>p,hl:()=>I,jz:()=>O,nR:()=>C,qZ:()=>h,s0:()=>g,sV:()=>v,uL:()=>z,vx:()=>w,xQ:()=>b,xq:()=>E});var n=r(66568),i=r(93247);class a extends n.C{constructor(e,{code:t,docsPath:r,metaMessages:n,name:a,shortMessage:s}){super(s,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages,name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof i.J8?e.code:t??-1}}class s extends a{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class o extends a{constructor(e){super(e,{code:o.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class u extends a{constructor(e){super(e,{code:u.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends a{constructor(e,{method:t}={}){super(e,{code:l.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c extends a{constructor(e){super(e,{code:c.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class f extends a{constructor(e){super(e,{code:f.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class d extends a{constructor(e){super(e,{code:d.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p extends a{constructor(e){super(e,{code:p.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class h extends a{constructor(e){super(e,{code:h.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class m extends a{constructor(e){super(e,{code:m.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class y extends a{constructor(e,{method:t}={}){super(e,{code:y.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class g extends a{constructor(e){super(e,{code:g.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends a{constructor(e){super(e,{code:b.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends s{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends s{constructor(e){super(e,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends s{constructor(e,{method:t}={}){super(e,{code:x.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class $ extends s{constructor(e){super(e,{code:$.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty($,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class E extends s{constructor(e){super(e,{code:E.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class P extends s{constructor(e){super(e,{code:P.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class _ extends s{constructor(e){super(e,{code:_.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class A extends s{constructor(e){super(e,{code:A.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class I extends s{constructor(e){super(e,{code:I.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class S extends s{constructor(e){super(e,{code:S.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class z extends s{constructor(e){super(e,{code:z.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(z,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class k extends s{constructor(e){super(e,{code:k.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
77);class O extends s{constructor(e){super(e,{code:O.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class C extends s{constructor(e){super(e,{code:C.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class T extends a{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},65725:(e,t,r)=>{"use strict";r.d(t,{W:()=>u});var n=r(51011),i=r(4181),a=r(4016),s=r(49586),o=r(73062);async function u(e,t){let{abi:r,address:u,args:l,functionName:c,dataSuffix:f="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...d}=t,p=(0,i.p)({abi:r,args:l,functionName:c});try{return await (0,s.T)(e,o.Q,"estimateGas")({data:`${p}${f?f.replace("0x",""):""}`,to:u,...d})}catch(t){let e=d.account?(0,n.J)(d.account):void 0;throw(0,a.j)(t,{abi:r,address:u,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:c,sender:e?.address})}}},65880:(e,t,r)=>{"use strict";r.d(t,{$8:()=>eW,$O:()=>P,$S:()=>e_,Af:()=>tn,Au:()=>es,B4:()=>ei,Bb:()=>eD,Be:()=>f,Bj:()=>w,Bt:()=>e6,CM:()=>e2,Ct:()=>v,Dl:()=>g,E4:()=>Y,ER:()=>eA,Eb:()=>eb,F7:()=>M,FG:()=>eR,FO:()=>e3,Fk:()=>ex,Fn:()=>m,G1:()=>T,G8:()=>et,GZ:()=>eS,HL:()=>L,Hi:()=>eh,Il:()=>eC,Jf:()=>eI,Jg:()=>G,K2:()=>eK,KA:()=>X,KB:()=>k,K_:()=>u,Kn:()=>j,L4:()=>ea,LK:()=>U,MB:()=>e9,MQ:()=>eG,Mu:()=>l,NC:()=>ec,Nd:()=>ey,Ny:()=>E,OC:()=>er,P:()=>F,P7:()=>eX,Pw:()=>x,QC:()=>eF,Q_:()=>el,R8:()=>_,Rl:()=>o,Rv:()=>eY,ST:()=>e7,So:()=>C,St:()=>K,TL:()=>eB,Tx:()=>eu,UI:()=>ep,Un:()=>eH,Uy:()=>A,W7:()=>J,WN:()=>eO,YA:()=>ev,YY:()=>en,Yv:()=>eo,Z$:()=>e8,Zm:()=>eo,_L:()=>W,_z:()=>$,aC:()=>y,bR:()=>ef,bS:()=>ez,cU:()=>z,d$:()=>eg,dN:()=>H,dR:()=>eP,dZ:()=>ej,db:()=>B,ej:()=>ed,em:()=>ee,f0:()=>eM,f2:()=>N,fI:()=>tr,fU:()=>e4,fs:()=>b,g6:()=>D,gP:()=>I,gt:()=>eL,h8:()=>eN,hH:()=>e$,ii:()=>Z,jS:()=>eJ,jw:()=>Q,kx:()=>e5,lo:()=>ek,m9:()=>ew,mI:()=>tt,nA:()=>d,nb:()=>e0,oI:()=>eZ,pY:()=>p,q0:()=>te,qF:()=>eE,qG:()=>R,qm:()=>el,rF:()=>eq,rk:()=>O,rn:()=>eV,rt:()=>S,sw:()=>q,tB:()=>c,tj:()=>eU,v$:()=>eQ,vL:()=>em,wA:()=>h,xY:()=>eT,yz:()=>e1,z$:()=>V});var n=r(74593),i=r(31711),a=r(38324),s=r(68056);function o(e,t){return new e({type:"string",...s.normalizeParams(t)})}function u(e,t){return new e({type:"string",coerce:!0,...s.normalizeParams(t)})}function l(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...s.normalizeParams(t)})}function c(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function f(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...s.normalizeParams(t)})}function p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...s.normalizeParams(t)})}function h(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...s.normalizeParams(t)})}function m(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...s.normalizeParams(t)})}function y(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...s.normalizeParams(t)})}function g(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function b(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function w(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...s.normalizeParams(t)})}function v(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function x(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function $(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...s.normalizeParams(t)})}function E(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...s.normalizeParams(t)})}function P(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...s.normalizeParams(t)})}function _(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...s.normalizeParams(t)})}function A(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...s.normalizeParams(t)})}function I(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...s.normalizeParams(t)})}function S(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...s.normalizeParams(t)})}function z(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...s.normalizeParams(t)})}function k(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...s.normalizeParams(t)})}function O(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...s.normalizeParams(t)})}let C={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function T(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...s.normalizeParams(t)})}function B(e,t){return new e({type:"string",format:"date",check:"string_format",...s.normalizeParams(t)})}function j(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...s.normalizeParams(t)})}function N(e,t){return new e({type:"string",format:"duration",check:"string_format",...s.normalizeParams(t)})}function M(e,t){return new e({type:"number",checks:[],...s.normalizeParams(t)})}function R(e,t){return new e({type:"number",coerce:!0,checks:[],...s.normalizeParams(t)})}function U(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...s.normalizeParams(t)})}function L(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...s.normalizeParams(t)})}function D(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...s.normalizeParams(t)})}function q(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...s.normalizeParams(t)})}function F(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...s.normalizeParams(t)})}function W(e,t){return new e({type:"boolean",...s.normalizeParams(t)})}function H(e,t){return new e({type:"boolean",coerce:!0,...s.normalizeParams(t)})}function V(e,t){return new e({type:"bigint",...s.normalizeParams(t)})}function K(e,t){return new e({type:"bigint",coerce:!0,...s.normalizeParams(t)})}function G(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...s.normalizeParams(t)})}function Z(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...s.normalizeParams(t)})}function J(e,t){return new e({type:"symbol",...s.normalizeParams(t)})}function Y(e,t){return new e({type:"undefined",...s.normalizeParams(t)})}function Q(e,t){return new e({type:"null",...s.normalizeParams(t)})}function X(e){return new e({type:"any"})}function ee(e){return new e({type:"unknown"})}function et(e,t){return new e({type:"never",...s.normalizeParams(t)})}function er(e,t){return new e({type:"void",...s.normalizeParams(t)})}function en(e,t){return new e({type:"date",...s.normalizeParams(t)})}function ei(e,t){return new e({type:"date",coerce:!0,...s.normalizeParams(t)})}function ea(e,t){return new e({type:"nan",...s.normalizeParams(t)})}function es(e,t){return new n.sm({check:"less_than",...s.normalizeParams(t),value:e,inclusive:!1})}function eo(e,t){return new n.sm({check:"less_than",...s.normalizeParams(t),value:e,inclusive:!0})}function eu(e,t){return new n.J_({check:"greater_than",...s.normalizeParams(t),value:e,inclusive:!1})}function el(e,t){return new n.J_({check:"greater_than",...s.normalizeParams(t),value:e,inclusive:!0})}function ec(e){return eu(0,e)}function ef(e){return es(0,e)}function ed(e){return eo(0,e)}function ep(e){return el(0,e)}function eh(e,t){return new n.Jk({check:"multiple_of",...s.normalizeParams(t),value:e})}function em(e,t){return new n.j2({check:"max_size",...s.normalizeParams(t),maximum:e})}function ey(e,t){return new n.PH({check:"min_size",...s.normalizeParams(t),minimum:e})}function eg(e,t){return new n.e2({check:"size_equals",...s.normalizeParams(t),size:e})}function eb(e,t){return new n.Yk({check:"max_length",...s.normalizeParams(t),maximum:e})}function ew(e,t){return new n.Kk({check:"min_length",...s.normalizeParams(t),minimum:e})}function ev(e,t){return new n.RM({check:"length_equals",...s.normalizeParams(t),length:e})}function ex(e,t){return new n.DG({check:"string_format",format:"regex",...s.normalizeParams(t),pattern:e})}function e$(e){return new n.NI({check:"string_format",format:"lowercase",...s.normalizeParams(e)})}function eE(e){return new n.kH({check:"string_format",format:"up
77percase",...s.normalizeParams(e)})}function eP(e,t){return new n.Tt({check:"string_format",format:"includes",...s.normalizeParams(t),includes:e})}function e_(e,t){return new n.J({check:"string_format",format:"starts_with",...s.normalizeParams(t),prefix:e})}function eA(e,t){return new n.E6({check:"string_format",format:"ends_with",...s.normalizeParams(t),suffix:e})}function eI(e,t,r){return new n.XF({check:"property",property:e,schema:t,...s.normalizeParams(r)})}function eS(e,t){return new n.sj({check:"mime_type",mime:e,...s.normalizeParams(t)})}function ez(e){return new n.v$({check:"overwrite",tx:e})}function ek(e){return ez(t=>t.normalize(e))}function eO(){return ez(e=>e.trim())}function eC(){return ez(e=>e.toLowerCase())}function eT(){return ez(e=>e.toUpperCase())}function eB(){return ez(e=>s.slugify(e))}function ej(e,t,r){return new e({type:"array",element:t,...s.normalizeParams(r)})}function eN(e,t,r){return new e({type:"union",options:t,...s.normalizeParams(r)})}function eM(e,t,r){return new e({type:"union",options:t,inclusive:!1,...s.normalizeParams(r)})}function eR(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...s.normalizeParams(n)})}function eU(e,t,r){return new e({type:"intersection",left:t,right:r})}function eL(e,t,r,n){let i=r instanceof a.W4,o=i?n:r;return new e({type:"tuple",items:t,rest:i?r:null,...s.normalizeParams(o)})}function eD(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...s.normalizeParams(n)})}function eq(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...s.normalizeParams(n)})}function eF(e,t,r){return new e({type:"set",valueType:t,...s.normalizeParams(r)})}function eW(e,t,r){return new e({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...s.normalizeParams(r)})}function eH(e,t,r){return new e({type:"enum",entries:t,...s.normalizeParams(r)})}function eV(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...s.normalizeParams(r)})}function eK(e,t){return new e({type:"file",...s.normalizeParams(t)})}function eG(e,t){return new e({type:"transform",transform:t})}function eZ(e,t){return new e({type:"optional",innerType:t})}function eJ(e,t){return new e({type:"nullable",innerType:t})}function eY(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():s.shallowClone(r)}})}function eQ(e,t,r){return new e({type:"nonoptional",innerType:t,...s.normalizeParams(r)})}function eX(e,t){return new e({type:"success",innerType:t})}function e0(e,t,r){return new e({type:"catch",innerType:t,catchValue:"function"==typeof r?r:()=>r})}function e1(e,t,r){return new e({type:"pipe",in:t,out:r})}function e2(e,t){return new e({type:"readonly",innerType:t})}function e6(e,t,r){return new e({type:"template_literal",parts:t,...s.normalizeParams(r)})}function e5(e,t){return new e({type:"lazy",getter:t})}function e8(e,t){return new e({type:"promise",innerType:t})}function e3(e,t,r){let n=s.normalizeParams(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function e4(e,t,r){return new e({type:"custom",check:"custom",fn:t,...s.normalizeParams(r)})}function e9(e,t){let r=e7(t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(s.issue(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(s.issue(e)))},e(t.value,t)),t);return r}function e7(e,t){let r=new n.QP({check:"custom",...s.normalizeParams(t)});return r._zod.check=e,r}function te(e){let t=new n.QP({check:"describe"});return t._zod.onattach=[t=>{let r=i.fd.get(t)??{};i.fd.add(t,{...r,description:e})}],t._zod.check=()=>{},t}function tt(e){let t=new n.QP({check:"meta"});return t._zod.onattach=[t=>{let r=i.fd.get(t)??{};i.fd.add(t,{...r,...e})}],t._zod.check=()=>{},t}function tr(e,t){let r=s.normalizeParams(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];"sensitive"!==r.case&&(n=n.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let o=new Set(n),u=new Set(i),l=e.Codec??a.YY,c=e.Boolean??a.sF,f=new l({type:"pipe",in:new(e.String??a.$v)({type:"string",error:r.error}),out:new c({type:"boolean",error:r.error}),transform:(e,t)=>
77{let n=e;return"sensitive"!==r.case&&(n=n.toLowerCase()),!!o.has(n)||!u.has(n)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...u],input:t.value,inst:f,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?n[0]||"true":i[0]||"false",error:r.error});return f}function tn(e,t,r,n={}){let i=s.normalizeParams(n),a={...s.normalizeParams(n),check:"string_format",type:"string",format:t,fn:"function"==typeof r?r:e=>r.test(e),...i};return r instanceof RegExp&&(a.pattern=r),new e(a)}},66113:(e,t,r)=>{"use strict";r.d(t,{dc:()=>h,og:()=>b,p$:()=>g,xO:()=>y,zv:()=>m});var n=r(33618),i=r(28285),a=r(71386),s=r(66568),o=r(70005),u=r(4879),l=r(4174),c=r(80339),f=r(45696),d=r(81693),p=r(94747);function h(e){let{authorizationList:t}=e;if(t)for(let e of t){let{chainId:t}=e,r=e.address;if(!(0,c.P)(r))throw new a.M({address:r});if(t<0)throw new u.qD({chainId:t})}y(e)}function m(e){let{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new o.zF;for(let e of t){let t=(0,f.E)(e),r=(0,p.ME)((0,d.di)(e,0,1));if(32!==t)throw new o.uP({hash:e,size:t});if(r!==n.E)throw new o.PK({hash:e,version:r})}}y(e)}function y(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:s}=e;if(t<=0)throw new u.qD({chainId:t});if(s&&!(0,c.P)(s))throw new a.M({address:s});if(n&&n>i.Ao)throw new l.BG({maxFeePerGas:n});if(r&&n&&r>n)throw new l.lN({maxFeePerGas:n,maxPriorityFeePerGas:r})}function g(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:f}=e;if(t<=0)throw new u.qD({chainId:t});if(f&&!(0,c.P)(f))throw new a.M({address:f});if(r||o)throw new s.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>i.Ao)throw new l.BG({maxFeePerGas:n})}function b(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:f}=e;if(f&&!(0,c.P)(f))throw new a.M({address:f});if(void 0!==t&&t<=0)throw new u.qD({chainId:t});if(r||o)throw new s.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>i.Ao)throw new l.BG({maxFeePerGas:n})}},66347:(e,t,r)=>{"use strict";r.d(t,{G6:()=>o,H2:()=>s,IN:()=>l,Ty:()=>i,ah:()=>c,u:()=>f,u7:()=>u,xO:()=>a});var n=r(66568);class i extends n.C{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class a extends n.C{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class s extends n.C{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class o extends n.C{constructor(e){super(`Hex value "${e}" is an odd length (${e.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}class u extends n.C{constructor({limit:e}){super(`RLP depth limit of \`${e}\` exceeded.`,{name:"RlpDepthLimitExceededError"})}}class l extends n.C{constructor({consumed:e,declared:t}){super(`RLP list items consumed \`${e}\` bytes but the list declared a length of \`${t}\`.`,{name:"RlpListBoundaryExceededError"})}}class c extends n.C{constructor({count:e}){super(`RLP payload encodes a single item, but \`${e}\` trailing ${1===e?"byte remains":"bytes remain"}.`,{name:"RlpTrailingBytesError"})}}class f extends n.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},66568:(e,t,r)=>{"use strict";r.d(t,{C:()=>a});let n="2.56.9",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class a extends Error{constructor(e,t={}){const r=t.cause instanceof a?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof a&&t.cause.docsPath||t.docsPath,o=i.getDocsUrl?.({...t,docsPath:s});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},66750:(e,t,r)=>{"use strict";
77Object.defineProperty(t,"__esModule",{value:!0});let n=r(95230),i=r(17950),a=r(93608),s=r(93608);t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:u,it:l}=e,{opts:c}=l,f=(0,n.allSchemaProperties)(r),d=f.filter(e=>(0,a.alwaysValidSchema)(l,r[e]));if(0===f.length||d.length===f.length&&(!l.opts.unevaluated||!0===l.props))return;let p=c.strictSchema&&!c.allowMatchingProperties&&u.properties,h=t.name("valid");!0===l.props||l.props instanceof i.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));let{props:m}=l;for(let e of f)p&&function(e){for(let t in p)new RegExp(e).test(t)&&(0,a.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),l.allErrors?y(e):(t.var(h,!0),y(e),t.if(h));function y(r){t.forIn("key",o,a=>{t.if((0,i._)`${(0,n.usePattern)(e,r)}.test(${a})`,()=>{let n=d.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:a,dataPropType:s.Type.Str},h),l.opts.unevaluated&&!0!==m?t.assign((0,i._)`${m}[${a}]`,!0):n||l.allErrors||t.if((0,i.not)(h),()=>t.break())})})}}}},66981:(e,t,r)=>{"use strict";r.d(t,{X:()=>i});var n=r(15904);function i(e,t){return n.HT(e,t)}},67221:(e,t,r)=>{"use strict";function n(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}r.d(t,{As:()=>n})},67463:(e,t,r)=>{"use strict";let{normalizeIPv6:n,removeDotSegments:i,recomposeAuthority:a,normalizePercentEncoding:s,normalizePathEncoding:o,escapePreservingEscapes:u,reescapeHostDelimiters:l,isIPv4:c,nonSimpleDomain:f}=r(99274),{SCHEMES:d,getSchemeHandler:p}=r(40051);function h(e,t,r,n){let a={};return n||(e=b(m(e,r),r),t=b(m(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=i(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=i(t.path||""),a.query=t.query):(t.path?("/"===t.path[0]?a.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=i(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function m(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],l=p(n.scheme||r.scheme);l&&l.serialize&&l.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=s(r.path):(r.path=u(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&o.push(r.scheme,":");let c=a(r);if(void 0!==c&&("suffix"!==n.reference&&o.push("//"),o.push(c),r.path&&"/"!==r.path[0]&&o.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||l&&l.absolutePath||(e=i(e)),void 0===c&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}let y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},a=!1,s=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let u=e.match(y);if(u){i.scheme=u[1],i.userinfo=u[3],i.host=u[4],i.port=parseInt(u[5],10),i.path=u[6]||"",i.query=u[7],i.fragment=u[8],isNaN(i.port)&&(i.port=u[5]);let t=void 0!==u[2]&&i.path&&"/"!==i.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof i.port&&(i.port<0||i.port>65535)?"URI port is malformed.":void 0;if(void 0!==t&&(i.error=i.error||t,a=!0),i.host)if(!1===c(i.host)){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let d=p(r.scheme||i.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(r.domainHost||d&&d.domainHost)&&!1===s&&f(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}if((!d||d&&!d.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),void 0!==i.host&&(i.host=l(unescape(i.host),s))),i.path&&(i.path=o(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}d&&d.parse&&d.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:a}}function b(e,t){return g(e,t).parsed}function w(e,t){let{parsed:r,malformedAuthorityOrPort:n}=g(e,t);return{normalized:n?e:m(r,t),malformedAuthorityOrPort:n}}function v(e,t){if("string"==typeof e){let{normalized:r,malformedAuthorityOrPort:n}=w(e,t);return n?void 0:r}if("object"==typeof e)return m(e,t)}let x={SCHEMES:d,normalize:function(e,t){return"string"==typeof e?e=w(e,t).normalized:"object"==typeof e&&(e=b(m(e,t),t)),e}
77,resolve:function(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=h(b(e,n),b(t,n),n,!0);return n.skipEscape=!0,m(i,n)},resolveComponent:h,equal:function(e,t,r){let n=v(e,r),i=v(t,r);return void 0!==n&&void 0!==i&&n.toLowerCase()===i.toLowerCase()},serialize:m,parse:b};e.exports=x,e.exports.default=x,e.exports.fastUri=x},68054:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!=i--;){var n,i,a,s=a[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},68056:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BIGINT_FORMAT_RANGES:()=>F,Class:()=>ep,NUMBER_FORMAT_RANGES:()=>q,aborted:()=>Y,allowsEval:()=>z,assert:()=>u,assertEqual:()=>i,assertIs:()=>s,assertNever:()=>o,assertNotEqual:()=>a,assignProp:()=>w,base64ToUint8Array:()=>eo,base64urlToUint8Array:()=>el,cached:()=>d,captureStackTrace:()=>I,cleanEnum:()=>es,cleanRegex:()=>h,clone:()=>M,cloneDef:()=>x,createTransparentProxy:()=>U,defineLazy:()=>g,esc:()=>_,escapeRegex:()=>N,explicitlyAborted:()=>Q,extend:()=>V,finalizeIssue:()=>et,floatSafeRemainder:()=>m,getElementAtPath:()=>$,getEnumValues:()=>l,getLengthableOrigin:()=>en,getParsedType:()=>T,getSizableOrigin:()=>er,hexToUint8Array:()=>ef,isObject:()=>S,isPlainObject:()=>k,issue:()=>ea,joinValues:()=>c,jsonStringifyReplacer:()=>f,merge:()=>G,mergeDefs:()=>v,normalizeParams:()=>R,nullish:()=>p,numKeys:()=>C,objectClone:()=>b,omit:()=>H,optionalKeys:()=>D,parsedType:()=>ei,partial:()=>Z,pick:()=>W,prefixIssues:()=>X,primitiveTypes:()=>j,promiseAllObject:()=>E,propertyKeyTypes:()=>B,randomString:()=>P,required:()=>J,safeExtend:()=>K,shallowClone:()=>O,slugify:()=>A,stringifyPrimitive:()=>L,uint8ArrayToBase64:()=>eu,uint8ArrayToBase64url:()=>ec,uint8ArrayToHex:()=>ed,unwrapMessage:()=>ee});var n=r(55503);function i(e){return e}function a(e){return e}function s(e){}function o(e){throw Error("Unexpected value in exhaustive check")}function u(e){}function l(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function c(e,t="|"){return e.map(e=>L(e)).join(t)}function f(e,t){return"bigint"==typeof t?t.toString():t}function d(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function p(e){return null==e}function h(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function m(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}let y=Symbol("evaluating");function g(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==y)return void 0===n&&(n=y,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function b(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function w(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function v(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function x(e){return v(e._zod.def)}function $(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function E(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function P(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function _(e){return JSON.stringify(e)}function A(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let I="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function S(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let z=d(()=>
77{if(n.cr.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function k(e){if(!1===S(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==S(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function O(e){return k(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function C(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let T=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},B=new Set(["string","number","symbol"]),j=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function R(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function U(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,a)=>(t??(t=e()),Reflect.set(t,n,i,a)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})}function L(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function D(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let q={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},F={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function W(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=v(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return w(this,"shape",e),e},checks:[]});return M(e,i)}function H(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=v(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return w(this,"shape",n),n},checks:[]});return M(e,i)}function V(e,t){if(!k(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=v(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return w(this,"shape",r),r}});return M(e,n)}function K(e,t){if(!k(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=v(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return w(this,"shape",r),r}});return M(e,r)}function G(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=v(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return w(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return M(e,r)}function Z(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=v(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return w(this,"shape",i),i},checks:[]});return M(t,i)}function J(e,t,r){let n=v(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return w(this,"shape",i),i}});return M(t,n)}function Y(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Q(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function X(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function ee(e){return"string"==typeof e?e:e?.message}function et(e,t,r){let n=e.message?e.message:ee(e.inst?._zod.def?.error?.(e))??ee(t?.error?.(e))??ee(r.customError?.(e))??ee(r.localeError?.(e))??"Invalid input",{inst:i,continue:a,input
77:s,...o}=e;return o.path??(o.path=[]),o.message=n,t?.reportInput&&(o.input=s),o}function er(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function en(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ei(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function ea(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function es(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function eo(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function eu(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function el(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eo(t+r)}function ec(e){return eu(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ef(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function ed(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class ep{constructor(...e){}}},68170:(e,t,r)=>{"use strict";r.d(t,{L:()=>f});var n=r(93247),i=r(66568);class a extends i.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}var s=r(37295),o=r(74594),u=r(85177);let l=0,c=new WeakMap;function f(e,t={}){let{batch:r,fetchFn:i,fetchOptions:d,key:p="http",maxResponseBodySize:h,methods:m,name:y="HTTP JSON-RPC",onFetchRequest:g,onFetchResponse:b,retryDelay:w,raw:v}=t;return({chain:f,retryCount:x,timeout:$})=>{let{batchSize:E=1e3,wait:P=0}="object"==typeof r?r:{},_=t.retryCount??x,A=$??t.timeout??1e4,I=e||f?.rpcUrls.default.http[0];if(!I)throw new a;let S=(0,o.d)(I,{fetchFn:i,fetchOptions:d,maxResponseBodySize:h,onRequest:g,onResponse:b,timeout:A});return(0,u.o)({key:p,methods:m,name:y,async request({method:e,params:t},i){let a={method:e,params:t},o=i?.signal?{signal:i.signal}:void 0,{schedule:u}=(0,s.u)({id:`${I}.${function(e){if(!e)return"default";let t=c.get(e);if(void 0!==t)return t;let r=l++;return c.set(e,r),r}(i?.signal)}`,wait:P,shouldSplitBatch:e=>e.length>E,fn:e=>S.request({body:e,fetchOptions:o}),sort:(e,t)=>e.id-t.id}),f=async e=>r?u(e):[await S.request({body:e,fetchOptions:o})],[{error:d,result:p}]=await f(a);if(v)return{error:d,result:p};if(d)throw new n.J8({body:a,error:d,url:I});return p},retryCount:_,retryDelay:w,timeout:A,type:"http"},{fetchOptions:d,url:I})}}},69960:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(94747);async function i(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,n.ME)(t)}},70005:(e,t,r)=>{"use strict";r.d(t,{PK:()=>u,iq:()=>a,uP:()=>o,zF:()=>s});var n=r(33618),i=r(66568);class a extends i.C{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class s extends i.C{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class o extends i.C{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class u extends i.C{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${n.E}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}},70234:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>s,BD:()=>i,D5:()=>n,Ge:()=>a});let n=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,a=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s=2n**256n-1n},70509:(e,t,r)=>{"use strict";r.d(t,{w:()=>i});var n=r(18267);function i(e,{errorInstance:t=Error("timed out"),timeout:r,signal:a}){return new Promise((i,s)=>{(async()=>{let o,u=new AbortController;try{r>0&&(o=setTimeout(()=>{a?u.abort():s(t)},r)),i(await e({signal:u?.signal||null}))}catch(e){if(u?.signal.aborted&&(0,n.zf)(e))return void s(t);s(e)}finally{clearTimeout(o)}})()})}},70536:(e,t,r)=>{"use strict";r.d(t,{c:()=>i});var n=r(15904);function i(e,t="wei"){return n.ck(e,t)}},70910:(e,t,r)=>{"use strict";function n(e,t){return({exclude:r,format:n})=>({exclude:r,format:(e,i)=>{let a=t(e,i);if(r)for(let e of r)delete a[e];return{...a,...n(e,i)}},type:e})}r.d(t,{q:()=>n})},70969:(e,t,r)=>{"use strict";r.d(t,{p:()=>s});var n=r(4174),i=r(96002),a=r(31750);function s(e,{docsPath:t,...r}){let o,u=(o=(0,a.l)(e,r))instanceof n.RM?e:o;return new i.$s(u,{docsPath:t,...r})}},71386:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(66568);class i extends n.C{constructor({address:e}){super(`Address "${e}
77" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},71605:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var n=r(53385),i=r(22106),a=r(40098),s=r(18860),o=r(8685),u=r(87499);function l(e){let{abi:t,args:r,logs:l,strict:c=!0}=e,f=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),d=t.filter(e=>"event"===e.type).map(e=>({abi:e,selector:(0,o.h)(e)}));return l.map(e=>{let t,o,l="string"==typeof e.blockNumber?(0,a.e)(e):e,p=d.filter(e=>l.topics[0]===e.selector);if(0===p.length)return null;for(let e of p)try{t=(0,u.j)({...l,abi:[e.abi],strict:!0}),o=e;break}catch{}if(!t&&!c){o=p[0];try{t=(0,u.j)({data:l.data,topics:l.topics,abi:[o.abi],strict:!1})}catch{let e=o.abi.inputs?.some(e=>!("name"in e&&e.name));return{...l,args:e?[]:{},eventName:o.abi.name}}}return t&&o&&(!f||f.includes(t.eventName))&&function(e){let{args:t,inputs:r,matchArgs:a}=e;if(!a)return!0;if(!t)return!1;function o(e,t,r){try{if("address"===e.type)return(0,n.h)(t,r);if("string"===e.type||"bytes"===e.type)return(0,s.S)((0,i.ZJ)(t))===r;return t===r}catch{return!1}}return Array.isArray(t)&&Array.isArray(a)?a.every((e,n)=>{if(null==e)return!0;let i=r[n];return!!i&&(Array.isArray(e)?e:[e]).some(e=>o(i,e,t[n]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof a||Array.isArray(a))&&Object.entries(a).every(([e,n])=>{if(null==n)return!0;let i=r.find(t=>t.name===e);return!!i&&(Array.isArray(n)?n:[n]).some(r=>o(i,r,t[e]))})}({args:t.args,inputs:o.abi.inputs,matchArgs:r})?{...t,...l}:null}).filter(Boolean)}},72254:(e,t,r)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let a=r(93339);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(i=n||(t.UsedValueState=n={}))[i.Started=0]="Started",i[i.Completed=1]="Completed",t.varKinds={const:new a.Name("const"),let:new a.Name("let"),var:new a.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof a.Name?e:this.name(e)}name(e){return new a.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class u extends a.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,a._)`.${new a.Name(t)}[${r}]`}}t.ValueScopeName=u;let l=(0,a._)`\n`;class c extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:a.nil}}get(){return this._scope}name(e){return new u(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,a=null!=(r=t.key)?r:t.ref,s=this._values[i];if(s){let e=s.get(a);if(e)return e}else s=this._values[i]=new Map;s.set(a,n);let o=this._scope[i]||(this._scope[i]=[]),u=o.length;return o[u]=t.ref,n.setValue(t,{property:i,itemIndex:u}),n}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,a._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,i={},o){let u=a.nil;for(let l in e){let c=e[l];if(!c)continue;let f=i[l]=i[l]||new Map;c.forEach(e=>{if(f.has(e))return;f.set(e,n.Started);let i=r(e);if(i){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;u=(0,a._)`${u}${r} ${e} = ${i};${this.opts._n}`}else if(i=null==o?void 0:o(e))u=(0,a._)`${u}${i}${this.opts._n}`;else throw new s(e);f.set(e,n.Completed)})}return u}}t.ValueScope=c},72401:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(96002);function i(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new n.Vg({transaction:e})}},73062:(e,t,r)=>{"use strict";r.d(t,{Q:()=>b});var n=r(51011),i=r(66568),a=r(46149),s=r(84428),o=r(70536),u=r(22160),l=r(96002);class c extends i.C{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:a,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:d,to:p,value:h}){const m=(0,l.aO)({from:t?.address,to:p,value:void 0!==h&&`${(0,o.c)(h)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:a,gasPrice:void 0!==s&&`${(0,u.Q)(s)} gwei`,maxFeePerGas:void 0!==c&&`${(0,u.Q)(c)}
77 gwei`,maxPriorityFeePerGas:void 0!==f&&`${(0,u.Q)(f)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",m].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var f=r(4174),d=r(31750),p=r(89649),h=r(58637),m=r(77309),y=r(97948),g=r(29562);async function b(e,t){let{account:r=e.account,prepare:o=!0}=t,u=r?(0,n.J)(r):void 0,l=Array.isArray(o)?o:u?.type!=="local"?["blobVersionedHashes"]:void 0;try{let r=await (async()=>t.to?t.to:t.authorizationList&&t.authorizationList.length>0?await (0,a.g)({authorization:t.authorizationList[0]}).catch(()=>{throw new i.C("`to` is required. Could not infer from `authorizationList`")}):void 0)(),{accessList:n,authorizationList:c,blobs:f,blobVersionedHashes:d,blockNumber:b,blockTag:w,data:v,gas:x,gasPrice:$,maxFeePerBlobGas:E,maxFeePerGas:P,maxPriorityFeePerGas:_,nonce:A,value:I,stateOverride:S,...z}=o?await (0,g.ft)(e,{...t,parameters:l,to:r}):t;if(x&&t.gas!==x)return x;let k=("bigint"==typeof b?(0,s.cK)(b):void 0)||w,O=(0,m.yH)(S);(0,y.c)(t);let C=e.chain?.formatters?.transactionRequest?.format,T=(C||h.Bv)({...(0,p.o)(z,{format:C}),account:u,accessList:n,authorizationList:c,blobs:f,blobVersionedHashes:d,data:v,gasPrice:$,maxFeePerBlobGas:E,maxFeePerGas:P,maxPriorityFeePerGas:_,nonce:A,to:r,value:I},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[T,k??e.experimental_blockTag??"latest",O]:k?[T,k]:[T]}))}catch(r){throw function(e,{docsPath:t,...r}){let n;return new c((n=(0,d.l)(e,r))instanceof f.RM?e:n,{docsPath:t,...r})}(r,{...t,account:u,chain:e.chain})}}},73260:(e,t,r)=>{"use strict";r.d(t,{Lj:()=>o,WB:()=>l,uL:()=>u});var n=r(94747),i=r(70910),a=r(40098),s=r(43748);let o={"0x0":"reverted","0x1":"success"};function u(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,a.e)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,n.ME)(e.transactionIndex):null,status:e.status?o[e.status]:null,type:e.type?s.b4[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}let l=(0,i.q)("transactionReceipt",u)},73320:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var n=r(80044),i=r(37826),a=r(42330);let s="/docs/contract/decodeFunctionResult";function o(e){let{abi:t,args:r,functionName:o,data:u}=e,l=t[0];if(o){let e=(0,a.iY)({abi:t,args:r,name:o});if(!e)throw new n.Iz(o,{docsPath:s});l=e}if("function"!==l.type)throw new n.Iz(void 0,{docsPath:s});if(!l.outputs)throw new n.MR(l.name,{docsPath:s});let c=(0,i.n)(l.outputs,u);return c&&c.length>1?c:c&&1===c.length?c[0]:void 0}},73331:(e,t,r)=>{"use strict";r.d(t,{d:()=>o});var n=r(84428),i=r(45089),a=r(89762),s=r(22106);function o(e){let{commitments:t,version:r}=e,o=e.to??("string"==typeof t[0]?"hex":"bytes"),u=[];for(let e of t)u.push(function(e){let{commitment:t,version:r=1}=e,o=e.to??("string"==typeof t?"hex":"bytes"),u=(0,i.sc)((0,a.q)(t,{strict:!1})?(0,s.ZJ)(t):t);return u.set([r],0),"bytes"===o?u:(0,n.My)(u)}({commitment:e,to:o,version:r}));return u}},73614:(e,t,r)=>{"use strict";r.d(t,{A9:()=>i,NO:()=>o,Pj:()=>u,dV:()=>a,nx:()=>l,zd:()=>s});var n=r(47347);n.C;class i extends n.C{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class a extends n.C{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class s extends n.C{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class o extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class u extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class l extends n.C{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
77d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}},74593:(e,t,r)=>{"use strict";r.d(t,{DG:()=>v,E6:()=>_,J:()=>P,J_:()=>l,Jk:()=>c,KH:()=>f,Kk:()=>g,NI:()=>x,PH:()=>h,QP:()=>s,RM:()=>b,Tt:()=>E,XF:()=>I,Yk:()=>y,e2:()=>m,j2:()=>p,kH:()=>$,ql:()=>w,sj:()=>S,sm:()=>u,uE:()=>d,v$:()=>z});var n=r(55503),i=r(9459),a=r(68056);let s=n.xI("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),o={number:"number",bigint:"bigint",object:"date"},u=n.xI("$ZodCheckLessThan",(e,t)=>{s.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),l=n.xI("$ZodCheckGreaterThan",(e,t)=>{s.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),c=n.xI("$ZodCheckMultipleOf",(e,t)=>{s.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===a.floatSafeRemainder(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),f=n.xI("$ZodCheckNumberFormat",(e,t)=>{s.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,u]=a.NUMBER_FORMAT_RANGES[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=o,n.maximum=u,r&&(n.pattern=i.integer)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a))return void i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>u&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),d=n.xI("$ZodCheckBigIntFormat",(e,t)=>{s.init(e,t);let[r,n]=a.BIGINT_FORMAT_RANGES[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),p=n.xI("$ZodCheckMaxSize",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:a.getSizableOrigin(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),h=n.xI("$ZodCheckMinSize",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:a.getSizableOrigin(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),m=n.xI("$ZodCheckSizeEquals",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:a.getSizableOrigin(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),y=n.xI("$ZodCheckMaxLength",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=a.getLengthableOrigin(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),g=n.xI("$ZodCheckMinLength",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=a.getLengthableOrigin(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),b=n.xI("$ZodCheckLengthEquals",(e,t)=>{var r;s.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let s=a.getLengthableOrigin(n),o=i>t.length;r.issues.push({origin:s,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),w=n.xI("$ZodCheckStringFormat",(e,t)=>{var r,n;s.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),v=n.xI("$ZodCheckRegex",(e,t)=>{w.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),x=n.xI("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=i.lowercase),w.init(e,t)}),$=n.xI("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=i.uppercase),w.init(e,t)}),E=n.xI("$ZodCheckIncludes",(e,t)=>{s.init(e,t);let r=a.escapeRegex(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
77:r.value,inst:e,continue:!t.abort})}}),P=n.xI("$ZodCheckStartsWith",(e,t)=>{s.init(e,t);let r=RegExp(`^${a.escapeRegex(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_=n.xI("$ZodCheckEndsWith",(e,t)=>{s.init(e,t);let r=RegExp(`.*${a.escapeRegex(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function A(e,t,r){e.issues.length&&t.issues.push(...a.prefixIssues(r,e.issues))}let I=n.xI("$ZodCheckProperty",(e,t)=>{s.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>A(r,e,t.property));A(r,e,t.property)}}),S=n.xI("$ZodCheckMimeType",(e,t)=>{s.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),z=n.xI("$ZodCheckOverwrite",(e,t)=>{s.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})},74594:(e,t,r)=>{"use strict";r.d(t,{d:()=>u});var n=r(93247),i=r(18267),a=r(70509),s=r(91497);let o={current:0,take(){return this.current++},reset(){this.current=0}};function u(e,t={}){let{url:r,headers:c}=function(e){try{let t=new URL(e),r=(()=>{if(t.username){let e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}(e);return{async request(e){let{body:u,fetchFn:f=t.fetchFn??fetch,maxResponseBodySize:d=t.maxResponseBodySize??0xa00000,onRequest:p=t.onRequest,onResponse:h=t.onResponse,timeout:m=t.timeout??1e4}=e,y={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:g,method:b,signal:w}=y;try{let e,t=await (0,a.w)(async({signal:e})=>{let t={...y,body:Array.isArray(u)?(0,s.A)(u.map(e=>({jsonrpc:"2.0",id:e.id??o.take(),...e}))):(0,s.A)({jsonrpc:"2.0",id:u.id??o.take(),...u}),headers:{...c,"Content-Type":"application/json",...g},method:b||"POST",signal:w||(m>0?e:null)},n=new Request(r,t),i=await p?.(n,t)??{...t,url:r};return await f(i.url??r,i)},{errorInstance:new n.MU({body:u,url:r}),timeout:m,signal:!0});h&&await h(t);let i=await l(t,{maxResponseBodySize:d});if(t.headers.get("Content-Type")?.startsWith("application/json"))e=JSON.parse(i);else{e=i;try{e=JSON.parse(e||"{}")}catch(r){if(t.ok)throw r;e={error:e}}}if(!t.ok){if("number"==typeof e.error?.code&&"string"==typeof e.error?.message)return e;throw new n.Ci({body:u,details:(0,s.A)(e.error)||t.statusText,headers:t.headers,status:t.status,url:r})}return e}catch(e){if(w?.aborted)throw(0,i.TY)(w);if((0,i.zf)(e)||e instanceof n.Ci||e instanceof n.f||e instanceof n.MU)throw e;throw new n.Ci({body:u,cause:e,url:r})}}}}async function l(e,{maxResponseBodySize:t}){if(!1===t)return e.text();let r=e.headers.get("Content-Length");if(r){let e=Number(r);if(e>t)throw new n.f({maxSize:t,size:e})}if(!e.body){let r=await e.text(),i=new TextEncoder().encode(r).length;if(i>t)throw new n.f({maxSize:t,size:i});return r}let i=e.body.getReader(),a=new TextDecoder,s="",o=0;try{for(;;){let{done:e,value:r}=await i.read();if(e)break;if((o+=r.byteLength)>t)throw await i.cancel(),new n.f({maxSize:t,size:o});s+=a.decode(r,{stream:!0})}return s+=a.decode()}finally{i.releaseLock()}}},74696:(e,t,r)=>{"use strict";r.d(t,{Ai:()=>o,UU:()=>a});var n=r(51011),i=r(85622);function a(e){let{batch:t,chain:r,ccipRead:a,dataSuffix:o,key:u="base",name:l="Base Client",tokens:c,type:f="base"}=e,d=e.experimental_blockTag??("number"==typeof r?.experimental_preconfirmationTime?"pending":void 0),p=Math.min(Math.max(Math.floor((r?.blockTime??12e3)/2),500),4e3),h=e.pollingInterval??p,m=e.cacheTime??h,y=e.account?(0,n.J)(e.account):void 0,{config:g,request:b,value:w}=e.transport({account:y,chain:r,pollingInterval:h}),v={account:y,batch:t,cacheTime:m,ccipRead:a,chain:r,dataSuffix:o,key:u,name:l,pollingInterval:h,request:b,tokens:c,transport:{...g,...w},type:f,uid:(0,i.L)(),...d?{experimental_blockTag:d}:{}};return Object.assign(v,{extend:function e(t){return r=>{let n=r(t);for(let e in v)delete n[e];let i={...t,...n};for(let e in n){let r=t[e],a=n[e];
77s(r)&&s(a)&&(i[e]={...r,...a})}return Object.assign(i,{extend:e(i)})}}(v)})}function s(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function o(e,t){let r=(r={})=>t(e,r);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","predict","simulate"])if(Object.hasOwn(t,n)){let i=t[n];r[n]=(t={})=>1===i.length?i(t):i(e,t)}for(let e of["extractEvent","extractEvents"])Object.hasOwn(t,e)&&(r[e]=t[e]);return r}},74833:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(39017);async function i(e,{address:t,blockHash:r,blockNumber:a,blockTag:s="latest",requireCanonical:o}){let u=(0,n.O)({blockHash:r,blockNumber:a,blockTag:s,requireCanonical:o}),l=await e.request({method:"eth_getCode",params:[t,u]},{dedupe:"bigint"==typeof a||void 0!==r});if("0x"!==l)return l}},75228:(e,t,r)=>{"use strict";r.d(t,{C:()=>i});var n=r(3399);class i extends Error{static setStaticOptions(e){i.prototype.docsOrigin=e.docsOrigin,i.prototype.showVersion=e.showVersion,i.prototype.version=e.version}constructor(e,t={}){const r=(()=>{if(t.cause instanceof i){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),n=t.cause instanceof i&&t.cause.docsPath||t.docsPath,a=t.docsOrigin??i.prototype.docsOrigin,s=`${a}${n??""}`,o=!!(t.version??i.prototype.showVersion),u=t.version??i.prototype.version;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||n||o?["",r?`Details: ${r}`:void 0,n?`See: ${s}`:void 0,o?`Version: ${u}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=r,this.docs=s,this.docsOrigin=a,this.docsPath=n,this.shortMessage=e,this.showVersion=o,this.version=u}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}Object.defineProperty(i,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,n.HF)()}`}}),i.setStaticOptions(i.defaultStaticOptions)},75255:(e,t,r)=>{"use strict";r.d(t,{BH:()=>p,vB:()=>d,yM:()=>h});var n=r(51011),i=r(66568),a=r(65261),s=r(4181),o=r(76429),u=r(94747),l=r(84428),c=r(70969),f=r(27426);let d="0x5792579257925792579257925792579257925792579257925792579257925792",p=(0,l.cK)(0,{size:32});async function h(e,t){let{account:r=e.account,chain:h=e.chain,experimental_fallback:m,experimental_fallbackDelay:y=32,forceAtomic:g=!1,id:b,version:w="2.0.0"}=t,v=r?(0,n.J)(r):null,x=t.capabilities;e.dataSuffix&&!t.capabilities?.dataSuffix&&(x="string"==typeof e.dataSuffix?{...t.capabilities,dataSuffix:{value:e.dataSuffix,optional:!0}}:{...t.capabilities,dataSuffix:{value:e.dataSuffix.value,...e.dataSuffix.required?{}:{optional:!0}}});let $=t.calls.map(e=>{let t=e.abi?(0,s.p)({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&t?(0,o.xW)([t,e.dataSuffix]):t,to:e.to,value:e.value?(0,l.cK)(e.value):void 0}});try{let t=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:g,calls:$,capabilities:x,chainId:(0,l.cK)(h.id),from:v?.address,id:b,version:w}]},{retryCount:0});if("string"==typeof t)return{id:t};return t}catch(r){if(m&&("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name||"UnknownRpcError"===r.name||r.details.toLowerCase().includes("does not exist / is not available")||r.details.toLowerCase().includes("missing or invalid. request()")||r.details.toLowerCase().includes("did n
77ot match any variant of untagged enum")||r.details.toLowerCase().includes("account upgraded to unsupported contract")||r.details.toLowerCase().includes("eip-7702 not supported")||r.details.toLowerCase().includes("unsupported wc_ method")||r.details.toLowerCase().includes("feature toggled misconfigured")||r.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(x&&Object.values(x).some(e=>!e.optional)){let e="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new a.L5(new i.C(e,{details:e}))}if(g&&$.length>1){let e="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new a.jz(new i.C(e,{details:e}))}let t=[];for(let r of $){try{let n=await (0,f.v)(e,{account:v,chain:h,data:r.data,to:r.to,value:r.value?(0,u.uU)(r.value):void 0});t.push({status:"fulfilled",value:n})}catch(e){t.push({reason:e,status:"rejected"})}y>0&&await new Promise(e=>setTimeout(e,y))}if(t.every(e=>"rejected"===e.status))throw t[0].reason;let r=t.map(e=>"fulfilled"===e.status?e.value:p);return{id:(0,o.xW)([...r,(0,l.cK)(h.id,{size:32}),d])}}throw(0,c.p)(r,{...t,account:v,chain:t.chain})}}},75279:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},75411:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(4879);function i({blockNumber:e,chain:t,contract:r}){let a=t?.contracts?.[r];if(!a)throw new n.rj({chain:t,contract:{name:r}});if(e&&a.blockCreated&&a.blockCreated>e)throw new n.rj({blockNumber:e,chain:t,contract:{name:r,blockCreated:a.blockCreated}});return a.address}},75839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(59580),i=r(17286);t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default]},76209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let n=r(25801),i=r(62567),a=r(87618),s=r(1410),o=["/properties"],u="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(e,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=r(9269);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var f=r(17950);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=r(27069);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=r(6100);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},76429:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce((e,t)=>
77e+t.replace("0x",""),"")}`}r.d(t,{aP:()=>i,xW:()=>n})},76590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let n=r(17950),i=r(93608),a=r(95230);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>(0,n.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,n._)`{property: ${e},
78    missingProperty: ${i},
79    depsCount: ${t},
80    deps: ${r}}`};let s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);o(e,t),u(e,r)}};function o(e,t=e.schema){let{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;let u=r.let("missing");for(let o in t){let l=t[o];if(0===l.length)continue;let c=(0,a.propertyInData)(r,i,o,s.opts.ownProperties);e.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),s.allErrors?r.if(c,()=>{for(let t of l)(0,a.checkReportMissingProp)(e,t)}):(r.if((0,n._)`${c} && (${(0,a.checkMissingProp)(e,l,u)})`),(0,a.reportMissingProp)(e,u),r.else())}}function u(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,l=r.name("valid");for(let u in t)(0,i.alwaysValidSchema)(o,t[u])||(r.if((0,a.propertyInData)(r,n,u,o.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:u},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}t.validatePropertyDeps=o,t.validateSchemaDeps=u,t.default=s},76900:(e,t,r)=>{"use strict";r.d(t,{T:()=>P});var n=r(4638),i=r(51392),a=r(51011),s=r(18587),o=r(32547),u=r(66568),l=r(4879),c=r(78568),f=r(18267),d=r(73320),p=r(24642),h=r(4181),m=r(53385),y=r(3901
807),g=r(75411),b=r(96462),w=r(89649),v=r(58637),x=r(37295),$=r(77309),E=r(97948);async function P(e,t){let{account:s=e.account,authorizationList:d,batch:h=!!e.batch?.multicall,blockHash:g,blockNumber:x,blockTag:P=e.experimental_blockTag??"latest",requireCanonical:_,accessList:A,blobs:k,blockOverrides:O,code:C,data:T,factory:B,factoryData:j,gas:N,gasPrice:M,maxFeePerBlobGas:R,maxFeePerGas:U,maxPriorityFeePerGas:L,nonce:D,requestOptions:q,to:F,value:W,stateOverride:H,...V}=t,K=s?(0,a.J)(s):void 0;if(C&&(B||j))throw new u.C("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(C&&F)throw new u.C("Cannot provide both `code` & `to` as parameters.");let G=C&&T,Z=B&&j&&F&&T,J=G||Z,Y=G?z({code:C,data:T}):Z?function(e){let{data:t,factory:r,factoryData:i,to:a}=e;return(0,p.m)({abi:(0,n.U)(["constructor(address, bytes, address, bytes)"]),bytecode:o.WN,args:[a,t,r,i]})}({data:T,factory:B,factoryData:j,to:F}):T;try{let r;(0,E.c)(t);let n=(0,y.O)({blockHash:g,blockNumber:x,blockTag:P,requireCanonical:_}),a=O?i.J(O):void 0,s=(0,$.yH)(H),o=e.chain?.formatters?.transactionRequest?.format,u=(o||v.Bv)({...(0,w.o)(V,{format:o}),accessList:A,account:K,authorizationList:d,blobs:k,data:Y,gas:N,gasPrice:M,maxFeePerBlobGas:R,maxFeePerGas:U,maxPriorityFeePerGas:L,nonce:D,to:J?void 0:F,value:W},"call");if(h&&function({request:e}){let{data:t,to:r,...n}=e;return!(!t||t.startsWith("0x82ad56cb"))&&!!r&&!(Object.values(n).filter(e=>void 0!==e).length>0)}({request:u})&&!a&&void 0===g)try{var Q,X;let{deployless:t=!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},r=S(e,{blockNumber:x,deployless:t});if(!r||(Q=s,X=r,!(Q&&Object.keys(Q).some(e=>(0,m.h)(e,X)))))return await I(e,{...u,blockHash:g,blockNumber:x,blockTag:P,multicallAddress:r,requestOptions:q,requireCanonical:_,rpcStateOverride:s})}catch(e){if(!(e instanceof l.YE)&&!(e instanceof l.rj))throw e}let c=(r=[u,n],s&&a?[...r,s,a]:s?[...r,s]:a?[...r,{},a]:r),f=await e.request({method:"eth_call",params:c},q);if("0x"===f)return{data:void 0};return{data:f}}catch(s){if(q?.signal?.aborted)throw(0,f.TY)(q.signal);if((0,f.zf)(s))throw s;let n=function(e){if(!(e instanceof u.C))return;let t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(s),{offchainLookup:i,offchainLookupSignature:a}=await r.e(11417).then(r.bind(r,11417));if(!1!==e.ccipRead&&n?.slice(0,10)===a&&F)return{data:await i(e,{data:n,requestOptions:q,to:F})};if(J&&n?.slice(0,10)==="0x101bb98d")throw new c.Po({factory:B});throw(0,b.d)(s,{...t,account:K,chain:e.chain})}}let _=0,A=new WeakMap;async function I(e,t){let{batchSize:r=1024,deployless:n=!1,wait:i=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockHash:a,blockNumber:u,blockTag:l=e.experimental_blockTag??"latest",requireCanonical:f,data:p,multicallAddress:m,requestOptions:g,rpcStateOverride:b,to:w}=t,v=void 0!==m?m:S(e,{blockNumber:u,deployless:n}),$=(0,y.O)({blockHash:a,blockNumber:u,blockTag:l,requireCanonical:f}),E="string"==typeof $?$:JSON.stringify($),P=b?`.${JSON.stringify(b)}`:"",{schedule:I}=(0,x.u)({id:`${e.uid}.${E}.${function(e){if(!e)return"default";let t=A.get(e);if(void 0!==t)return t;let r=_++;return A.set(e,r),r}(g)}${P}`,wait:i,shouldSplitBatch:e=>e.reduce((e,{data:t})=>e+(t.length-2),0)>2*r,fn:async t=>{let r=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),n=(0,h.p)({abi:s.v2,args:[r],functionName:"aggregate3"}),i={...null===v?{data:z({code:o.Ez,data:n})}:{to:v,data:n}},a=await e.request({method:"eth_call",params:b?[i,$,b]:[i,$]},g);return(0,d.e)({abi:s.v2,args:[r],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:k,success:O}]=await I({data:p,to:w});if(!O)throw new c.$S({data:k});return"0x"===k?{data:void 0}:{data:k}}function S(e,t){let{blockNumber:r,deployless:n}=t;if(n)return null;if(e.chain)return(0,g.M)({blockNumber:r,chain:e.chain,contract:"multicall3"});throw new l.YE}function z(e){let{code:t,data:r}=e;return(0,p.m)({abi:(0,n.U)(["constructor(bytes, bytes)"]),bytecode:o.LX,args:[t,r]})}},77022:(e,t,r)=>{"use strict";r.d(t,{t:()=>a});var n=r(22106),i=r(84428);function a(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),a="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,n.aT)(e)):e.commitments,o=[];for(let e=0;e<a.length;e++){let r=a[e],n=s[e];o.push(Uint8Array.from(t.computeBlobKzgProof(r,n)))}return"bytes"===r?o:o.map(e=>(0,i.My)(e))}},77144:(e,t,r)=>{"use strict";r.d(t,{B4:()=>p,CQ:()=>v,CW:()=>w,Ei:()=>f,F8:()=>x,P5:()=>d,TH:()=>$,Vl:()=>g,Vr:()=>b,WM:()=>h,WQ:()=>y,im:()=>m,jm:()=>o,lD:()=>a,qh:()=>c,rE:()=>u,ry:()=>l,xn:()=>s});let n=BigInt(0x100000000-1),i=BigInt(32);function a(e,t=!1){let r=e.length,s=new Uint32Array(r),o=new Uint32Array(r);for(let a=0;a<r;a++){let{h:r,l:u}=function(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}(e[a],t);[s[a],o[a]]=[r,u]}return[s,o]}let s=(e,t,r)=>e>>>r,o=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e>>>r|t<<32-r,l=(e,t,r)=>e<<32-r|t>>>r,c=(e,t,r)=>e<<64-r|t>>>r-32,f=(e,t,r)=>e>>>r-32|t<<64-r,d=(e,t,r)=>e<<r|t>>>32-r,p=(e,t,r)=>t<<r|e>>>32-r,h=(e,t,r)=>t<<r-32|e>>>64-r,m=(e,t,r)=>e<<r-32|t>>>64-r;function y(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}let g=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),b=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),v=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,x=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),$=(e,t,r,n,i,a)=>t+r+n+i+a+(e/0x100000000|0)|0},77148:(e,t,r)=>{"use strict";
80Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608),a=r(64989);t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,n._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:s,data:o,$data:u,schema:l,schemaCode:c,it:f}=e;if(!u&&0===l.length)throw Error("enum must have non-empty array");let d=l.length>=f.opts.loopEnum,p=()=>null!=t?t:t=(0,i.useFunc)(s,a.default);if(d||u)r=s.let("valid"),e.block$data(r,function(){s.assign(r,!1),s.forOf("v",c,e=>s.if((0,n._)`${p()}(${o}, ${e})`,()=>s.assign(r,!0).break()))});else{if(!Array.isArray(l))throw Error("ajv implementation error");let e=s.const("vSchema",c);r=(0,n.or)(...l.map((t,r)=>{var i,a;let s;return i=e,"object"==typeof(s=l[a=r])&&null!==s?(0,n._)`${p()}(${o}, ${i}[${a}])`:(0,n._)`${o} === ${s}`}))}e.pass(r)}}},77309:(e,t,r)=>{"use strict";r.d(t,{yH:()=>l});var n=r(71386),i=r(44546),a=r(12515),s=r(80339),o=r(84428);function u(e){if(e&&0!==e.length)return e.reduce((e,{slot:t,value:r})=>{if(66!==t.length)throw new i.NV({size:t.length,targetSize:66,type:"hex"});if(66!==r.length)throw new i.NV({size:r.length,targetSize:66,type:"hex"});return e[t]=r,e},{})}function l(e){if(!e)return;let t={};for(let{address:r,...i}of e){if(!(0,s.P)(r,{strict:!1}))throw new n.M({address:r});if(t[r])throw new a.Hi({address:r});t[r]=function(e){let{balance:t,nonce:r,state:n,stateDiff:i,code:s}=e,l={};if(void 0!==s&&(l.code=s),void 0!==t&&(l.balance=(0,o.cK)(t)),void 0!==r&&(l.nonce=(0,o.cK)(r)),void 0!==n&&(l.state=u(n)),void 0!==i){if(l.state)throw new a.ft;l.stateDiff=u(i)}return l}(i)}return t}},77334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let n=r(17950),i=r(64032),a=r(95230),s=r(95519);function o(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,n._)`${i.parentData}[${i.parentDataProperty}]`))}function u(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){let{gen:r,keyword:i,schema:a,parentSchema:s,it:o}=e,l=t.macro.call(o.self,a,s,o),c=u(r,i,l);!1!==o.opts.validateSchema&&o.self.validateSchema(l,!0);let f=r.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${o.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},f),e.pass(f,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;let{gen:l,keyword:c,schema:f,parentSchema:d,$data:p,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(h,t);let m=u(l,c,!p&&t.compile?t.compile.call(h.self,f,d,h):t.validate),y=l.let("valid");function g(r=t.async?(0,n._)`await `:n.nil){let s=h.opts.passContext?i.default.this:i.default.self,o=!("compile"in t&&!p||!1===t.schema);l.assign(y,(0,n._)`${r}${(0,a.callValidateCode)(e,m,s,o)}`,t.modifying)}function b(e){var r;l.if((0,n.not)(null!=(r=t.valid)?r:y),e)}e.block$data(y,function(){if(!1===t.errors)g(),t.modifying&&o(e),b(()=>e.error());else{let r,a,u=t.async?(r=l.let("ruleErrs",null),l.try(()=>g((0,n._)`await `),e=>l.assign(y,!1).if((0,n._)`${e} instanceof ${h.ValidationError}`,()=>l.assign(r,(0,n._)`${e}.errors`),()=>l.throw(e))),r):(a=(0,n._)`${m}.errors`,l.assign(a,null),g(n.nil),a);t.modifying&&o(e),b(()=>(function(e,t){let{gen:r}=e;r.if((0,n._)`Array.isArray(${t})`,()=>{r.assign(i.default.vErrors,(0,n._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,(0,n._)`${i.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())})(e,u))}}),e.ok(null!=(r=t.valid)?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error("ajv implementation error");let s=i.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${s.join(",")}`);
80if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},77590:(e,t)=>{"use strict";function r(e){let t,r=e.length,n=0,i=0;for(;i<r;)n++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<r&&(64512&(t=e.charCodeAt(i)))==56320&&i++;return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},78283:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(25274),i=r(94747),a=r(22106);function s({r:e,s:t,to:r="hex",v:o,yParity:u}){let l=(()=>{if(0===u||1===u)return u;if(o&&(27n===o||28n===o||o>=35n))return+(o%2n===0n);throw Error("Invalid `v` or `yParity` value")})(),c=`0x${new n.secp256k1.Signature((0,i.uU)(e),(0,i.uU)(t)).toCompactHex()}${0===l?"1b":"1c"}`;return"hex"===r?c:(0,a.aT)(c)}},78423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(93608);t.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let a=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;let s=e.subschema({keyword:"allOf",schemaProp:r},a);e.ok(a),e.mergeEvaluated(s)})}}},78568:(e,t,r)=>{"use strict";r.d(t,{zX:()=>g,bG:()=>b,M:()=>w,rR:()=>v,Po:()=>x,$S:()=>$});var n=r(51011),i=r(95889),a=r(52856),s=r(24029),o=r(91497);function u({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,o.A)(t[r]):t[r]}`).join(", ")})`}var l=r(42330),c=r(70536),f=r(22160),d=r(80044),p=r(66568),h=r(12515),m=r(96002),y=r(18267);class g extends p.C{constructor(e,{account:t,docsPath:r,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:u,maxPriorityFeePerGas:l,nonce:d,to:p,value:y,stateOverride:g}){const b=t?(0,n.J)(t):void 0;let w=(0,m.aO)({from:b?.address,to:p,value:void 0!==y&&`${(0,c.c)(y)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==o&&`${(0,f.Q)(o)} gwei`,maxFeePerGas:void 0!==u&&`${(0,f.Q)(u)} gwei`,maxPriorityFeePerGas:void 0!==l&&`${(0,f.Q)(l)} gwei`,nonce:d});g&&(w+=`
81${(0,h.uj)(g)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class b extends p.C{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:a,sender:o}){const c=(0,l.iY)({abi:t,args:r,name:a}),f=c?u({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?(0,s.B)(c,{includeName:!0}):void 0,p=(0,m.aO)({address:n&&(0,y.RZ)(n),function:d,args:f&&"()"!==f&&`${[...Array(a?.length??0).keys()].map(()=>" ").join("")}${f}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],p&&"Contract Call:",p].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=a,this.sender=o}}class w extends p.C{constructor({abi:e,data:t,functionName:r,message:n,cause:o}){let l,c,f,p,h;if(t&&"0x"!==t)try{const{abiItem:r,errorName:n,args:l}=c=(0,a.W)({abi:e,data:t,cause:o});if("Error"===n)p=l[0];else if("Panic"===n){const[e]=l;p=i.fD[e]}else{const e=r?(0,s.B)(r,{includeName:!0}):void 0,t=r&&l?u({abiItem:r,args:l,includeFunctionName:!1,includeName:!1}):void 0;f=[e?`Error: ${e}`:"",t&&"()"!==t?`       ${[...Array(n?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){l=e}else n&&(p=n);l instanceof d.Wq&&(h=l.signature,f=[`Unable to decode signature "${h}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${h}.`]),super(p&&"execution reverted"!==p||h?[`The contract function "${r}" reverted with the following ${h?"signature":"reason"}:`,p||h].join("\n"):`The contract function "${r}" reverted.`,{cause:l??o,metaMessages:f,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=c,this.raw=t,this.reason=p,this.signature=h}}class v extends p.C{constructor({functionName:e,cause:t}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${e}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:t})}}class x extends p.C{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class $ extends p.C{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},80044:(e,t,r)=>{"use strict";r.d(t,{BI:()=>E,EB:()=>x,Iy:()=>u,Iz:()=>w,MR:()=>v,M_:()=>b,Nc:()=>c,O:()=>l,Wl:()=>k,Wq:()=>m,YE:()=>d,YF:()=>o,YW:()=>s,ZP:()=>p,_z:()=>y,d_:()=>z,dm:()=>S,fo:()=>P,gH:()=>f,j:()=>I,kE:()=>g,l3:()=>_,nK:()=>A,nM:()=>$,yy:()=>h});var n=r(24029),i=r(45696),a=r(66568);class s extends a.C{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e,name:"AbiConstructorNotFoundError"})}}class o extends a.C{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}a.C;class u extends a.C{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.A)(t,{includeName:!0})})`,`Data:   ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class l extends a.C{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class c extends a.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
82Expected length: ${e}
83Given length: ${t}
83`,{name:"AbiEncodingArrayLengthMismatchError"})}}class f extends a.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.E)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class d extends a.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
84Expected length (params): ${e}
85Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}class p extends a.C{constructor(e,{docsPath:t}){super(`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).
86Cannot encode error result without knowing what the parameter types are.
87Make sure you are using the correct ABI and that the inputs exist on it.`,{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class h extends a.C{constructor(e,{docsPath:t}={}){super(`Error ${e?`"${e}" `:""}not found on ABI.
88Make sure you are using the correct ABI and that the error exists on it.`,{docsPath:t,name:"AbiErrorNotFoundError"})}}class m extends a.C{constructor(e,{docsPath:t,cause:r}){super(`Encoded error signature "${e}" not found on ABI.
89Make sure you are using the correct ABI and that the error exists on it.
90You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class y extends a.C{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class g extends a.C{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
91Make sure you are using the correct ABI and that the event exists on it.
92You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class b extends a.C{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI.
93Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t,name:"AbiEventNotFoundError"})}}class w extends a.C{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI.
94Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionNotFoundError"})}}class v extends a.C{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI.
95Cannot decode function result without knowing what the parameter types are.
96Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class x extends a.C{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" not found on ABI.
97Make sure you are using the correct ABI and that the function exists on it.
98You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class $ extends a.C{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.B)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.B)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class E extends a.C{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class P extends a.C{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.A)(r,{includeName:!0})})`,`Data:   ${t} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class _ extends a.C{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.B)(e,{includeName:!0})}".`,{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class A extends a.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
99Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}class I extends a.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
100Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiDecodingType"})}}class S extends a.C{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class z extends a.C{constructor(e){super(`"${e}" is not a valid definition type.
101Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}class k extends a.C{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}},80339:(e,t,r)=>{"use strict";r.d(t,{P:()=>o});var n=r(86301),i=r(96685);let a=/^0x[a-fA-F0-9]{40}$/,s=new n.A(8192);function o(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(s.has(n))return s.get(n);let o=!!a.test(e)&&(e.toLowerCase()===e||!r||(0,i.o)(e)===e);return s.set(n,o),o}},80440:(e,t,r)=>{"use strict";
101Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608),a=r(64989);t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,n._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:s,schemaCode:o,schema:u}=e;s||u&&"object"==typeof u?e.fail$data((0,n._)`!${(0,i.useFunc)(t,a.default)}(${r}, ${o})`):e.fail((0,n._)`${u} !== ${r}`)}}},80771:(e,t,r)=>{"use strict";r.d(t,{y:()=>a});var n=r(39017),i=r(94747);async function a(e,{address:t,blockHash:r,blockNumber:s,blockTag:o="latest",requireCanonical:u}){let l=(0,n.O)({blockHash:r,blockNumber:s,blockTag:o,requireCanonical:u}),c=await e.request({method:"eth_getTransactionCount",params:[t,l]},{dedupe:"bigint"==typeof s||void 0!==r});return(0,i.ME)(c)}},81278:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(4879);function i({chain:e,currentChainId:t}){if(!e)throw new n.jF;if(t!==e.id)throw new n.EH({chain:e,currentChainId:t})}},81693:(e,t,r)=>{"use strict";r.d(t,{A1:()=>l,di:()=>s,iN:()=>c});var n=r(44546),i=r(89762),a=r(45696);function s(e,t,r,{strict:n}={}){return(0,i.q)(e,{strict:!1})?c(e,t,r,{strict:n}):l(e,t,r,{strict:n})}function o(e,t){if("number"==typeof t&&t>0&&t>(0,a.E)(e)-1)throw new n.ii({offset:t,position:"start",size:(0,a.E)(e)})}function u(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,a.E)(e)!==r-t)throw new n.ii({offset:r,position:"end",size:(0,a.E)(e)})}function l(e,t,r,{strict:n}={}){o(e,t);let i=e.slice(t,r);return n&&u(i,t,r),i}function c(e,t,r,{strict:n}={}){o(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&u(i,t,r),i}},81852:(e,t)=>{t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,u=(1<<o)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+f],f+=d,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=l}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,d=5960464477539062e-23*(23===i),p=n?0:a-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=c?(o=0,s=c):s+f>=1?(o=(t*u-1)*Math.pow(2,i),s+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=h,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[r+p]=255&s,p+=h,s/=256,l-=8);e[r+p-h]|=128*m}},82766:(e,t,r)=>{"use strict";r.d(t,{Vw:()=>y,DO:()=>a,CC:()=>o,sd:()=>s,Fe:()=>i,Ht:()=>u,uH:()=>c,Id:()=>m,qj:()=>g,O8:()=>f,po:()=>b,Ow:()=>d,fd:()=>p,ZJ:()=>h,DH:()=>l});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function a(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");i(e.outputLen),i(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function u(e,t){a(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function l(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function f(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function d(e,t){return e<<32-t|e>>>t}let p=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function h(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),a(e),e}function m(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];a(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class y{}function g(e){let t=t=>e().update(h(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function b(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));if(n&&"function"==typeof n.randomBytes)return Uint8Array.from(n.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}},83165:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});let n={major:4,minor:4,patch:3}},83646:(e,t,r)=>{"use strict";r.d(t,{Bq:()=>l,Sl:()=>i,X:()=>s,eV:()=>u,kK:()=>a,t7:()=>o});var n=r(94734);function i(e,t){if(n.Ej(e)>t)throw new n.u({givenSize:n.Ej(e),maxSize:t})}function a(e,t){if("number"==typeof t&&t>0&&t>n.Ej(e)-1)throw new n.ii({offset:t,position:"start",size:n.Ej(e)})}function s(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.Ej(e)!==r-t)throw new n.ii({offset:r,position:"end",size:n.Ej(e)})}function o(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function u(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;if(e.length>i)throw new n.Fl({size:e.length,targetSize:i,type:"Bytes"});let a=new Uint8Array(i);for(let t=0;t<i;t++){let n="right"===r;a[n?t:i-t-1]=e[n?t:e.length-t-1]}return a}function l(e,t={}){let{dir:r="left"}=t,n=e,i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"left"===r?n.slice(i):n.slice(0,n.length-i)}},84428:(e,t,r)=>{"use strict";r.d(t,{$P:()=>u,My:()=>l,cK:()=>c,i3:()=>d,nj:()=>o});var n=r(66347),i=r(89950),a=r(94747);let s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e,t={}){return"number"==typeof e||"bigint"==typeof e?c(e,t):"string"==typeof e?d(e,t):"boolean"==typeof e?u(e,t):l(e,t)}function u(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,a.Sl)(r,{size:t.size}),(0,i.eV)(r,{size:t.size})):r}function l(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=s[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,a.Sl)(n,{size:t.size}),(0,i.eV)(n,{dir:"right",size:t.size})):n}function c(e,t={}){let r,{signed:a,size:s}=t,o=BigInt(e);s?r=a?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let u="bigint"==typeof r&&a?-r-1n:0;if(r&&o>r||o<u){let t="bigint"==typeof e?"n":"";throw new n.Ty({max:r?`${r}${t}`:void 0,min:`${u}${t}`,signed:a,size:s,value:`${e}${t}`})}let l=`0x${(a&&o<0?(1n<<BigInt(8*s))+BigInt(o):o).toString(16)}`;return s?(0,i.eV)(l,{size:s}):l}let f=new TextEncoder;function d(e,t={}){return l(f.encode(e),t)}},84974:(e,t,r)=>{"use strict";
101Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let n=r(17950),i=r(93608);function a(e,t){let{gen:r,schema:a,data:s,keyword:o,it:u}=e;u.items=!0;let l=r.const("len",(0,n._)`${s}.length`);if(!1===a)e.setParams({len:t.length}),e.pass((0,n._)`${l} <= ${t.length}`);else if("object"==typeof a&&!(0,i.alwaysValidSchema)(u,a)){let a=r.var("valid",(0,n._)`${l} <= ${t.length}`);r.if((0,n.not)(a),()=>{var s;return s=a,void r.forRange("i",t.length,l,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:i.Type.Num},s),u.allErrors||r.if((0,n.not)(s),()=>r.break())})}),e.ok(a)}}t.validateAdditionalItems=a,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?a(e,n):(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},85177:(e,t,r)=>{"use strict";r.d(t,{o:()=>f});var n=r(66568),i=r(93247),a=r(65261),s=r(18267);let o=new(r(86301)).A(8192);var u=r(7528),l=r(91497),c=r(85622);function f({key:e,methods:t,name:r,request:d,retryCount:p=3,retryDelay:h=150,timeout:m,type:y},g){return{config:{key:e,methods:t,name:r,request:d,retryCount:p,retryDelay:h,timeout:m,type:y},request:function(e,t={}){return async(r,c={})=>{let{dedupe:f=!1,methods:d,retryDelay:p=150,retryCount:h=3,signal:m,uid:y}={...t,...c},{method:g}=r;if(d?.exclude?.includes(g)||d?.include&&!d.include.includes(g))throw new a.ab(Error("method not supported"),{method:g});if(m?.aborted)throw(0,s.TY)(m);let b=f?function(e,t=0){let r=0xdeadbeef^t,n=0x41c6ce57^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);r=Math.imul(r^i,0x9e3779b1),n=Math.imul(n^i,0x5f356495)}return r=Math.imul(r^r>>>16,0x85ebca6b)^Math.imul(n^n>>>16,0xc2b2ae35),(0x100000000*(2097151&(n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(r^r>>>16,0xc2b2ae35)))+(r>>>0)).toString(36)}(`${y}.${(0,l.A)(r)}`):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(o.get(r))return o.get(r);let n=e().finally(()=>o.delete(r));return o.set(r,n),n}(()=>(0,u.b)(async()=>{try{return await e(r,m?{signal:m}:void 0)}catch(e){if(m?.aborted)throw(0,s.TY)(m);if((0,s.zf)(e))throw e;switch(e.code){case a.XU.code:throw new a.XU(e);case a.CL.code:throw new a.CL(e);case a.Gi.code:throw new a.Gi(e,{method:r.method});case a.D5.code:throw new a.D5(e);case a.bq.code:throw new a.bq(e);case a.Di.code:throw new a.Di(e);case a.hA.code:throw new a.hA(e);case a.qZ.code:throw new a.qZ(e);case a.YW.code:throw new a.YW(e);case a.ab.code:throw new a.ab(e,{method:r.method});case a.s0.code:throw new a.s0(e);case a.xQ.code:throw new a.xQ(e);case a.vx.code:throw new a.vx(e);case a.sV.code:throw new a.sV(e);case a.Sf.code:throw new a.Sf(e);case a.RV.code:throw new a.RV(e);case a.xq.code:throw new a.xq(e);case a.ch.code:throw new a.ch(e);case a.L5.code:throw new a.L5(e);case a.WT.code:throw new a.WT(e);case a.hl.code:throw new a.hl(e);case a.cg.code:throw new a.cg(e);case a.uL.code:throw new a.uL(e);case a.G1.code:throw new a.G1(e);case a.jz.code:throw new a.jz(e);case 5e3:throw new a.vx(e);case a.nR.code:throw new a.nR(e);default:if(e instanceof n.C)throw e;throw new a.MI(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof i.Ci){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*p},retryCount:h,signal:m,shouldRetry:({error:e})=>{var t;return t=e,!(0,s.zf)(t)&&("code"in t&&"number"==typeof t.code?-1===t.code||t.code===a.s0.code||t.code===a.bq.code||429===t.code||-32007===t.code:!(t instanceof i.Ci)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status||!1)}}),{enabled:f,id:b})}}(d,{methods:t,retryCount:p,retryDelay:h,uid:(0,c.L)()}),value:g}}},85622:(e,t,r)=>{"use strict";let n;r.d(t,{L:()=>a});let i=256;function a(e=11){if(!n||i+e>512){n="",i=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++e)}},86190:(e,t,r)=>{"use strict";r.d(t,{x:()=>c});var n=r(53834),i=r(89762),a=r(45696),s=r(94747),o=r(84428);async function u({hash:e,signature:t}){let n=(0,i.q)(e)?e:(0,o.nj)(e),{secp256k1:c}=await Promise.resolve().then(r.bind(r,25274)),f=(()=>
101{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:i}=t,a=l(Number(i??n));return new c.Signature((0,s.uU)(e),(0,s.uU)(r)).addRecoveryBit(a)}let e=(0,i.q)(t)?t:(0,o.nj)(t);if(65!==(0,a.E)(e))throw Error("invalid signature length");let r=l((0,s.ME)(`0x${e.slice(130)}`));return c.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${f}`}function l(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function c({hash:e,signature:t}){return(0,n.M)(await u({hash:e,signature:t}))}},86301:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}},87499:(e,t,r)=>{"use strict";r.d(t,{j:()=>c});var n=r(80044),i=r(41568),a=r(45696),s=r(8685),o=r(37826),u=r(24029);let l="/docs/contract/decodeEventLog";function c(e){let{abi:t,data:r,strict:c,topics:f}=e,d=c??!0,[p,...h]=f;if(!p)throw new n._z({docsPath:l});let m=t.find(e=>"event"===e.type&&p===(0,s.h)((0,u.B)(e)));if(!(m&&"name"in m)||"event"!==m.type)throw new n.kE(p,{docsPath:l});let{name:y,inputs:g}=m,b=g?.some(e=>!("name"in e&&e.name)),w=b?[]:{},v=g.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed),x=[];for(let e=0;e<v.length;e++){let[t,r]=v[e],i=h[e];if(!i){if(d)throw new n.l3({abiItem:m,param:t});x.push([t,r]);continue}w[b?r:t.name||r]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,o.n)([e],t)||[])[0]}({param:t,value:i})}let $=g.filter(e=>!("indexed"in e&&e.indexed)),E=d?$:[...x.map(([e])=>e),...$];if(E.length>0){if(r&&"0x"!==r)try{let e=(0,o.n)(E,r);if(e){let t=0;if(!d)for(let[r,n]of x)w[b?n:r.name||n]=e[t++];if(b)for(let r=0;r<g.length;r++)void 0===w[r]&&t<e.length&&(w[r]=e[t++]);else for(let r=0;r<$.length;r++)w[$[r].name]=e[t++]}}catch(e){if(d){if(e instanceof n.Iy||e instanceof i.SK)throw new n.fo({abiItem:m,data:r,params:E,size:(0,a.E)(r)});throw e}}else if(d)throw new n.fo({abiItem:m,data:"0x",params:E,size:0})}return{eventName:y,args:Object.values(w).length>0?w:void 0}}},87618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(57995),a=r(92280),s=r(6100),o=r(93608);t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,n._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:u,parentSchema:l,it:c}=e,{oneOf:f}=l;if(!c.opts.discriminator)throw Error("discriminator: requires discriminator option");let d=u.propertyName;if("string"!=typeof d)throw Error("discriminator: requires propertyName");if(u.mapping)throw Error("discriminator: mapping is not supported");if(!f)throw Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),h=t.const("tag",(0,n._)`${r}${(0,n.getProperty)(d)}`);t.if((0,n._)`typeof ${h} == "string"`,()=>(function(){let r=function(){var e;let t={},r=i(l),n=!0;for(let t=0;t<f.length;t++){let l=f[t];if((null==l?void 0:l.$ref)&&!(0,o.schemaHasRulesButRef)(l,c.self.RULES)){let e=l.$ref;if((l=a.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,e))instanceof a.SchemaEnv&&(l=l.schema),void 0===l)throw new s.default(c.opts.uriResolver,c.baseId,e)}let p=null==(e=null==l?void 0:l.properties)?void 0:e[d];if("object"!=typeof p)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||i(l)),function(e,t){if(e.const)u(e.const,t);else if(e.enum)for(let r of e.enum)u(r,t);else throw Error(`discriminator: "properties/${d}" must have "const" or "enum"`)}(p,t)}if(!n)throw Error(`discriminator: "${d}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(d)}function u(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}();for(let i in t.if(!1),r)t.elseIf((0,n._)`${h} === ${i}`),t.assign(p,function(r){let i=t.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(a,n.Name),i}(r[i]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:h,tagName:d}),t.endIf()})(),()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:h,tagName:d})),e.ok(p)}}},88207:(e,t,r)=>{"use strict";r.d(t,{b:()=>g,Z:()=>b});
101var n=r(96002),i=r(84428),a=r(94073),s=r(77022),o=r(73331),u=r(57723),l=r(76429),c=r(12581),f=r(7211),d=r(66113),p=r(72401),h=r(71386),m=r(80339);function y(e){if(!e||0===e.length)return[];let t=[];for(let r=0;r<e.length;r++){let{address:i,storageKeys:a}=e[r];for(let e=0;e<a.length;e++)if(a[e].length-2!=64)throw new n.fZ({storageKey:a[e]});if(!(0,m.P)(i,{strict:!1}))throw new h.M({address:i});t.push([i,a])}return t}function g(e,t){let r=(0,p.L)(e);return"eip1559"===r?function(e,t){let{chainId:r,gas:n,nonce:a,to:s,value:o,maxFeePerGas:u,maxPriorityFeePerGas:c,accessList:p,data:h}=e;(0,d.xO)(e);let m=y(p),g=[(0,i.cK)(r),a?(0,i.cK)(a):"0x",c?(0,i.cK)(c):"0x",u?(0,i.cK)(u):"0x",n?(0,i.cK)(n):"0x",s??"0x",o?(0,i.cK)(o):"0x",h??"0x",m,...b(e,t)];return(0,l.aP)(["0x02",(0,f.EQ)(g)])}(e,t):"eip2930"===r?function(e,t){let{chainId:r,gas:n,data:a,nonce:s,to:o,value:u,accessList:c,gasPrice:p}=e;(0,d.p$)(e);let h=y(c),m=[(0,i.cK)(r),s?(0,i.cK)(s):"0x",p?(0,i.cK)(p):"0x",n?(0,i.cK)(n):"0x",o??"0x",u?(0,i.cK)(u):"0x",a??"0x",h,...b(e,t)];return(0,l.aP)(["0x01",(0,f.EQ)(m)])}(e,t):"eip4844"===r?function(e,t){let{chainId:r,gas:n,nonce:c,to:p,value:h,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,accessList:v,data:x}=e;(0,d.zv)(e);let $=e.blobVersionedHashes,E=e.sidecars;if(e.blobs&&(void 0===$||void 0===E)){let t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map(e=>(0,i.My)(e)),r=e.kzg,n=(0,a.S)({blobs:t,kzg:r});if(void 0===$&&($=(0,o.d)({commitments:n})),void 0===E){let e=(0,s.t)({blobs:t,commitments:n,kzg:r});E=(0,u.T)({blobs:t,commitments:n,proofs:e})}}let P=y(v),_=[(0,i.cK)(r),c?(0,i.cK)(c):"0x",w?(0,i.cK)(w):"0x",g?(0,i.cK)(g):"0x",n?(0,i.cK)(n):"0x",p??"0x",h?(0,i.cK)(h):"0x",x??"0x",P,m?(0,i.cK)(m):"0x",$??[],...b(e,t)],A=[],I=[],S=[];if(E)for(let e=0;e<E.length;e++){let{blob:t,commitment:r,proof:n}=E[e];A.push(t),I.push(r),S.push(n)}return(0,l.aP)(["0x03",E?(0,f.EQ)([_,A,I,S]):(0,f.EQ)(_)])}(e,t):"eip7702"===r?function(e,t){let{authorizationList:r,chainId:n,gas:a,nonce:s,to:o,value:u,maxFeePerGas:c,maxPriorityFeePerGas:p,accessList:h,data:m}=e;(0,d.dc)(e);let g=y(h),w=function(e){if(!e||0===e.length)return[];let t=[];for(let r of e){let{chainId:e,nonce:n,...a}=r,s=r.address;t.push([e?(0,i.nj)(e):"0x",s,n?(0,i.nj)(n):"0x",...b({},a)])}return t}(r);return(0,l.aP)(["0x04",(0,f.EQ)([(0,i.cK)(n),s?(0,i.cK)(s):"0x",p?(0,i.cK)(p):"0x",c?(0,i.cK)(c):"0x",a?(0,i.cK)(a):"0x",o??"0x",u?(0,i.cK)(u):"0x",m??"0x",g,w,...b(e,t)])])}(e,t):function(e,t){let{chainId:r=0,gas:a,data:s,nonce:o,to:u,value:l,gasPrice:p}=e;(0,d.og)(e);let h=[o?(0,i.cK)(o):"0x",p?(0,i.cK)(p):"0x",a?(0,i.cK)(a):"0x",u??"0x",l?(0,i.cK)(l):"0x",s??"0x"];if(t){let e=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n);if(r>0)return BigInt(2*r)+BigInt(35n+t.v-27n);let e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new n.zW({v:t.v});return e})(),a=(0,c.B)(t.r),s=(0,c.B)(t.s);h=[...h,(0,i.cK)(e),"0x00"===a?"0x":a,"0x00"===s?"0x":s]}else r>0&&(h=[...h,(0,i.cK)(r),"0x","0x"]);return(0,f.EQ)(h)}(e,t)}function b(e,t){let r=t??e,{v:n,yParity:a}=r;if(void 0===r.r||void 0===r.s||void 0===n&&void 0===a)return[];let s=(0,c.B)(r.r),o=(0,c.B)(r.s);return["number"==typeof a?a?(0,i.cK)(1):"0x":0n===n?"0x":1n===n?(0,i.cK)(1):27n===n?"0x":(0,i.cK)(1),"0x00"===s?"0x":s,"0x00"===o?"0x":o]}},89529:(e,t,r)=>{"use strict";r.d(t,{$:()=>a,R:()=>s});var n=r(70910),i=r(43748);function a(e,t){let r=(e.transactions??[]).map(e=>"string"==typeof e?e:(0,i.uP)(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}let s=(0,n.q)("block",a)},89649:(e,t,r)=>{"use strict";function n(e,{format:t}){if(!t)return{};let r={};return!function t(n){for(let i of Object.keys(n))i in e&&(r[i]=e[i]),n[i]&&"object"==typeof n[i]&&!Array.isArray(n[i])&&t(n[i])}(t(e||{})),r}r.d(t,{o:()=>n})},89762:(e,t,r)=>{"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{q:()=>n})},89840:(e,t,r)=>{"use strict";
101Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608);function a(e,t){let r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,n.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,n._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:s,it:o}=e;void 0===s.then&&void 0===s.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let u=a(o,"then"),l=a(o,"else");if(!u&&!l)return;let c=r.let("valid",!0),f=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f),e.mergeEvaluated(t),e.reset(),u&&l){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(f,d("then",t),d("else",t))}else u?r.if(f,d("then")):r.if((0,n.not)(f),d("else"));function d(t,i){return()=>{let a=e.subschema({keyword:t},f);r.assign(c,f),e.mergeValidEvaluated(a,c),i?r.assign(i,(0,n._)`${t}`):e.setParams({ifClause:t})}}e.pass(c,()=>e.error(!0))}}},89913:(e,t,r)=>{"use strict";r.d(t,{lY:()=>v});var n=r(77144),i=r(82766);let a=BigInt(0),s=BigInt(1),o=BigInt(2),u=BigInt(7),l=BigInt(256),c=BigInt(113),f=[],d=[],p=[];for(let e=0,t=s,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],f.push(2*(5*n+r)),d.push((e+1)*(e+2)/2%64);let i=a;for(let e=0;e<7;e++)(t=(t<<s^(t>>u)*c)%l)&o&&(i^=s<<(s<<BigInt(e))-s);p.push(i)}let h=(0,n.lD)(p,!0),m=h[0],y=h[1],g=(e,t,r)=>r>32?(0,n.WM)(e,t,r):(0,n.P5)(e,t,r),b=(e,t,r)=>r>32?(0,n.im)(e,t,r):(0,n.B4)(e,t,r);class w extends i.Vw{constructor(e,t,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,(0,i.Fe)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.fd)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,a=r[i],s=r[i+1],o=g(a,s,1)^r[n],u=b(a,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=u}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=d[r],a=g(t,i,n),s=b(t,i,n),o=f[r];t=e[o],i=e[o+1],e[o]=a,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=m[n],e[1]^=y[n]}(0,i.uH)(r)}(this.state32,this.rounds),(0,i.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.CC)(this),e=(0,i.ZJ)(e),(0,i.DO)(e);let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let a=Math.min(t-this.pos,n-i);for(let t=0;t<a;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.CC)(this,!1),(0,i.DO)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.Ht)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.uH)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return e||(e=new w(t,r,n,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=a,e.destroyed=this.destroyed,e}}let v=(0,i.qj)(()=>new w(136,1,32))},89950:(e,t,r)=>{"use strict";r.d(t,{db:()=>a,eV:()=>i});var n=r(44546);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?a(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.Fl({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let a="right"===t;i[a?n:r-n-1]=e[a?n:e.length-n-1]}return i}(e,{dir:t,size:r})}function a(e,{dir:t,size:r=32}={}){if(null===r)return e;let i=e.replace("0x","");if(i.length>2*r)throw new n.Fl({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}}
101,90516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950);t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,n._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:i,it:a}=e,s=a.opts.multipleOfPrecision,o=t.let("res"),u=s?(0,n._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,n._)`${o} !== parseInt(${o})`;e.fail$data((0,n._)`(${i} === 0 || (${o} = ${r}/${i}, ${u}))`)}}},91497:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(e,t,r)=>JSON.stringify(e,(e,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n},r)},92280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let n=r(17950),i=r(27069),a=r(64032),s=r(14252),o=r(93608),u=r(9269);class l{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function c(e){let t,r,o=d.call(this,e);if(o)return o;let l=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:f}=this.opts.code,{ownProperties:p}=this.opts,h=new n.CodeGen(this.scope,{es5:c,lines:f,ownProperties:p});e.$async&&(t=h.scopeValue("Error",{ref:i.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:l,baseId:e.baseId||l,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,u.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let t=h.toString();r=`${h.scopeRefs(a.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let i=Function(`${a.default.self}`,`${a.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:m,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){let{props:e,items:t}=y;i.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let n of this._compilations){var t,r;if(t=n,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n}}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||h.call(this,e,t)}function h(e,t){let r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r),i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return y.call(this,r,e);let a=(0,s.normalizeId)(n),o=this.refs[a]||this.schemas[a];if("string"==typeof o){let t=h.call(this,e,o);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==o?void 0:o.schema)){if(o.validate||c.call(this,o),a===(0,s.normalizeId)(t)){let{schema:t}=o,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new l({schema:t,schemaId:r,root:e,baseId:i})}
101return y.call(this,r,o)}}t.SchemaEnv=l,t.compileSchema=c,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let a=p.call(this,e,r);if(void 0===a){let i=null==(n=e.localRefs)?void 0:n[r],{schemaId:s}=this.opts;i&&(a=new l({schema:i,schemaId:s,root:e,baseId:t}))}if(void 0!==a)return e.refs[r]=f.call(this,a)},t.getCompilingSchema=d,t.resolveSchema=h;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var i;let a;if((null==(i=e.fragment)?void 0:i[0])!=="/")return;for(let n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,o.unescapeFragment)(n)];if(void 0===e)return;let i="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){let e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=h.call(this,n,e)}let{schemaId:u}=this.opts;if((a=a||new l({schema:r,schemaId:u,root:n,baseId:t})).schema!==a.root.schema)return a}},93247:(e,t,r)=>{"use strict";r.d(t,{Ci:()=>s,J8:()=>u,MU:()=>l,f:()=>o});var n=r(91497),i=r(66568),a=r(18267);class s extends i.C{constructor({body:e,cause:t,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${(0,a.ID)(o)}`,e&&`Request body: ${(0,n.A)(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class o extends i.C{constructor({maxSize:e,size:t}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${t} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=t}}i.C;class u extends i.C{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,a.ID)(r)}`,`Request body: ${(0,n.A)(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}}i.C;class l extends i.C{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,a.ID)(t)}`,`Request body: ${(0,n.A)(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}},93339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function a(e,...t){let r=[e[0]],n=0;for(;n<t.length;)u(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=a;let s=new i("+");function o(e,...t){let r=[l(e[0])],a=0;for(;a<t.length;)r.push(s),u(r,t[a]),r.push(s,l(e[++a]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){var r,i;let a=(r=e[t-1],'""'===(i=e[t+1])?r:'""'===r?i:"string"==typeof r?i instanceof n||'"'!==r[r.length-1]?void 0:"string"!=typeof i?`${r.slice(0,-1)}${i}"`:'"'===i[0]?r.slice(0,-1)+i.slice(1):void 0:"string"!=typeof i||'"'!==i[0]||r instanceof n?void 0:`"${r}${i.slice(1)}`);if(void 0!==a){e.splice(t-1,3,a);continue}e[t++]="+"}t++}}(r),new i(r)}function u(e,t){var r;t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:l(Array.isArray(r)?r.join(","):r))}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=u,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new i(l(e))},t.safeStringify=l,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);
101throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},93608:(e,t,r)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let a=r(17950),s=r(93339);function o(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||"boolean"==typeof t)return;let i=n.RULES.keywords;for(let r in t)i[r]||m(e,`unknown keyword: "${r}"`)}function u(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function l(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function f({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,u)=>{let l=void 0===o?s:o instanceof a.Name?(s instanceof a.Name?e(i,s,o):t(i,s,o),o):s instanceof a.Name?(t(i,o,s),s):r(s,o);return u!==a.Name||l instanceof a.Name?l:n(i,l)}}function d(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,a._)`{}`);return void 0!==t&&p(e,r,t),r}function p(e,t,r){Object.keys(r).forEach(r=>e.assign((0,a._)`${t}${(0,a.getProperty)(r)}`,!0))}t.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!u(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=u,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,a._)`${r}`}return(0,a._)`${e}${t}${(0,a.getProperty)(n)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(l(e))},t.escapeJsonPointer=l,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},t.mergeEvaluated={props:f({mergeNames:(e,t,r)=>e.if((0,a._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,a._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,a._)`${r} || {}`).code((0,a._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,a._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,a._)`${r} || {}`),p(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:d}),items:f({mergeNames:(e,t,r)=>e.if((0,a._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,a._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,a._)`${r} !== true`,()=>e.assign(r,!0===t||(0,a._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=d,t.setEvaluated=p;let h={};function m(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new s._Code(t.code))})},(i=n||(t.Type=n={}))[i.Num=0]="Num",i[i.Str=1]="Str",t.getErrorPath=function(e,t,r){if(e instanceof a.Name){let i=t===n.Num;return r?i?(0,a._)`"[" + ${e} + "]"`:(0,a._)`"['" + ${e} + "']"`:i?(0,a._)`"/" + ${e}`:(0,a._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,a.getProperty)(e).toString():"/"+l(e)},t.checkStrictMode=m},94073:(e,t,r)=>{"use strict";r.d(t,{S:()=>a});var n=r(22106),i=r(84428);function a(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),a="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,s=[];for(let e of a)s.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===r?s:s.map(e=>(0,i.My)(e))}},94310:(e,t,r)=>{"use strict";async function n(e){return BigInt(await e.request({method:"eth_gasPrice"}))}r.d(t,{L:()=>n})},94734:(e,t,r)=>{"use strict";r.d(t,{$T:()=>_,Dg:()=>v,Ej:()=>b,Fl:()=>O,G4:()=>x,HT:()=>d,Ho:()=>y,Mr:()=>P,Ro:()=>$,aD:()=>p,dI:()=>E,di:()=>w,ii:()=>k,n4:()=>m,sH:()=>h,tf:()=>A,u:()=>z,xW:()=>f,yT:()=>g});var n=r(37942),i=r(75228),a=r(56184),s=r(83646),o=r(32872),u=r(67221);let l=new TextDecoder,c=new TextEncoder;function f(...e){let t=0;
101for(let r of e)t+=r.length;let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}function d(e){var t;return e instanceof Uint8Array?e:"string"==typeof e?p(e):(t=e)instanceof Uint8Array?t:new Uint8Array(t)}function p(e,t={}){let{size:r}=t,n=e;r&&(o.Sl(e,r),n=a.M7(e,r));let u=n.slice(2);u.length%2&&(u=`0${u}`);let l=u.length/2,c=new Uint8Array(l);for(let e=0,t=0;e<l;e++){let r=s.t7(u.charCodeAt(t++)),n=s.t7(u.charCodeAt(t++));if(void 0===r||void 0===n)throw new i.C(`Invalid byte sequence ("${u[t-2]}${u[t-1]}" in "${u}").`);c[e]=r<<4|n}return c}function h(e,t={}){var r,n;let{size:i}=t,a=c.encode(e);return"number"==typeof i?(s.Sl(a,i),r=a,n=i,s.eV(r,{dir:"right",size:n})):a}function m(e,t){return(0,n.ex)(e,t)}function y(e,t){return s.eV(e,{dir:"left",size:t})}function g(e){return crypto.getRandomValues(new Uint8Array(e))}function b(e){return e.length}function w(e,t,r,n={}){let{strict:i}=n;s.kK(e,t);let a=e.slice(t,r);return i&&s.X(a,t,r),a}function v(e,t={}){let{size:r}=t;void 0!==r&&s.Sl(e,r);let n=a.uK(e,t);return a.Dg(n,t)}function x(e,t={}){let{size:r}=t,n=e;if(void 0!==r&&(s.Sl(n,r),n=P(n)),n.length>1||n[0]>1)throw new I(n);return!!n[0]}function $(e,t={}){let{size:r}=t;void 0!==r&&s.Sl(e,r);let n=a.uK(e,t);return a.Ro(n,t)}function E(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(s.Sl(n,r),n=_(n)),l.decode(n)}function P(e){return s.Bq(e,{dir:"left"})}function _(e){return s.Bq(e,{dir:"right"})}function A(e){try{if(!(e instanceof Uint8Array)&&(!e||"object"!=typeof e||!("BYTES_PER_ELEMENT"in e)||1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name))throw new S(e);return!0}catch{return!1}}class I extends i.C{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class S extends i.C{constructor(e){super(`Value \`${"object"==typeof e?u.As(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class z extends i.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class k extends i.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class O extends i.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}},94747:(e,t,r)=>{"use strict";r.d(t,{IQ:()=>d,ME:()=>f,Nx:()=>c,Sl:()=>o,aD:()=>u,uU:()=>l});var n=r(66347),i=r(45696),a=r(12581),s=r(22106);function o(e,{size:t}){if((0,i.E)(e)>t)throw new n.u({givenSize:(0,i.E)(e),maxSize:t})}function u(e,t){let r="string"==typeof t?{to:t}:t,n=r.to;return"number"===n?f(e,r):"bigint"===n?l(e,r):"string"===n?d(e,r):"boolean"===n?c(e,r):(0,s.aT)(e,r)}function l(e,t={}){let{signed:r}=t;t.size&&o(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=Math.ceil((e.length-2)/2);return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function c(e,t={}){let r=e;if(t.size&&(o(r,{size:t.size}),r=(0,a.B)(r)),"0x00"===(0,a.B)(r))return!1;if("0x01"===(0,a.B)(r))return!0;throw new n.H2(r)}function f(e,t={}){let r=l(e,t),i=Number(r);if(!Number.isSafeInteger(i))throw new n.Ty({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${r}n`});return i}function d(e,t={}){let r=(0,s.aT)(e);return t.size&&(o(r,{size:t.size}),r=(0,a.B)(r,{dir:"right"})),new TextDecoder().decode(r)}},95230:(e,t,r)=>{"use strict";
101Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let n=r(17950),i=r(93608),a=r(64032),s=r(93608);function o(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,n._)`Object.prototype.hasOwnProperty`})}function u(e,t,r){return(0,n._)`${o(e)}.call(${t}, ${r})`}function l(e,t,r,i){let a=(0,n._)`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(a,(0,n.not)(u(e,t,r))):a}function c(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){let{gen:r,data:i,it:a}=e;r.if(l(r,i,t,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,n._)`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},i,a){return(0,n.or)(...i.map(i=>(0,n.and)(l(e,t,i,r.ownProperties),(0,n._)`${a} = ${i}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=o,t.isOwnProperty=u,t.propertyInData=function(e,t,r,i){let a=(0,n._)`${t}${(0,n.getProperty)(r)} !== undefined`;return i?(0,n._)`${a} && ${u(e,t,r)}`:a},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter(r=>!(0,i.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:o},it:u},l,c,f){let d=f?(0,n._)`${e}, ${t}, ${i}${s}`:t,p=[[a.default.instancePath,(0,n.strConcat)(a.default.instancePath,o)],[a.default.parentData,u.parentData],[a.default.parentDataProperty,u.parentDataProperty],[a.default.rootData,a.default.rootData]];u.opts.dynamicRef&&p.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);let h=(0,n._)`${d}, ${r.object(...p)}`;return c!==n.nil?(0,n._)`${l}.call(${c}, ${h})`:(0,n._)`${l}(${h})`};let f=(0,n._)`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:a}=t.code,o=a(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,n._)`${"new RegExp"===a.code?f:(0,s.useFunc)(e,a)}(${r}, ${i})`})},t.validateArray=function(e){let{gen:t,data:r,keyword:a,it:s}=e,o=t.name("valid");if(s.allErrors){let e=t.let("valid",!0);return u(()=>t.assign(e,!1)),e}return t.var(o,!0),u(()=>t.break()),o;function u(s){let u=t.const("len",(0,n._)`${r}.length`);t.forRange("i",0,u,r=>{e.subschema({keyword:a,dataProp:r,dataPropType:i.Type.Num},o),t.if((0,n.not)(o),s)})}},t.validateUnion=function(e){let{gen:t,schema:r,keyword:a,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,i.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let o=t.let("valid",!1),u=t.name("_valid");t.block(()=>r.forEach((r,i)=>{let s=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},u);t.assign(o,(0,n._)`${o} || ${u}`),e.mergeValidEvaluated(s,u)||t.if((0,n.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}},95519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let n=r(17950),i=r(93608),a=r(64032);function s(e,t){let r=e.const("err",t);e.if((0,n._)`${a.default.vErrors} === null`,()=>e.assign(a.default.vErrors,(0,n._)`[${r}]`),(0,n._)`${a.default.vErrors}.push(${r})`),e.code((0,n._)`${a.default.errors}++`)}function o(e,t){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,n._)`new ${e.ValidationError}(${t})`):(r.assign((0,n._)`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,i,a){let{it:u}=e,{gen:c,compositeRule:f,allErrors:d}=u,p=l(e,r,i);(null!=a?a:f||d)?s(c,p):o(u,(0,n._)`[${p}]`)},t.reportExtraError=function(e,r=t.keywordError,n){let{it:i}=e,{gen:u,compositeRule:c,allErrors:f}=i;s(u,l(e,r,n)),c||f||o(i,a.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(a.default.errors,t),e.if((0,n._)`${a.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,n._)`${a.default.vErrors}.length`,t),()=>e.assign(a.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:o}){if(void 0===s)throw Error("ajv implementation error");let u=e.name("err");e.forRange("i",s,a.default.errors,s=>{e.const(u,(0,n._)`${a.default.vErrors}[${s}]`),e.if((0,n._)`${u}.instancePath === undefined`,()=>e.assign((0,n._)`${u}.instancePath`,(0,n.strConcat)(a.default.instancePath,o.errorPath))),e.assign((0,n._)`${u}.schemaPath`,(0,n.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,n._)`${u}.schema`,r),e.assign((0,n._)`${u}.data`,i))})};let u={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,r){let{createErrors:s}=e.it;return!1===s?(0,n._)`{}`:function(e,t,r={}){let{gen:s,it:o}=e,l=[function({errorPath:e},{instancePath:t}){let r=t?(0,n.str)`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[a.default.instancePath,(0,n.strConcat)(a.default.instancePath,r)]}(o,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:a}){let s=a?t:(0,n.str)`${t}/${e}`;return r&&(s=(0,n.str)`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[u.schemaPath,s]}(e,r)];return function(e,{params:t,message:r},i){let{keyword:s,data:o,schemaValue:l,it:c}=e,{opts:f,propertyName:d,topSchemaRef:p,schemaPath:h}=c;i.push([u.keyword,s],[u.params,"function"==typeof t?t(e):t||(0,n._)`{}`]),f.messages&&i.push([u.message,"function"==typeof r?r(e):r]),f.verbose&&i.push([u.schema,l],[u.parentSchema,(0,n._)`${p}${h}`],[a.default.data,o]),d&&i.push([u.propertyName,d])}(e,t,l),s.object(...l)}(e,t,r)}},95889:(e,t,r)=>{"use strict";r.d(t,{J9:()=>a,Mc:()=>i,fD:()=>n});
101let n={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},a={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},96002:(e,t,r)=>{"use strict";r.d(t,{$s:()=>h,Kc:()=>y,Kz:()=>m,Sq:()=>g,UD:()=>d,Vg:()=>c,WA:()=>b,aO:()=>s,dz:()=>o,fZ:()=>p,gr:()=>f,kb:()=>l,zW:()=>u});var n=r(70536),i=r(22160),a=r(66568);function s(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>`  ${`${e}:`.padEnd(r+1)}  ${t}`).join("\n")}a.C;class o extends a.C{constructor({filledNonce:e,requestedNonce:t}){super("The filled transaction nonce does not match the requested nonce.",{metaMessages:[`Requested Nonce: ${t}`,`Filled Nonce: ${e}`],name:"FeePayerNonceMismatchError"})}}class u extends a.C{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class l extends a.C{constructor({yParity:e}){super(`Invalid \`yParity\` value "${e}". Expected 0 or 1.`,{name:"InvalidYParityError"})}}class c extends a.C{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",s(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class f extends a.C{constructor({serializedType:e}){super(`Serialized transaction type "${e}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=e}}class d extends a.C{constructor({attributes:e,serializedTransaction:t,type:r}){const n=Object.entries(e).map(([e,t])=>void 0===t?e:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${r}" was provided.`,{metaMessages:[`Serialized Transaction: "${t}"`,n.length>0?`Missing Attributes: ${n.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=t,this.type=r}}class p extends a.C{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class h extends a.C{constructor(e,{account:t,docsPath:r,chain:a,data:o,gas:u,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:d,to:p,value:h}){const m=s({chain:a&&`${a?.name} (id: ${a?.id})`,from:t?.address,to:p,value:void 0!==h&&`${(0,n.c)(h)} ${a?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:u,gasPrice:void 0!==l&&`${(0,i.Q)(l)} gwei`,maxFeePerGas:void 0!==c&&`${(0,i.Q)(c)} gwei`,maxPriorityFeePerGas:void 0!==f&&`${(0,i.Q)(f)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class m extends a.C{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let a="Transaction";r&&void 0!==i&&(a=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(a=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(a=`Transaction at block number "${t}" at index "${i}"`),n&&(a=`Transaction with hash "${n}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}}class y extends a.C{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class g extends a.C{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class b extends a.C{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}},96420:(e,t,r)=>{"use strict";
101Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let n=r(95519),i=r(17950),a=r(64032),s={message:"boolean schema is false"};function o(e,t){let{gen:r,data:i}=e;(0,n.reportError)({gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},s,void 0,t)}t.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:n}=e;!1===r?o(e,!1):"object"==typeof r&&!0===r.$async?t.return(a.default.data):(t.assign((0,i._)`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){let{gen:r,schema:n}=e;!1===n?(r.var(t,!1),o(e)):r.var(t,!0)}},96462:(e,t,r)=>{"use strict";r.d(t,{d:()=>s});var n=r(78568),i=r(4174),a=r(31750);function s(e,{docsPath:t,...r}){let o,u=(o=(0,a.l)(e,r))instanceof i.RM?e:o;return new n.zX(u,{docsPath:t,...r})}},96685:(e,t,r)=>{"use strict";r.d(t,{b:()=>c,o:()=>l});var n=r(71386),i=r(22106),a=r(18860),s=r(86301),o=r(80339);let u=new s.A(8192);function l(e,t){if(u.has(`${e}.${t}`))return u.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,a.S)((0,i.Af)(r),"bytes"),s=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&n[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());let o=`0x${s.join("")}`;return u.set(`${e}.${t}`,o),o}function c(e,t){if(!(0,o.P)(e,{strict:!1}))throw new n.M({address:e});return l(e,t)}},97195:(e,t,r)=>{"use strict";r.d(t,{_o:()=>g,Pj:()=>m,uT:()=>f,NV:()=>y});var n=r(27075),i=r(17120),a=r(73614),s=r(98955),o=r(47347);class u extends o.C{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let l=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);var c=r(15163);function f(e,t={}){if((0,c.Ji)(e))return function(e,t={}){let r=(0,c.ej)(e);if(!r)throw new s.s7({signature:e,type:"function"});let n=y(r.parameters),i=[],a=n.length;for(let e=0;e<a;e++)i.push(m(n[e],{modifiers:c.v7,structs:t,type:"function"}));let o=[];if(r.returns){let e=y(r.returns),n=e.length;for(let r=0;r<n;r++)o.push(m(e[r],{modifiers:c.v7,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:o}}(e,t);if((0,c.Rv)(e))return function(e,t={}){let r=(0,c.iB)(e);if(!r)throw new s.s7({signature:e,type:"event"});let n=y(r.parameters),i=[],a=n.length;for(let e=0;e<a;e++)i.push(m(n[e],{modifiers:c.fC,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:i}}(e,t);if((0,c.pc)(e))return function(e,t={}){let r=(0,c.kz)(e);if(!r)throw new s.s7({signature:e,type:"error"});let n=y(r.parameters),i=[],a=n.length;for(let e=0;e<a;e++)i.push(m(n[e],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:i}}(e,t);if((0,c.l9)(e))return function(e,t={}){let r=(0,c.Yo)(e);if(!r)throw new s.s7({signature:e,type:"constructor"});let n=y(r.parameters),i=[],a=n.length;for(let e=0;e<a;e++)i.push(m(n[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}(e,t);if((0,c.v8)(e)){var r=e;let t=(0,c.If)(r);if(!t)throw new s.s7({signature:r,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}if((0,c.sP)(e))return{type:"receive",stateMutability:"payable"};throw new s.x8({signature:e})}let d=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,h=/^u?int$/;function m(e,t){var r,s;let o,u=function(e,t,r){let n="";if(r)for(let e of Object.entries(r)){if(!e)continue;let t="";for(let r of e[1])t+=`[${r.type}${r.name?`:${r.name}`:""}]`;n+=`(${e[0]}{${t}})`}return t?`${t}:${e}${n}`:`${e}${n}`}(e,t?.type,t?.structs);if(l.has(u))return l.get(u);let f=n.wj.test(e),w=(0,n.Yv)(f?p:d,e);if(!w)throw new a.dV({param:e});if(w.name&&("address"===(r=w.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||n.BD.test(r)||n.Ge.test(r)||b.test(r)))throw new a.zd({param:e,name:w.name});let v=w.name?{name:w.name}:{},x="indexed"===w.modifier?{indexed:!0}:{},$=t?.structs??{},E={};if(f){o="tuple";let e=y(w.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(m(e[n],{structs:$}));E={components:t}}else if(w.type in $)o="tuple",E={components:$[w.type]};else if(h.test(w.type))o=`${w.type}256`;else if("address payable"===w.type)o="address";else if(o=w.type,t?.type!=="struct"&&!g(o))throw new i.UG({type:o});if(w.modifier){if(!t?.modifiers?.has?.(w.modifier))throw new a.NO({param:e,type:t?.type,modifier:w.modifier});if(c.v7.has(w.modifier)&&(s=o,!w.array&&"bytes"!==s&&"string"!==s&&"tuple"!==s))throw new a.Pj({param:e,type:t?.type,modifier:w.modifier})}let P={type:`${o}${w.array??""}`,...v,...x,...E};return l.set(u,P),P}function y(e,t=[],r="",n=0){let i=e.trim().length;for(let a=0;a<i;a++){let i=e[a],s=e.slice(a+1);switch(i){case",":return 0===n?y(s,[...t,r.trim()]):y(s,t,`${r}${i}`,n);case"(":return y(s,t,`${r}${i}`,n+1);case")":return y(s,t,`${r}${i}`,n-1);default:return y(s,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new u({current:r,depth:n});return t.push(r.trim()),t}function g(e){return"address"===e||"bool"===e||"function"===e||"string"===e||n.BD.test(e)||n.Ge.test(e)}let b=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/},97948:(e,t,r)=>{"use strict";r.d(t,{c:()=>u});var n=r(51011),i=r(28285),a=r(71386),s=r(4174),o=r(80339);function u(e){let{account:t,maxFeePerGas:r,maxPriorityFeePerGas:u,to:l}=e,c=t?(0,n.J)(t):void 0;if(c&&!(0,o.P)(c.address))throw new a.M({address:c.address});if(l&&!(0,o.P)(l))throw new a.M({address:l});if(r&&r>i.Ao)throw new s.BG({maxFeePerGas:r});if(u&&r&&u>r)throw new s.lN({maxFeePerGas:r,maxPriorityFeePerGas:u})}},98858:(e,t,r)=>{"use strict";r.d(t,{J:()=>n});
101class n{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}},98900:(e,t,r)=>{"use strict";r.d(t,{mj:()=>y,nh:()=>p,E7:()=>d,ov:()=>m,cP:()=>c,Yr:()=>f});var n=r(18587),i=r(80339),a=r(53385),s=r(4181),o=r(15904),u=r(66981),l=r(27854);function c(e,t){return{amount:e,decimals:t,formatted:o.GP(e,t)}}function f(e,t){if("bigint"==typeof e)return e;let r=e.decimals??t;return(0,u.X)(e.formatted,function(e){if(void 0===e)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}(r))}function d(e,t){let{decimals:r,token:n}=t,s=p(e,n);if(s)return{address:s.address,decimals:r??s.decimals};if((0,i.P)(n,{strict:!1}))return{address:n,decimals:r??function(e,t){let r=e.tokens,n=e.chain?.id;if(r&&void 0!==n)for(let e of r){let r=h(e,n);if(r&&(0,a.h)(r.address,t))return r.decimals}}(e,n)};throw Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function p(e,t){let r=e.tokens,n=e.chain?.id;if(!r||void 0===n)return;let s=function(e,t){let r=t.toLowerCase();for(let t of e)if(t.symbol?.toLowerCase()===r)return t}(r,t);if(s)return h(s,n);if((0,i.P)(t,{strict:!1}))for(let e of r){let r=h(e,n);if(r&&(0,a.h)(r.address,t))return r}}function h(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}async function m(e,t){let{address:r,decimals:i}=d(e,t);return void 0!==i?{address:r,decimals:i}:{address:r,decimals:await (0,l.J)(e,{abi:n.xw,address:r,functionName:"decimals"})}}function y(e){return{...e,data:(0,s.p)(e),to:e.address}}},98908:(e,t,r)=>{"use strict";r.d(t,{G_:()=>o,HT:()=>a,lh:()=>l});var n=r(56184),i=r(34651);function a(e,t={}){return"string"==typeof e.chainId?s(e):{...e,...t.signature}}function s(e){let{address:t,chainId:r,nonce:n}=e,a=i.o6(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...a}}function o(e){return e.map(s)}function u(e){let{address:t,chainId:r,nonce:a,...s}=e;return{address:t,chainId:n.oB(r),nonce:n.oB(a),...i.J$(s)}}function l(e){return e.map(u)}},98955:(e,t,r)=>{"use strict";r.d(t,{X9:()=>s,s7:()=>i,x8:()=>a});var n=r(47347);class i extends n.C{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class a extends n.C{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class s extends n.C{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},99015:(e,t,r)=>{"use strict";r.d(t,{BD:()=>i,D5:()=>n,Ge:()=>a});let n=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,a=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/},99274:e=>{"use strict";let t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(48!==(r=e[n].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;
101n++){if(!((r=e[n].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}let o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function u(e){return e.length=0,!0}function l(e,t,r){if(e.length){let n=s(e);if(""===n)return r.error=!0,!1;t.push(n),e.length=0}return!0}function c(e){if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],a=!1,o=!1,c=l;for(let s=0;s<e.length;s++){let l=e[s];if("["!==l&&"]"!==l)if(":"===l){if(!0===a&&(o=!0),!c(i,n,r))break;if(++t>7){r.error=!0;break}s>0&&":"===e[s-1]&&(a=!0),n.push(":");continue}else if("%"===l){if(!c(i,n,r))break;c=u}else{i.push(l);continue}}return i.length&&(c===u?r.zone=i.join(""):o?n.push(i.join("")):n.push(s(i))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}let f={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},d=/[@/?#:]/g,p=/[@/?#]/g;function h(e,t){let r=t?p:d;return r.lastIndex=0,e.replace(r,e=>f[e])}e.exports={nonSimpleDomain:o,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){let e=c(n);n=!0===e.isIPV6?`[${e.escapedHost}]`:h(n,!1)}t.push(n)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},reescapeHostDelimiters:h,normalizePercentEncoding:function(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let a=0;a<e.length;a++){if("%"===e[a]&&a+2<e.length){let s=e.slice(a+1,a+3);if(n(s)){let e=s.toUpperCase(),n=String.fromCharCode(parseInt(e,16));t&&i(n)?r+=n:r+="%"+e,a+=2;continue}}r+=e[a]}return r},normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let a=e.slice(r+1,r+3);if(n(a)){let e=a.toUpperCase(),n=String.fromCharCode(parseInt(e,16));"."!==n&&i(n)?t+=n:t+="%"+e,r+=2;continue}}a(e[r])?t+=e[r]:t+=escape(e[r])}return t},escapePreservingEscapes:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let i=e.slice(r+1,r+3);if(n(i)){t+="%"+i.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},removeDotSegments:function(e){let t=e,r=[],n=-1,i=0;for(;i=t.length;){if(1===i)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===i){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===i&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:c,stringArrayToHexStripped:s}},99644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(17950),i=r(93608),a=r(77590);t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s,it:o}=e,u="maxLength"===t?n.operators.GT:n.operators.LT,l=!1===o.opts.unicode?(0,n._)`${r}.length`:(0,n._)`${(0,i.useFunc)(e.gen,a.default)}(${r})`;e.fail$data((0,n._)`${l} ${u} ${s}`)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.